From 8088b1cc3372a810e2afd89ce5278b7062ee9c7f Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 6 Mar 2023 17:24:12 +0000 Subject: [PATCH] Regenerate client from commit 5248c0df of spec repo --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 400 +++++++- .../frozen.json | 1 + .../recording.har | 204 ++++ .../frozen.json | 1 + .../recording.har | 247 +++++ .../frozen.json | 1 + .../recording.har | 247 +++++ .../frozen.json | 1 + .../recording.har | 247 +++++ .../frozen.json | 1 + .../recording.har | 257 ++++++ .../v2/incidents/CreateIncidentIntegration.ts | 45 + .../v2/incidents/DeleteIncidentIntegration.ts | 30 + .../v2/incidents/GetIncidentIntegration.ts | 30 + .../v2/incidents/ListIncidentIntegrations.ts | 25 + .../v2/incidents/UpdateIncidentIntegration.ts | 50 + features/support/scenarios_model_mapping.ts | 55 ++ features/v2/given.json | 16 + features/v2/incidents.feature | 149 +++ features/v2/undo.json | 41 + .../configuration.ts | 5 + .../apis/IncidentsApi.ts | 871 +++++++++++++++++- packages/datadog-api-client-v2/index.ts | 19 + .../IncidentIntegrationMetadataAttributes.ts | 73 ++ .../IncidentIntegrationMetadataCreateData.ts | 53 ++ ...ncidentIntegrationMetadataCreateRequest.ts | 43 + ...IncidentIntegrationMetadataListResponse.ts | 61 ++ .../IncidentIntegrationMetadataMetadata.ts | 18 + .../IncidentIntegrationMetadataPatchData.ts | 53 ++ ...IncidentIntegrationMetadataPatchRequest.ts | 43 + .../IncidentIntegrationMetadataResponse.ts | 52 ++ ...IncidentIntegrationMetadataResponseData.ts | 61 ++ ...IntegrationMetadataResponseIncludedItem.ts | 16 + .../models/IncidentUpdateData.ts | 2 +- .../models/JiraIntegrationMetadata.ts | 43 + .../JiraIntegrationMetadataIssuesItem.ts | 75 ++ .../models/ObjectSerializer.ts | 33 + ...ationshipToIncidentIntegrationMetadatas.ts | 2 +- .../models/SlackIntegrationMetadata.ts | 43 + .../SlackIntegrationMetadataChannelItem.ts | 68 ++ 41 files changed, 3647 insertions(+), 43 deletions(-) create mode 100644 cassettes/v2/Incidents_2863714588/Create-an-incident-integration-metadata-returns-CREATED-response_2910943433/frozen.json create mode 100644 cassettes/v2/Incidents_2863714588/Create-an-incident-integration-metadata-returns-CREATED-response_2910943433/recording.har create mode 100644 cassettes/v2/Incidents_2863714588/Delete-an-incident-integration-metadata-returns-OK-response_2610741314/frozen.json create mode 100644 cassettes/v2/Incidents_2863714588/Delete-an-incident-integration-metadata-returns-OK-response_2610741314/recording.har create mode 100644 cassettes/v2/Incidents_2863714588/Get-a-list-of-an-incident-s-integration-metadata-returns-OK-response_3296712257/frozen.json create mode 100644 cassettes/v2/Incidents_2863714588/Get-a-list-of-an-incident-s-integration-metadata-returns-OK-response_3296712257/recording.har create mode 100644 cassettes/v2/Incidents_2863714588/Get-incident-integration-metadata-details-returns-OK-response_2822980162/frozen.json create mode 100644 cassettes/v2/Incidents_2863714588/Get-incident-integration-metadata-details-returns-OK-response_2822980162/recording.har create mode 100644 cassettes/v2/Incidents_2863714588/Update-an-existing-incident-integration-metadata-returns-OK-response_467419511/frozen.json create mode 100644 cassettes/v2/Incidents_2863714588/Update-an-existing-incident-integration-metadata-returns-OK-response_467419511/recording.har create mode 100644 examples/v2/incidents/CreateIncidentIntegration.ts create mode 100644 examples/v2/incidents/DeleteIncidentIntegration.ts create mode 100644 examples/v2/incidents/GetIncidentIntegration.ts create mode 100644 examples/v2/incidents/ListIncidentIntegrations.ts create mode 100644 examples/v2/incidents/UpdateIncidentIntegration.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentIntegrationMetadataAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentIntegrationMetadataCreateData.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentIntegrationMetadataCreateRequest.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentIntegrationMetadataListResponse.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentIntegrationMetadataMetadata.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentIntegrationMetadataPatchData.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentIntegrationMetadataPatchRequest.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentIntegrationMetadataResponse.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentIntegrationMetadataResponseData.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentIntegrationMetadataResponseIncludedItem.ts create mode 100644 packages/datadog-api-client-v2/models/JiraIntegrationMetadata.ts create mode 100644 packages/datadog-api-client-v2/models/JiraIntegrationMetadataIssuesItem.ts create mode 100644 packages/datadog-api-client-v2/models/SlackIntegrationMetadata.ts create mode 100644 packages/datadog-api-client-v2/models/SlackIntegrationMetadataChannelItem.ts diff --git a/.apigentools-info b/.apigentools-info index b49e44f9ffa..f578e34712d 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2023-03-03 14:44:24.329280", - "spec_repo_commit": "52f78f82" + "regenerated": "2023-03-06 17:22:51.508929", + "spec_repo_commit": "5248c0df" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2023-03-03 14:44:24.342241", - "spec_repo_commit": "52f78f82" + "regenerated": "2023-03-06 17:22:51.521755", + "spec_repo_commit": "5248c0df" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 8b4befe6ab4..28bf6944d5d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -211,6 +211,13 @@ components: items: $ref: '#/components/schemas/IncidentRelatedObject' type: array + IncidentIntegrationMetadataIDPathParameter: + description: The UUID of the incident integration metadata. + in: path + name: integration_metadata_id + required: true + schema: + type: string IncidentSearchIncludeQueryParameter: description: Specifies which types of related objects should be included in the response. @@ -4347,6 +4354,137 @@ components: - TEXTARRAY - METRICTAG - AUTOCOMPLETE + IncidentIntegrationMetadataAttributes: + description: Incident integration metadata's attributes for a create request. + properties: + incident_id: + description: UUID of the incident this integration metadata is connected + to. + example: 00000000-aaaa-0000-0000-000000000000 + type: string + integration_type: + description: 'A number indicating the type of integration this metadata + is for. 1 indicates Slack; + + 8 indicates Jira.' + example: 1 + format: int32 + maximum: 9 + type: integer + metadata: + $ref: '#/components/schemas/IncidentIntegrationMetadataMetadata' + status: + description: 'A number indicating the status of this integration metadata. + 0 indicates unknown; + + 1 indicates pending; 2 indicates complete; 3 indicates manually created; + + 4 indicates manually updated; 5 indicates failed.' + format: int32 + maximum: 5 + type: integer + required: + - integration_type + - metadata + type: object + IncidentIntegrationMetadataCreateData: + description: Incident integration metadata data for a create request. + properties: + attributes: + $ref: '#/components/schemas/IncidentIntegrationMetadataAttributes' + type: + $ref: '#/components/schemas/IncidentIntegrationMetadataType' + required: + - type + - attributes + type: object + IncidentIntegrationMetadataCreateRequest: + description: Create request for an incident integration metadata. + properties: + data: + $ref: '#/components/schemas/IncidentIntegrationMetadataCreateData' + required: + - data + type: object + IncidentIntegrationMetadataListResponse: + description: Response with a list of incident integration metadata. + properties: + data: + description: An array of incident integration metadata. + items: + $ref: '#/components/schemas/IncidentIntegrationMetadataResponseData' + type: array + included: + description: Included related resources that the user requested. + items: + $ref: '#/components/schemas/IncidentIntegrationMetadataResponseIncludedItem' + readOnly: true + type: array + meta: + $ref: '#/components/schemas/IncidentResponseMeta' + required: + - data + type: object + IncidentIntegrationMetadataMetadata: + description: Incident integration metadata's metadata attribute. + oneOf: + - $ref: '#/components/schemas/SlackIntegrationMetadata' + - $ref: '#/components/schemas/JiraIntegrationMetadata' + type: object + IncidentIntegrationMetadataPatchData: + description: Incident integration metadata data for a patch request. + properties: + attributes: + $ref: '#/components/schemas/IncidentIntegrationMetadataAttributes' + type: + $ref: '#/components/schemas/IncidentIntegrationMetadataType' + required: + - type + - attributes + type: object + IncidentIntegrationMetadataPatchRequest: + description: Patch request for an incident integration metadata. + properties: + data: + $ref: '#/components/schemas/IncidentIntegrationMetadataPatchData' + required: + - data + type: object + IncidentIntegrationMetadataResponse: + description: Response with an incident integration metadata. + properties: + data: + $ref: '#/components/schemas/IncidentIntegrationMetadataResponseData' + included: + description: Included related resources that the user requested. + items: + $ref: '#/components/schemas/IncidentIntegrationMetadataResponseIncludedItem' + readOnly: true + type: array + required: + - data + type: object + IncidentIntegrationMetadataResponseData: + description: Incident integration metadata from a response. + properties: + attributes: + $ref: '#/components/schemas/IncidentIntegrationMetadataAttributes' + id: + description: The incident integration metadata's ID. + example: 00000000-0000-0000-1234-000000000000 + type: string + type: + $ref: '#/components/schemas/IncidentIntegrationMetadataType' + required: + - id + - type + type: object + IncidentIntegrationMetadataResponseIncludedItem: + description: An object related to an incident integration metadata that is included + in the response. + oneOf: + - $ref: '#/components/schemas/User' + type: object IncidentIntegrationMetadataType: default: incident_integrations description: Integration metadata resource type. @@ -5201,7 +5339,7 @@ components: attributes: $ref: '#/components/schemas/IncidentUpdateAttributes' id: - description: The team's ID. + description: The incident's ID. example: 00000000-0000-0000-4567-000000000000 type: string relationships: @@ -5348,6 +5486,45 @@ components: type: string type: array type: object + JiraIntegrationMetadata: + description: Incident integration metadata for the Jira integration. + properties: + issues: + description: Array of Jira issues in this integration metadata. + example: [] + items: + $ref: '#/components/schemas/JiraIntegrationMetadataIssuesItem' + type: array + required: + - issues + type: object + JiraIntegrationMetadataIssuesItem: + description: Item in the Jira integration metadata issue array. + properties: + account: + description: URL of issue's Jira account. + example: https://example.atlassian.net + type: string + issue_key: + description: Jira issue's issue key. + example: PROJ-123 + type: string + issuetype_id: + description: Jira issue's issue type. + example: '1000' + type: string + project_key: + description: Jira issue's project keys. + example: PROJ + type: string + redirect_url: + description: URL redirecting to the Jira issue. + example: https://example.atlassian.net/browse/PROJ-123 + type: string + required: + - project_key + - account + type: object ListApplicationKeysResponse: description: Response for a list of application keys. properties: @@ -8965,7 +9142,7 @@ components: type: incident_integrations properties: data: - description: The integration metadata relationship array + description: Integration metadata relationship array example: - id: 00000000-abcd-0003-0000-000000000000 type: incident_integrations @@ -12131,6 +12308,42 @@ components: $ref: '#/components/schemas/ServiceDefinitionData' type: array type: object + SlackIntegrationMetadata: + description: Incident integration metadata for the Slack integration. + properties: + channels: + description: Array of Slack channels in this integration metadata. + example: [] + items: + $ref: '#/components/schemas/SlackIntegrationMetadataChannelItem' + type: array + required: + - channels + type: object + SlackIntegrationMetadataChannelItem: + description: Item in the Slack integration metadata channel array. + properties: + channel_id: + description: Slack channel ID. + example: C0123456789 + type: string + channel_name: + description: Name of the Slack channel. + example: '#example-channel-name' + type: string + redirect_url: + description: URL redirecting to the Slack channel. + example: https://slack.com/app_redirect?channel=C0123456789&team=T01234567 + type: string + team_id: + description: Slack team ID. + example: T01234567 + type: string + required: + - channel_id + - channel_name + - redirect_url + type: object TagsEventAttribute: description: Array of tags associated with your event. example: @@ -14477,6 +14690,189 @@ paths: x-unstable: '**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/incidents/{incident_id}/relationships/integrations: + get: + description: Get all integration metadata for an incident. + operationId: ListIncidentIntegrations + parameters: + - $ref: '#/components/parameters/IncidentIDPathParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentIntegrationMetadataListResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_read + summary: Get a list of an incident's integration metadata + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Create an incident integration metadata. + operationId: CreateIncidentIntegration + parameters: + - $ref: '#/components/parameters/IncidentIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentIntegrationMetadataCreateRequest' + description: Incident integration metadata payload. + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentIntegrationMetadataResponse' + description: CREATED + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Create an incident integration metadata + tags: + - Incidents + x-codegen-request-body-name: body + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}: + delete: + description: Delete an incident integration metadata. + operationId: DeleteIncidentIntegration + parameters: + - $ref: '#/components/parameters/IncidentIDPathParameter' + - $ref: '#/components/parameters/IncidentIntegrationMetadataIDPathParameter' + responses: + '204': + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Delete an incident integration metadata + tags: + - Incidents + x-codegen-request-body-name: body + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Get incident integration metadata details. + operationId: GetIncidentIntegration + parameters: + - $ref: '#/components/parameters/IncidentIDPathParameter' + - $ref: '#/components/parameters/IncidentIntegrationMetadataIDPathParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentIntegrationMetadataResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_read + summary: Get incident integration metadata details + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + patch: + description: Update an existing incident integration metadata. + operationId: UpdateIncidentIntegration + parameters: + - $ref: '#/components/parameters/IncidentIDPathParameter' + - $ref: '#/components/parameters/IncidentIntegrationMetadataIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentIntegrationMetadataPatchRequest' + description: Incident integration metadata payload. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentIntegrationMetadataResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Update an existing incident integration metadata + tags: + - Incidents + x-codegen-request-body-name: body + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/integration/opsgenie/services: get: description: Get a list of all services from the Datadog Opsgenie integration. diff --git a/cassettes/v2/Incidents_2863714588/Create-an-incident-integration-metadata-returns-CREATED-response_2910943433/frozen.json b/cassettes/v2/Incidents_2863714588/Create-an-incident-integration-metadata-returns-CREATED-response_2910943433/frozen.json new file mode 100644 index 00000000000..e03fe13ef28 --- /dev/null +++ b/cassettes/v2/Incidents_2863714588/Create-an-incident-integration-metadata-returns-CREATED-response_2910943433/frozen.json @@ -0,0 +1 @@ +"2023-03-02T08:30:38.031Z" diff --git a/cassettes/v2/Incidents_2863714588/Create-an-incident-integration-metadata-returns-CREATED-response_2910943433/recording.har b/cassettes/v2/Incidents_2863714588/Create-an-incident-integration-metadata-returns-CREATED-response_2910943433/recording.har new file mode 100644 index 00000000000..3eb14567cf7 --- /dev/null +++ b/cassettes/v2/Incidents_2863714588/Create-an-incident-integration-metadata-returns-CREATED-response_2910943433/recording.har @@ -0,0 +1,204 @@ +{ + "log": { + "_recordingName": "Incidents/Create an incident integration metadata returns \"CREATED\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "2264efee81ff513566dbb6d7574bdc39", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 161, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 558, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"customer_impacted\":false,\"title\":\"Test-Create_an_incident_integration_metadata_returns_CREATED_response-1677745838\"},\"type\":\"incidents\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents" + }, + "response": { + "bodySize": 2680, + "content": { + "mimeType": "application/json", + "size": 2680, + "text": "{\"data\":{\"type\":\"incidents\",\"id\":\"c1c3c52e-a1a6-52b3-9dcd-65d04496033f\",\"attributes\":{\"public_id\":124034,\"title\":\"Test-Create_an_incident_integration_metadata_returns_CREATED_response-1677745838\",\"resolved\":null,\"customer_impact_scope\":null,\"customer_impact_start\":null,\"customer_impact_end\":null,\"customer_impacted\":false,\"notification_handles\":null,\"last_modified_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"last_modified_by_uuid\":null,\"created\":\"2023-03-02T08:30:38.468135+00:00\",\"modified\":\"2023-03-02T08:30:38.468135+00:00\",\"commander\":null,\"detected\":\"2023-03-02T08:30:38.458636+00:00\",\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"created_by_uuid\":null,\"creation_idempotency_key\":null,\"customer_impact_duration\":0,\"time_to_detect\":0,\"time_to_repair\":0,\"time_to_internal_response\":0,\"time_to_resolve\":0,\"fields\":{\"severity\":{\"type\":\"dropdown\",\"value\":\"UNKNOWN\"},\"state\":{\"type\":\"dropdown\",\"value\":\"active\"},\"root_cause\":{\"type\":\"textbox\",\"value\":null},\"detection_method\":{\"type\":\"dropdown\",\"value\":\"unknown\"},\"services\":{\"type\":\"autocomplete\",\"value\":null},\"teams\":{\"type\":\"autocomplete\",\"value\":null},\"summary\":{\"type\":\"textbox\",\"value\":null}},\"field_analytics\":null,\"severity\":\"UNKNOWN\",\"state\":\"active\",\"non_datadog_creator\":null,\"visibility\":\"organization\",\"case_id\":null},\"relationships\":{\"created_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"last_modified_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"commander_user\":{\"data\":null},\"user_defined_fields\":{\"data\":[{\"type\":\"user_defined_field\",\"id\":\"ad2b9456-eaec-5bbd-9bae-e502d74e23f8\"},{\"type\":\"user_defined_field\",\"id\":\"299616f7-8acd-5403-886b-991656d6b982\"},{\"type\":\"user_defined_field\",\"id\":\"4148ead2-da45-548e-b6be-8e319bafc425\"},{\"type\":\"user_defined_field\",\"id\":\"66b62f59-48f6-5fee-969a-0886b1db6dcd\"},{\"type\":\"user_defined_field\",\"id\":\"d8a54f16-8b2a-5ab4-87b8-5f0fa575c83e\"},{\"type\":\"user_defined_field\",\"id\":\"623af0a5-f30c-577e-8146-09b8324bdb2d\"},{\"type\":\"user_defined_field\",\"id\":\"ccfc9e6c-f586-58e5-b502-03c466c72e6f\"}]},\"integrations\":{\"data\":[]},\"attachments\":{\"data\":[]},\"responders\":{\"data\":[]},\"impacts\":{\"data\":[]}}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 635, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2023-03-02T08:30:38.040Z", + "time": 631 + }, + { + "_id": "def7a9ca2c67084c0d3e7f1b70de4d08", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 320, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 633, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"incident_id\":\"c1c3c52e-a1a6-52b3-9dcd-65d04496033f\",\"integration_type\":1,\"metadata\":{\"channels\":[{\"channel_id\":\"C0123456789\",\"channel_name\":\"#new-channel\",\"redirect_url\":\"https://slack.com/app_redirect?channel=C0123456789&team=T01234567\",\"team_id\":\"T01234567\"}]}},\"type\":\"incident_integrations\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents/c1c3c52e-a1a6-52b3-9dcd-65d04496033f/relationships/integrations" + }, + "response": { + "bodySize": 1407, + "content": { + "mimeType": "application/json", + "size": 1407, + "text": "{\"data\":{\"type\":\"incident_integrations\",\"id\":\"b841d498-4840-5388-98af-9f6cc30307f1\",\"attributes\":{\"created\":\"2023-03-02T08:30:39.110755+00:00\",\"modified\":\"2023-03-02T08:30:39.110755+00:00\",\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"created_by_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"incident_id\":\"c1c3c52e-a1a6-52b3-9dcd-65d04496033f\",\"last_modified_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"last_modified_by_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"status\":3,\"integration_type\":1,\"metadata\":{\"channels\":[{\"channel_id\":\"C0123456789\",\"channel_name\":\"#new-channel\",\"redirect_url\":\"https://slack.com/app_redirect?channel=C0123456789&team=T01234567\",\"team_id\":\"T01234567\"}]}},\"relationships\":{\"created_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"last_modified_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 659, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2023-03-02T08:30:38.681Z", + "time": 524 + }, + { + "_id": "14483406e4c3ce76551d933feaaa8f36", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 606, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents/c1c3c52e-a1a6-52b3-9dcd-65d04496033f/relationships/integrations/b841d498-4840-5388-98af-9f6cc30307f1" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 645, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2023-03-02T08:30:39.211Z", + "time": 501 + }, + { + "_id": "40d821f49fd1b99fadc2945d963aa76a", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 531, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents/c1c3c52e-a1a6-52b3-9dcd-65d04496033f" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 621, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2023-03-02T08:30:39.717Z", + "time": 573 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Incidents_2863714588/Delete-an-incident-integration-metadata-returns-OK-response_2610741314/frozen.json b/cassettes/v2/Incidents_2863714588/Delete-an-incident-integration-metadata-returns-OK-response_2610741314/frozen.json new file mode 100644 index 00000000000..87b519d9f56 --- /dev/null +++ b/cassettes/v2/Incidents_2863714588/Delete-an-incident-integration-metadata-returns-OK-response_2610741314/frozen.json @@ -0,0 +1 @@ +"2023-02-24T19:28:01.343Z" diff --git a/cassettes/v2/Incidents_2863714588/Delete-an-incident-integration-metadata-returns-OK-response_2610741314/recording.har b/cassettes/v2/Incidents_2863714588/Delete-an-incident-integration-metadata-returns-OK-response_2610741314/recording.har new file mode 100644 index 00000000000..2ec20648a24 --- /dev/null +++ b/cassettes/v2/Incidents_2863714588/Delete-an-incident-integration-metadata-returns-OK-response_2610741314/recording.har @@ -0,0 +1,247 @@ +{ + "log": { + "_recordingName": "Incidents/Delete an incident integration metadata returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "eff4e522b87c8321099fdc7482ed4aea", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 156, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 558, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"customer_impacted\":false,\"title\":\"Test-Delete_an_incident_integration_metadata_returns_OK_response-1677266881\"},\"type\":\"incidents\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents" + }, + "response": { + "bodySize": 2675, + "content": { + "mimeType": "application/json", + "size": 2675, + "text": "{\"data\":{\"type\":\"incidents\",\"id\":\"312a9af4-0bed-524e-9243-a9de9492506a\",\"attributes\":{\"public_id\":123329,\"title\":\"Test-Delete_an_incident_integration_metadata_returns_OK_response-1677266881\",\"resolved\":null,\"customer_impact_scope\":null,\"customer_impact_start\":null,\"customer_impact_end\":null,\"customer_impacted\":false,\"notification_handles\":null,\"last_modified_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"last_modified_by_uuid\":null,\"created\":\"2023-02-24T19:28:01.563619+00:00\",\"modified\":\"2023-02-24T19:28:01.563619+00:00\",\"commander\":null,\"detected\":\"2023-02-24T19:28:01.554591+00:00\",\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"created_by_uuid\":null,\"creation_idempotency_key\":null,\"customer_impact_duration\":0,\"time_to_detect\":0,\"time_to_repair\":0,\"time_to_internal_response\":0,\"time_to_resolve\":0,\"fields\":{\"severity\":{\"type\":\"dropdown\",\"value\":\"UNKNOWN\"},\"state\":{\"type\":\"dropdown\",\"value\":\"active\"},\"root_cause\":{\"type\":\"textbox\",\"value\":null},\"detection_method\":{\"type\":\"dropdown\",\"value\":\"unknown\"},\"services\":{\"type\":\"autocomplete\",\"value\":null},\"teams\":{\"type\":\"autocomplete\",\"value\":null},\"summary\":{\"type\":\"textbox\",\"value\":null}},\"field_analytics\":null,\"severity\":\"UNKNOWN\",\"state\":\"active\",\"non_datadog_creator\":null,\"visibility\":\"organization\",\"case_id\":null},\"relationships\":{\"created_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"last_modified_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"commander_user\":{\"data\":null},\"user_defined_fields\":{\"data\":[{\"type\":\"user_defined_field\",\"id\":\"ad2b9456-eaec-5bbd-9bae-e502d74e23f8\"},{\"type\":\"user_defined_field\",\"id\":\"299616f7-8acd-5403-886b-991656d6b982\"},{\"type\":\"user_defined_field\",\"id\":\"4148ead2-da45-548e-b6be-8e319bafc425\"},{\"type\":\"user_defined_field\",\"id\":\"66b62f59-48f6-5fee-969a-0886b1db6dcd\"},{\"type\":\"user_defined_field\",\"id\":\"d8a54f16-8b2a-5ab4-87b8-5f0fa575c83e\"},{\"type\":\"user_defined_field\",\"id\":\"623af0a5-f30c-577e-8146-09b8324bdb2d\"},{\"type\":\"user_defined_field\",\"id\":\"ccfc9e6c-f586-58e5-b502-03c466c72e6f\"}]},\"integrations\":{\"data\":[]},\"attachments\":{\"data\":[]},\"responders\":{\"data\":[]},\"impacts\":{\"data\":[]}}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 635, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2023-02-24T19:28:01.347Z", + "time": 407 + }, + { + "_id": "c4acf7ca5a820ed9837ba28c735488e7", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 340, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 633, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"incident_id\":\"312a9af4-0bed-524e-9243-a9de9492506a\",\"integration_type\":1,\"metadata\":{\"channels\":[{\"channel_id\":\"C0123456789\",\"channel_name\":\"#example-channel-name\",\"redirect_url\":\"https://slack.com/app_redirect?channel=C0123456789&team=T01234567\",\"team_id\":\"T01234567\"}]},\"status\":2},\"type\":\"incident_integrations\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents/312a9af4-0bed-524e-9243-a9de9492506a/relationships/integrations" + }, + "response": { + "bodySize": 1416, + "content": { + "mimeType": "application/json", + "size": 1416, + "text": "{\"data\":{\"type\":\"incident_integrations\",\"id\":\"74bd2fb0-e385-5564-85db-7d8de4966f36\",\"attributes\":{\"created\":\"2023-02-24T19:28:01.991274+00:00\",\"modified\":\"2023-02-24T19:28:01.991274+00:00\",\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"created_by_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"incident_id\":\"312a9af4-0bed-524e-9243-a9de9492506a\",\"last_modified_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"last_modified_by_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"status\":3,\"integration_type\":1,\"metadata\":{\"channels\":[{\"channel_id\":\"C0123456789\",\"channel_name\":\"#example-channel-name\",\"redirect_url\":\"https://slack.com/app_redirect?channel=C0123456789&team=T01234567\",\"team_id\":\"T01234567\"}]}},\"relationships\":{\"created_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"last_modified_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 659, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2023-02-24T19:28:01.761Z", + "time": 286 + }, + { + "_id": "f708958bfdd0a2f5ebf10a1b7d8a61bb", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 606, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents/312a9af4-0bed-524e-9243-a9de9492506a/relationships/integrations/74bd2fb0-e385-5564-85db-7d8de4966f36" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 645, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2023-02-24T19:28:02.052Z", + "time": 283 + }, + { + "_id": "f708958bfdd0a2f5ebf10a1b7d8a61bb", + "_order": 1, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 606, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents/312a9af4-0bed-524e-9243-a9de9492506a/relationships/integrations/74bd2fb0-e385-5564-85db-7d8de4966f36" + }, + "response": { + "bodySize": 61, + "content": { + "mimeType": "application/json", + "size": 61, + "text": "{\"errors\":[\"74bd2fb0-e385-5564-85db-7d8de4966f36 not found\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 657, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2023-02-24T19:28:02.342Z", + "time": 218 + }, + { + "_id": "87d2edeee40fbd7d5fcd1f6b7496bf49", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 531, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents/312a9af4-0bed-524e-9243-a9de9492506a" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 621, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2023-02-24T19:28:02.566Z", + "time": 466 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Incidents_2863714588/Get-a-list-of-an-incident-s-integration-metadata-returns-OK-response_3296712257/frozen.json b/cassettes/v2/Incidents_2863714588/Get-a-list-of-an-incident-s-integration-metadata-returns-OK-response_3296712257/frozen.json new file mode 100644 index 00000000000..e00593e876f --- /dev/null +++ b/cassettes/v2/Incidents_2863714588/Get-a-list-of-an-incident-s-integration-metadata-returns-OK-response_3296712257/frozen.json @@ -0,0 +1 @@ +"2023-02-28T08:31:00.439Z" diff --git a/cassettes/v2/Incidents_2863714588/Get-a-list-of-an-incident-s-integration-metadata-returns-OK-response_3296712257/recording.har b/cassettes/v2/Incidents_2863714588/Get-a-list-of-an-incident-s-integration-metadata-returns-OK-response_3296712257/recording.har new file mode 100644 index 00000000000..7ac5e3449bb --- /dev/null +++ b/cassettes/v2/Incidents_2863714588/Get-a-list-of-an-incident-s-integration-metadata-returns-OK-response_3296712257/recording.har @@ -0,0 +1,247 @@ +{ + "log": { + "_recordingName": "Incidents/Get a list of an incident's integration metadata returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "37aab2d2cde4b517e9eabab347cd6718", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 165, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 558, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"customer_impacted\":false,\"title\":\"Test-Get_a_list_of_an_incident_s_integration_metadata_returns_OK_response-1677573060\"},\"type\":\"incidents\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents" + }, + "response": { + "bodySize": 2684, + "content": { + "mimeType": "application/json", + "size": 2684, + "text": "{\"data\":{\"type\":\"incidents\",\"id\":\"ef6f2ac8-25ee-5771-903c-8fbea1b0ff8a\",\"attributes\":{\"public_id\":123751,\"title\":\"Test-Get_a_list_of_an_incident_s_integration_metadata_returns_OK_response-1677573060\",\"resolved\":null,\"customer_impact_scope\":null,\"customer_impact_start\":null,\"customer_impact_end\":null,\"customer_impacted\":false,\"notification_handles\":null,\"last_modified_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"last_modified_by_uuid\":null,\"created\":\"2023-02-28T08:31:00.888846+00:00\",\"modified\":\"2023-02-28T08:31:00.888846+00:00\",\"commander\":null,\"detected\":\"2023-02-28T08:31:00.879554+00:00\",\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"created_by_uuid\":null,\"creation_idempotency_key\":null,\"customer_impact_duration\":0,\"time_to_detect\":0,\"time_to_repair\":0,\"time_to_internal_response\":0,\"time_to_resolve\":0,\"fields\":{\"severity\":{\"type\":\"dropdown\",\"value\":\"UNKNOWN\"},\"state\":{\"type\":\"dropdown\",\"value\":\"active\"},\"root_cause\":{\"type\":\"textbox\",\"value\":null},\"detection_method\":{\"type\":\"dropdown\",\"value\":\"unknown\"},\"services\":{\"type\":\"autocomplete\",\"value\":null},\"teams\":{\"type\":\"autocomplete\",\"value\":null},\"summary\":{\"type\":\"textbox\",\"value\":null}},\"field_analytics\":null,\"severity\":\"UNKNOWN\",\"state\":\"active\",\"non_datadog_creator\":null,\"visibility\":\"organization\",\"case_id\":null},\"relationships\":{\"created_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"last_modified_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"commander_user\":{\"data\":null},\"user_defined_fields\":{\"data\":[{\"type\":\"user_defined_field\",\"id\":\"ad2b9456-eaec-5bbd-9bae-e502d74e23f8\"},{\"type\":\"user_defined_field\",\"id\":\"299616f7-8acd-5403-886b-991656d6b982\"},{\"type\":\"user_defined_field\",\"id\":\"4148ead2-da45-548e-b6be-8e319bafc425\"},{\"type\":\"user_defined_field\",\"id\":\"66b62f59-48f6-5fee-969a-0886b1db6dcd\"},{\"type\":\"user_defined_field\",\"id\":\"d8a54f16-8b2a-5ab4-87b8-5f0fa575c83e\"},{\"type\":\"user_defined_field\",\"id\":\"623af0a5-f30c-577e-8146-09b8324bdb2d\"},{\"type\":\"user_defined_field\",\"id\":\"ccfc9e6c-f586-58e5-b502-03c466c72e6f\"}]},\"integrations\":{\"data\":[]},\"attachments\":{\"data\":[]},\"responders\":{\"data\":[]},\"impacts\":{\"data\":[]}}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 635, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2023-02-28T08:31:00.448Z", + "time": 675 + }, + { + "_id": "71b1098f33c08ecd0583229b17dc193b", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 340, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 633, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"incident_id\":\"ef6f2ac8-25ee-5771-903c-8fbea1b0ff8a\",\"integration_type\":1,\"metadata\":{\"channels\":[{\"channel_id\":\"C0123456789\",\"channel_name\":\"#example-channel-name\",\"redirect_url\":\"https://slack.com/app_redirect?channel=C0123456789&team=T01234567\",\"team_id\":\"T01234567\"}]},\"status\":2},\"type\":\"incident_integrations\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents/ef6f2ac8-25ee-5771-903c-8fbea1b0ff8a/relationships/integrations" + }, + "response": { + "bodySize": 1416, + "content": { + "mimeType": "application/json", + "size": 1416, + "text": "{\"data\":{\"type\":\"incident_integrations\",\"id\":\"52ba8c74-a1c2-56ef-8c72-8ea578719072\",\"attributes\":{\"created\":\"2023-02-28T08:31:01.472130+00:00\",\"modified\":\"2023-02-28T08:31:01.472130+00:00\",\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"created_by_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"incident_id\":\"ef6f2ac8-25ee-5771-903c-8fbea1b0ff8a\",\"last_modified_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"last_modified_by_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"status\":3,\"integration_type\":1,\"metadata\":{\"channels\":[{\"channel_id\":\"C0123456789\",\"channel_name\":\"#example-channel-name\",\"redirect_url\":\"https://slack.com/app_redirect?channel=C0123456789&team=T01234567\",\"team_id\":\"T01234567\"}]}},\"relationships\":{\"created_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"last_modified_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 659, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2023-02-28T08:31:01.132Z", + "time": 430 + }, + { + "_id": "aa5f812ef8260ac59c1ce770fb3abc9f", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 578, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents/ef6f2ac8-25ee-5771-903c-8fbea1b0ff8a/relationships/integrations" + }, + "response": { + "bodySize": 862, + "content": { + "mimeType": "application/json", + "size": 862, + "text": "{\"data\":[{\"type\":\"incident_integrations\",\"id\":\"52ba8c74-a1c2-56ef-8c72-8ea578719072\",\"attributes\":{\"created\":\"2023-02-28T08:31:01.472130+00:00\",\"modified\":\"2023-02-28T08:31:01.472130+00:00\",\"created_by_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"incident_id\":\"ef6f2ac8-25ee-5771-903c-8fbea1b0ff8a\",\"last_modified_by_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"status\":3,\"integration_type\":1,\"metadata\":{\"channels\":[{\"team_id\":\"T01234567\",\"channel_id\":\"C0123456789\",\"channel_name\":\"#example-channel-name\",\"redirect_url\":\"https://slack.com/app_redirect?channel=C0123456789&team=T01234567\"}]}},\"relationships\":{\"created_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"last_modified_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}}],\"meta\":{\"pagination\":{\"offset\":0,\"next_offset\":1,\"size\":1}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 662, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2023-02-28T08:31:01.571Z", + "time": 365 + }, + { + "_id": "9fb0cd73ea6afd99e593a5ace618f9dc", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 606, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents/ef6f2ac8-25ee-5771-903c-8fbea1b0ff8a/relationships/integrations/52ba8c74-a1c2-56ef-8c72-8ea578719072" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 645, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2023-02-28T08:31:01.944Z", + "time": 387 + }, + { + "_id": "3819c34a89737367de2aab09b6c056a2", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 531, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents/ef6f2ac8-25ee-5771-903c-8fbea1b0ff8a" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 621, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2023-02-28T08:31:02.336Z", + "time": 584 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Incidents_2863714588/Get-incident-integration-metadata-details-returns-OK-response_2822980162/frozen.json b/cassettes/v2/Incidents_2863714588/Get-incident-integration-metadata-details-returns-OK-response_2822980162/frozen.json new file mode 100644 index 00000000000..19cd5a29b3b --- /dev/null +++ b/cassettes/v2/Incidents_2863714588/Get-incident-integration-metadata-details-returns-OK-response_2822980162/frozen.json @@ -0,0 +1 @@ +"2023-02-24T19:28:03.052Z" diff --git a/cassettes/v2/Incidents_2863714588/Get-incident-integration-metadata-details-returns-OK-response_2822980162/recording.har b/cassettes/v2/Incidents_2863714588/Get-incident-integration-metadata-details-returns-OK-response_2822980162/recording.har new file mode 100644 index 00000000000..807f80c9085 --- /dev/null +++ b/cassettes/v2/Incidents_2863714588/Get-incident-integration-metadata-details-returns-OK-response_2822980162/recording.har @@ -0,0 +1,247 @@ +{ + "log": { + "_recordingName": "Incidents/Get incident integration metadata details returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "3a571986f6cef962c31134861aa81d94", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 158, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 558, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"customer_impacted\":false,\"title\":\"Test-Get_incident_integration_metadata_details_returns_OK_response-1677266883\"},\"type\":\"incidents\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents" + }, + "response": { + "bodySize": 2677, + "content": { + "mimeType": "application/json", + "size": 2677, + "text": "{\"data\":{\"type\":\"incidents\",\"id\":\"57400630-f287-5c30-8cb8-0ecabb3d44b9\",\"attributes\":{\"public_id\":123330,\"title\":\"Test-Get_incident_integration_metadata_details_returns_OK_response-1677266883\",\"resolved\":null,\"customer_impact_scope\":null,\"customer_impact_start\":null,\"customer_impact_end\":null,\"customer_impacted\":false,\"notification_handles\":null,\"last_modified_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"last_modified_by_uuid\":null,\"created\":\"2023-02-24T19:28:03.236100+00:00\",\"modified\":\"2023-02-24T19:28:03.236100+00:00\",\"commander\":null,\"detected\":\"2023-02-24T19:28:03.228113+00:00\",\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"created_by_uuid\":null,\"creation_idempotency_key\":null,\"customer_impact_duration\":0,\"time_to_detect\":0,\"time_to_repair\":0,\"time_to_internal_response\":0,\"time_to_resolve\":0,\"fields\":{\"severity\":{\"type\":\"dropdown\",\"value\":\"UNKNOWN\"},\"state\":{\"type\":\"dropdown\",\"value\":\"active\"},\"root_cause\":{\"type\":\"textbox\",\"value\":null},\"detection_method\":{\"type\":\"dropdown\",\"value\":\"unknown\"},\"services\":{\"type\":\"autocomplete\",\"value\":null},\"teams\":{\"type\":\"autocomplete\",\"value\":null},\"summary\":{\"type\":\"textbox\",\"value\":null}},\"field_analytics\":null,\"severity\":\"UNKNOWN\",\"state\":\"active\",\"non_datadog_creator\":null,\"visibility\":\"organization\",\"case_id\":null},\"relationships\":{\"created_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"last_modified_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"commander_user\":{\"data\":null},\"user_defined_fields\":{\"data\":[{\"type\":\"user_defined_field\",\"id\":\"ad2b9456-eaec-5bbd-9bae-e502d74e23f8\"},{\"type\":\"user_defined_field\",\"id\":\"299616f7-8acd-5403-886b-991656d6b982\"},{\"type\":\"user_defined_field\",\"id\":\"4148ead2-da45-548e-b6be-8e319bafc425\"},{\"type\":\"user_defined_field\",\"id\":\"66b62f59-48f6-5fee-969a-0886b1db6dcd\"},{\"type\":\"user_defined_field\",\"id\":\"d8a54f16-8b2a-5ab4-87b8-5f0fa575c83e\"},{\"type\":\"user_defined_field\",\"id\":\"623af0a5-f30c-577e-8146-09b8324bdb2d\"},{\"type\":\"user_defined_field\",\"id\":\"ccfc9e6c-f586-58e5-b502-03c466c72e6f\"}]},\"integrations\":{\"data\":[]},\"attachments\":{\"data\":[]},\"responders\":{\"data\":[]},\"impacts\":{\"data\":[]}}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 635, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2023-02-24T19:28:03.057Z", + "time": 373 + }, + { + "_id": "24dbd185b7292453c517bf4ba8f40a5c", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 340, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 633, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"incident_id\":\"57400630-f287-5c30-8cb8-0ecabb3d44b9\",\"integration_type\":1,\"metadata\":{\"channels\":[{\"channel_id\":\"C0123456789\",\"channel_name\":\"#example-channel-name\",\"redirect_url\":\"https://slack.com/app_redirect?channel=C0123456789&team=T01234567\",\"team_id\":\"T01234567\"}]},\"status\":2},\"type\":\"incident_integrations\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents/57400630-f287-5c30-8cb8-0ecabb3d44b9/relationships/integrations" + }, + "response": { + "bodySize": 1416, + "content": { + "mimeType": "application/json", + "size": 1416, + "text": "{\"data\":{\"type\":\"incident_integrations\",\"id\":\"6e654fe0-d3db-56c9-937c-861a9f9ce19e\",\"attributes\":{\"created\":\"2023-02-24T19:28:03.731346+00:00\",\"modified\":\"2023-02-24T19:28:03.731346+00:00\",\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"created_by_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"incident_id\":\"57400630-f287-5c30-8cb8-0ecabb3d44b9\",\"last_modified_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"last_modified_by_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"status\":3,\"integration_type\":1,\"metadata\":{\"channels\":[{\"channel_id\":\"C0123456789\",\"channel_name\":\"#example-channel-name\",\"redirect_url\":\"https://slack.com/app_redirect?channel=C0123456789&team=T01234567\",\"team_id\":\"T01234567\"}]}},\"relationships\":{\"created_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"last_modified_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 659, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2023-02-24T19:28:03.436Z", + "time": 395 + }, + { + "_id": "671671fb2a6f48afd786dbd0676663cd", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 613, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents/57400630-f287-5c30-8cb8-0ecabb3d44b9/relationships/integrations/6e654fe0-d3db-56c9-937c-861a9f9ce19e" + }, + "response": { + "bodySize": 800, + "content": { + "mimeType": "application/json", + "size": 800, + "text": "{\"data\":{\"type\":\"incident_integrations\",\"id\":\"6e654fe0-d3db-56c9-937c-861a9f9ce19e\",\"attributes\":{\"created\":\"2023-02-24T19:28:03.731346+00:00\",\"modified\":\"2023-02-24T19:28:03.731346+00:00\",\"created_by_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"incident_id\":\"57400630-f287-5c30-8cb8-0ecabb3d44b9\",\"last_modified_by_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"status\":3,\"integration_type\":1,\"metadata\":{\"channels\":[{\"team_id\":\"T01234567\",\"channel_id\":\"C0123456789\",\"channel_name\":\"#example-channel-name\",\"redirect_url\":\"https://slack.com/app_redirect?channel=C0123456789&team=T01234567\"}]}},\"relationships\":{\"created_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"last_modified_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 656, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2023-02-24T19:28:03.836Z", + "time": 306 + }, + { + "_id": "47d9319d416b9478ad3aec99b4415eb7", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 606, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents/57400630-f287-5c30-8cb8-0ecabb3d44b9/relationships/integrations/6e654fe0-d3db-56c9-937c-861a9f9ce19e" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 645, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2023-02-24T19:28:04.166Z", + "time": 315 + }, + { + "_id": "9055c481e7de433378664658511cdeff", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 531, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents/57400630-f287-5c30-8cb8-0ecabb3d44b9" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 621, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2023-02-24T19:28:04.485Z", + "time": 391 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Incidents_2863714588/Update-an-existing-incident-integration-metadata-returns-OK-response_467419511/frozen.json b/cassettes/v2/Incidents_2863714588/Update-an-existing-incident-integration-metadata-returns-OK-response_467419511/frozen.json new file mode 100644 index 00000000000..5ead9c3dcdd --- /dev/null +++ b/cassettes/v2/Incidents_2863714588/Update-an-existing-incident-integration-metadata-returns-OK-response_467419511/frozen.json @@ -0,0 +1 @@ +"2023-03-02T08:30:18.771Z" diff --git a/cassettes/v2/Incidents_2863714588/Update-an-existing-incident-integration-metadata-returns-OK-response_467419511/recording.har b/cassettes/v2/Incidents_2863714588/Update-an-existing-incident-integration-metadata-returns-OK-response_467419511/recording.har new file mode 100644 index 00000000000..beb1167e669 --- /dev/null +++ b/cassettes/v2/Incidents_2863714588/Update-an-existing-incident-integration-metadata-returns-OK-response_467419511/recording.har @@ -0,0 +1,257 @@ +{ + "log": { + "_recordingName": "Incidents/Update an existing incident integration metadata returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "8d4cd8d722a06cf2ff43416da6cbccff", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 165, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 558, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"customer_impacted\":false,\"title\":\"Test-Update_an_existing_incident_integration_metadata_returns_OK_response-1677745818\"},\"type\":\"incidents\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents" + }, + "response": { + "bodySize": 2684, + "content": { + "mimeType": "application/json", + "size": 2684, + "text": "{\"data\":{\"type\":\"incidents\",\"id\":\"3291404a-284f-5ef5-b012-16aa4bcbb677\",\"attributes\":{\"public_id\":124033,\"title\":\"Test-Update_an_existing_incident_integration_metadata_returns_OK_response-1677745818\",\"resolved\":null,\"customer_impact_scope\":null,\"customer_impact_start\":null,\"customer_impact_end\":null,\"customer_impacted\":false,\"notification_handles\":null,\"last_modified_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"last_modified_by_uuid\":null,\"created\":\"2023-03-02T08:30:19.354738+00:00\",\"modified\":\"2023-03-02T08:30:19.354738+00:00\",\"commander\":null,\"detected\":\"2023-03-02T08:30:19.344778+00:00\",\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"created_by_uuid\":null,\"creation_idempotency_key\":null,\"customer_impact_duration\":0,\"time_to_detect\":0,\"time_to_repair\":0,\"time_to_internal_response\":0,\"time_to_resolve\":0,\"fields\":{\"severity\":{\"type\":\"dropdown\",\"value\":\"UNKNOWN\"},\"state\":{\"type\":\"dropdown\",\"value\":\"active\"},\"root_cause\":{\"type\":\"textbox\",\"value\":null},\"detection_method\":{\"type\":\"dropdown\",\"value\":\"unknown\"},\"services\":{\"type\":\"autocomplete\",\"value\":null},\"teams\":{\"type\":\"autocomplete\",\"value\":null},\"summary\":{\"type\":\"textbox\",\"value\":null}},\"field_analytics\":null,\"severity\":\"UNKNOWN\",\"state\":\"active\",\"non_datadog_creator\":null,\"visibility\":\"organization\",\"case_id\":null},\"relationships\":{\"created_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"last_modified_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"commander_user\":{\"data\":null},\"user_defined_fields\":{\"data\":[{\"type\":\"user_defined_field\",\"id\":\"ad2b9456-eaec-5bbd-9bae-e502d74e23f8\"},{\"type\":\"user_defined_field\",\"id\":\"299616f7-8acd-5403-886b-991656d6b982\"},{\"type\":\"user_defined_field\",\"id\":\"4148ead2-da45-548e-b6be-8e319bafc425\"},{\"type\":\"user_defined_field\",\"id\":\"66b62f59-48f6-5fee-969a-0886b1db6dcd\"},{\"type\":\"user_defined_field\",\"id\":\"d8a54f16-8b2a-5ab4-87b8-5f0fa575c83e\"},{\"type\":\"user_defined_field\",\"id\":\"623af0a5-f30c-577e-8146-09b8324bdb2d\"},{\"type\":\"user_defined_field\",\"id\":\"ccfc9e6c-f586-58e5-b502-03c466c72e6f\"}]},\"integrations\":{\"data\":[]},\"attachments\":{\"data\":[]},\"responders\":{\"data\":[]},\"impacts\":{\"data\":[]}}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 635, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2023-03-02T08:30:18.781Z", + "time": 796 + }, + { + "_id": "a8b9c0568c0a5ade53f09e959c63a1cd", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 340, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 633, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"incident_id\":\"3291404a-284f-5ef5-b012-16aa4bcbb677\",\"integration_type\":1,\"metadata\":{\"channels\":[{\"channel_id\":\"C0123456789\",\"channel_name\":\"#example-channel-name\",\"redirect_url\":\"https://slack.com/app_redirect?channel=C0123456789&team=T01234567\",\"team_id\":\"T01234567\"}]},\"status\":2},\"type\":\"incident_integrations\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents/3291404a-284f-5ef5-b012-16aa4bcbb677/relationships/integrations" + }, + "response": { + "bodySize": 1416, + "content": { + "mimeType": "application/json", + "size": 1416, + "text": "{\"data\":{\"type\":\"incident_integrations\",\"id\":\"7c127cf5-9381-5a41-a83d-4b0190c8cd6a\",\"attributes\":{\"created\":\"2023-03-02T08:30:20.051847+00:00\",\"modified\":\"2023-03-02T08:30:20.051847+00:00\",\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"created_by_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"incident_id\":\"3291404a-284f-5ef5-b012-16aa4bcbb677\",\"last_modified_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"last_modified_by_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"status\":3,\"integration_type\":1,\"metadata\":{\"channels\":[{\"channel_id\":\"C0123456789\",\"channel_name\":\"#example-channel-name\",\"redirect_url\":\"https://slack.com/app_redirect?channel=C0123456789&team=T01234567\",\"team_id\":\"T01234567\"}]}},\"relationships\":{\"created_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"last_modified_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 659, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2023-03-02T08:30:19.586Z", + "time": 584 + }, + { + "_id": "c8b57c2fe1e662ca1e94e2d91e1354b9", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 329, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 671, + "httpVersion": "HTTP/1.1", + "method": "PATCH", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"incident_id\":\"3291404a-284f-5ef5-b012-16aa4bcbb677\",\"integration_type\":1,\"metadata\":{\"channels\":[{\"channel_id\":\"C0123456789\",\"channel_name\":\"#updated-channel-name\",\"redirect_url\":\"https://slack.com/app_redirect?channel=C0123456789&team=T01234567\",\"team_id\":\"T01234567\"}]}},\"type\":\"incident_integrations\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents/3291404a-284f-5ef5-b012-16aa4bcbb677/relationships/integrations/7c127cf5-9381-5a41-a83d-4b0190c8cd6a" + }, + "response": { + "bodySize": 1416, + "content": { + "mimeType": "application/json", + "size": 1416, + "text": "{\"data\":{\"type\":\"incident_integrations\",\"id\":\"7c127cf5-9381-5a41-a83d-4b0190c8cd6a\",\"attributes\":{\"created\":\"2023-03-02T08:30:20.051847+00:00\",\"modified\":\"2023-03-02T08:30:20.597056+00:00\",\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"created_by_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"incident_id\":\"3291404a-284f-5ef5-b012-16aa4bcbb677\",\"last_modified_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"last_modified_by_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"status\":4,\"integration_type\":1,\"metadata\":{\"channels\":[{\"channel_id\":\"C0123456789\",\"channel_name\":\"#updated-channel-name\",\"redirect_url\":\"https://slack.com/app_redirect?channel=C0123456789&team=T01234567\",\"team_id\":\"T01234567\"}]}},\"relationships\":{\"created_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"last_modified_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 659, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2023-03-02T08:30:20.180Z", + "time": 547 + }, + { + "_id": "5a1602266dc0aadf6af5f8019b92ce3b", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 606, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents/3291404a-284f-5ef5-b012-16aa4bcbb677/relationships/integrations/7c127cf5-9381-5a41-a83d-4b0190c8cd6a" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 645, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2023-03-02T08:30:20.738Z", + "time": 489 + }, + { + "_id": "d0cecbd285e9376dce81bbe0dc86db2a", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 531, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents/3291404a-284f-5ef5-b012-16aa4bcbb677" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 621, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2023-03-02T08:30:21.231Z", + "time": 644 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/examples/v2/incidents/CreateIncidentIntegration.ts b/examples/v2/incidents/CreateIncidentIntegration.ts new file mode 100644 index 00000000000..e0976eeb27c --- /dev/null +++ b/examples/v2/incidents/CreateIncidentIntegration.ts @@ -0,0 +1,45 @@ +/** + * Create an incident integration metadata returns "CREATED" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.createIncidentIntegration"] = true; +const apiInstance = new v2.IncidentsApi(configuration); + +// there is a valid "incident" in the system +const INCIDENT_DATA_ID = process.env.INCIDENT_DATA_ID as string; + +const params: v2.IncidentsApiCreateIncidentIntegrationRequest = { + body: { + data: { + attributes: { + incidentId: INCIDENT_DATA_ID, + integrationType: 1, + metadata: { + channels: [ + { + channelId: "C0123456789", + channelName: "#new-channel", + teamId: "T01234567", + redirectUrl: + "https://slack.com/app_redirect?channel=C0123456789&team=T01234567", + }, + ], + }, + }, + type: "incident_integrations", + }, + }, + incidentId: INCIDENT_DATA_ID, +}; + +apiInstance + .createIncidentIntegration(params) + .then((data: v2.IncidentIntegrationMetadataResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/incidents/DeleteIncidentIntegration.ts b/examples/v2/incidents/DeleteIncidentIntegration.ts new file mode 100644 index 00000000000..ead2225efed --- /dev/null +++ b/examples/v2/incidents/DeleteIncidentIntegration.ts @@ -0,0 +1,30 @@ +/** + * Delete an incident integration metadata returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.deleteIncidentIntegration"] = true; +const apiInstance = new v2.IncidentsApi(configuration); + +// there is a valid "incident" in the system +const INCIDENT_DATA_ID = process.env.INCIDENT_DATA_ID as string; + +// the "incident" has an "incident_integration_metadata" +const INCIDENT_INTEGRATION_METADATA_DATA_ID = process.env + .INCIDENT_INTEGRATION_METADATA_DATA_ID as string; + +const params: v2.IncidentsApiDeleteIncidentIntegrationRequest = { + incidentId: INCIDENT_DATA_ID, + integrationMetadataId: INCIDENT_INTEGRATION_METADATA_DATA_ID, +}; + +apiInstance + .deleteIncidentIntegration(params) + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/incidents/GetIncidentIntegration.ts b/examples/v2/incidents/GetIncidentIntegration.ts new file mode 100644 index 00000000000..ab3391e2475 --- /dev/null +++ b/examples/v2/incidents/GetIncidentIntegration.ts @@ -0,0 +1,30 @@ +/** + * Get incident integration metadata details returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.getIncidentIntegration"] = true; +const apiInstance = new v2.IncidentsApi(configuration); + +// there is a valid "incident" in the system +const INCIDENT_DATA_ID = process.env.INCIDENT_DATA_ID as string; + +// the "incident" has an "incident_integration_metadata" +const INCIDENT_INTEGRATION_METADATA_DATA_ID = process.env + .INCIDENT_INTEGRATION_METADATA_DATA_ID as string; + +const params: v2.IncidentsApiGetIncidentIntegrationRequest = { + incidentId: INCIDENT_DATA_ID, + integrationMetadataId: INCIDENT_INTEGRATION_METADATA_DATA_ID, +}; + +apiInstance + .getIncidentIntegration(params) + .then((data: v2.IncidentIntegrationMetadataResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/incidents/ListIncidentIntegrations.ts b/examples/v2/incidents/ListIncidentIntegrations.ts new file mode 100644 index 00000000000..a1ddb41cdbc --- /dev/null +++ b/examples/v2/incidents/ListIncidentIntegrations.ts @@ -0,0 +1,25 @@ +/** + * Get a list of an incident's integration metadata returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.listIncidentIntegrations"] = true; +const apiInstance = new v2.IncidentsApi(configuration); + +// there is a valid "incident" in the system +const INCIDENT_DATA_ID = process.env.INCIDENT_DATA_ID as string; + +const params: v2.IncidentsApiListIncidentIntegrationsRequest = { + incidentId: INCIDENT_DATA_ID, +}; + +apiInstance + .listIncidentIntegrations(params) + .then((data: v2.IncidentIntegrationMetadataListResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/incidents/UpdateIncidentIntegration.ts b/examples/v2/incidents/UpdateIncidentIntegration.ts new file mode 100644 index 00000000000..7fe6a54ad5d --- /dev/null +++ b/examples/v2/incidents/UpdateIncidentIntegration.ts @@ -0,0 +1,50 @@ +/** + * Update an existing incident integration metadata returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.updateIncidentIntegration"] = true; +const apiInstance = new v2.IncidentsApi(configuration); + +// there is a valid "incident" in the system +const INCIDENT_DATA_ID = process.env.INCIDENT_DATA_ID as string; + +// the "incident" has an "incident_integration_metadata" +const INCIDENT_INTEGRATION_METADATA_DATA_ID = process.env + .INCIDENT_INTEGRATION_METADATA_DATA_ID as string; + +const params: v2.IncidentsApiUpdateIncidentIntegrationRequest = { + body: { + data: { + attributes: { + incidentId: INCIDENT_DATA_ID, + integrationType: 1, + metadata: { + channels: [ + { + channelId: "C0123456789", + channelName: "#updated-channel-name", + teamId: "T01234567", + redirectUrl: + "https://slack.com/app_redirect?channel=C0123456789&team=T01234567", + }, + ], + }, + }, + type: "incident_integrations", + }, + }, + incidentId: INCIDENT_DATA_ID, + integrationMetadataId: INCIDENT_INTEGRATION_METADATA_DATA_ID, +}; + +apiInstance + .updateIncidentIntegration(params) + .then((data: v2.IncidentIntegrationMetadataResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 2baa755e571..56d112ec2d1 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -2716,6 +2716,61 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "IncidentAttachmentUpdateResponse", }, + "v2.ListIncidentIntegrations": { + "incidentId": { + "type": "string", + "format": "", + }, + "operationResponseType": "IncidentIntegrationMetadataListResponse", + }, + "v2.CreateIncidentIntegration": { + "incidentId": { + "type": "string", + "format": "", + }, + "body": { + "type": "IncidentIntegrationMetadataCreateRequest", + "format": "", + }, + "operationResponseType": "IncidentIntegrationMetadataResponse", + }, + "v2.DeleteIncidentIntegration": { + "incidentId": { + "type": "string", + "format": "", + }, + "integrationMetadataId": { + "type": "string", + "format": "", + }, + "operationResponseType": "void", + }, + "v2.GetIncidentIntegration": { + "incidentId": { + "type": "string", + "format": "", + }, + "integrationMetadataId": { + "type": "string", + "format": "", + }, + "operationResponseType": "IncidentIntegrationMetadataResponse", + }, + "v2.UpdateIncidentIntegration": { + "incidentId": { + "type": "string", + "format": "", + }, + "integrationMetadataId": { + "type": "string", + "format": "", + }, + "body": { + "type": "IncidentIntegrationMetadataPatchRequest", + "format": "", + }, + "operationResponseType": "IncidentIntegrationMetadataResponse", + }, "v2.ListOpsgenieServices": { "operationResponseType": "OpsgenieServicesResponse", }, diff --git a/features/v2/given.json b/features/v2/given.json index a1507110282..17620e9575e 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -95,6 +95,22 @@ "tag": "Incidents", "operationId": "UpdateIncidentAttachments" }, + { + "parameters": [ + { + "name": "incident_id", + "source": "incident.data.id" + }, + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"integration_type\": 1,\n \"incident_id\": \"{{ incident.data.id }}\",\n \"status\": 2,\n \"metadata\": {\n \"channels\": [\n {\n \"channel_id\": \"C0123456789\",\n \"team_id\": \"T01234567\",\n \"channel_name\": \"#example-channel-name\",\n \"redirect_url\": \"https://slack.com/app_redirect?channel=C0123456789&team=T01234567\"\n }\n ]\n }\n },\n \"type\": \"incident_integrations\"\n }\n}" + } + ], + "step": "the \"incident\" has an \"incident_integration_metadata\"", + "key": "incident_integration_metadata", + "tag": "Incidents", + "operationId": "CreateIncidentIntegration" + }, { "parameters": [ { diff --git a/features/v2/incidents.feature b/features/v2/incidents.feature index 1b8b2ea8993..5146d464318 100644 --- a/features/v2/incidents.feature +++ b/features/v2/incidents.feature @@ -32,6 +32,37 @@ Feature: Incidents And the response "data[0].attributes.attachment_type" is equal to "link" And the response "data[0].attributes.attachment.documentUrl" is equal to "https://www.example.com/doc" + @generated @skip @team:DataDog/incident-app + Scenario: Create an incident integration metadata returns "Bad Request" response + Given operation "CreateIncidentIntegration" enabled + And new "CreateIncidentIntegration" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"incident_id": "00000000-aaaa-0000-0000-000000000000", "integration_type": 1, "metadata": {"channels": []}}, "type": "incident_integrations"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/incident-app + Scenario: Create an incident integration metadata returns "CREATED" response + Given operation "CreateIncidentIntegration" enabled + And new "CreateIncidentIntegration" request + And there is a valid "incident" in the system + And request contains "incident_id" parameter from "incident.data.id" + And body with value {"data": {"attributes": {"incident_id": "{{ incident.data.id }}", "integration_type": 1, "metadata": {"channels": [{"channel_id": "C0123456789", "channel_name": "#new-channel", "team_id": "T01234567", "redirect_url": "https://slack.com/app_redirect?channel=C0123456789&team=T01234567"}]}}, "type": "incident_integrations"}} + When the request is sent + Then the response status is 201 CREATED + And the response "data.type" is equal to "incident_integrations" + And the response "data.attributes.metadata.channels" has length 1 + And the response "data.attributes.metadata.channels[0].channel_name" is equal to "#new-channel" + + @generated @skip @team:DataDog/incident-app + Scenario: Create an incident integration metadata returns "Not Found" response + Given operation "CreateIncidentIntegration" enabled + And new "CreateIncidentIntegration" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"incident_id": "00000000-aaaa-0000-0000-000000000000", "integration_type": 1, "metadata": {"channels": []}}, "type": "incident_integrations"}} + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/incident-app Scenario: Create an incident returns "Bad Request" response Given operation "CreateIncident" enabled @@ -111,6 +142,62 @@ Feature: Incidents When the request is sent Then the response status is 204 OK + @generated @skip @team:DataDog/incident-app + Scenario: Delete an incident integration metadata returns "Bad Request" response + Given operation "DeleteIncidentIntegration" enabled + And new "DeleteIncidentIntegration" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "integration_metadata_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Delete an incident integration metadata returns "Not Found" response + Given operation "DeleteIncidentIntegration" enabled + And new "DeleteIncidentIntegration" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "integration_metadata_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/incident-app + Scenario: Delete an incident integration metadata returns "OK" response + Given operation "DeleteIncidentIntegration" enabled + And new "DeleteIncidentIntegration" request + And there is a valid "incident" in the system + And request contains "incident_id" parameter from "incident.data.id" + And the "incident" has an "incident_integration_metadata" + And request contains "integration_metadata_id" parameter from "incident_integration_metadata.data.id" + When the request is sent + Then the response status is 204 OK + + @generated @skip @team:DataDog/incident-app + Scenario: Get a list of an incident's integration metadata returns "Bad Request" response + Given operation "ListIncidentIntegrations" enabled + And new "ListIncidentIntegrations" request + And request contains "incident_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Get a list of an incident's integration metadata returns "Not Found" response + Given operation "ListIncidentIntegrations" enabled + And new "ListIncidentIntegrations" request + And request contains "incident_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/incident-app + Scenario: Get a list of an incident's integration metadata returns "OK" response + Given operation "ListIncidentIntegrations" enabled + And new "ListIncidentIntegrations" request + And there is a valid "incident" in the system + And request contains "incident_id" parameter from "incident.data.id" + And the "incident" has an "incident_integration_metadata" + When the request is sent + Then the response status is 200 OK + And the response "data[0].attributes.metadata.channels[0].channel_name" is equal to "#example-channel-name" + @generated @skip @team:DataDog/incident-app Scenario: Get a list of attachments returns "Bad Request" response Given operation "ListIncidentAttachments" enabled @@ -181,6 +268,35 @@ Feature: Incidents And the response "data[0].attributes.attachment_type" is equal to "link" And the response "data[0].attributes.attachment.documentUrl" is equal to "https://www.example.com/doc" + @generated @skip @team:DataDog/incident-app + Scenario: Get incident integration metadata details returns "Bad Request" response + Given operation "GetIncidentIntegration" enabled + And new "GetIncidentIntegration" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "integration_metadata_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Get incident integration metadata details returns "Not Found" response + Given operation "GetIncidentIntegration" enabled + And new "GetIncidentIntegration" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "integration_metadata_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/incident-app + Scenario: Get incident integration metadata details returns "OK" response + Given operation "GetIncidentIntegration" enabled + And new "GetIncidentIntegration" request + And there is a valid "incident" in the system + And request contains "incident_id" parameter from "incident.data.id" + And the "incident" has an "incident_integration_metadata" + And request contains "integration_metadata_id" parameter from "incident_integration_metadata.data.id" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app Scenario: Get the details of an incident returns "Bad Request" response Given operation "GetIncident" enabled @@ -245,6 +361,39 @@ Feature: Incidents And the response "data.type" is equal to "incidents_search_results" And the response "data.attributes.incidents[0].data.type" is equal to "incidents" + @generated @skip @team:DataDog/incident-app + Scenario: Update an existing incident integration metadata returns "Bad Request" response + Given operation "UpdateIncidentIntegration" enabled + And new "UpdateIncidentIntegration" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "integration_metadata_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"incident_id": "00000000-aaaa-0000-0000-000000000000", "integration_type": 1, "metadata": {"channels": []}}, "type": "incident_integrations"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Update an existing incident integration metadata returns "Not Found" response + Given operation "UpdateIncidentIntegration" enabled + And new "UpdateIncidentIntegration" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "integration_metadata_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"incident_id": "00000000-aaaa-0000-0000-000000000000", "integration_type": 1, "metadata": {"channels": []}}, "type": "incident_integrations"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/incident-app + Scenario: Update an existing incident integration metadata returns "OK" response + Given operation "UpdateIncidentIntegration" enabled + And new "UpdateIncidentIntegration" request + And there is a valid "incident" in the system + And request contains "incident_id" parameter from "incident.data.id" + And the "incident" has an "incident_integration_metadata" + And request contains "integration_metadata_id" parameter from "incident_integration_metadata.data.id" + And body with value {"data": {"attributes": {"incident_id": "{{ incident.data.id }}", "integration_type": 1, "metadata": {"channels": [{"channel_id": "C0123456789", "channel_name": "#updated-channel-name", "team_id": "T01234567", "redirect_url": "https://slack.com/app_redirect?channel=C0123456789&team=T01234567"}]}}, "type": "incident_integrations"}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.metadata.channels[0].channel_name" is equal to "#updated-channel-name" + @generated @skip @team:DataDog/incident-app Scenario: Update an existing incident returns "Bad Request" response Given operation "UpdateIncident" enabled diff --git a/features/v2/undo.json b/features/v2/undo.json index e4a5021518d..2ae185f7f21 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -273,6 +273,47 @@ "type": "idempotent" } }, + "ListIncidentIntegrations": { + "tag": "Incidents", + "undo": { + "type": "safe" + } + }, + "CreateIncidentIntegration": { + "tag": "Incidents", + "undo": { + "operationId": "DeleteIncidentIntegration", + "parameters": [ + { + "name": "incident_id", + "source": "data.attributes.incident_id" + }, + { + "name": "integration_metadata_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteIncidentIntegration": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, + "GetIncidentIntegration": { + "tag": "Incidents", + "undo": { + "type": "safe" + } + }, + "UpdateIncidentIntegration": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, "ListOpsgenieServices": { "tag": "Opsgenie Integration", "undo": { diff --git a/packages/datadog-api-client-common/configuration.ts b/packages/datadog-api-client-common/configuration.ts index cffa058c321..6904e58e89b 100644 --- a/packages/datadog-api-client-common/configuration.ts +++ b/packages/datadog-api-client-common/configuration.ts @@ -117,13 +117,18 @@ export function createConfiguration( "v2.listEvents": false, "v2.searchEvents": false, "v2.createIncident": false, + "v2.createIncidentIntegration": false, "v2.deleteIncident": false, + "v2.deleteIncidentIntegration": false, "v2.getIncident": false, + "v2.getIncidentIntegration": false, "v2.listIncidentAttachments": false, + "v2.listIncidentIntegrations": false, "v2.listIncidents": false, "v2.searchIncidents": false, "v2.updateIncident": false, "v2.updateIncidentAttachments": false, + "v2.updateIncidentIntegration": false, "v2.queryScalarData": false, "v2.queryTimeseriesData": false, "v2.createIncidentService": false, diff --git a/packages/datadog-api-client-v2/apis/IncidentsApi.ts b/packages/datadog-api-client-v2/apis/IncidentsApi.ts index a0183870d66..2f7ab227c86 100644 --- a/packages/datadog-api-client-v2/apis/IncidentsApi.ts +++ b/packages/datadog-api-client-v2/apis/IncidentsApi.ts @@ -24,6 +24,10 @@ import { IncidentAttachmentsResponse } from "../models/IncidentAttachmentsRespon import { IncidentAttachmentUpdateRequest } from "../models/IncidentAttachmentUpdateRequest"; import { IncidentAttachmentUpdateResponse } from "../models/IncidentAttachmentUpdateResponse"; import { IncidentCreateRequest } from "../models/IncidentCreateRequest"; +import { IncidentIntegrationMetadataCreateRequest } from "../models/IncidentIntegrationMetadataCreateRequest"; +import { IncidentIntegrationMetadataListResponse } from "../models/IncidentIntegrationMetadataListResponse"; +import { IncidentIntegrationMetadataPatchRequest } from "../models/IncidentIntegrationMetadataPatchRequest"; +import { IncidentIntegrationMetadataResponse } from "../models/IncidentIntegrationMetadataResponse"; import { IncidentRelatedObject } from "../models/IncidentRelatedObject"; import { IncidentResponse } from "../models/IncidentResponse"; import { IncidentResponseData } from "../models/IncidentResponseData"; @@ -81,6 +85,70 @@ export class IncidentsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async createIncidentIntegration( + incidentId: string, + body: IncidentIntegrationMetadataCreateRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'createIncidentIntegration'"); + if (!_config.unstableOperations["v2.createIncidentIntegration"]) { + throw new Error( + "Unstable operation 'createIncidentIntegration' is disabled" + ); + } + + // verify required parameter 'incidentId' is not null or undefined + if (incidentId === null || incidentId === undefined) { + throw new RequiredError("incidentId", "createIncidentIntegration"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createIncidentIntegration"); + } + + // Path Params + const localVarPath = + "/api/v2/incidents/{incident_id}/relationships/integrations".replace( + "{incident_id}", + encodeURIComponent(String(incidentId)) + ); + + // Make Request Context + const requestContext = getServer( + _config, + "v2.IncidentsApi.createIncidentIntegration" + ).makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize( + body, + "IncidentIntegrationMetadataCreateRequest", + "" + ), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async deleteIncident( incidentId: string, _options?: Configuration @@ -121,6 +189,60 @@ export class IncidentsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async deleteIncidentIntegration( + incidentId: string, + integrationMetadataId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'deleteIncidentIntegration'"); + if (!_config.unstableOperations["v2.deleteIncidentIntegration"]) { + throw new Error( + "Unstable operation 'deleteIncidentIntegration' is disabled" + ); + } + + // verify required parameter 'incidentId' is not null or undefined + if (incidentId === null || incidentId === undefined) { + throw new RequiredError("incidentId", "deleteIncidentIntegration"); + } + + // verify required parameter 'integrationMetadataId' is not null or undefined + if (integrationMetadataId === null || integrationMetadataId === undefined) { + throw new RequiredError( + "integrationMetadataId", + "deleteIncidentIntegration" + ); + } + + // Path Params + const localVarPath = + "/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}" + .replace("{incident_id}", encodeURIComponent(String(incidentId))) + .replace( + "{integration_metadata_id}", + encodeURIComponent(String(integrationMetadataId)) + ); + + // Make Request Context + const requestContext = getServer( + _config, + "v2.IncidentsApi.deleteIncidentIntegration" + ).makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async getIncident( incidentId: string, include?: Array, @@ -170,6 +292,60 @@ export class IncidentsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async getIncidentIntegration( + incidentId: string, + integrationMetadataId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'getIncidentIntegration'"); + if (!_config.unstableOperations["v2.getIncidentIntegration"]) { + throw new Error( + "Unstable operation 'getIncidentIntegration' is disabled" + ); + } + + // verify required parameter 'incidentId' is not null or undefined + if (incidentId === null || incidentId === undefined) { + throw new RequiredError("incidentId", "getIncidentIntegration"); + } + + // verify required parameter 'integrationMetadataId' is not null or undefined + if (integrationMetadataId === null || integrationMetadataId === undefined) { + throw new RequiredError( + "integrationMetadataId", + "getIncidentIntegration" + ); + } + + // Path Params + const localVarPath = + "/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}" + .replace("{incident_id}", encodeURIComponent(String(incidentId))) + .replace( + "{integration_metadata_id}", + encodeURIComponent(String(integrationMetadataId)) + ); + + // Make Request Context + const requestContext = getServer( + _config, + "v2.IncidentsApi.getIncidentIntegration" + ).makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async listIncidentAttachments( incidentId: string, include?: Array, @@ -236,6 +412,49 @@ export class IncidentsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async listIncidentIntegrations( + incidentId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'listIncidentIntegrations'"); + if (!_config.unstableOperations["v2.listIncidentIntegrations"]) { + throw new Error( + "Unstable operation 'listIncidentIntegrations' is disabled" + ); + } + + // verify required parameter 'incidentId' is not null or undefined + if (incidentId === null || incidentId === undefined) { + throw new RequiredError("incidentId", "listIncidentIntegrations"); + } + + // Path Params + const localVarPath = + "/api/v2/incidents/{incident_id}/relationships/integrations".replace( + "{incident_id}", + encodeURIComponent(String(incidentId)) + ); + + // Make Request Context + const requestContext = getServer( + _config, + "v2.IncidentsApi.listIncidentIntegrations" + ).makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async listIncidents( include?: Array, pageSize?: number, @@ -485,23 +704,346 @@ export class IncidentsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } -} -export class IncidentsApiResponseProcessor { + public async updateIncidentIntegration( + incidentId: string, + integrationMetadataId: string, + body: IncidentIntegrationMetadataPatchRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'updateIncidentIntegration'"); + if (!_config.unstableOperations["v2.updateIncidentIntegration"]) { + throw new Error( + "Unstable operation 'updateIncidentIntegration' is disabled" + ); + } + + // verify required parameter 'incidentId' is not null or undefined + if (incidentId === null || incidentId === undefined) { + throw new RequiredError("incidentId", "updateIncidentIntegration"); + } + + // verify required parameter 'integrationMetadataId' is not null or undefined + if (integrationMetadataId === null || integrationMetadataId === undefined) { + throw new RequiredError( + "integrationMetadataId", + "updateIncidentIntegration" + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "updateIncidentIntegration"); + } + + // Path Params + const localVarPath = + "/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}" + .replace("{incident_id}", encodeURIComponent(String(incidentId))) + .replace( + "{integration_metadata_id}", + encodeURIComponent(String(integrationMetadataId)) + ); + + // Make Request Context + const requestContext = getServer( + _config, + "v2.IncidentsApi.updateIncidentIntegration" + ).makeRequestContext(localVarPath, HttpMethod.PATCH); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize( + body, + "IncidentIntegrationMetadataPatchRequest", + "" + ), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } +} + +export class IncidentsApiResponseProcessor { + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createIncident + * @throws ApiException if the response code was not in [200, 299] + */ + public async createIncident( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode == 201) { + const body: IncidentResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "IncidentResponse" + ) as IncidentResponse; + return body; + } + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 401 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: IncidentResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "IncidentResponse", + "" + ) as IncidentResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createIncidentIntegration + * @throws ApiException if the response code was not in [200, 299] + */ + public async createIncidentIntegration( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode == 201) { + const body: IncidentIntegrationMetadataResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "IncidentIntegrationMetadataResponse" + ) as IncidentIntegrationMetadataResponse; + return body; + } + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 401 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: IncidentIntegrationMetadataResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "IncidentIntegrationMetadataResponse", + "" + ) as IncidentIntegrationMetadataResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteIncident + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteIncident(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode == 204) { + return; + } + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 401 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: void = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "void", + "" + ) as void; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteIncidentIntegration + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteIncidentIntegration( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode == 204) { + return; + } + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 401 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: void = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "void", + "" + ) as void; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to createIncident + * @params response Response returned by the server for a request to getIncident * @throws ApiException if the response code was not in [200, 299] */ - public async createIncident( + public async getIncident( response: ResponseContext ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (response.httpStatusCode == 201) { + if (response.httpStatusCode == 200) { const body: IncidentResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), "IncidentResponse" @@ -556,15 +1098,22 @@ export class IncidentsApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to deleteIncident + * @params response Response returned by the server for a request to getIncidentIntegration * @throws ApiException if the response code was not in [200, 299] */ - public async deleteIncident(response: ResponseContext): Promise { + public async getIncidentIntegration( + response: ResponseContext + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (response.httpStatusCode == 204) { - return; + if (response.httpStatusCode == 200) { + const body: IncidentIntegrationMetadataResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "IncidentIntegrationMetadataResponse" + ) as IncidentIntegrationMetadataResponse; + return body; } if ( response.httpStatusCode == 400 || @@ -595,11 +1144,12 @@ export class IncidentsApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: void = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "void", - "" - ) as void; + const body: IncidentIntegrationMetadataResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "IncidentIntegrationMetadataResponse", + "" + ) as IncidentIntegrationMetadataResponse; return body; } @@ -614,20 +1164,20 @@ export class IncidentsApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to getIncident + * @params response Response returned by the server for a request to listIncidentAttachments * @throws ApiException if the response code was not in [200, 299] */ - public async getIncident( + public async listIncidentAttachments( response: ResponseContext - ): Promise { + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); if (response.httpStatusCode == 200) { - const body: IncidentResponse = ObjectSerializer.deserialize( + const body: IncidentAttachmentsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "IncidentResponse" - ) as IncidentResponse; + "IncidentAttachmentsResponse" + ) as IncidentAttachmentsResponse; return body; } if ( @@ -659,11 +1209,11 @@ export class IncidentsApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: IncidentResponse = ObjectSerializer.deserialize( + const body: IncidentAttachmentsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "IncidentResponse", + "IncidentAttachmentsResponse", "" - ) as IncidentResponse; + ) as IncidentAttachmentsResponse; return body; } @@ -678,20 +1228,21 @@ export class IncidentsApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to listIncidentAttachments + * @params response Response returned by the server for a request to listIncidentIntegrations * @throws ApiException if the response code was not in [200, 299] */ - public async listIncidentAttachments( + public async listIncidentIntegrations( response: ResponseContext - ): Promise { + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); if (response.httpStatusCode == 200) { - const body: IncidentAttachmentsResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "IncidentAttachmentsResponse" - ) as IncidentAttachmentsResponse; + const body: IncidentIntegrationMetadataListResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "IncidentIntegrationMetadataListResponse" + ) as IncidentIntegrationMetadataListResponse; return body; } if ( @@ -723,11 +1274,12 @@ export class IncidentsApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: IncidentAttachmentsResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "IncidentAttachmentsResponse", - "" - ) as IncidentAttachmentsResponse; + const body: IncidentIntegrationMetadataListResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "IncidentIntegrationMetadataListResponse", + "" + ) as IncidentIntegrationMetadataListResponse; return body; } @@ -995,6 +1547,72 @@ export class IncidentsApiResponseProcessor { 'Unknown API Status Code!\nBody: "' + body + '"' ); } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to updateIncidentIntegration + * @throws ApiException if the response code was not in [200, 299] + */ + public async updateIncidentIntegration( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode == 200) { + const body: IncidentIntegrationMetadataResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "IncidentIntegrationMetadataResponse" + ) as IncidentIntegrationMetadataResponse; + return body; + } + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 401 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: IncidentIntegrationMetadataResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "IncidentIntegrationMetadataResponse", + "" + ) as IncidentIntegrationMetadataResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } } export interface IncidentsApiCreateIncidentRequest { @@ -1005,6 +1623,19 @@ export interface IncidentsApiCreateIncidentRequest { body: IncidentCreateRequest; } +export interface IncidentsApiCreateIncidentIntegrationRequest { + /** + * The UUID of the incident. + * @type string + */ + incidentId: string; + /** + * Incident integration metadata payload. + * @type IncidentIntegrationMetadataCreateRequest + */ + body: IncidentIntegrationMetadataCreateRequest; +} + export interface IncidentsApiDeleteIncidentRequest { /** * The UUID of the incident. @@ -1013,6 +1644,19 @@ export interface IncidentsApiDeleteIncidentRequest { incidentId: string; } +export interface IncidentsApiDeleteIncidentIntegrationRequest { + /** + * The UUID of the incident. + * @type string + */ + incidentId: string; + /** + * The UUID of the incident integration metadata. + * @type string + */ + integrationMetadataId: string; +} + export interface IncidentsApiGetIncidentRequest { /** * The UUID of the incident. @@ -1026,6 +1670,19 @@ export interface IncidentsApiGetIncidentRequest { include?: Array; } +export interface IncidentsApiGetIncidentIntegrationRequest { + /** + * The UUID of the incident. + * @type string + */ + incidentId: string; + /** + * The UUID of the incident integration metadata. + * @type string + */ + integrationMetadataId: string; +} + export interface IncidentsApiListIncidentAttachmentsRequest { /** * The UUID of the incident. @@ -1044,6 +1701,14 @@ export interface IncidentsApiListIncidentAttachmentsRequest { filterAttachmentType?: Array; } +export interface IncidentsApiListIncidentIntegrationsRequest { + /** + * The UUID of the incident. + * @type string + */ + incidentId: string; +} + export interface IncidentsApiListIncidentsRequest { /** * Specifies which types of related objects should be included in the response. @@ -1122,6 +1787,24 @@ export interface IncidentsApiUpdateIncidentAttachmentsRequest { include?: Array; } +export interface IncidentsApiUpdateIncidentIntegrationRequest { + /** + * The UUID of the incident. + * @type string + */ + incidentId: string; + /** + * The UUID of the incident integration metadata. + * @type string + */ + integrationMetadataId: string; + /** + * Incident integration metadata payload. + * @type IncidentIntegrationMetadataPatchRequest + */ + body: IncidentIntegrationMetadataPatchRequest; +} + export class IncidentsApi { private requestFactory: IncidentsApiRequestFactory; private responseProcessor: IncidentsApiResponseProcessor; @@ -1160,6 +1843,30 @@ export class IncidentsApi { }); } + /** + * Create an incident integration metadata. + * @param param The request object + */ + public createIncidentIntegration( + param: IncidentsApiCreateIncidentIntegrationRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.createIncidentIntegration( + param.incidentId, + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createIncidentIntegration( + responseContext + ); + }); + }); + } + /** * Deletes an existing incident from the users organization. * @param param The request object @@ -1181,6 +1888,30 @@ export class IncidentsApi { }); } + /** + * Delete an incident integration metadata. + * @param param The request object + */ + public deleteIncidentIntegration( + param: IncidentsApiDeleteIncidentIntegrationRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.deleteIncidentIntegration( + param.incidentId, + param.integrationMetadataId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.deleteIncidentIntegration( + responseContext + ); + }); + }); + } + /** * Get the details of an incident by `incident_id`. * @param param The request object @@ -1203,6 +1934,28 @@ export class IncidentsApi { }); } + /** + * Get incident integration metadata details. + * @param param The request object + */ + public getIncidentIntegration( + param: IncidentsApiGetIncidentIntegrationRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.getIncidentIntegration( + param.incidentId, + param.integrationMetadataId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getIncidentIntegration(responseContext); + }); + }); + } + /** * Get all attachments for a given incident. * @param param The request object @@ -1228,6 +1981,29 @@ export class IncidentsApi { }); } + /** + * Get all integration metadata for an incident. + * @param param The request object + */ + public listIncidentIntegrations( + param: IncidentsApiListIncidentIntegrationsRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.listIncidentIntegrations( + param.incidentId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listIncidentIntegrations( + responseContext + ); + }); + }); + } + /** * Get all incidents for the user's organization. * @param param The request object @@ -1366,4 +2142,29 @@ export class IncidentsApi { }); }); } + + /** + * Update an existing incident integration metadata. + * @param param The request object + */ + public updateIncidentIntegration( + param: IncidentsApiUpdateIncidentIntegrationRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.updateIncidentIntegration( + param.incidentId, + param.integrationMetadataId, + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.updateIncidentIntegration( + responseContext + ); + }); + }); + } } diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index 6a56557eed1..5f1db9b07de 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -108,13 +108,18 @@ export { export { IncidentsApiCreateIncidentRequest, + IncidentsApiCreateIncidentIntegrationRequest, IncidentsApiDeleteIncidentRequest, + IncidentsApiDeleteIncidentIntegrationRequest, IncidentsApiGetIncidentRequest, + IncidentsApiGetIncidentIntegrationRequest, IncidentsApiListIncidentAttachmentsRequest, + IncidentsApiListIncidentIntegrationsRequest, IncidentsApiListIncidentsRequest, IncidentsApiSearchIncidentsRequest, IncidentsApiUpdateIncidentRequest, IncidentsApiUpdateIncidentAttachmentsRequest, + IncidentsApiUpdateIncidentIntegrationRequest, IncidentsApi, } from "./apis/IncidentsApi"; @@ -571,6 +576,16 @@ export { IncidentFieldAttributesMultipleValue } from "./models/IncidentFieldAttr export { IncidentFieldAttributesSingleValue } from "./models/IncidentFieldAttributesSingleValue"; export { IncidentFieldAttributesSingleValueType } from "./models/IncidentFieldAttributesSingleValueType"; export { IncidentFieldAttributesValueType } from "./models/IncidentFieldAttributesValueType"; +export { IncidentIntegrationMetadataAttributes } from "./models/IncidentIntegrationMetadataAttributes"; +export { IncidentIntegrationMetadataCreateData } from "./models/IncidentIntegrationMetadataCreateData"; +export { IncidentIntegrationMetadataCreateRequest } from "./models/IncidentIntegrationMetadataCreateRequest"; +export { IncidentIntegrationMetadataListResponse } from "./models/IncidentIntegrationMetadataListResponse"; +export { IncidentIntegrationMetadataMetadata } from "./models/IncidentIntegrationMetadataMetadata"; +export { IncidentIntegrationMetadataPatchData } from "./models/IncidentIntegrationMetadataPatchData"; +export { IncidentIntegrationMetadataPatchRequest } from "./models/IncidentIntegrationMetadataPatchRequest"; +export { IncidentIntegrationMetadataResponse } from "./models/IncidentIntegrationMetadataResponse"; +export { IncidentIntegrationMetadataResponseData } from "./models/IncidentIntegrationMetadataResponseData"; +export { IncidentIntegrationMetadataResponseIncludedItem } from "./models/IncidentIntegrationMetadataResponseIncludedItem"; export { IncidentIntegrationMetadataType } from "./models/IncidentIntegrationMetadataType"; export { IncidentNotificationHandle } from "./models/IncidentNotificationHandle"; export { IncidentPostmortemType } from "./models/IncidentPostmortemType"; @@ -640,6 +655,8 @@ export { IPAllowlistEntryType } from "./models/IPAllowlistEntryType"; export { IPAllowlistResponse } from "./models/IPAllowlistResponse"; export { IPAllowlistType } from "./models/IPAllowlistType"; export { IPAllowlistUpdateRequest } from "./models/IPAllowlistUpdateRequest"; +export { JiraIntegrationMetadata } from "./models/JiraIntegrationMetadata"; +export { JiraIntegrationMetadataIssuesItem } from "./models/JiraIntegrationMetadataIssuesItem"; export { ListApplicationKeysResponse } from "./models/ListApplicationKeysResponse"; export { Log } from "./models/Log"; export { LogAttributes } from "./models/LogAttributes"; @@ -1100,6 +1117,8 @@ export { ServiceDefinitionV2Repo } from "./models/ServiceDefinitionV2Repo"; export { ServiceDefinitionV2Slack } from "./models/ServiceDefinitionV2Slack"; export { ServiceDefinitionV2SlackType } from "./models/ServiceDefinitionV2SlackType"; export { ServiceDefinitionV2Version } from "./models/ServiceDefinitionV2Version"; +export { SlackIntegrationMetadata } from "./models/SlackIntegrationMetadata"; +export { SlackIntegrationMetadataChannelItem } from "./models/SlackIntegrationMetadataChannelItem"; export { TimeseriesFormulaQueryRequest } from "./models/TimeseriesFormulaQueryRequest"; export { TimeseriesFormulaQueryResponse } from "./models/TimeseriesFormulaQueryResponse"; export { TimeseriesFormulaRequest } from "./models/TimeseriesFormulaRequest"; diff --git a/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataAttributes.ts b/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataAttributes.ts new file mode 100644 index 00000000000..e65c852ab96 --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataAttributes.ts @@ -0,0 +1,73 @@ +/** + * 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. + */ +import { IncidentIntegrationMetadataMetadata } from "./IncidentIntegrationMetadataMetadata"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Incident integration metadata's attributes for a create request. + */ +export class IncidentIntegrationMetadataAttributes { + /** + * UUID of the incident this integration metadata is connected to. + */ + "incidentId"?: string; + /** + * A number indicating the type of integration this metadata is for. 1 indicates Slack; + * 8 indicates Jira. + */ + "integrationType": number; + /** + * Incident integration metadata's metadata attribute. + */ + "metadata": IncidentIntegrationMetadataMetadata; + /** + * A number indicating the status of this integration metadata. 0 indicates unknown; + * 1 indicates pending; 2 indicates complete; 3 indicates manually created; + * 4 indicates manually updated; 5 indicates failed. + */ + "status"?: number; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + incidentId: { + baseName: "incident_id", + type: "string", + }, + integrationType: { + baseName: "integration_type", + type: "number", + required: true, + format: "int32", + }, + metadata: { + baseName: "metadata", + type: "IncidentIntegrationMetadataMetadata", + required: true, + }, + status: { + baseName: "status", + type: "number", + format: "int32", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return IncidentIntegrationMetadataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataCreateData.ts b/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataCreateData.ts new file mode 100644 index 00000000000..12a1df02c3c --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataCreateData.ts @@ -0,0 +1,53 @@ +/** + * 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. + */ +import { IncidentIntegrationMetadataAttributes } from "./IncidentIntegrationMetadataAttributes"; +import { IncidentIntegrationMetadataType } from "./IncidentIntegrationMetadataType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Incident integration metadata data for a create request. + */ +export class IncidentIntegrationMetadataCreateData { + /** + * Incident integration metadata's attributes for a create request. + */ + "attributes": IncidentIntegrationMetadataAttributes; + /** + * Integration metadata resource type. + */ + "type": IncidentIntegrationMetadataType; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "IncidentIntegrationMetadataAttributes", + required: true, + }, + type: { + baseName: "type", + type: "IncidentIntegrationMetadataType", + required: true, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return IncidentIntegrationMetadataCreateData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataCreateRequest.ts b/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataCreateRequest.ts new file mode 100644 index 00000000000..0aeb781cece --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataCreateRequest.ts @@ -0,0 +1,43 @@ +/** + * 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. + */ +import { IncidentIntegrationMetadataCreateData } from "./IncidentIntegrationMetadataCreateData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Create request for an incident integration metadata. + */ +export class IncidentIntegrationMetadataCreateRequest { + /** + * Incident integration metadata data for a create request. + */ + "data": IncidentIntegrationMetadataCreateData; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "IncidentIntegrationMetadataCreateData", + required: true, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return IncidentIntegrationMetadataCreateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataListResponse.ts b/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataListResponse.ts new file mode 100644 index 00000000000..87c5a19159d --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataListResponse.ts @@ -0,0 +1,61 @@ +/** + * 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. + */ +import { IncidentIntegrationMetadataResponseData } from "./IncidentIntegrationMetadataResponseData"; +import { IncidentIntegrationMetadataResponseIncludedItem } from "./IncidentIntegrationMetadataResponseIncludedItem"; +import { IncidentResponseMeta } from "./IncidentResponseMeta"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response with a list of incident integration metadata. + */ +export class IncidentIntegrationMetadataListResponse { + /** + * An array of incident integration metadata. + */ + "data": Array; + /** + * Included related resources that the user requested. + */ + "included"?: Array; + /** + * The metadata object containing pagination metadata. + */ + "meta"?: IncidentResponseMeta; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + required: true, + }, + included: { + baseName: "included", + type: "Array", + }, + meta: { + baseName: "meta", + type: "IncidentResponseMeta", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return IncidentIntegrationMetadataListResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataMetadata.ts b/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataMetadata.ts new file mode 100644 index 00000000000..2696c31448f --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataMetadata.ts @@ -0,0 +1,18 @@ +/** + * 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. + */ +import { JiraIntegrationMetadata } from "./JiraIntegrationMetadata"; +import { SlackIntegrationMetadata } from "./SlackIntegrationMetadata"; + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Incident integration metadata's metadata attribute. + */ + +export type IncidentIntegrationMetadataMetadata = + | SlackIntegrationMetadata + | JiraIntegrationMetadata + | UnparsedObject; diff --git a/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataPatchData.ts b/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataPatchData.ts new file mode 100644 index 00000000000..ed1a63922a2 --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataPatchData.ts @@ -0,0 +1,53 @@ +/** + * 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. + */ +import { IncidentIntegrationMetadataAttributes } from "./IncidentIntegrationMetadataAttributes"; +import { IncidentIntegrationMetadataType } from "./IncidentIntegrationMetadataType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Incident integration metadata data for a patch request. + */ +export class IncidentIntegrationMetadataPatchData { + /** + * Incident integration metadata's attributes for a create request. + */ + "attributes": IncidentIntegrationMetadataAttributes; + /** + * Integration metadata resource type. + */ + "type": IncidentIntegrationMetadataType; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "IncidentIntegrationMetadataAttributes", + required: true, + }, + type: { + baseName: "type", + type: "IncidentIntegrationMetadataType", + required: true, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return IncidentIntegrationMetadataPatchData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataPatchRequest.ts b/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataPatchRequest.ts new file mode 100644 index 00000000000..87e81f9d614 --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataPatchRequest.ts @@ -0,0 +1,43 @@ +/** + * 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. + */ +import { IncidentIntegrationMetadataPatchData } from "./IncidentIntegrationMetadataPatchData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Patch request for an incident integration metadata. + */ +export class IncidentIntegrationMetadataPatchRequest { + /** + * Incident integration metadata data for a patch request. + */ + "data": IncidentIntegrationMetadataPatchData; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "IncidentIntegrationMetadataPatchData", + required: true, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return IncidentIntegrationMetadataPatchRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataResponse.ts b/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataResponse.ts new file mode 100644 index 00000000000..22d74e26849 --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataResponse.ts @@ -0,0 +1,52 @@ +/** + * 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. + */ +import { IncidentIntegrationMetadataResponseData } from "./IncidentIntegrationMetadataResponseData"; +import { IncidentIntegrationMetadataResponseIncludedItem } from "./IncidentIntegrationMetadataResponseIncludedItem"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response with an incident integration metadata. + */ +export class IncidentIntegrationMetadataResponse { + /** + * Incident integration metadata from a response. + */ + "data": IncidentIntegrationMetadataResponseData; + /** + * Included related resources that the user requested. + */ + "included"?: Array; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "IncidentIntegrationMetadataResponseData", + required: true, + }, + included: { + baseName: "included", + type: "Array", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return IncidentIntegrationMetadataResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataResponseData.ts b/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataResponseData.ts new file mode 100644 index 00000000000..6d25595c358 --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataResponseData.ts @@ -0,0 +1,61 @@ +/** + * 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. + */ +import { IncidentIntegrationMetadataAttributes } from "./IncidentIntegrationMetadataAttributes"; +import { IncidentIntegrationMetadataType } from "./IncidentIntegrationMetadataType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Incident integration metadata from a response. + */ +export class IncidentIntegrationMetadataResponseData { + /** + * Incident integration metadata's attributes for a create request. + */ + "attributes"?: IncidentIntegrationMetadataAttributes; + /** + * The incident integration metadata's ID. + */ + "id": string; + /** + * Integration metadata resource type. + */ + "type": IncidentIntegrationMetadataType; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "IncidentIntegrationMetadataAttributes", + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "IncidentIntegrationMetadataType", + required: true, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return IncidentIntegrationMetadataResponseData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataResponseIncludedItem.ts b/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataResponseIncludedItem.ts new file mode 100644 index 00000000000..514a8b5acdf --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentIntegrationMetadataResponseIncludedItem.ts @@ -0,0 +1,16 @@ +/** + * 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. + */ +import { User } from "./User"; + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * An object related to an incident integration metadata that is included in the response. + */ + +export type IncidentIntegrationMetadataResponseIncludedItem = + | User + | UnparsedObject; diff --git a/packages/datadog-api-client-v2/models/IncidentUpdateData.ts b/packages/datadog-api-client-v2/models/IncidentUpdateData.ts index 14f25559554..54ff17aef40 100644 --- a/packages/datadog-api-client-v2/models/IncidentUpdateData.ts +++ b/packages/datadog-api-client-v2/models/IncidentUpdateData.ts @@ -18,7 +18,7 @@ export class IncidentUpdateData { */ "attributes"?: IncidentUpdateAttributes; /** - * The team's ID. + * The incident's ID. */ "id": string; /** diff --git a/packages/datadog-api-client-v2/models/JiraIntegrationMetadata.ts b/packages/datadog-api-client-v2/models/JiraIntegrationMetadata.ts new file mode 100644 index 00000000000..5196476d6ed --- /dev/null +++ b/packages/datadog-api-client-v2/models/JiraIntegrationMetadata.ts @@ -0,0 +1,43 @@ +/** + * 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. + */ +import { JiraIntegrationMetadataIssuesItem } from "./JiraIntegrationMetadataIssuesItem"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Incident integration metadata for the Jira integration. + */ +export class JiraIntegrationMetadata { + /** + * Array of Jira issues in this integration metadata. + */ + "issues": Array; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + issues: { + baseName: "issues", + type: "Array", + required: true, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return JiraIntegrationMetadata.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/JiraIntegrationMetadataIssuesItem.ts b/packages/datadog-api-client-v2/models/JiraIntegrationMetadataIssuesItem.ts new file mode 100644 index 00000000000..9272b2da953 --- /dev/null +++ b/packages/datadog-api-client-v2/models/JiraIntegrationMetadataIssuesItem.ts @@ -0,0 +1,75 @@ +/** + * 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. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Item in the Jira integration metadata issue array. + */ +export class JiraIntegrationMetadataIssuesItem { + /** + * URL of issue's Jira account. + */ + "account": string; + /** + * Jira issue's issue key. + */ + "issueKey"?: string; + /** + * Jira issue's issue type. + */ + "issuetypeId"?: string; + /** + * Jira issue's project keys. + */ + "projectKey": string; + /** + * URL redirecting to the Jira issue. + */ + "redirectUrl"?: string; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + account: { + baseName: "account", + type: "string", + required: true, + }, + issueKey: { + baseName: "issue_key", + type: "string", + }, + issuetypeId: { + baseName: "issuetype_id", + type: "string", + }, + projectKey: { + baseName: "project_key", + type: "string", + required: true, + }, + redirectUrl: { + baseName: "redirect_url", + type: "string", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return JiraIntegrationMetadataIssuesItem.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index e69c996193e..09eaa25797a 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -206,6 +206,14 @@ import { IncidentCreateRelationships } from "./IncidentCreateRelationships"; import { IncidentCreateRequest } from "./IncidentCreateRequest"; import { IncidentFieldAttributesMultipleValue } from "./IncidentFieldAttributesMultipleValue"; import { IncidentFieldAttributesSingleValue } from "./IncidentFieldAttributesSingleValue"; +import { IncidentIntegrationMetadataAttributes } from "./IncidentIntegrationMetadataAttributes"; +import { IncidentIntegrationMetadataCreateData } from "./IncidentIntegrationMetadataCreateData"; +import { IncidentIntegrationMetadataCreateRequest } from "./IncidentIntegrationMetadataCreateRequest"; +import { IncidentIntegrationMetadataListResponse } from "./IncidentIntegrationMetadataListResponse"; +import { IncidentIntegrationMetadataPatchData } from "./IncidentIntegrationMetadataPatchData"; +import { IncidentIntegrationMetadataPatchRequest } from "./IncidentIntegrationMetadataPatchRequest"; +import { IncidentIntegrationMetadataResponse } from "./IncidentIntegrationMetadataResponse"; +import { IncidentIntegrationMetadataResponseData } from "./IncidentIntegrationMetadataResponseData"; import { IncidentNotificationHandle } from "./IncidentNotificationHandle"; import { IncidentResponse } from "./IncidentResponse"; import { IncidentResponseAttributes } from "./IncidentResponseAttributes"; @@ -253,6 +261,8 @@ import { IncidentUpdateRelationships } from "./IncidentUpdateRelationships"; import { IncidentUpdateRequest } from "./IncidentUpdateRequest"; import { IncidentsResponse } from "./IncidentsResponse"; import { IntakePayloadAccepted } from "./IntakePayloadAccepted"; +import { JiraIntegrationMetadata } from "./JiraIntegrationMetadata"; +import { JiraIntegrationMetadataIssuesItem } from "./JiraIntegrationMetadataIssuesItem"; import { ListApplicationKeysResponse } from "./ListApplicationKeysResponse"; import { Log } from "./Log"; import { LogAttributes } from "./LogAttributes"; @@ -602,6 +612,8 @@ import { ServiceDefinitionV2Opsgenie } from "./ServiceDefinitionV2Opsgenie"; import { ServiceDefinitionV2Repo } from "./ServiceDefinitionV2Repo"; import { ServiceDefinitionV2Slack } from "./ServiceDefinitionV2Slack"; import { ServiceDefinitionsListResponse } from "./ServiceDefinitionsListResponse"; +import { SlackIntegrationMetadata } from "./SlackIntegrationMetadata"; +import { SlackIntegrationMetadataChannelItem } from "./SlackIntegrationMetadataChannelItem"; import { TimeseriesFormulaQueryRequest } from "./TimeseriesFormulaQueryRequest"; import { TimeseriesFormulaQueryResponse } from "./TimeseriesFormulaQueryResponse"; import { TimeseriesFormulaRequest } from "./TimeseriesFormulaRequest"; @@ -1236,6 +1248,18 @@ const typeMap: { [index: string]: any } = { IncidentCreateRequest: IncidentCreateRequest, IncidentFieldAttributesMultipleValue: IncidentFieldAttributesMultipleValue, IncidentFieldAttributesSingleValue: IncidentFieldAttributesSingleValue, + IncidentIntegrationMetadataAttributes: IncidentIntegrationMetadataAttributes, + IncidentIntegrationMetadataCreateData: IncidentIntegrationMetadataCreateData, + IncidentIntegrationMetadataCreateRequest: + IncidentIntegrationMetadataCreateRequest, + IncidentIntegrationMetadataListResponse: + IncidentIntegrationMetadataListResponse, + IncidentIntegrationMetadataPatchData: IncidentIntegrationMetadataPatchData, + IncidentIntegrationMetadataPatchRequest: + IncidentIntegrationMetadataPatchRequest, + IncidentIntegrationMetadataResponse: IncidentIntegrationMetadataResponse, + IncidentIntegrationMetadataResponseData: + IncidentIntegrationMetadataResponseData, IncidentNotificationHandle: IncidentNotificationHandle, IncidentResponse: IncidentResponse, IncidentResponseAttributes: IncidentResponseAttributes, @@ -1288,6 +1312,8 @@ const typeMap: { [index: string]: any } = { IncidentUpdateRequest: IncidentUpdateRequest, IncidentsResponse: IncidentsResponse, IntakePayloadAccepted: IntakePayloadAccepted, + JiraIntegrationMetadata: JiraIntegrationMetadata, + JiraIntegrationMetadataIssuesItem: JiraIntegrationMetadataIssuesItem, ListApplicationKeysResponse: ListApplicationKeysResponse, Log: Log, LogAttributes: LogAttributes, @@ -1688,6 +1714,8 @@ const typeMap: { [index: string]: any } = { ServiceDefinitionV2Repo: ServiceDefinitionV2Repo, ServiceDefinitionV2Slack: ServiceDefinitionV2Slack, ServiceDefinitionsListResponse: ServiceDefinitionsListResponse, + SlackIntegrationMetadata: SlackIntegrationMetadata, + SlackIntegrationMetadataChannelItem: SlackIntegrationMetadataChannelItem, TimeseriesFormulaQueryRequest: TimeseriesFormulaQueryRequest, TimeseriesFormulaQueryResponse: TimeseriesFormulaQueryResponse, TimeseriesFormulaRequest: TimeseriesFormulaRequest, @@ -1748,6 +1776,11 @@ const oneOfMap: { [index: string]: string[] } = { "IncidentFieldAttributesSingleValue", "IncidentFieldAttributesMultipleValue", ], + IncidentIntegrationMetadataMetadata: [ + "SlackIntegrationMetadata", + "JiraIntegrationMetadata", + ], + IncidentIntegrationMetadataResponseIncludedItem: ["User"], IncidentResponseIncludedItem: ["User", "IncidentAttachmentData"], IncidentServiceIncludedItems: ["User"], IncidentTeamIncludedItems: ["User"], diff --git a/packages/datadog-api-client-v2/models/RelationshipToIncidentIntegrationMetadatas.ts b/packages/datadog-api-client-v2/models/RelationshipToIncidentIntegrationMetadatas.ts index dd5a2e6986a..4968febf13c 100644 --- a/packages/datadog-api-client-v2/models/RelationshipToIncidentIntegrationMetadatas.ts +++ b/packages/datadog-api-client-v2/models/RelationshipToIncidentIntegrationMetadatas.ts @@ -12,7 +12,7 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util"; */ export class RelationshipToIncidentIntegrationMetadatas { /** - * The integration metadata relationship array + * Integration metadata relationship array */ "data": Array; diff --git a/packages/datadog-api-client-v2/models/SlackIntegrationMetadata.ts b/packages/datadog-api-client-v2/models/SlackIntegrationMetadata.ts new file mode 100644 index 00000000000..d58ec1f7ecf --- /dev/null +++ b/packages/datadog-api-client-v2/models/SlackIntegrationMetadata.ts @@ -0,0 +1,43 @@ +/** + * 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. + */ +import { SlackIntegrationMetadataChannelItem } from "./SlackIntegrationMetadataChannelItem"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Incident integration metadata for the Slack integration. + */ +export class SlackIntegrationMetadata { + /** + * Array of Slack channels in this integration metadata. + */ + "channels": Array; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + channels: { + baseName: "channels", + type: "Array", + required: true, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SlackIntegrationMetadata.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SlackIntegrationMetadataChannelItem.ts b/packages/datadog-api-client-v2/models/SlackIntegrationMetadataChannelItem.ts new file mode 100644 index 00000000000..8fb26c6a270 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SlackIntegrationMetadataChannelItem.ts @@ -0,0 +1,68 @@ +/** + * 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. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Item in the Slack integration metadata channel array. + */ +export class SlackIntegrationMetadataChannelItem { + /** + * Slack channel ID. + */ + "channelId": string; + /** + * Name of the Slack channel. + */ + "channelName": string; + /** + * URL redirecting to the Slack channel. + */ + "redirectUrl": string; + /** + * Slack team ID. + */ + "teamId"?: string; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + channelId: { + baseName: "channel_id", + type: "string", + required: true, + }, + channelName: { + baseName: "channel_name", + type: "string", + required: true, + }, + redirectUrl: { + baseName: "redirect_url", + type: "string", + required: true, + }, + teamId: { + baseName: "team_id", + type: "string", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SlackIntegrationMetadataChannelItem.attributeTypeMap; + } + + public constructor() {} +}