diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 3abfaf3ebf6..3e7aab25b5c 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -29738,6 +29738,81 @@ components: required: - errors type: object + JiraAccountAttributes: + description: Attributes of a Jira account + properties: + consumer_key: + description: The consumer key for the Jira account + example: consumer-key-1 + type: string + instance_url: + description: The URL of the Jira instance + example: https://example.atlassian.net + type: string + last_webhook_timestamp: + description: Timestamp of the last webhook received + example: '2024-01-15T10:30:00Z' + format: date-time + type: string + required: + - consumer_key + - instance_url + type: object + JiraAccountData: + description: Data object for a Jira account + properties: + attributes: + $ref: '#/components/schemas/JiraAccountAttributes' + id: + description: Unique identifier for the Jira account + example: account-1 + type: string + type: + $ref: '#/components/schemas/JiraAccountType' + required: + - id + - type + - attributes + type: object + JiraAccountRelationship: + description: Relationship to a Jira account + properties: + data: + $ref: '#/components/schemas/JiraAccountData' + required: + - data + type: object + JiraAccountType: + description: Type identifier for Jira account resources + enum: + - jira-account + example: jira-account + type: string + x-enum-varnames: + - JIRA_ACCOUNT + JiraAccountsData: + description: Array of Jira account data objects + items: + $ref: '#/components/schemas/JiraAccountData' + type: array + JiraAccountsMeta: + description: Metadata for Jira accounts response + properties: + public_key: + description: Public key for the Jira integration + example: c29tZSBkYXRhIHdpdGggACBhbmQg77u/ + type: string + type: object + JiraAccountsResponse: + description: Response containing Jira accounts + properties: + data: + $ref: '#/components/schemas/JiraAccountsData' + meta: + $ref: '#/components/schemas/JiraAccountsMeta' + required: + - data + type: object JiraIntegrationMetadata: description: Incident integration metadata for the Jira integration. properties: @@ -29803,6 +29878,181 @@ components: description: Jira project key type: string type: object + JiraIssueTemplateCreateRequest: + description: Request to create a Jira issue template + properties: + data: + $ref: '#/components/schemas/JiraIssueTemplateCreateRequestData' + type: object + JiraIssueTemplateCreateRequestAttributes: + description: Attributes for creating a Jira issue template + properties: + fields: + additionalProperties: {} + description: Custom fields for the Jira issue template + example: + description: + payload: Test + type: json + type: object + issue_type_id: + description: The ID of the Jira issue type + example: '12730' + type: string + jira-account: + $ref: '#/components/schemas/JiraIssueTemplateCreateRequestAttributesJiraAccount' + name: + description: The name of the issue template + example: test-template + type: string + project_id: + description: The ID of the Jira project + example: '10772' + type: string + type: object + JiraIssueTemplateCreateRequestAttributesJiraAccount: + description: Reference to the Jira account + properties: + id: + description: The ID of the Jira account + example: 80f16d40-1fba-486e-b1fc-983e6ca19bec + format: uuid + type: string + required: + - id + type: object + JiraIssueTemplateCreateRequestData: + description: Data object for creating a Jira issue template + properties: + attributes: + $ref: '#/components/schemas/JiraIssueTemplateCreateRequestAttributes' + type: + $ref: '#/components/schemas/JiraIssueTemplateType' + type: object + JiraIssueTemplateData: + description: Data object for a Jira issue template + properties: + attributes: + $ref: '#/components/schemas/JiraIssueTemplateDataAttributes' + id: + description: Unique identifier for the Jira issue template + example: 65b3341b-0680-47f9-a6d4-134db45c603e + format: uuid + type: string + relationships: + $ref: '#/components/schemas/JiraIssueTemplateDataRelationships' + type: + $ref: '#/components/schemas/JiraIssueTemplateType' + required: + - id + - type + - attributes + type: object + JiraIssueTemplateDataAttributes: + description: Attributes of a Jira issue template + properties: + fields: + additionalProperties: {} + description: Custom fields for the Jira issue template + example: + description: + payload: Test Description + type: json + type: object + issue_type_id: + description: The ID of the Jira issue type + example: '456' + type: string + name: + description: The name of the issue template + example: Test Template + type: string + project_id: + description: The ID of the Jira project + example: '123' + type: string + required: + - name + - project_id + - issue_type_id + - fields + type: object + JiraIssueTemplateDataRelationships: + description: Relationships of a Jira issue template + properties: + jira-account: + $ref: '#/components/schemas/JiraAccountRelationship' + required: + - jira-account + type: object + JiraIssueTemplateResponse: + description: Response containing a single Jira issue template + properties: + data: + $ref: '#/components/schemas/JiraIssueTemplateData' + included: + $ref: '#/components/schemas/JiraAccountsData' + required: + - data + type: object + JiraIssueTemplateType: + description: Type identifier for Jira issue template resources + enum: + - jira-issue-template + example: jira-issue-template + type: string + x-enum-varnames: + - JIRA_ISSUE_TEMPLATE + JiraIssueTemplateUpdateRequest: + description: Request to update a Jira issue template + properties: + data: + $ref: '#/components/schemas/JiraIssueTemplateUpdateRequestData' + required: + - data + type: object + JiraIssueTemplateUpdateRequestAttributes: + description: Attributes for updating a Jira issue template + properties: + fields: + additionalProperties: {} + description: Custom fields for the Jira issue template + example: + description: + payload: Updated Description + type: json + type: object + name: + description: The name of the issue template + example: test_template_updated + type: string + type: object + JiraIssueTemplateUpdateRequestData: + description: Data object for updating a Jira issue template + properties: + attributes: + $ref: '#/components/schemas/JiraIssueTemplateUpdateRequestAttributes' + type: + $ref: '#/components/schemas/JiraIssueTemplateType' + required: + - type + - attributes + type: object + JiraIssueTemplatesData: + description: Array of Jira issue template data objects + items: + $ref: '#/components/schemas/JiraIssueTemplateData' + type: array + JiraIssueTemplatesResponse: + description: Response containing Jira issue templates + properties: + data: + $ref: '#/components/schemas/JiraIssueTemplatesData' + included: + $ref: '#/components/schemas/JiraAccountsData' + required: + - data + type: object JiraIssuesDataType: default: jira_issues description: Jira issues resource type. @@ -72916,6 +73166,213 @@ paths: operator: OR permissions: - gcp_configuration_edit + /api/v2/integration/jira/accounts: + get: + description: Get all Jira accounts for the organization. + operationId: ListJiraAccounts + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/JiraAccountsResponse' + description: OK + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List Jira accounts + tags: + - Jira Integration + x-unstable: '**Note**: This endpoint is in public beta and it''s subject to + change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/integration/jira/accounts/{account_id}: + delete: + description: Delete a Jira account by ID. + operationId: DeleteJiraAccount + parameters: + - description: The ID of the Jira account to delete + example: 65b3341b-0680-47f9-a6d4-134db45c603e + in: path + name: account_id + required: true + schema: + format: uuid + type: string + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete Jira account + tags: + - Jira Integration + x-unstable: '**Note**: This endpoint is in public beta and it''s subject to + change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/integration/jira/issue-templates: + get: + description: Get all Jira issue templates for the organization. + operationId: ListJiraIssueTemplates + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/JiraIssueTemplatesResponse' + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List Jira issue templates + tags: + - Jira Integration + x-unstable: '**Note**: This endpoint is in public beta and it''s subject to + change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Create a new Jira issue template. + operationId: CreateJiraIssueTemplate + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/JiraIssueTemplateCreateRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/JiraIssueTemplateResponse' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create Jira issue template + tags: + - Jira Integration + x-unstable: '**Note**: This endpoint is in public beta and it''s subject to + change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/integration/jira/issue-templates/{issue_template_id}: + delete: + description: Delete a Jira issue template by ID. + operationId: DeleteJiraIssueTemplate + parameters: + - description: The ID of the Jira issue template to delete + example: 65b3341b-0680-47f9-a6d4-134db45c603e + in: path + name: issue_template_id + required: true + schema: + format: uuid + type: string + responses: + '204': + description: No Content + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete Jira issue template + tags: + - Jira Integration + x-unstable: '**Note**: This endpoint is in public beta and it''s subject to + change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Get a Jira issue template by ID. + operationId: GetJiraIssueTemplate + parameters: + - description: The ID of the Jira issue template to retrieve + example: 65b3341b-0680-47f9-a6d4-134db45c603e + in: path + name: issue_template_id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/JiraIssueTemplateResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get Jira issue template + tags: + - Jira Integration + x-unstable: '**Note**: This endpoint is in public beta and it''s subject to + change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + patch: + description: Update a Jira issue template by ID. + operationId: UpdateJiraIssueTemplate + parameters: + - description: The ID of the Jira issue template to update + example: 65b3341b-0680-47f9-a6d4-134db45c603e + in: path + name: issue_template_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/JiraIssueTemplateUpdateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/JiraIssueTemplateResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update Jira issue template + tags: + - Jira Integration + x-unstable: '**Note**: This endpoint is in public beta and it''s subject to + change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/integration/ms-teams/configuration/channel/{tenant_name}/{team_name}/{channel_name}: get: description: Get the tenant, team, and channel ID of a channel in the Datadog @@ -92567,6 +93024,9 @@ tags: and todos. See the [Incident Management page](https://docs.datadoghq.com/service_management/incident_management/) for more information. name: Incidents +- description: Manage your Jira Integration. Atlassian Jira is a project management + and issue tracking tool for teams to coordinate work and handle tasks efficiently. + name: Jira Integration - description: 'Manage your Datadog API and application keys. You need an API key and an diff --git a/examples/v2/jira-integration/CreateJiraIssueTemplate.rb b/examples/v2/jira-integration/CreateJiraIssueTemplate.rb new file mode 100644 index 00000000000..f9d7e38eac3 --- /dev/null +++ b/examples/v2/jira-integration/CreateJiraIssueTemplate.rb @@ -0,0 +1,25 @@ +# Create Jira issue template returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_jira_issue_template".to_sym] = true +end +api_instance = DatadogAPIClient::V2::JiraIntegrationAPI.new + +body = DatadogAPIClient::V2::JiraIssueTemplateCreateRequest.new({ + data: DatadogAPIClient::V2::JiraIssueTemplateCreateRequestData.new({ + attributes: DatadogAPIClient::V2::JiraIssueTemplateCreateRequestAttributes.new({ + fields: { + "description": "{'payload': 'Test', 'type': 'json'}", + }, + issue_type_id: "12730", + jira_account: DatadogAPIClient::V2::JiraIssueTemplateCreateRequestAttributesJiraAccount.new({ + id: "80f16d40-1fba-486e-b1fc-983e6ca19bec", + }), + name: "test-template", + project_id: "10772", + }), + type: DatadogAPIClient::V2::JiraIssueTemplateType::JIRA_ISSUE_TEMPLATE, + }), +}) +p api_instance.create_jira_issue_template(body) diff --git a/examples/v2/jira-integration/DeleteJiraAccount.rb b/examples/v2/jira-integration/DeleteJiraAccount.rb new file mode 100644 index 00000000000..9a878483284 --- /dev/null +++ b/examples/v2/jira-integration/DeleteJiraAccount.rb @@ -0,0 +1,8 @@ +# Delete Jira account returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_jira_account".to_sym] = true +end +api_instance = DatadogAPIClient::V2::JiraIntegrationAPI.new +api_instance.delete_jira_account("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/jira-integration/DeleteJiraIssueTemplate.rb b/examples/v2/jira-integration/DeleteJiraIssueTemplate.rb new file mode 100644 index 00000000000..055bbaf9769 --- /dev/null +++ b/examples/v2/jira-integration/DeleteJiraIssueTemplate.rb @@ -0,0 +1,8 @@ +# Delete Jira issue template returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_jira_issue_template".to_sym] = true +end +api_instance = DatadogAPIClient::V2::JiraIntegrationAPI.new +api_instance.delete_jira_issue_template("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/jira-integration/GetJiraIssueTemplate.rb b/examples/v2/jira-integration/GetJiraIssueTemplate.rb new file mode 100644 index 00000000000..671dfc60de1 --- /dev/null +++ b/examples/v2/jira-integration/GetJiraIssueTemplate.rb @@ -0,0 +1,8 @@ +# Get Jira issue template returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_jira_issue_template".to_sym] = true +end +api_instance = DatadogAPIClient::V2::JiraIntegrationAPI.new +p api_instance.get_jira_issue_template("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/jira-integration/ListJiraAccounts.rb b/examples/v2/jira-integration/ListJiraAccounts.rb new file mode 100644 index 00000000000..5e0fea026ea --- /dev/null +++ b/examples/v2/jira-integration/ListJiraAccounts.rb @@ -0,0 +1,8 @@ +# List Jira accounts returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_jira_accounts".to_sym] = true +end +api_instance = DatadogAPIClient::V2::JiraIntegrationAPI.new +p api_instance.list_jira_accounts() diff --git a/examples/v2/jira-integration/ListJiraIssueTemplates.rb b/examples/v2/jira-integration/ListJiraIssueTemplates.rb new file mode 100644 index 00000000000..afa99857f14 --- /dev/null +++ b/examples/v2/jira-integration/ListJiraIssueTemplates.rb @@ -0,0 +1,8 @@ +# List Jira issue templates returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_jira_issue_templates".to_sym] = true +end +api_instance = DatadogAPIClient::V2::JiraIntegrationAPI.new +p api_instance.list_jira_issue_templates() diff --git a/examples/v2/jira-integration/UpdateJiraIssueTemplate.rb b/examples/v2/jira-integration/UpdateJiraIssueTemplate.rb new file mode 100644 index 00000000000..41bf3f7fc6b --- /dev/null +++ b/examples/v2/jira-integration/UpdateJiraIssueTemplate.rb @@ -0,0 +1,20 @@ +# Update Jira issue template returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_jira_issue_template".to_sym] = true +end +api_instance = DatadogAPIClient::V2::JiraIntegrationAPI.new + +body = DatadogAPIClient::V2::JiraIssueTemplateUpdateRequest.new({ + data: DatadogAPIClient::V2::JiraIssueTemplateUpdateRequestData.new({ + attributes: DatadogAPIClient::V2::JiraIssueTemplateUpdateRequestAttributes.new({ + fields: { + "description": "{'payload': 'Updated Description', 'type': 'json'}", + }, + name: "test_template_updated", + }), + type: DatadogAPIClient::V2::JiraIssueTemplateType::JIRA_ISSUE_TEMPLATE, + }), +}) +p api_instance.update_jira_issue_template("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index a0f480622db..541fb61f523 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2242,6 +2242,22 @@ "v2.MakeGCPSTSDelegate" => { "body" => "Object", }, + "v2.DeleteJiraAccount" => { + "account_id" => "UUID", + }, + "v2.CreateJiraIssueTemplate" => { + "body" => "JiraIssueTemplateCreateRequest", + }, + "v2.DeleteJiraIssueTemplate" => { + "issue_template_id" => "UUID", + }, + "v2.GetJiraIssueTemplate" => { + "issue_template_id" => "UUID", + }, + "v2.UpdateJiraIssueTemplate" => { + "issue_template_id" => "UUID", + "body" => "JiraIssueTemplateUpdateRequest", + }, "v2.GetChannelByName" => { "tenant_name" => "String", "team_name" => "String", diff --git a/features/v2/jira_integration.feature b/features/v2/jira_integration.feature new file mode 100644 index 00000000000..528a78b7b3b --- /dev/null +++ b/features/v2/jira_integration.feature @@ -0,0 +1,105 @@ +@endpoint(jira-integration) @endpoint(jira-integration-v2) +Feature: Jira Integration + Manage your Jira Integration. Atlassian Jira is a project management and + issue tracking tool for teams to coordinate work and handle tasks + efficiently. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "JiraIntegration" API + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Create Jira issue template returns "Bad Request" response + Given operation "CreateJiraIssueTemplate" enabled + And new "CreateJiraIssueTemplate" request + And body with value {"data": {"attributes": {"fields": {"description": {"payload": "Test", "type": "json"}}, "issue_type_id": "12730", "jira-account": {"id": "80f16d40-1fba-486e-b1fc-983e6ca19bec"}, "name": "test-template", "project_id": "10772"}, "type": "jira-issue-template"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Create Jira issue template returns "Created" response + Given operation "CreateJiraIssueTemplate" enabled + And new "CreateJiraIssueTemplate" request + And body with value {"data": {"attributes": {"fields": {"description": {"payload": "Test", "type": "json"}}, "issue_type_id": "12730", "jira-account": {"id": "80f16d40-1fba-486e-b1fc-983e6ca19bec"}, "name": "test-template", "project_id": "10772"}, "type": "jira-issue-template"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Delete Jira account returns "Bad Request" response + Given operation "DeleteJiraAccount" enabled + And new "DeleteJiraAccount" request + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Delete Jira account returns "No Content" response + Given operation "DeleteJiraAccount" enabled + And new "DeleteJiraAccount" request + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Delete Jira issue template returns "No Content" response + Given operation "DeleteJiraIssueTemplate" enabled + And new "DeleteJiraIssueTemplate" request + And request contains "issue_template_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Get Jira issue template returns "Bad Request" response + Given operation "GetJiraIssueTemplate" enabled + And new "GetJiraIssueTemplate" request + And request contains "issue_template_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Get Jira issue template returns "OK" response + Given operation "GetJiraIssueTemplate" enabled + And new "GetJiraIssueTemplate" request + And request contains "issue_template_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: List Jira accounts returns "Not Found" response + Given operation "ListJiraAccounts" enabled + And new "ListJiraAccounts" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: List Jira accounts returns "OK" response + Given operation "ListJiraAccounts" enabled + And new "ListJiraAccounts" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: List Jira issue templates returns "OK" response + Given operation "ListJiraIssueTemplates" enabled + And new "ListJiraIssueTemplates" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Update Jira issue template returns "Bad Request" response + Given operation "UpdateJiraIssueTemplate" enabled + And new "UpdateJiraIssueTemplate" request + And request contains "issue_template_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"fields": {"description": {"payload": "Updated Description", "type": "json"}}, "name": "test_template_updated"}, "type": "jira-issue-template"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/collaboration-integrations + Scenario: Update Jira issue template returns "OK" response + Given operation "UpdateJiraIssueTemplate" enabled + And new "UpdateJiraIssueTemplate" request + And request contains "issue_template_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"fields": {"description": {"payload": "Updated Description", "type": "json"}}, "name": "test_template_updated"}, "type": "jira-issue-template"}} + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index 59046d30f0b..1cd2195bba1 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -2001,6 +2001,55 @@ "type": "idempotent" } }, + "ListJiraAccounts": { + "tag": "Jira Integration", + "undo": { + "type": "safe" + } + }, + "DeleteJiraAccount": { + "tag": "Jira Integration", + "undo": { + "type": "idempotent" + } + }, + "ListJiraIssueTemplates": { + "tag": "Jira Integration", + "undo": { + "type": "safe" + } + }, + "CreateJiraIssueTemplate": { + "tag": "Jira Integration", + "undo": { + "operationId": "DeleteJiraIssueTemplate", + "parameters": [ + { + "name": "issue_template_id", + "source": "" + } + ], + "type": "unsafe" + } + }, + "DeleteJiraIssueTemplate": { + "tag": "Jira Integration", + "undo": { + "type": "idempotent" + } + }, + "GetJiraIssueTemplate": { + "tag": "Jira Integration", + "undo": { + "type": "safe" + } + }, + "UpdateJiraIssueTemplate": { + "tag": "Jira Integration", + "undo": { + "type": "idempotent" + } + }, "GetChannelByName": { "tag": "Microsoft Teams Integration", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index a050d85bf5a..e715f704f7f 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -284,6 +284,13 @@ def initialize "v2.update_incident_notification_template": false, "v2.update_incident_todo": false, "v2.update_incident_type": false, + "v2.create_jira_issue_template": false, + "v2.delete_jira_account": false, + "v2.delete_jira_issue_template": false, + "v2.get_jira_issue_template": false, + "v2.list_jira_accounts": false, + "v2.list_jira_issue_templates": false, + "v2.update_jira_issue_template": false, "v2.add_role_to_restriction_query": false, "v2.create_restriction_query": false, "v2.delete_restriction_query": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 76c337d245c..71f009a54b9 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2775,11 +2775,30 @@ def overrides "v2.item_api_payload_meta_page" => "ItemApiPayloadMetaPage", "v2.item_api_payload_meta_schema" => "ItemApiPayloadMetaSchema", "v2.item_api_payload_meta_schema_field" => "ItemApiPayloadMetaSchemaField", + "v2.jira_account_attributes" => "JiraAccountAttributes", + "v2.jira_account_data" => "JiraAccountData", + "v2.jira_account_relationship" => "JiraAccountRelationship", + "v2.jira_accounts_meta" => "JiraAccountsMeta", + "v2.jira_accounts_response" => "JiraAccountsResponse", + "v2.jira_account_type" => "JiraAccountType", "v2.jira_integration_metadata" => "JiraIntegrationMetadata", "v2.jira_integration_metadata_issues_item" => "JiraIntegrationMetadataIssuesItem", "v2.jira_issue" => "JiraIssue", "v2.jira_issue_result" => "JiraIssueResult", "v2.jira_issues_data_type" => "JiraIssuesDataType", + "v2.jira_issue_template_create_request" => "JiraIssueTemplateCreateRequest", + "v2.jira_issue_template_create_request_attributes" => "JiraIssueTemplateCreateRequestAttributes", + "v2.jira_issue_template_create_request_attributes_jira_account" => "JiraIssueTemplateCreateRequestAttributesJiraAccount", + "v2.jira_issue_template_create_request_data" => "JiraIssueTemplateCreateRequestData", + "v2.jira_issue_template_data" => "JiraIssueTemplateData", + "v2.jira_issue_template_data_attributes" => "JiraIssueTemplateDataAttributes", + "v2.jira_issue_template_data_relationships" => "JiraIssueTemplateDataRelationships", + "v2.jira_issue_template_response" => "JiraIssueTemplateResponse", + "v2.jira_issue_templates_response" => "JiraIssueTemplatesResponse", + "v2.jira_issue_template_type" => "JiraIssueTemplateType", + "v2.jira_issue_template_update_request" => "JiraIssueTemplateUpdateRequest", + "v2.jira_issue_template_update_request_attributes" => "JiraIssueTemplateUpdateRequestAttributes", + "v2.jira_issue_template_update_request_data" => "JiraIssueTemplateUpdateRequestData", "v2.job_create_response" => "JobCreateResponse", "v2.job_create_response_data" => "JobCreateResponseData", "v2.job_definition" => "JobDefinition", @@ -4867,6 +4886,7 @@ def overrides "v2.incident_teams_api" => "IncidentTeamsAPI", "v2.incidents_api" => "IncidentsAPI", "v2.ip_allowlist_api" => "IPAllowlistAPI", + "v2.jira_integration_api" => "JiraIntegrationAPI", "v2.key_management_api" => "KeyManagementAPI", "v2.logs_api" => "LogsAPI", "v2.logs_archives_api" => "LogsArchivesAPI", diff --git a/lib/datadog_api_client/v2/api/jira_integration_api.rb b/lib/datadog_api_client/v2/api/jira_integration_api.rb new file mode 100644 index 00000000000..669904fa4af --- /dev/null +++ b/lib/datadog_api_client/v2/api/jira_integration_api.rb @@ -0,0 +1,522 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'cgi' + +module DatadogAPIClient::V2 + class JiraIntegrationAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Create Jira issue template. + # + # @see #create_jira_issue_template_with_http_info + def create_jira_issue_template(body, opts = {}) + data, _status_code, _headers = create_jira_issue_template_with_http_info(body, opts) + data + end + + # Create Jira issue template. + # + # Create a new Jira issue template. + # + # @param body [JiraIssueTemplateCreateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(JiraIssueTemplateResponse, Integer, Hash)>] JiraIssueTemplateResponse data, response status code and response headers + def create_jira_issue_template_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_jira_issue_template".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_jira_issue_template") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_jira_issue_template")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: JiraIntegrationAPI.create_jira_issue_template ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling JiraIntegrationAPI.create_jira_issue_template" + end + # resource path + local_var_path = '/api/v2/integration/jira/issue-templates' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'JiraIssueTemplateResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_jira_issue_template, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: JiraIntegrationAPI#create_jira_issue_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete Jira account. + # + # @see #delete_jira_account_with_http_info + def delete_jira_account(account_id, opts = {}) + delete_jira_account_with_http_info(account_id, opts) + nil + end + + # Delete Jira account. + # + # Delete a Jira account by ID. + # + # @param account_id [UUID] The ID of the Jira account to delete + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_jira_account_with_http_info(account_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_jira_account".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_jira_account") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_jira_account")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: JiraIntegrationAPI.delete_jira_account ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling JiraIntegrationAPI.delete_jira_account" + end + # resource path + local_var_path = '/api/v2/integration/jira/accounts/{account_id}'.sub('{account_id}', CGI.escape(account_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_jira_account, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: JiraIntegrationAPI#delete_jira_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete Jira issue template. + # + # @see #delete_jira_issue_template_with_http_info + def delete_jira_issue_template(issue_template_id, opts = {}) + delete_jira_issue_template_with_http_info(issue_template_id, opts) + nil + end + + # Delete Jira issue template. + # + # Delete a Jira issue template by ID. + # + # @param issue_template_id [UUID] The ID of the Jira issue template to delete + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_jira_issue_template_with_http_info(issue_template_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_jira_issue_template".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_jira_issue_template") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_jira_issue_template")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: JiraIntegrationAPI.delete_jira_issue_template ...' + end + # verify the required parameter 'issue_template_id' is set + if @api_client.config.client_side_validation && issue_template_id.nil? + fail ArgumentError, "Missing the required parameter 'issue_template_id' when calling JiraIntegrationAPI.delete_jira_issue_template" + end + # resource path + local_var_path = '/api/v2/integration/jira/issue-templates/{issue_template_id}'.sub('{issue_template_id}', CGI.escape(issue_template_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_jira_issue_template, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: JiraIntegrationAPI#delete_jira_issue_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get Jira issue template. + # + # @see #get_jira_issue_template_with_http_info + def get_jira_issue_template(issue_template_id, opts = {}) + data, _status_code, _headers = get_jira_issue_template_with_http_info(issue_template_id, opts) + data + end + + # Get Jira issue template. + # + # Get a Jira issue template by ID. + # + # @param issue_template_id [UUID] The ID of the Jira issue template to retrieve + # @param opts [Hash] the optional parameters + # @return [Array<(JiraIssueTemplateResponse, Integer, Hash)>] JiraIssueTemplateResponse data, response status code and response headers + def get_jira_issue_template_with_http_info(issue_template_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_jira_issue_template".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_jira_issue_template") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_jira_issue_template")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: JiraIntegrationAPI.get_jira_issue_template ...' + end + # verify the required parameter 'issue_template_id' is set + if @api_client.config.client_side_validation && issue_template_id.nil? + fail ArgumentError, "Missing the required parameter 'issue_template_id' when calling JiraIntegrationAPI.get_jira_issue_template" + end + # resource path + local_var_path = '/api/v2/integration/jira/issue-templates/{issue_template_id}'.sub('{issue_template_id}', CGI.escape(issue_template_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'JiraIssueTemplateResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_jira_issue_template, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: JiraIntegrationAPI#get_jira_issue_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List Jira accounts. + # + # @see #list_jira_accounts_with_http_info + def list_jira_accounts(opts = {}) + data, _status_code, _headers = list_jira_accounts_with_http_info(opts) + data + end + + # List Jira accounts. + # + # Get all Jira accounts for the organization. + # + # @param opts [Hash] the optional parameters + # @return [Array<(JiraAccountsResponse, Integer, Hash)>] JiraAccountsResponse data, response status code and response headers + def list_jira_accounts_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_jira_accounts".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_jira_accounts") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_jira_accounts")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: JiraIntegrationAPI.list_jira_accounts ...' + end + # resource path + local_var_path = '/api/v2/integration/jira/accounts' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'JiraAccountsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_jira_accounts, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: JiraIntegrationAPI#list_jira_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List Jira issue templates. + # + # @see #list_jira_issue_templates_with_http_info + def list_jira_issue_templates(opts = {}) + data, _status_code, _headers = list_jira_issue_templates_with_http_info(opts) + data + end + + # List Jira issue templates. + # + # Get all Jira issue templates for the organization. + # + # @param opts [Hash] the optional parameters + # @return [Array<(JiraIssueTemplatesResponse, Integer, Hash)>] JiraIssueTemplatesResponse data, response status code and response headers + def list_jira_issue_templates_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_jira_issue_templates".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_jira_issue_templates") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_jira_issue_templates")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: JiraIntegrationAPI.list_jira_issue_templates ...' + end + # resource path + local_var_path = '/api/v2/integration/jira/issue-templates' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'JiraIssueTemplatesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_jira_issue_templates, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: JiraIntegrationAPI#list_jira_issue_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update Jira issue template. + # + # @see #update_jira_issue_template_with_http_info + def update_jira_issue_template(issue_template_id, body, opts = {}) + data, _status_code, _headers = update_jira_issue_template_with_http_info(issue_template_id, body, opts) + data + end + + # Update Jira issue template. + # + # Update a Jira issue template by ID. + # + # @param issue_template_id [UUID] The ID of the Jira issue template to update + # @param body [JiraIssueTemplateUpdateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(JiraIssueTemplateResponse, Integer, Hash)>] JiraIssueTemplateResponse data, response status code and response headers + def update_jira_issue_template_with_http_info(issue_template_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_jira_issue_template".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_jira_issue_template") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_jira_issue_template")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: JiraIntegrationAPI.update_jira_issue_template ...' + end + # verify the required parameter 'issue_template_id' is set + if @api_client.config.client_side_validation && issue_template_id.nil? + fail ArgumentError, "Missing the required parameter 'issue_template_id' when calling JiraIntegrationAPI.update_jira_issue_template" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling JiraIntegrationAPI.update_jira_issue_template" + end + # resource path + local_var_path = '/api/v2/integration/jira/issue-templates/{issue_template_id}'.sub('{issue_template_id}', CGI.escape(issue_template_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'JiraIssueTemplateResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_jira_issue_template, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: JiraIntegrationAPI#update_jira_issue_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/models/jira_account_attributes.rb b/lib/datadog_api_client/v2/models/jira_account_attributes.rb new file mode 100644 index 00000000000..a77ccd7bdf2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/jira_account_attributes.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a Jira account + class JiraAccountAttributes + include BaseGenericModel + + # The consumer key for the Jira account + attr_reader :consumer_key + + # The URL of the Jira instance + attr_reader :instance_url + + # Timestamp of the last webhook received + attr_accessor :last_webhook_timestamp + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'consumer_key' => :'consumer_key', + :'instance_url' => :'instance_url', + :'last_webhook_timestamp' => :'last_webhook_timestamp' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'consumer_key' => :'String', + :'instance_url' => :'String', + :'last_webhook_timestamp' => :'Time' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::JiraAccountAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'consumer_key') + self.consumer_key = attributes[:'consumer_key'] + end + + if attributes.key?(:'instance_url') + self.instance_url = attributes[:'instance_url'] + end + + if attributes.key?(:'last_webhook_timestamp') + self.last_webhook_timestamp = attributes[:'last_webhook_timestamp'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @consumer_key.nil? + return false if @instance_url.nil? + true + end + + # Custom attribute writer method with validation + # @param consumer_key [Object] Object to be assigned + # @!visibility private + def consumer_key=(consumer_key) + if consumer_key.nil? + fail ArgumentError, 'invalid value for "consumer_key", consumer_key cannot be nil.' + end + @consumer_key = consumer_key + end + + # Custom attribute writer method with validation + # @param instance_url [Object] Object to be assigned + # @!visibility private + def instance_url=(instance_url) + if instance_url.nil? + fail ArgumentError, 'invalid value for "instance_url", instance_url cannot be nil.' + end + @instance_url = instance_url + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + consumer_key == o.consumer_key && + instance_url == o.instance_url && + last_webhook_timestamp == o.last_webhook_timestamp && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [consumer_key, instance_url, last_webhook_timestamp, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/jira_account_data.rb b/lib/datadog_api_client/v2/models/jira_account_data.rb new file mode 100644 index 00000000000..833217edf80 --- /dev/null +++ b/lib/datadog_api_client/v2/models/jira_account_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for a Jira account + class JiraAccountData + include BaseGenericModel + + # Attributes of a Jira account + attr_reader :attributes + + # Unique identifier for the Jira account + attr_reader :id + + # Type identifier for Jira account resources + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'JiraAccountAttributes', + :'id' => :'String', + :'type' => :'JiraAccountType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::JiraAccountData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/jira_account_relationship.rb b/lib/datadog_api_client/v2/models/jira_account_relationship.rb new file mode 100644 index 00000000000..d8761df5974 --- /dev/null +++ b/lib/datadog_api_client/v2/models/jira_account_relationship.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship to a Jira account + class JiraAccountRelationship + include BaseGenericModel + + # Data object for a Jira account + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'JiraAccountData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::JiraAccountRelationship` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/jira_account_type.rb b/lib/datadog_api_client/v2/models/jira_account_type.rb new file mode 100644 index 00000000000..210a55f7431 --- /dev/null +++ b/lib/datadog_api_client/v2/models/jira_account_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type identifier for Jira account resources + class JiraAccountType + include BaseEnumModel + + JIRA_ACCOUNT = "jira-account".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/jira_accounts_meta.rb b/lib/datadog_api_client/v2/models/jira_accounts_meta.rb new file mode 100644 index 00000000000..2d6a5a589bd --- /dev/null +++ b/lib/datadog_api_client/v2/models/jira_accounts_meta.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Metadata for Jira accounts response + class JiraAccountsMeta + include BaseGenericModel + + # Public key for the Jira integration + attr_accessor :public_key + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'public_key' => :'public_key' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'public_key' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::JiraAccountsMeta` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'public_key') + self.public_key = attributes[:'public_key'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + public_key == o.public_key && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [public_key, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/jira_accounts_response.rb b/lib/datadog_api_client/v2/models/jira_accounts_response.rb new file mode 100644 index 00000000000..c3b8644a465 --- /dev/null +++ b/lib/datadog_api_client/v2/models/jira_accounts_response.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing Jira accounts + class JiraAccountsResponse + include BaseGenericModel + + # Array of Jira account data objects + attr_reader :data + + # Metadata for Jira accounts response + attr_accessor :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'JiraAccountsMeta' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::JiraAccountsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/jira_issue_template_create_request.rb b/lib/datadog_api_client/v2/models/jira_issue_template_create_request.rb new file mode 100644 index 00000000000..a752444d0ed --- /dev/null +++ b/lib/datadog_api_client/v2/models/jira_issue_template_create_request.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to create a Jira issue template + class JiraIssueTemplateCreateRequest + include BaseGenericModel + + # Data object for creating a Jira issue template + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'JiraIssueTemplateCreateRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::JiraIssueTemplateCreateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/jira_issue_template_create_request_attributes.rb b/lib/datadog_api_client/v2/models/jira_issue_template_create_request_attributes.rb new file mode 100644 index 00000000000..9dfa74b5983 --- /dev/null +++ b/lib/datadog_api_client/v2/models/jira_issue_template_create_request_attributes.rb @@ -0,0 +1,145 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for creating a Jira issue template + class JiraIssueTemplateCreateRequestAttributes + include BaseGenericModel + + # Custom fields for the Jira issue template + attr_accessor :fields + + # The ID of the Jira issue type + attr_accessor :issue_type_id + + # Reference to the Jira account + attr_accessor :jira_account + + # The name of the issue template + attr_accessor :name + + # The ID of the Jira project + attr_accessor :project_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'fields' => :'fields', + :'issue_type_id' => :'issue_type_id', + :'jira_account' => :'jira-account', + :'name' => :'name', + :'project_id' => :'project_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'fields' => :'Hash', + :'issue_type_id' => :'String', + :'jira_account' => :'JiraIssueTemplateCreateRequestAttributesJiraAccount', + :'name' => :'String', + :'project_id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::JiraIssueTemplateCreateRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'fields') + self.fields = attributes[:'fields'] + end + + if attributes.key?(:'issue_type_id') + self.issue_type_id = attributes[:'issue_type_id'] + end + + if attributes.key?(:'jira_account') + self.jira_account = attributes[:'jira_account'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'project_id') + self.project_id = attributes[:'project_id'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + fields == o.fields && + issue_type_id == o.issue_type_id && + jira_account == o.jira_account && + name == o.name && + project_id == o.project_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [fields, issue_type_id, jira_account, name, project_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/jira_issue_template_create_request_attributes_jira_account.rb b/lib/datadog_api_client/v2/models/jira_issue_template_create_request_attributes_jira_account.rb new file mode 100644 index 00000000000..33d78154ee6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/jira_issue_template_create_request_attributes_jira_account.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Reference to the Jira account + class JiraIssueTemplateCreateRequestAttributesJiraAccount + include BaseGenericModel + + # The ID of the Jira account + attr_reader :id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'UUID' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::JiraIssueTemplateCreateRequestAttributesJiraAccount` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/jira_issue_template_create_request_data.rb b/lib/datadog_api_client/v2/models/jira_issue_template_create_request_data.rb new file mode 100644 index 00000000000..86514b095b8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/jira_issue_template_create_request_data.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for creating a Jira issue template + class JiraIssueTemplateCreateRequestData + include BaseGenericModel + + # Attributes for creating a Jira issue template + attr_accessor :attributes + + # Type identifier for Jira issue template resources + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'JiraIssueTemplateCreateRequestAttributes', + :'type' => :'JiraIssueTemplateType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::JiraIssueTemplateCreateRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/jira_issue_template_data.rb b/lib/datadog_api_client/v2/models/jira_issue_template_data.rb new file mode 100644 index 00000000000..76ac8bea2b2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/jira_issue_template_data.rb @@ -0,0 +1,175 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for a Jira issue template + class JiraIssueTemplateData + include BaseGenericModel + + # Attributes of a Jira issue template + attr_reader :attributes + + # Unique identifier for the Jira issue template + attr_reader :id + + # Relationships of a Jira issue template + attr_accessor :relationships + + # Type identifier for Jira issue template resources + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'JiraIssueTemplateDataAttributes', + :'id' => :'UUID', + :'relationships' => :'JiraIssueTemplateDataRelationships', + :'type' => :'JiraIssueTemplateType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::JiraIssueTemplateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/jira_issue_template_data_attributes.rb b/lib/datadog_api_client/v2/models/jira_issue_template_data_attributes.rb new file mode 100644 index 00000000000..8b87ef0817f --- /dev/null +++ b/lib/datadog_api_client/v2/models/jira_issue_template_data_attributes.rb @@ -0,0 +1,186 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a Jira issue template + class JiraIssueTemplateDataAttributes + include BaseGenericModel + + # Custom fields for the Jira issue template + attr_reader :fields + + # The ID of the Jira issue type + attr_reader :issue_type_id + + # The name of the issue template + attr_reader :name + + # The ID of the Jira project + attr_reader :project_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'fields' => :'fields', + :'issue_type_id' => :'issue_type_id', + :'name' => :'name', + :'project_id' => :'project_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'fields' => :'Hash', + :'issue_type_id' => :'String', + :'name' => :'String', + :'project_id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::JiraIssueTemplateDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'fields') + self.fields = attributes[:'fields'] + end + + if attributes.key?(:'issue_type_id') + self.issue_type_id = attributes[:'issue_type_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'project_id') + self.project_id = attributes[:'project_id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @fields.nil? + return false if @issue_type_id.nil? + return false if @name.nil? + return false if @project_id.nil? + true + end + + # Custom attribute writer method with validation + # @param fields [Object] Object to be assigned + # @!visibility private + def fields=(fields) + if fields.nil? + fail ArgumentError, 'invalid value for "fields", fields cannot be nil.' + end + @fields = fields + end + + # Custom attribute writer method with validation + # @param issue_type_id [Object] Object to be assigned + # @!visibility private + def issue_type_id=(issue_type_id) + if issue_type_id.nil? + fail ArgumentError, 'invalid value for "issue_type_id", issue_type_id cannot be nil.' + end + @issue_type_id = issue_type_id + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param project_id [Object] Object to be assigned + # @!visibility private + def project_id=(project_id) + if project_id.nil? + fail ArgumentError, 'invalid value for "project_id", project_id cannot be nil.' + end + @project_id = project_id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + fields == o.fields && + issue_type_id == o.issue_type_id && + name == o.name && + project_id == o.project_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [fields, issue_type_id, name, project_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/jira_issue_template_data_relationships.rb b/lib/datadog_api_client/v2/models/jira_issue_template_data_relationships.rb new file mode 100644 index 00000000000..b6c68502d24 --- /dev/null +++ b/lib/datadog_api_client/v2/models/jira_issue_template_data_relationships.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships of a Jira issue template + class JiraIssueTemplateDataRelationships + include BaseGenericModel + + # Relationship to a Jira account + attr_reader :jira_account + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'jira_account' => :'jira-account' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'jira_account' => :'JiraAccountRelationship' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::JiraIssueTemplateDataRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'jira_account') + self.jira_account = attributes[:'jira_account'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @jira_account.nil? + true + end + + # Custom attribute writer method with validation + # @param jira_account [Object] Object to be assigned + # @!visibility private + def jira_account=(jira_account) + if jira_account.nil? + fail ArgumentError, 'invalid value for "jira_account", jira_account cannot be nil.' + end + @jira_account = jira_account + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + jira_account == o.jira_account && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [jira_account, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/jira_issue_template_response.rb b/lib/datadog_api_client/v2/models/jira_issue_template_response.rb new file mode 100644 index 00000000000..bad151e5c55 --- /dev/null +++ b/lib/datadog_api_client/v2/models/jira_issue_template_response.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a single Jira issue template + class JiraIssueTemplateResponse + include BaseGenericModel + + # Data object for a Jira issue template + attr_reader :data + + # Array of Jira account data objects + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'JiraIssueTemplateData', + :'included' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::JiraIssueTemplateResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/jira_issue_template_type.rb b/lib/datadog_api_client/v2/models/jira_issue_template_type.rb new file mode 100644 index 00000000000..a1f1aa3eb50 --- /dev/null +++ b/lib/datadog_api_client/v2/models/jira_issue_template_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type identifier for Jira issue template resources + class JiraIssueTemplateType + include BaseEnumModel + + JIRA_ISSUE_TEMPLATE = "jira-issue-template".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/jira_issue_template_update_request.rb b/lib/datadog_api_client/v2/models/jira_issue_template_update_request.rb new file mode 100644 index 00000000000..e0a811feace --- /dev/null +++ b/lib/datadog_api_client/v2/models/jira_issue_template_update_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to update a Jira issue template + class JiraIssueTemplateUpdateRequest + include BaseGenericModel + + # Data object for updating a Jira issue template + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'JiraIssueTemplateUpdateRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::JiraIssueTemplateUpdateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/jira_issue_template_update_request_attributes.rb b/lib/datadog_api_client/v2/models/jira_issue_template_update_request_attributes.rb new file mode 100644 index 00000000000..2bcd0e00326 --- /dev/null +++ b/lib/datadog_api_client/v2/models/jira_issue_template_update_request_attributes.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for updating a Jira issue template + class JiraIssueTemplateUpdateRequestAttributes + include BaseGenericModel + + # Custom fields for the Jira issue template + attr_accessor :fields + + # The name of the issue template + attr_accessor :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'fields' => :'fields', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'fields' => :'Hash', + :'name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::JiraIssueTemplateUpdateRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'fields') + self.fields = attributes[:'fields'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + fields == o.fields && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [fields, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/jira_issue_template_update_request_data.rb b/lib/datadog_api_client/v2/models/jira_issue_template_update_request_data.rb new file mode 100644 index 00000000000..7ee9a4351f2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/jira_issue_template_update_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for updating a Jira issue template + class JiraIssueTemplateUpdateRequestData + include BaseGenericModel + + # Attributes for updating a Jira issue template + attr_reader :attributes + + # Type identifier for Jira issue template resources + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'JiraIssueTemplateUpdateRequestAttributes', + :'type' => :'JiraIssueTemplateType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::JiraIssueTemplateUpdateRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/jira_issue_templates_response.rb b/lib/datadog_api_client/v2/models/jira_issue_templates_response.rb new file mode 100644 index 00000000000..58ee5152085 --- /dev/null +++ b/lib/datadog_api_client/v2/models/jira_issue_templates_response.rb @@ -0,0 +1,137 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing Jira issue templates + class JiraIssueTemplatesResponse + include BaseGenericModel + + # Array of Jira issue template data objects + attr_reader :data + + # Array of Jira account data objects + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'included' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::JiraIssueTemplatesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end