diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ad4c9abc7a7b..b14a6aa2fa7d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -510,6 +510,34 @@ components: items: $ref: '#/components/schemas/GetIssueIncludeQueryParameterItem' type: array + GoogleChatHandleIdPathParameter: + description: Your organization handle ID. + in: path + name: handle_id + required: true + schema: + type: string + GoogleChatOrganizationBindingIdPathParameter: + description: Your organization binding ID. + in: path + name: organization_binding_id + required: true + schema: + type: string + GoogleChatOrganizationDomainNamePathParameter: + description: The Google Chat domain name. + in: path + name: domain_name + required: true + schema: + type: string + GoogleChatOrganizationSpaceDisplayNamePathParameter: + description: The Google Chat space display name. + in: path + name: space_display_name + required: true + schema: + type: string IncidentIDPathParameter: description: The UUID of the incident. in: path @@ -28495,6 +28523,206 @@ components: type: string x-enum-varnames: - GLOBAL_VARIABLES + GoogleChatAppNamedSpaceResponse: + description: Response with Google Chat space information. + properties: + data: + $ref: '#/components/schemas/GoogleChatAppNamedSpaceResponseData' + required: + - data + type: object + GoogleChatAppNamedSpaceResponseAttributes: + description: Google Chat space attributes. + properties: + display_name: + description: Google space display name. + example: Fake Space Name + maxLength: 255 + type: string + organization_binding_id: + description: Organization binding ID. + example: 2f18a894-adb5-4c53-8248-39fd3f5386a5 + maxLength: 255 + type: string + resource_name: + description: Google space resource name. + example: spaces/AAAAAAAAA + maxLength: 255 + type: string + space_uri: + description: Google space URI. + example: https://chat.google.com/room/AAAAAAAAA + maxLength: 255 + type: string + type: object + GoogleChatAppNamedSpaceResponseData: + description: Google Chat space data from a response. + properties: + attributes: + $ref: '#/components/schemas/GoogleChatAppNamedSpaceResponseAttributes' + id: + description: The ID of the Google Chat space. + example: 596da4af-0563-4097-90ff-07230c3f9db3 + maxLength: 100 + minLength: 1 + type: string + type: + $ref: '#/components/schemas/GoogleChatAppNamedSpaceType' + type: object + GoogleChatAppNamedSpaceType: + default: google-chat-app-named-space + description: Google Chat space resource type. + enum: + - google-chat-app-named-space + example: google-chat-app-named-space + type: string + x-enum-varnames: + - GOOGLE_CHAT_APP_NAMED_SPACE_TYPE + GoogleChatCreateOrganizationHandleRequest: + description: Create organization handle request. + properties: + data: + $ref: '#/components/schemas/GoogleChatCreateOrganizationHandleRequestData' + type: + $ref: '#/components/schemas/GoogleChatOrganizationHandleType' + required: + - type + - data + type: object + GoogleChatCreateOrganizationHandleRequestAttributes: + description: Organization handle attributes for a create request. + properties: + name: + description: Organization handle name. + example: fake-handle-name + maxLength: 255 + type: string + space_resource_name: + description: Google space resource name. + example: spaces/AAAAAAAAA + maxLength: 255 + type: string + required: + - name + - space_resource_name + type: object + GoogleChatCreateOrganizationHandleRequestData: + description: Organization handle data for a create request. + properties: + attributes: + $ref: '#/components/schemas/GoogleChatCreateOrganizationHandleRequestAttributes' + required: + - attributes + type: object + GoogleChatOrganizationHandleResponse: + description: Organization handle for monitor notifications to a Google Chat + space within a Google organization. + properties: + data: + $ref: '#/components/schemas/GoogleChatOrganizationHandleResponseData' + required: + - data + type: object + GoogleChatOrganizationHandleResponseAttributes: + description: Organization handle attributes. + properties: + name: + description: Organization handle name. + example: fake-handle-name + maxLength: 255 + type: string + space_display_name: + description: Google space display name. + example: Fake Space Name + maxLength: 255 + type: string + space_resource_name: + description: Google space resource name. + example: spaces/AAAAAAAAA + maxLength: 255 + type: string + type: object + GoogleChatOrganizationHandleResponseData: + description: Organization handle data from a response. + properties: + attributes: + $ref: '#/components/schemas/GoogleChatOrganizationHandleResponseAttributes' + id: + description: The ID of the organization handle. + example: 596da4af-0563-4097-90ff-07230c3f9db3 + maxLength: 100 + minLength: 1 + type: string + type: + $ref: '#/components/schemas/GoogleChatOrganizationHandleType' + type: object + GoogleChatOrganizationHandleType: + default: google-chat-organization-handle + description: Organization handle resource type. + enum: + - google-chat-organization-handle + example: google-chat-organization-handle + type: string + x-enum-varnames: + - GOOGLE_CHAT_ORGANIZATION_HANDLE_TYPE + GoogleChatOrganizationHandlesResponse: + description: List of organization handles for monitor notifications to Google + Chat spaces within a Google organization. + properties: + data: + description: An array of organization handles. + example: + - attributes: + name: general-handle + space_display_name: General + space_resource_name: spaces/AAAAAAAAA + id: 596da4af-0563-4097-90ff-07230c3f9db3 + type: google-chat-organization-handle + - attributes: + name: general-handle-2 + space_display_name: General2 + space_resource_name: spaces/BBBBBBBBB + id: 596da4af-0563-4097-90ff-07230c3f9db4 + type: google-chat-organization-handle + items: + $ref: '#/components/schemas/GoogleChatOrganizationHandleResponseData' + type: array + required: + - data + type: object + GoogleChatUpdateOrganizationHandleRequest: + description: Update organization handle request. + properties: + data: + $ref: '#/components/schemas/GoogleChatUpdateOrganizationHandleRequestData' + type: + $ref: '#/components/schemas/GoogleChatOrganizationHandleType' + required: + - type + - data + type: object + GoogleChatUpdateOrganizationHandleRequestAttributes: + description: Organization handle attributes for an update request. + properties: + name: + description: Organization handle name. + example: fake-handle-name + maxLength: 255 + type: string + space_resource_name: + description: Google space resource name. + example: spaces/AAAAAAAAA + maxLength: 255 + type: string + type: object + GoogleChatUpdateOrganizationHandleRequestData: + description: Organization handle data for an update request. + properties: + attributes: + $ref: '#/components/schemas/GoogleChatUpdateOrganizationHandleRequestAttributes' + required: + - attributes + type: object GoogleMeetConfigurationReference: description: A reference to a Google Meet Configuration resource. nullable: true @@ -83137,6 +83365,177 @@ paths: operator: OR permissions: - gcp_configuration_edit + /api/v2/integration/google-chat/organizations/app/named-spaces/{domain_name}/{space_display_name}: + get: + description: Get the resource name and organization binding ID of a space in + the Datadog Google Chat integration. + operationId: GetSpaceByDisplayName + parameters: + - $ref: '#/components/parameters/GoogleChatOrganizationDomainNamePathParameter' + - $ref: '#/components/parameters/GoogleChatOrganizationSpaceDisplayNamePathParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GoogleChatAppNamedSpaceResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get space information by display name + tags: + - Google Chat Integration + /api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles: + get: + description: Get a list of all organization handles from the Datadog Google + Chat integration. + operationId: ListOrganizationHandles + parameters: + - $ref: '#/components/parameters/GoogleChatOrganizationBindingIdPathParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GoogleChatOrganizationHandlesResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get all organization handles + tags: + - Google Chat Integration + post: + description: Create an organization handle in the Datadog Google Chat integration. + operationId: CreateOrganizationHandle + parameters: + - $ref: '#/components/parameters/GoogleChatOrganizationBindingIdPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GoogleChatCreateOrganizationHandleRequest' + description: Organization handle payload. + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/GoogleChatOrganizationHandleResponse' + description: CREATED + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '409': + $ref: '#/components/responses/ConflictResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create organization handle + tags: + - Google Chat Integration + x-codegen-request-body-name: body + /api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles/{handle_id}: + delete: + description: Delete an organization handle from the Datadog Google Chat integration. + operationId: DeleteOrganizationHandle + parameters: + - description: Your organization binding ID. + in: path + name: organization_binding_id + required: true + schema: + type: string + - description: Your organization handle ID. + in: path + name: handle_id + required: true + schema: + type: string + responses: + '204': + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete organization handle + tags: + - Google Chat Integration + get: + description: Get an organization handle from the Datadog Google Chat integration. + operationId: GetOrganizationHandle + parameters: + - $ref: '#/components/parameters/GoogleChatOrganizationBindingIdPathParameter' + - $ref: '#/components/parameters/GoogleChatHandleIdPathParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GoogleChatOrganizationHandleResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get organization handle + tags: + - Google Chat Integration + patch: + description: Update an organization handle from the Datadog Google Chat integration. + operationId: UpdateOrganizationHandle + parameters: + - $ref: '#/components/parameters/GoogleChatOrganizationBindingIdPathParameter' + - $ref: '#/components/parameters/GoogleChatHandleIdPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GoogleChatUpdateOrganizationHandleRequest' + description: Organization handle payload. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GoogleChatOrganizationHandleResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '409': + $ref: '#/components/responses/ConflictResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update organization handle + tags: + - Google Chat Integration + x-codegen-request-body-name: body /api/v2/integration/jira/accounts: get: description: Get all Jira accounts for the organization. @@ -106353,6 +106752,14 @@ tags: externalDocs: url: https://docs.datadoghq.com/integrations/google_cloud_platform name: GCP Integration +- description: 'Configure your [Datadog Google Chat integration](https://docs.datadoghq.com/integrations/google-hangouts-chat/) + + directly through the Datadog API.' + externalDocs: + description: For more information about the Datadog Google Chat integration, see + the integration page. + url: https://docs.datadoghq.com/integrations/google-hangouts-chat/ + name: Google Chat Integration - description: 'Configure High Availability Multi-Region (HAMR) connections between Datadog organizations. diff --git a/cassettes/v2/Google-Chat-Integration_1502589702/Create-organization-handle-returns-CREATED-response_2040418584/frozen.json b/cassettes/v2/Google-Chat-Integration_1502589702/Create-organization-handle-returns-CREATED-response_2040418584/frozen.json new file mode 100644 index 000000000000..4eda1dba3890 --- /dev/null +++ b/cassettes/v2/Google-Chat-Integration_1502589702/Create-organization-handle-returns-CREATED-response_2040418584/frozen.json @@ -0,0 +1 @@ +"2026-02-10T19:17:08.664Z" diff --git a/cassettes/v2/Google-Chat-Integration_1502589702/Create-organization-handle-returns-CREATED-response_2040418584/recording.har b/cassettes/v2/Google-Chat-Integration_1502589702/Create-organization-handle-returns-CREATED-response_2040418584/recording.har new file mode 100644 index 000000000000..cc75733d9a78 --- /dev/null +++ b/cassettes/v2/Google-Chat-Integration_1502589702/Create-organization-handle-returns-CREATED-response_2040418584/recording.har @@ -0,0 +1,104 @@ +{ + "log": { + "_recordingName": "Google Chat Integration/Create organization handle returns \"CREATED\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "be844af4443529cfe868515ccb19e2fa", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 186, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 654, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"name\":\"Test-Create_organization_handle_returns_CREATED_response-1770751028\",\"space_resource_name\":\"spaces/AAQA-zFIks8\"}},\"type\":\"google-chat-organization-handle\"}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/integration/google-chat/organizations/e54cb570-c674-529c-769d-84b312288ed7/organization-handles" + }, + "response": { + "bodySize": 268, + "content": { + "mimeType": "application/vnd.api+json", + "size": 268, + "text": "{\"data\":{\"id\":\"dcad18fd-a3b1-4544-8fee-e1e2988204d8\",\"type\":\"google-chat-organization-handle\",\"attributes\":{\"name\":\"Test-Create_organization_handle_returns_CREATED_response-1770751028\",\"space_display_name\":\"api-test-space\",\"space_resource_name\":\"spaces/AAQA-zFIks8\"}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2026-02-10T19:17:08.667Z", + "time": 321 + }, + { + "_id": "7928316ba21b7110225c72d2c8a86d6c", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 627, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/integration/google-chat/organizations/e54cb570-c674-529c-769d-84b312288ed7/organization-handles/dcad18fd-a3b1-4544-8fee-e1e2988204d8" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 464, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2026-02-10T19:17:08.998Z", + "time": 308 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Google-Chat-Integration_1502589702/Delete-organization-handle-returns-OK-response_2645363451/frozen.json b/cassettes/v2/Google-Chat-Integration_1502589702/Delete-organization-handle-returns-OK-response_2645363451/frozen.json new file mode 100644 index 000000000000..0f8e115622ba --- /dev/null +++ b/cassettes/v2/Google-Chat-Integration_1502589702/Delete-organization-handle-returns-OK-response_2645363451/frozen.json @@ -0,0 +1 @@ +"2026-02-10T19:17:09.317Z" diff --git a/cassettes/v2/Google-Chat-Integration_1502589702/Delete-organization-handle-returns-OK-response_2645363451/recording.har b/cassettes/v2/Google-Chat-Integration_1502589702/Delete-organization-handle-returns-OK-response_2645363451/recording.har new file mode 100644 index 000000000000..ca2dc64fa397 --- /dev/null +++ b/cassettes/v2/Google-Chat-Integration_1502589702/Delete-organization-handle-returns-OK-response_2645363451/recording.har @@ -0,0 +1,141 @@ +{ + "log": { + "_recordingName": "Google Chat Integration/Delete organization handle returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "295657c035e7e8d937423f064780dd39", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 181, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 654, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"name\":\"Test-Delete_organization_handle_returns_OK_response-1770751029\",\"space_resource_name\":\"spaces/AAQA-zFIks8\"}},\"type\":\"google-chat-organization-handle\"}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/integration/google-chat/organizations/e54cb570-c674-529c-769d-84b312288ed7/organization-handles" + }, + "response": { + "bodySize": 263, + "content": { + "mimeType": "application/vnd.api+json", + "size": 263, + "text": "{\"data\":{\"id\":\"e70e04d1-7547-47de-ad3b-41a345fd1abe\",\"type\":\"google-chat-organization-handle\",\"attributes\":{\"name\":\"Test-Delete_organization_handle_returns_OK_response-1770751029\",\"space_display_name\":\"api-test-space\",\"space_resource_name\":\"spaces/AAQA-zFIks8\"}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2026-02-10T19:17:09.321Z", + "time": 96 + }, + { + "_id": "43883590a0eadd899a7989bf95fa01b4", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 627, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/integration/google-chat/organizations/e54cb570-c674-529c-769d-84b312288ed7/organization-handles/e70e04d1-7547-47de-ad3b-41a345fd1abe" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 464, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2026-02-10T19:17:09.423Z", + "time": 317 + }, + { + "_id": "43883590a0eadd899a7989bf95fa01b4", + "_order": 1, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 627, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/integration/google-chat/organizations/e54cb570-c674-529c-769d-84b312288ed7/organization-handles/e70e04d1-7547-47de-ad3b-41a345fd1abe" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 464, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2026-02-10T19:17:09.746Z", + "time": 311 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Google-Chat-Integration_1502589702/Get-all-organization-handles-returns-OK-response_3353102098/frozen.json b/cassettes/v2/Google-Chat-Integration_1502589702/Get-all-organization-handles-returns-OK-response_3353102098/frozen.json new file mode 100644 index 000000000000..a37ad30dc842 --- /dev/null +++ b/cassettes/v2/Google-Chat-Integration_1502589702/Get-all-organization-handles-returns-OK-response_3353102098/frozen.json @@ -0,0 +1 @@ +"2026-02-10T19:17:10.064Z" diff --git a/cassettes/v2/Google-Chat-Integration_1502589702/Get-all-organization-handles-returns-OK-response_3353102098/recording.har b/cassettes/v2/Google-Chat-Integration_1502589702/Get-all-organization-handles-returns-OK-response_3353102098/recording.har new file mode 100644 index 000000000000..4c20734a4747 --- /dev/null +++ b/cassettes/v2/Google-Chat-Integration_1502589702/Get-all-organization-handles-returns-OK-response_3353102098/recording.har @@ -0,0 +1,147 @@ +{ + "log": { + "_recordingName": "Google Chat Integration/Get all organization handles returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "f63029fdb4471b39d0585889b334aa66", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 183, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 654, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"name\":\"Test-Get_all_organization_handles_returns_OK_response-1770751030\",\"space_resource_name\":\"spaces/AAQA-zFIks8\"}},\"type\":\"google-chat-organization-handle\"}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/integration/google-chat/organizations/e54cb570-c674-529c-769d-84b312288ed7/organization-handles" + }, + "response": { + "bodySize": 265, + "content": { + "mimeType": "application/vnd.api+json", + "size": 265, + "text": "{\"data\":{\"id\":\"9c140b3f-05c1-4943-959a-cae272356979\",\"type\":\"google-chat-organization-handle\",\"attributes\":{\"name\":\"Test-Get_all_organization_handles_returns_OK_response-1770751030\",\"space_display_name\":\"api-test-space\",\"space_resource_name\":\"spaces/AAQA-zFIks8\"}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2026-02-10T19:17:10.069Z", + "time": 325 + }, + { + "_id": "ae5d5fc86f94e60f08514ac4e061bed6", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 599, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/integration/google-chat/organizations/e54cb570-c674-529c-769d-84b312288ed7/organization-handles" + }, + "response": { + "bodySize": 267, + "content": { + "mimeType": "application/vnd.api+json", + "size": 267, + "text": "{\"data\":[{\"id\":\"9c140b3f-05c1-4943-959a-cae272356979\",\"type\":\"google-chat-organization-handle\",\"attributes\":{\"name\":\"Test-Get_all_organization_handles_returns_OK_response-1770751030\",\"space_display_name\":\"api-test-space\",\"space_resource_name\":\"spaces/AAQA-zFIks8\"}}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-02-10T19:17:10.400Z", + "time": 307 + }, + { + "_id": "ab0b8062f10e1248b66e1aede7c9d77c", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 627, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/integration/google-chat/organizations/e54cb570-c674-529c-769d-84b312288ed7/organization-handles/9c140b3f-05c1-4943-959a-cae272356979" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 464, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2026-02-10T19:17:10.715Z", + "time": 324 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Google-Chat-Integration_1502589702/Get-organization-handle-returns-OK-response_3777682014/frozen.json b/cassettes/v2/Google-Chat-Integration_1502589702/Get-organization-handle-returns-OK-response_3777682014/frozen.json new file mode 100644 index 000000000000..a1c3b08a83f5 --- /dev/null +++ b/cassettes/v2/Google-Chat-Integration_1502589702/Get-organization-handle-returns-OK-response_3777682014/frozen.json @@ -0,0 +1 @@ +"2026-02-10T19:17:11.045Z" diff --git a/cassettes/v2/Google-Chat-Integration_1502589702/Get-organization-handle-returns-OK-response_3777682014/recording.har b/cassettes/v2/Google-Chat-Integration_1502589702/Get-organization-handle-returns-OK-response_3777682014/recording.har new file mode 100644 index 000000000000..8d9063ceaa35 --- /dev/null +++ b/cassettes/v2/Google-Chat-Integration_1502589702/Get-organization-handle-returns-OK-response_3777682014/recording.har @@ -0,0 +1,147 @@ +{ + "log": { + "_recordingName": "Google Chat Integration/Get organization handle returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "1fb74f9200a2d68140669beb84d3f3e2", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 178, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 654, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"name\":\"Test-Get_organization_handle_returns_OK_response-1770751031\",\"space_resource_name\":\"spaces/AAQA-zFIks8\"}},\"type\":\"google-chat-organization-handle\"}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/integration/google-chat/organizations/e54cb570-c674-529c-769d-84b312288ed7/organization-handles" + }, + "response": { + "bodySize": 260, + "content": { + "mimeType": "application/vnd.api+json", + "size": 260, + "text": "{\"data\":{\"id\":\"f712e551-628f-4688-be1d-cb69c69c9690\",\"type\":\"google-chat-organization-handle\",\"attributes\":{\"name\":\"Test-Get_organization_handle_returns_OK_response-1770751031\",\"space_display_name\":\"api-test-space\",\"space_resource_name\":\"spaces/AAQA-zFIks8\"}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2026-02-10T19:17:11.048Z", + "time": 321 + }, + { + "_id": "4bd5b396dd60c2a7eff67314912559f6", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 634, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/integration/google-chat/organizations/e54cb570-c674-529c-769d-84b312288ed7/organization-handles/f712e551-628f-4688-be1d-cb69c69c9690" + }, + "response": { + "bodySize": 260, + "content": { + "mimeType": "application/vnd.api+json", + "size": 260, + "text": "{\"data\":{\"id\":\"f712e551-628f-4688-be1d-cb69c69c9690\",\"type\":\"google-chat-organization-handle\",\"attributes\":{\"name\":\"Test-Get_organization_handle_returns_OK_response-1770751031\",\"space_display_name\":\"api-test-space\",\"space_resource_name\":\"spaces/AAQA-zFIks8\"}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-02-10T19:17:11.375Z", + "time": 325 + }, + { + "_id": "f5f2a28d9f2eca22add692b35be49c18", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 627, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/integration/google-chat/organizations/e54cb570-c674-529c-769d-84b312288ed7/organization-handles/f712e551-628f-4688-be1d-cb69c69c9690" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 464, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2026-02-10T19:17:11.708Z", + "time": 309 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Google-Chat-Integration_1502589702/Get-space-information-by-display-name-returns-OK-response_273598999/frozen.json b/cassettes/v2/Google-Chat-Integration_1502589702/Get-space-information-by-display-name-returns-OK-response_273598999/frozen.json new file mode 100644 index 000000000000..40081eb88f34 --- /dev/null +++ b/cassettes/v2/Google-Chat-Integration_1502589702/Get-space-information-by-display-name-returns-OK-response_273598999/frozen.json @@ -0,0 +1 @@ +"2026-02-10T19:17:12.022Z" diff --git a/cassettes/v2/Google-Chat-Integration_1502589702/Get-space-information-by-display-name-returns-OK-response_273598999/recording.har b/cassettes/v2/Google-Chat-Integration_1502589702/Get-space-information-by-display-name-returns-OK-response_273598999/recording.har new file mode 100644 index 000000000000..b62602e5044d --- /dev/null +++ b/cassettes/v2/Google-Chat-Integration_1502589702/Get-space-information-by-display-name-returns-OK-response_273598999/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Google Chat Integration/Get space information by display name returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "5c0717bd3bffbf0cbc70ab3e4d29d478", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 585, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/integration/google-chat/organizations/app/named-spaces/datadog.ninja/api-test-space" + }, + "response": { + "bodySize": 302, + "content": { + "mimeType": "application/vnd.api+json", + "size": 302, + "text": "{\"data\":{\"id\":\"d57f39c4-f22b-6da0-108c-23bdb9c460a3\",\"type\":\"google-chat-app-named-space\",\"attributes\":{\"display_name\":\"api-test-space\",\"organization_binding_id\":\"e54cb570-c674-529c-769d-84b312288ed7\",\"resource_name\":\"spaces/AAQA-zFIks8\",\"space_uri\":\"https://chat.google.com/room/AAQA-zFIks8?cls=11\"}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-02-10T19:17:12.025Z", + "time": 303 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Google-Chat-Integration_1502589702/Update-organization-handle-returns-OK-response_661721561/frozen.json b/cassettes/v2/Google-Chat-Integration_1502589702/Update-organization-handle-returns-OK-response_661721561/frozen.json new file mode 100644 index 000000000000..b3c40e0a3d5b --- /dev/null +++ b/cassettes/v2/Google-Chat-Integration_1502589702/Update-organization-handle-returns-OK-response_661721561/frozen.json @@ -0,0 +1 @@ +"2026-02-10T19:17:12.337Z" diff --git a/cassettes/v2/Google-Chat-Integration_1502589702/Update-organization-handle-returns-OK-response_661721561/recording.har b/cassettes/v2/Google-Chat-Integration_1502589702/Update-organization-handle-returns-OK-response_661721561/recording.har new file mode 100644 index 000000000000..f8fdce15fb23 --- /dev/null +++ b/cassettes/v2/Google-Chat-Integration_1502589702/Update-organization-handle-returns-OK-response_661721561/recording.har @@ -0,0 +1,157 @@ +{ + "log": { + "_recordingName": "Google Chat Integration/Update organization handle returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "cc0cef267f9ef6150627fd057cf04b85", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 181, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 654, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"name\":\"Test-Update_organization_handle_returns_OK_response-1770751032\",\"space_resource_name\":\"spaces/AAQA-zFIks8\"}},\"type\":\"google-chat-organization-handle\"}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/integration/google-chat/organizations/e54cb570-c674-529c-769d-84b312288ed7/organization-handles" + }, + "response": { + "bodySize": 263, + "content": { + "mimeType": "application/vnd.api+json", + "size": 263, + "text": "{\"data\":{\"id\":\"b036578c-665f-4ff2-8785-ba4d00fc87b5\",\"type\":\"google-chat-organization-handle\",\"attributes\":{\"name\":\"Test-Update_organization_handle_returns_OK_response-1770751032\",\"space_display_name\":\"api-test-space\",\"space_resource_name\":\"spaces/AAQA-zFIks8\"}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2026-02-10T19:17:12.340Z", + "time": 317 + }, + { + "_id": "9c4b31f40d27e74de4d33d0b210a73ba", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 147, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 692, + "httpVersion": "HTTP/1.1", + "method": "PATCH", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"name\":\"Test-Update_organization_handle_returns_OK_response-1770751032--updated\"}},\"type\":\"google-chat-organization-handle\"}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/integration/google-chat/organizations/e54cb570-c674-529c-769d-84b312288ed7/organization-handles/b036578c-665f-4ff2-8785-ba4d00fc87b5" + }, + "response": { + "bodySize": 272, + "content": { + "mimeType": "application/vnd.api+json", + "size": 272, + "text": "{\"data\":{\"id\":\"b036578c-665f-4ff2-8785-ba4d00fc87b5\",\"type\":\"google-chat-organization-handle\",\"attributes\":{\"name\":\"Test-Update_organization_handle_returns_OK_response-1770751032--updated\",\"space_display_name\":\"api-test-space\",\"space_resource_name\":\"spaces/AAQA-zFIks8\"}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 525, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2026-02-10T19:17:12.665Z", + "time": 324 + }, + { + "_id": "029937c13cadac0e258ad3a4c8ac5b8a", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 627, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/integration/google-chat/organizations/e54cb570-c674-529c-769d-84b312288ed7/organization-handles/b036578c-665f-4ff2-8785-ba4d00fc87b5" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 464, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2026-02-10T19:17:12.996Z", + "time": 306 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/features/v2/given.json b/features/v2/given.json index 0651545f2814..1202e4f78a13 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -565,6 +565,22 @@ "tag": "GCP Integration", "operationId": "CreateGCPSTSAccount" }, + { + "parameters": [ + { + "name": "organization_binding_id", + "value": "\"e54cb570-c674-529c-769d-84b312288ed7\"" + }, + { + "name": "body", + "value": "{\n \"type\": \"google-chat-organization-handle\",\n \"data\": {\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"space_resource_name\": \"spaces/AAQA-zFIks8\"\n }\n }\n}" + } + ], + "step": "there is a valid \"organization_handle\" in the system", + "key": "organization_handle", + "tag": "Google Chat Integration", + "operationId": "CreateOrganizationHandle" + }, { "parameters": [ { diff --git a/features/v2/google_chat_integration.feature b/features/v2/google_chat_integration.feature new file mode 100644 index 000000000000..f722a7ea2088 --- /dev/null +++ b/features/v2/google_chat_integration.feature @@ -0,0 +1,175 @@ +@endpoint(google-chat-integration) @endpoint(google-chat-integration-v2) +Feature: Google Chat Integration + Configure your [Datadog Google Chat + integration](https://docs.datadoghq.com/integrations/google-hangouts- + chat/) directly through the Datadog API. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "GoogleChatIntegration" API + + @generated @skip @team:DataDog/chat-integrations + Scenario: Create organization handle returns "Bad Request" response + Given new "CreateOrganizationHandle" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "fake-handle-name", "space_resource_name": "spaces/AAAAAAAAA"}}, "type": "google-chat-organization-handle"} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/chat-integrations + Scenario: Create organization handle returns "CREATED" response + Given new "CreateOrganizationHandle" request + And request contains "organization_binding_id" parameter with value "e54cb570-c674-529c-769d-84b312288ed7" + And body with value {"data": {"attributes": {"name": "{{unique}}", "space_resource_name": "spaces/AAQA-zFIks8"}}, "type": "google-chat-organization-handle"} + When the request is sent + Then the response status is 201 CREATED + And the response "data.attributes.name" is equal to "{{unique}}" + + @generated @skip @team:DataDog/chat-integrations + Scenario: Create organization handle returns "Conflict" response + Given new "CreateOrganizationHandle" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "fake-handle-name", "space_resource_name": "spaces/AAAAAAAAA"}}, "type": "google-chat-organization-handle"} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/chat-integrations + Scenario: Create organization handle returns "Not Found" response + Given new "CreateOrganizationHandle" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "fake-handle-name", "space_resource_name": "spaces/AAAAAAAAA"}}, "type": "google-chat-organization-handle"} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/chat-integrations + Scenario: Delete organization handle returns "Bad Request" response + Given new "DeleteOrganizationHandle" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And request contains "handle_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/chat-integrations + Scenario: Delete organization handle returns "OK" response + Given new "DeleteOrganizationHandle" request + And there is a valid "organization_handle" in the system + And request contains "organization_binding_id" parameter with value "e54cb570-c674-529c-769d-84b312288ed7" + And request contains "handle_id" parameter from "organization_handle.data.id" + When the request is sent + Then the response status is 204 OK + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get all organization handles returns "Bad Request" response + Given new "ListOrganizationHandles" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get all organization handles returns "Not Found" response + Given new "ListOrganizationHandles" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/chat-integrations + Scenario: Get all organization handles returns "OK" response + Given new "ListOrganizationHandles" request + And there is a valid "organization_handle" in the system + And request contains "organization_binding_id" parameter with value "e54cb570-c674-529c-769d-84b312288ed7" + When the request is sent + Then the response status is 200 OK + And the response "data[0].type" is equal to "google-chat-organization-handle" + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get organization handle returns "Bad Request" response + Given new "GetOrganizationHandle" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And request contains "handle_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get organization handle returns "Not Found" response + Given new "GetOrganizationHandle" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And request contains "handle_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/chat-integrations + Scenario: Get organization handle returns "OK" response + Given new "GetOrganizationHandle" request + And there is a valid "organization_handle" in the system + And request contains "organization_binding_id" parameter with value "e54cb570-c674-529c-769d-84b312288ed7" + And request contains "handle_id" parameter from "organization_handle.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.name" has the same value as "organization_handle.data.attributes.name" + And the response "data.attributes.space_display_name" has the same value as "organization_handle.data.attributes.space_display_name" + And the response "data.attributes.space_resource_name" has the same value as "organization_handle.data.attributes.space_resource_name" + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get space information by display name returns "Bad Request" response + Given new "GetSpaceByDisplayName" request + And request contains "domain_name" parameter from "REPLACE.ME" + And request contains "space_display_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get space information by display name returns "Not Found" response + Given new "GetSpaceByDisplayName" request + And request contains "domain_name" parameter from "REPLACE.ME" + And request contains "space_display_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/chat-integrations + Scenario: Get space information by display name returns "OK" response + Given new "GetSpaceByDisplayName" request + And request contains "domain_name" parameter with value "datadog.ninja" + And request contains "space_display_name" parameter with value "api-test-space" + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.resource_name" is equal to "spaces/AAQA-zFIks8" + And the response "data.attributes.organization_binding_id" is equal to "e54cb570-c674-529c-769d-84b312288ed7" + + @generated @skip @team:DataDog/chat-integrations + Scenario: Update organization handle returns "Bad Request" response + Given new "UpdateOrganizationHandle" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And request contains "handle_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "fake-handle-name", "space_resource_name": "spaces/AAAAAAAAA"}}, "type": "google-chat-organization-handle"} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/chat-integrations + Scenario: Update organization handle returns "Conflict" response + Given new "UpdateOrganizationHandle" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And request contains "handle_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "fake-handle-name", "space_resource_name": "spaces/AAAAAAAAA"}}, "type": "google-chat-organization-handle"} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/chat-integrations + Scenario: Update organization handle returns "Not Found" response + Given new "UpdateOrganizationHandle" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And request contains "handle_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "fake-handle-name", "space_resource_name": "spaces/AAAAAAAAA"}}, "type": "google-chat-organization-handle"} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/chat-integrations + Scenario: Update organization handle returns "OK" response + Given new "UpdateOrganizationHandle" request + And there is a valid "organization_handle" in the system + And request contains "organization_binding_id" parameter with value "e54cb570-c674-529c-769d-84b312288ed7" + And request contains "handle_id" parameter from "organization_handle.data.id" + And body with value {"data": {"attributes": {"name": "{{organization_handle.data.attributes.name}}--updated"}}, "type": "google-chat-organization-handle"} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.name" is equal to "{{organization_handle.data.attributes.name}}--updated" diff --git a/features/v2/undo.json b/features/v2/undo.json index 4428105073e9..ec42a6bbb0e1 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -2257,6 +2257,54 @@ "type": "idempotent" } }, + "GetSpaceByDisplayName": { + "tag": "Google Chat Integration", + "undo": { + "type": "safe" + } + }, + "ListOrganizationHandles": { + "tag": "Google Chat Integration", + "undo": { + "type": "safe" + } + }, + "CreateOrganizationHandle": { + "tag": "Google Chat Integration", + "undo": { + "operationId": "DeleteOrganizationHandle", + "parameters": [ + { + "name": "organization_binding_id", + "origin": "path", + "source": "organization_binding_id" + }, + { + "name": "handle_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteOrganizationHandle": { + "tag": "Google Chat Integration", + "undo": { + "type": "idempotent" + } + }, + "GetOrganizationHandle": { + "tag": "Google Chat Integration", + "undo": { + "type": "safe" + } + }, + "UpdateOrganizationHandle": { + "tag": "Google Chat Integration", + "undo": { + "type": "idempotent" + } + }, "ListJiraAccounts": { "tag": "Jira Integration", "undo": { diff --git a/packages/datadog-api-client/README.md b/packages/datadog-api-client/README.md index 808d4fbd7f7d..6ec96b1fec5d 100644 --- a/packages/datadog-api-client/README.md +++ b/packages/datadog-api-client/README.md @@ -391,6 +391,7 @@ apiInstance | Fastly Integration | @datadog/datadog-api-client-fastly-integration | [README.md](../../services/fastly-integration/README.md) | | Fleet Automation | @datadog/datadog-api-client-fleet-automation | [README.md](../../services/fleet-automation/README.md) | | GCP Integration | @datadog/datadog-api-client-gcp-integration | [README.md](../../services/gcp-integration/README.md) | +| Google Chat Integration | @datadog/datadog-api-client-google-chat-integration | [README.md](../../services/google-chat-integration/README.md) | | High Availability MultiRegion | @datadog/datadog-api-client-high-availability-multi-region | [README.md](../../services/high-availability-multi-region/README.md) | | Hosts | @datadog/datadog-api-client-hosts | [README.md](../../services/hosts/README.md) | | Incident Services | @datadog/datadog-api-client-incident-services | [README.md](../../services/incident-services/README.md) | diff --git a/private/bdd_runner/src/support/scenarios_model_mapping.ts b/private/bdd_runner/src/support/scenarios_model_mapping.ts index 1c6a23cc7c27..3bfdfa5b9535 100644 --- a/private/bdd_runner/src/support/scenarios_model_mapping.ts +++ b/private/bdd_runner/src/support/scenarios_model_mapping.ts @@ -6747,6 +6747,72 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = { }, operationResponseType: "GCPSTSDelegateAccountResponse", }, + "GoogleChatIntegrationApi.V2.GetSpaceByDisplayName": { + domainName: { + type: "string", + format: "", + }, + spaceDisplayName: { + type: "string", + format: "", + }, + operationResponseType: "GoogleChatAppNamedSpaceResponse", + }, + "GoogleChatIntegrationApi.V2.ListOrganizationHandles": { + organizationBindingId: { + type: "string", + format: "", + }, + operationResponseType: "GoogleChatOrganizationHandlesResponse", + }, + "GoogleChatIntegrationApi.V2.CreateOrganizationHandle": { + organizationBindingId: { + type: "string", + format: "", + }, + body: { + type: "GoogleChatCreateOrganizationHandleRequest", + format: "", + }, + operationResponseType: "GoogleChatOrganizationHandleResponse", + }, + "GoogleChatIntegrationApi.V2.GetOrganizationHandle": { + organizationBindingId: { + type: "string", + format: "", + }, + handleId: { + type: "string", + format: "", + }, + operationResponseType: "GoogleChatOrganizationHandleResponse", + }, + "GoogleChatIntegrationApi.V2.DeleteOrganizationHandle": { + organizationBindingId: { + type: "string", + format: "", + }, + handleId: { + type: "string", + format: "", + }, + operationResponseType: "{}", + }, + "GoogleChatIntegrationApi.V2.UpdateOrganizationHandle": { + organizationBindingId: { + type: "string", + format: "", + }, + handleId: { + type: "string", + format: "", + }, + body: { + type: "GoogleChatUpdateOrganizationHandleRequest", + format: "", + }, + operationResponseType: "GoogleChatOrganizationHandleResponse", + }, "JiraIntegrationApi.V2.ListJiraAccounts": { operationResponseType: "JiraAccountsResponse", }, diff --git a/services/google_chat_integration/.yarnrc.yml b/services/google_chat_integration/.yarnrc.yml new file mode 100644 index 000000000000..3186f3f0795a --- /dev/null +++ b/services/google_chat_integration/.yarnrc.yml @@ -0,0 +1 @@ +nodeLinker: node-modules diff --git a/services/google_chat_integration/README.md b/services/google_chat_integration/README.md new file mode 100644 index 000000000000..cc879a2b6ef8 --- /dev/null +++ b/services/google_chat_integration/README.md @@ -0,0 +1,37 @@ +# @datadog/datadog-api-client-google-chat-integration + +## Description + +Configure your [Datadog Google Chat integration](https://docs.datadoghq.com/integrations/google-hangouts-chat/) +directly through the Datadog API. + +## Navigation + +- [Installation](#installation) +- [Getting Started](#getting-started) + +## Installation + +```sh +# NPM +npm install @datadog/datadog-api-client-google-chat-integration +# Yarn +yarn add @datadog/datadog-api-client-google-chat-integration +``` + +## Getting Started +```ts +import { createConfiguration } from "@datadog/datadog-api-client"; +import { GoogleChatIntegrationApiV2 } from "@datadog/datadog-api-client-google-chat-integration"; +import { v2 } from "@datadog/datadog-api-client-google-chat-integration"; + +const configuration = createConfiguration(); +const apiInstance = new GoogleChatIntegrationApiV2(configuration); +const params = {/* parameters */}; + +apiInstance.getSpaceByDisplayName(params).then((data) => { + console.log("API called successfully. Returned data: " + JSON.stringify(data)); +}).catch((error) => { + console.error("Error calling API: " + error); +}); +``` \ No newline at end of file diff --git a/services/google_chat_integration/package.json b/services/google_chat_integration/package.json new file mode 100644 index 000000000000..fa758e0424bd --- /dev/null +++ b/services/google_chat_integration/package.json @@ -0,0 +1,43 @@ +{ + "name": "@datadog/datadog-api-client-google-chat-integration", + "description": "", + "author": "", + "keywords": [ + "api", + "fetch", + "typescript" + ], + "license": "Apache-2.0", + "licenses": [ + { + "type": "Apache-2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/DataDog/datadog-api-client-typescript.git", + "directory": "services/google-chat-integration" + }, + "files": [ + "dist/**/*" + ], + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "scripts": { + "prepack": "yarn workspace @datadog/datadog-api-client build && yarn build", + "build": "yarn generate-version-files && tsc", + "generate-version-files": "node -p \"'export const version = ' + JSON.stringify(require('./package.json').version)\" > src/version.ts" + }, + "dependencies": { + "@datadog/datadog-api-client": "^2.0.0-beta.2" + }, + "devDependencies": { + "typescript": "5.8.3" + }, + "engines": { + "node": ">=18.0.0" + }, + "version": "0.0.1", + "packageManager": "yarn@4.9.1" +} diff --git a/services/google_chat_integration/src/index.ts b/services/google_chat_integration/src/index.ts new file mode 100644 index 000000000000..08998ca58967 --- /dev/null +++ b/services/google_chat_integration/src/index.ts @@ -0,0 +1,3 @@ +export * as v2 from "./v2"; + +export { GoogleChatIntegrationApi as GoogleChatIntegrationApiV2 } from "./v2/GoogleChatIntegrationApi"; diff --git a/services/google_chat_integration/src/v2/GoogleChatIntegrationApi.ts b/services/google_chat_integration/src/v2/GoogleChatIntegrationApi.ts new file mode 100644 index 000000000000..1eb965e2b0e6 --- /dev/null +++ b/services/google_chat_integration/src/v2/GoogleChatIntegrationApi.ts @@ -0,0 +1,992 @@ +import { + ApiException, + BaseAPIRequestFactory, + BaseServerConfiguration, + buildUserAgent, + Configuration, + createConfiguration, + deserialize, + getPreferredMediaType, + HttpMethod, + isBrowser, + logger, + normalizeMediaType, + parse, + RequiredError, + RequestContext, + ResponseContext, + serialize, + ServerConfiguration, + stringify, + applySecurityAuthentication, +} from "@datadog/datadog-api-client"; + +import { TypingInfo } from "./models/TypingInfo"; +import { APIErrorResponse } from "./models/APIErrorResponse"; +import { GoogleChatAppNamedSpaceResponse } from "./models/GoogleChatAppNamedSpaceResponse"; +import { GoogleChatCreateOrganizationHandleRequest } from "./models/GoogleChatCreateOrganizationHandleRequest"; +import { GoogleChatOrganizationHandleResponse } from "./models/GoogleChatOrganizationHandleResponse"; +import { GoogleChatOrganizationHandlesResponse } from "./models/GoogleChatOrganizationHandlesResponse"; +import { GoogleChatUpdateOrganizationHandleRequest } from "./models/GoogleChatUpdateOrganizationHandleRequest"; +import { version } from "../version"; + +export class GoogleChatIntegrationApiRequestFactory extends BaseAPIRequestFactory { + public userAgent: string | undefined; + + public constructor(configuration: Configuration) { + super(configuration); + if (!isBrowser) { + this.userAgent = buildUserAgent("google-chat-integration", version); + } + } + public async createOrganizationHandle( + organizationBindingId: string, + body: GoogleChatCreateOrganizationHandleRequest, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'organizationBindingId' is not null or undefined + if (organizationBindingId === null || organizationBindingId === undefined) { + throw new RequiredError( + "organizationBindingId", + "createOrganizationHandle", + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createOrganizationHandle"); + } + + // Path Params + const localVarPath = + "/api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles".replace( + "{organization_binding_id}", + encodeURIComponent(String(organizationBindingId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "GoogleChatIntegrationApi.v2.createOrganizationHandle", + GoogleChatIntegrationApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.POST, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize( + body, + TypingInfo, + "GoogleChatCreateOrganizationHandleRequest", + "", + ), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async deleteOrganizationHandle( + organizationBindingId: string, + handleId: string, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'organizationBindingId' is not null or undefined + if (organizationBindingId === null || organizationBindingId === undefined) { + throw new RequiredError( + "organizationBindingId", + "deleteOrganizationHandle", + ); + } + + // verify required parameter 'handleId' is not null or undefined + if (handleId === null || handleId === undefined) { + throw new RequiredError("handleId", "deleteOrganizationHandle"); + } + + // Path Params + const localVarPath = + "/api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles/{handle_id}" + .replace( + "{organization_binding_id}", + encodeURIComponent(String(organizationBindingId)), + ) + .replace("{handle_id}", encodeURIComponent(String(handleId))); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "GoogleChatIntegrationApi.v2.deleteOrganizationHandle", + GoogleChatIntegrationApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.DELETE, + overrides, + ); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async getOrganizationHandle( + organizationBindingId: string, + handleId: string, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'organizationBindingId' is not null or undefined + if (organizationBindingId === null || organizationBindingId === undefined) { + throw new RequiredError("organizationBindingId", "getOrganizationHandle"); + } + + // verify required parameter 'handleId' is not null or undefined + if (handleId === null || handleId === undefined) { + throw new RequiredError("handleId", "getOrganizationHandle"); + } + + // Path Params + const localVarPath = + "/api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles/{handle_id}" + .replace( + "{organization_binding_id}", + encodeURIComponent(String(organizationBindingId)), + ) + .replace("{handle_id}", encodeURIComponent(String(handleId))); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "GoogleChatIntegrationApi.v2.getOrganizationHandle", + GoogleChatIntegrationApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.GET, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async getSpaceByDisplayName( + domainName: string, + spaceDisplayName: string, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'domainName' is not null or undefined + if (domainName === null || domainName === undefined) { + throw new RequiredError("domainName", "getSpaceByDisplayName"); + } + + // verify required parameter 'spaceDisplayName' is not null or undefined + if (spaceDisplayName === null || spaceDisplayName === undefined) { + throw new RequiredError("spaceDisplayName", "getSpaceByDisplayName"); + } + + // Path Params + const localVarPath = + "/api/v2/integration/google-chat/organizations/app/named-spaces/{domain_name}/{space_display_name}" + .replace("{domain_name}", encodeURIComponent(String(domainName))) + .replace( + "{space_display_name}", + encodeURIComponent(String(spaceDisplayName)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "GoogleChatIntegrationApi.v2.getSpaceByDisplayName", + GoogleChatIntegrationApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.GET, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async listOrganizationHandles( + organizationBindingId: string, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'organizationBindingId' is not null or undefined + if (organizationBindingId === null || organizationBindingId === undefined) { + throw new RequiredError( + "organizationBindingId", + "listOrganizationHandles", + ); + } + + // Path Params + const localVarPath = + "/api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles".replace( + "{organization_binding_id}", + encodeURIComponent(String(organizationBindingId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "GoogleChatIntegrationApi.v2.listOrganizationHandles", + GoogleChatIntegrationApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.GET, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async updateOrganizationHandle( + organizationBindingId: string, + handleId: string, + body: GoogleChatUpdateOrganizationHandleRequest, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'organizationBindingId' is not null or undefined + if (organizationBindingId === null || organizationBindingId === undefined) { + throw new RequiredError( + "organizationBindingId", + "updateOrganizationHandle", + ); + } + + // verify required parameter 'handleId' is not null or undefined + if (handleId === null || handleId === undefined) { + throw new RequiredError("handleId", "updateOrganizationHandle"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "updateOrganizationHandle"); + } + + // Path Params + const localVarPath = + "/api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles/{handle_id}" + .replace( + "{organization_binding_id}", + encodeURIComponent(String(organizationBindingId)), + ) + .replace("{handle_id}", encodeURIComponent(String(handleId))); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "GoogleChatIntegrationApi.v2.updateOrganizationHandle", + GoogleChatIntegrationApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.PATCH, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize( + body, + TypingInfo, + "GoogleChatUpdateOrganizationHandleRequest", + "", + ), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } +} + +export class GoogleChatIntegrationApiResponseProcessor { + /** + * 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 createOrganizationHandle + * @throws ApiException if the response code was not in [200, 299] + */ + public async createOrganizationHandle( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 201) { + const body: GoogleChatOrganizationHandleResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "GoogleChatOrganizationHandleResponse", + ) as GoogleChatOrganizationHandleResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 409 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`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: GoogleChatOrganizationHandleResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "GoogleChatOrganizationHandleResponse", + "", + ) as GoogleChatOrganizationHandleResponse; + 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 deleteOrganizationHandle + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteOrganizationHandle( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 204) { + return; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`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) { + return; + } + + 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 getOrganizationHandle + * @throws ApiException if the response code was not in [200, 299] + */ + public async getOrganizationHandle( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: GoogleChatOrganizationHandleResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "GoogleChatOrganizationHandleResponse", + ) as GoogleChatOrganizationHandleResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`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: GoogleChatOrganizationHandleResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "GoogleChatOrganizationHandleResponse", + "", + ) as GoogleChatOrganizationHandleResponse; + 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 getSpaceByDisplayName + * @throws ApiException if the response code was not in [200, 299] + */ + public async getSpaceByDisplayName( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: GoogleChatAppNamedSpaceResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "GoogleChatAppNamedSpaceResponse", + ) as GoogleChatAppNamedSpaceResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`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: GoogleChatAppNamedSpaceResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "GoogleChatAppNamedSpaceResponse", + "", + ) as GoogleChatAppNamedSpaceResponse; + 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 listOrganizationHandles + * @throws ApiException if the response code was not in [200, 299] + */ + public async listOrganizationHandles( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: GoogleChatOrganizationHandlesResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "GoogleChatOrganizationHandlesResponse", + ) as GoogleChatOrganizationHandlesResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`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: GoogleChatOrganizationHandlesResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "GoogleChatOrganizationHandlesResponse", + "", + ) as GoogleChatOrganizationHandlesResponse; + 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 updateOrganizationHandle + * @throws ApiException if the response code was not in [200, 299] + */ + public async updateOrganizationHandle( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: GoogleChatOrganizationHandleResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "GoogleChatOrganizationHandleResponse", + ) as GoogleChatOrganizationHandleResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 409 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`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: GoogleChatOrganizationHandleResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "GoogleChatOrganizationHandleResponse", + "", + ) as GoogleChatOrganizationHandleResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } +} + +export interface GoogleChatIntegrationApiCreateOrganizationHandleRequest { + /** + * Your organization binding ID. + * @type string + */ + organizationBindingId: string; + /** + * Organization handle payload. + * @type GoogleChatCreateOrganizationHandleRequest + */ + body: GoogleChatCreateOrganizationHandleRequest; +} + +export interface GoogleChatIntegrationApiDeleteOrganizationHandleRequest { + /** + * Your organization binding ID. + * @type string + */ + organizationBindingId: string; + /** + * Your organization handle ID. + * @type string + */ + handleId: string; +} + +export interface GoogleChatIntegrationApiGetOrganizationHandleRequest { + /** + * Your organization binding ID. + * @type string + */ + organizationBindingId: string; + /** + * Your organization handle ID. + * @type string + */ + handleId: string; +} + +export interface GoogleChatIntegrationApiGetSpaceByDisplayNameRequest { + /** + * The Google Chat domain name. + * @type string + */ + domainName: string; + /** + * The Google Chat space display name. + * @type string + */ + spaceDisplayName: string; +} + +export interface GoogleChatIntegrationApiListOrganizationHandlesRequest { + /** + * Your organization binding ID. + * @type string + */ + organizationBindingId: string; +} + +export interface GoogleChatIntegrationApiUpdateOrganizationHandleRequest { + /** + * Your organization binding ID. + * @type string + */ + organizationBindingId: string; + /** + * Your organization handle ID. + * @type string + */ + handleId: string; + /** + * Organization handle payload. + * @type GoogleChatUpdateOrganizationHandleRequest + */ + body: GoogleChatUpdateOrganizationHandleRequest; +} + +export class GoogleChatIntegrationApi { + private requestFactory: GoogleChatIntegrationApiRequestFactory; + private responseProcessor: GoogleChatIntegrationApiResponseProcessor; + private configuration: Configuration; + + static operationServers: { [key: string]: BaseServerConfiguration[] } = {}; + + public constructor( + configuration?: Configuration, + requestFactory?: GoogleChatIntegrationApiRequestFactory, + responseProcessor?: GoogleChatIntegrationApiResponseProcessor, + ) { + this.configuration = configuration || createConfiguration(); + this.requestFactory = + requestFactory || + new GoogleChatIntegrationApiRequestFactory(this.configuration); + this.responseProcessor = + responseProcessor || new GoogleChatIntegrationApiResponseProcessor(); + } + + /** + * Create an organization handle in the Datadog Google Chat integration. + * @param param The request object + */ + public createOrganizationHandle( + param: GoogleChatIntegrationApiCreateOrganizationHandleRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.createOrganizationHandle( + param.organizationBindingId, + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createOrganizationHandle( + responseContext, + ); + }); + }); + } + + /** + * Delete an organization handle from the Datadog Google Chat integration. + * @param param The request object + */ + public deleteOrganizationHandle( + param: GoogleChatIntegrationApiDeleteOrganizationHandleRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.deleteOrganizationHandle( + param.organizationBindingId, + param.handleId, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.deleteOrganizationHandle( + responseContext, + ); + }); + }); + } + + /** + * Get an organization handle from the Datadog Google Chat integration. + * @param param The request object + */ + public getOrganizationHandle( + param: GoogleChatIntegrationApiGetOrganizationHandleRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.getOrganizationHandle( + param.organizationBindingId, + param.handleId, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getOrganizationHandle(responseContext); + }); + }); + } + + /** + * Get the resource name and organization binding ID of a space in the Datadog Google Chat integration. + * @param param The request object + */ + public getSpaceByDisplayName( + param: GoogleChatIntegrationApiGetSpaceByDisplayNameRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.getSpaceByDisplayName( + param.domainName, + param.spaceDisplayName, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getSpaceByDisplayName(responseContext); + }); + }); + } + + /** + * Get a list of all organization handles from the Datadog Google Chat integration. + * @param param The request object + */ + public listOrganizationHandles( + param: GoogleChatIntegrationApiListOrganizationHandlesRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.listOrganizationHandles( + param.organizationBindingId, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listOrganizationHandles( + responseContext, + ); + }); + }); + } + + /** + * Update an organization handle from the Datadog Google Chat integration. + * @param param The request object + */ + public updateOrganizationHandle( + param: GoogleChatIntegrationApiUpdateOrganizationHandleRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.updateOrganizationHandle( + param.organizationBindingId, + param.handleId, + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.updateOrganizationHandle( + responseContext, + ); + }); + }); + } +} diff --git a/services/google_chat_integration/src/v2/index.ts b/services/google_chat_integration/src/v2/index.ts new file mode 100644 index 000000000000..0e969d3ac000 --- /dev/null +++ b/services/google_chat_integration/src/v2/index.ts @@ -0,0 +1,26 @@ +export { + GoogleChatIntegrationApiCreateOrganizationHandleRequest, + GoogleChatIntegrationApiDeleteOrganizationHandleRequest, + GoogleChatIntegrationApiGetOrganizationHandleRequest, + GoogleChatIntegrationApiGetSpaceByDisplayNameRequest, + GoogleChatIntegrationApiListOrganizationHandlesRequest, + GoogleChatIntegrationApiUpdateOrganizationHandleRequest, + GoogleChatIntegrationApi, +} from "./GoogleChatIntegrationApi"; + +export { APIErrorResponse } from "./models/APIErrorResponse"; +export { GoogleChatAppNamedSpaceResponse } from "./models/GoogleChatAppNamedSpaceResponse"; +export { GoogleChatAppNamedSpaceResponseAttributes } from "./models/GoogleChatAppNamedSpaceResponseAttributes"; +export { GoogleChatAppNamedSpaceResponseData } from "./models/GoogleChatAppNamedSpaceResponseData"; +export { GoogleChatAppNamedSpaceType } from "./models/GoogleChatAppNamedSpaceType"; +export { GoogleChatCreateOrganizationHandleRequest } from "./models/GoogleChatCreateOrganizationHandleRequest"; +export { GoogleChatCreateOrganizationHandleRequestAttributes } from "./models/GoogleChatCreateOrganizationHandleRequestAttributes"; +export { GoogleChatCreateOrganizationHandleRequestData } from "./models/GoogleChatCreateOrganizationHandleRequestData"; +export { GoogleChatOrganizationHandleResponse } from "./models/GoogleChatOrganizationHandleResponse"; +export { GoogleChatOrganizationHandleResponseAttributes } from "./models/GoogleChatOrganizationHandleResponseAttributes"; +export { GoogleChatOrganizationHandleResponseData } from "./models/GoogleChatOrganizationHandleResponseData"; +export { GoogleChatOrganizationHandlesResponse } from "./models/GoogleChatOrganizationHandlesResponse"; +export { GoogleChatOrganizationHandleType } from "./models/GoogleChatOrganizationHandleType"; +export { GoogleChatUpdateOrganizationHandleRequest } from "./models/GoogleChatUpdateOrganizationHandleRequest"; +export { GoogleChatUpdateOrganizationHandleRequestAttributes } from "./models/GoogleChatUpdateOrganizationHandleRequestAttributes"; +export { GoogleChatUpdateOrganizationHandleRequestData } from "./models/GoogleChatUpdateOrganizationHandleRequestData"; diff --git a/services/google_chat_integration/src/v2/models/APIErrorResponse.ts b/services/google_chat_integration/src/v2/models/APIErrorResponse.ts new file mode 100644 index 000000000000..58d6c35b80f0 --- /dev/null +++ b/services/google_chat_integration/src/v2/models/APIErrorResponse.ts @@ -0,0 +1,45 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * API error response. + */ +export class APIErrorResponse { + /** + * A list of errors. + */ + "errors": Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + errors: { + baseName: "errors", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return APIErrorResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/google_chat_integration/src/v2/models/GoogleChatAppNamedSpaceResponse.ts b/services/google_chat_integration/src/v2/models/GoogleChatAppNamedSpaceResponse.ts new file mode 100644 index 000000000000..67dd162ede7c --- /dev/null +++ b/services/google_chat_integration/src/v2/models/GoogleChatAppNamedSpaceResponse.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GoogleChatAppNamedSpaceResponseData } from "./GoogleChatAppNamedSpaceResponseData"; + +/** + * Response with Google Chat space information. + */ +export class GoogleChatAppNamedSpaceResponse { + /** + * Google Chat space data from a response. + */ + "data": GoogleChatAppNamedSpaceResponseData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "GoogleChatAppNamedSpaceResponseData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GoogleChatAppNamedSpaceResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/google_chat_integration/src/v2/models/GoogleChatAppNamedSpaceResponseAttributes.ts b/services/google_chat_integration/src/v2/models/GoogleChatAppNamedSpaceResponseAttributes.ts new file mode 100644 index 000000000000..4c8ab5afdee8 --- /dev/null +++ b/services/google_chat_integration/src/v2/models/GoogleChatAppNamedSpaceResponseAttributes.ts @@ -0,0 +1,68 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Google Chat space attributes. + */ +export class GoogleChatAppNamedSpaceResponseAttributes { + /** + * Google space display name. + */ + "displayName"?: string; + /** + * Organization binding ID. + */ + "organizationBindingId"?: string; + /** + * Google space resource name. + */ + "resourceName"?: string; + /** + * Google space URI. + */ + "spaceUri"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + displayName: { + baseName: "display_name", + type: "string", + }, + organizationBindingId: { + baseName: "organization_binding_id", + type: "string", + }, + resourceName: { + baseName: "resource_name", + type: "string", + }, + spaceUri: { + baseName: "space_uri", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GoogleChatAppNamedSpaceResponseAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/google_chat_integration/src/v2/models/GoogleChatAppNamedSpaceResponseData.ts b/services/google_chat_integration/src/v2/models/GoogleChatAppNamedSpaceResponseData.ts new file mode 100644 index 000000000000..cd4bc12439dc --- /dev/null +++ b/services/google_chat_integration/src/v2/models/GoogleChatAppNamedSpaceResponseData.ts @@ -0,0 +1,63 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GoogleChatAppNamedSpaceResponseAttributes } from "./GoogleChatAppNamedSpaceResponseAttributes"; +import { GoogleChatAppNamedSpaceType } from "./GoogleChatAppNamedSpaceType"; + +/** + * Google Chat space data from a response. + */ +export class GoogleChatAppNamedSpaceResponseData { + /** + * Google Chat space attributes. + */ + "attributes"?: GoogleChatAppNamedSpaceResponseAttributes; + /** + * The ID of the Google Chat space. + */ + "id"?: string; + /** + * Google Chat space resource type. + */ + "type"?: GoogleChatAppNamedSpaceType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "GoogleChatAppNamedSpaceResponseAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "GoogleChatAppNamedSpaceType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GoogleChatAppNamedSpaceResponseData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/google_chat_integration/src/v2/models/GoogleChatAppNamedSpaceType.ts b/services/google_chat_integration/src/v2/models/GoogleChatAppNamedSpaceType.ts new file mode 100644 index 000000000000..e4d6717d3c1c --- /dev/null +++ b/services/google_chat_integration/src/v2/models/GoogleChatAppNamedSpaceType.ts @@ -0,0 +1,9 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Google Chat space resource type. + */ +export type GoogleChatAppNamedSpaceType = + | typeof GOOGLE_CHAT_APP_NAMED_SPACE_TYPE + | UnparsedObject; +export const GOOGLE_CHAT_APP_NAMED_SPACE_TYPE = "google-chat-app-named-space"; diff --git a/services/google_chat_integration/src/v2/models/GoogleChatCreateOrganizationHandleRequest.ts b/services/google_chat_integration/src/v2/models/GoogleChatCreateOrganizationHandleRequest.ts new file mode 100644 index 000000000000..a79a4808b2b0 --- /dev/null +++ b/services/google_chat_integration/src/v2/models/GoogleChatCreateOrganizationHandleRequest.ts @@ -0,0 +1,57 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GoogleChatCreateOrganizationHandleRequestData } from "./GoogleChatCreateOrganizationHandleRequestData"; +import { GoogleChatOrganizationHandleType } from "./GoogleChatOrganizationHandleType"; + +/** + * Create organization handle request. + */ +export class GoogleChatCreateOrganizationHandleRequest { + /** + * Organization handle data for a create request. + */ + "data": GoogleChatCreateOrganizationHandleRequestData; + /** + * Organization handle resource type. + */ + "type": GoogleChatOrganizationHandleType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "GoogleChatCreateOrganizationHandleRequestData", + required: true, + }, + type: { + baseName: "type", + type: "GoogleChatOrganizationHandleType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GoogleChatCreateOrganizationHandleRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/google_chat_integration/src/v2/models/GoogleChatCreateOrganizationHandleRequestAttributes.ts b/services/google_chat_integration/src/v2/models/GoogleChatCreateOrganizationHandleRequestAttributes.ts new file mode 100644 index 000000000000..a5818a97b9e8 --- /dev/null +++ b/services/google_chat_integration/src/v2/models/GoogleChatCreateOrganizationHandleRequestAttributes.ts @@ -0,0 +1,54 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Organization handle attributes for a create request. + */ +export class GoogleChatCreateOrganizationHandleRequestAttributes { + /** + * Organization handle name. + */ + "name": string; + /** + * Google space resource name. + */ + "spaceResourceName": string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + name: { + baseName: "name", + type: "string", + required: true, + }, + spaceResourceName: { + baseName: "space_resource_name", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GoogleChatCreateOrganizationHandleRequestAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/google_chat_integration/src/v2/models/GoogleChatCreateOrganizationHandleRequestData.ts b/services/google_chat_integration/src/v2/models/GoogleChatCreateOrganizationHandleRequestData.ts new file mode 100644 index 000000000000..b128b37c7bf6 --- /dev/null +++ b/services/google_chat_integration/src/v2/models/GoogleChatCreateOrganizationHandleRequestData.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GoogleChatCreateOrganizationHandleRequestAttributes } from "./GoogleChatCreateOrganizationHandleRequestAttributes"; + +/** + * Organization handle data for a create request. + */ +export class GoogleChatCreateOrganizationHandleRequestData { + /** + * Organization handle attributes for a create request. + */ + "attributes": GoogleChatCreateOrganizationHandleRequestAttributes; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "GoogleChatCreateOrganizationHandleRequestAttributes", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GoogleChatCreateOrganizationHandleRequestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/google_chat_integration/src/v2/models/GoogleChatOrganizationHandleResponse.ts b/services/google_chat_integration/src/v2/models/GoogleChatOrganizationHandleResponse.ts new file mode 100644 index 000000000000..2a39d4aca119 --- /dev/null +++ b/services/google_chat_integration/src/v2/models/GoogleChatOrganizationHandleResponse.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GoogleChatOrganizationHandleResponseData } from "./GoogleChatOrganizationHandleResponseData"; + +/** + * Organization handle for monitor notifications to a Google Chat space within a Google organization. + */ +export class GoogleChatOrganizationHandleResponse { + /** + * Organization handle data from a response. + */ + "data": GoogleChatOrganizationHandleResponseData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "GoogleChatOrganizationHandleResponseData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GoogleChatOrganizationHandleResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/google_chat_integration/src/v2/models/GoogleChatOrganizationHandleResponseAttributes.ts b/services/google_chat_integration/src/v2/models/GoogleChatOrganizationHandleResponseAttributes.ts new file mode 100644 index 000000000000..2b5b9a5f0412 --- /dev/null +++ b/services/google_chat_integration/src/v2/models/GoogleChatOrganizationHandleResponseAttributes.ts @@ -0,0 +1,60 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Organization handle attributes. + */ +export class GoogleChatOrganizationHandleResponseAttributes { + /** + * Organization handle name. + */ + "name"?: string; + /** + * Google space display name. + */ + "spaceDisplayName"?: string; + /** + * Google space resource name. + */ + "spaceResourceName"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + name: { + baseName: "name", + type: "string", + }, + spaceDisplayName: { + baseName: "space_display_name", + type: "string", + }, + spaceResourceName: { + baseName: "space_resource_name", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GoogleChatOrganizationHandleResponseAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/google_chat_integration/src/v2/models/GoogleChatOrganizationHandleResponseData.ts b/services/google_chat_integration/src/v2/models/GoogleChatOrganizationHandleResponseData.ts new file mode 100644 index 000000000000..703e38d84df3 --- /dev/null +++ b/services/google_chat_integration/src/v2/models/GoogleChatOrganizationHandleResponseData.ts @@ -0,0 +1,63 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GoogleChatOrganizationHandleResponseAttributes } from "./GoogleChatOrganizationHandleResponseAttributes"; +import { GoogleChatOrganizationHandleType } from "./GoogleChatOrganizationHandleType"; + +/** + * Organization handle data from a response. + */ +export class GoogleChatOrganizationHandleResponseData { + /** + * Organization handle attributes. + */ + "attributes"?: GoogleChatOrganizationHandleResponseAttributes; + /** + * The ID of the organization handle. + */ + "id"?: string; + /** + * Organization handle resource type. + */ + "type"?: GoogleChatOrganizationHandleType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "GoogleChatOrganizationHandleResponseAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "GoogleChatOrganizationHandleType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GoogleChatOrganizationHandleResponseData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/google_chat_integration/src/v2/models/GoogleChatOrganizationHandleType.ts b/services/google_chat_integration/src/v2/models/GoogleChatOrganizationHandleType.ts new file mode 100644 index 000000000000..e0ee2560cf6c --- /dev/null +++ b/services/google_chat_integration/src/v2/models/GoogleChatOrganizationHandleType.ts @@ -0,0 +1,10 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Organization handle resource type. + */ +export type GoogleChatOrganizationHandleType = + | typeof GOOGLE_CHAT_ORGANIZATION_HANDLE_TYPE + | UnparsedObject; +export const GOOGLE_CHAT_ORGANIZATION_HANDLE_TYPE = + "google-chat-organization-handle"; diff --git a/services/google_chat_integration/src/v2/models/GoogleChatOrganizationHandlesResponse.ts b/services/google_chat_integration/src/v2/models/GoogleChatOrganizationHandlesResponse.ts new file mode 100644 index 000000000000..bbc772edbdcb --- /dev/null +++ b/services/google_chat_integration/src/v2/models/GoogleChatOrganizationHandlesResponse.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GoogleChatOrganizationHandleResponseData } from "./GoogleChatOrganizationHandleResponseData"; + +/** + * List of organization handles for monitor notifications to Google Chat spaces within a Google organization. + */ +export class GoogleChatOrganizationHandlesResponse { + /** + * An array of organization handles. + */ + "data": Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GoogleChatOrganizationHandlesResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/google_chat_integration/src/v2/models/GoogleChatUpdateOrganizationHandleRequest.ts b/services/google_chat_integration/src/v2/models/GoogleChatUpdateOrganizationHandleRequest.ts new file mode 100644 index 000000000000..ad27f3981641 --- /dev/null +++ b/services/google_chat_integration/src/v2/models/GoogleChatUpdateOrganizationHandleRequest.ts @@ -0,0 +1,57 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GoogleChatOrganizationHandleType } from "./GoogleChatOrganizationHandleType"; +import { GoogleChatUpdateOrganizationHandleRequestData } from "./GoogleChatUpdateOrganizationHandleRequestData"; + +/** + * Update organization handle request. + */ +export class GoogleChatUpdateOrganizationHandleRequest { + /** + * Organization handle data for an update request. + */ + "data": GoogleChatUpdateOrganizationHandleRequestData; + /** + * Organization handle resource type. + */ + "type": GoogleChatOrganizationHandleType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "GoogleChatUpdateOrganizationHandleRequestData", + required: true, + }, + type: { + baseName: "type", + type: "GoogleChatOrganizationHandleType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GoogleChatUpdateOrganizationHandleRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/google_chat_integration/src/v2/models/GoogleChatUpdateOrganizationHandleRequestAttributes.ts b/services/google_chat_integration/src/v2/models/GoogleChatUpdateOrganizationHandleRequestAttributes.ts new file mode 100644 index 000000000000..c1a480504850 --- /dev/null +++ b/services/google_chat_integration/src/v2/models/GoogleChatUpdateOrganizationHandleRequestAttributes.ts @@ -0,0 +1,52 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Organization handle attributes for an update request. + */ +export class GoogleChatUpdateOrganizationHandleRequestAttributes { + /** + * Organization handle name. + */ + "name"?: string; + /** + * Google space resource name. + */ + "spaceResourceName"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + name: { + baseName: "name", + type: "string", + }, + spaceResourceName: { + baseName: "space_resource_name", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GoogleChatUpdateOrganizationHandleRequestAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/google_chat_integration/src/v2/models/GoogleChatUpdateOrganizationHandleRequestData.ts b/services/google_chat_integration/src/v2/models/GoogleChatUpdateOrganizationHandleRequestData.ts new file mode 100644 index 000000000000..14d81a418e81 --- /dev/null +++ b/services/google_chat_integration/src/v2/models/GoogleChatUpdateOrganizationHandleRequestData.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GoogleChatUpdateOrganizationHandleRequestAttributes } from "./GoogleChatUpdateOrganizationHandleRequestAttributes"; + +/** + * Organization handle data for an update request. + */ +export class GoogleChatUpdateOrganizationHandleRequestData { + /** + * Organization handle attributes for an update request. + */ + "attributes": GoogleChatUpdateOrganizationHandleRequestAttributes; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "GoogleChatUpdateOrganizationHandleRequestAttributes", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GoogleChatUpdateOrganizationHandleRequestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/google_chat_integration/src/v2/models/TypingInfo.ts b/services/google_chat_integration/src/v2/models/TypingInfo.ts new file mode 100644 index 000000000000..175506ade139 --- /dev/null +++ b/services/google_chat_integration/src/v2/models/TypingInfo.ts @@ -0,0 +1,50 @@ +import { ModelTypingInfo } from "@datadog/datadog-api-client"; + +import { APIErrorResponse } from "./APIErrorResponse"; +import { GoogleChatAppNamedSpaceResponse } from "./GoogleChatAppNamedSpaceResponse"; +import { GoogleChatAppNamedSpaceResponseAttributes } from "./GoogleChatAppNamedSpaceResponseAttributes"; +import { GoogleChatAppNamedSpaceResponseData } from "./GoogleChatAppNamedSpaceResponseData"; +import { GoogleChatCreateOrganizationHandleRequest } from "./GoogleChatCreateOrganizationHandleRequest"; +import { GoogleChatCreateOrganizationHandleRequestAttributes } from "./GoogleChatCreateOrganizationHandleRequestAttributes"; +import { GoogleChatCreateOrganizationHandleRequestData } from "./GoogleChatCreateOrganizationHandleRequestData"; +import { GoogleChatOrganizationHandleResponse } from "./GoogleChatOrganizationHandleResponse"; +import { GoogleChatOrganizationHandleResponseAttributes } from "./GoogleChatOrganizationHandleResponseAttributes"; +import { GoogleChatOrganizationHandleResponseData } from "./GoogleChatOrganizationHandleResponseData"; +import { GoogleChatOrganizationHandlesResponse } from "./GoogleChatOrganizationHandlesResponse"; +import { GoogleChatUpdateOrganizationHandleRequest } from "./GoogleChatUpdateOrganizationHandleRequest"; +import { GoogleChatUpdateOrganizationHandleRequestAttributes } from "./GoogleChatUpdateOrganizationHandleRequestAttributes"; +import { GoogleChatUpdateOrganizationHandleRequestData } from "./GoogleChatUpdateOrganizationHandleRequestData"; + +export const TypingInfo: ModelTypingInfo = { + enumsMap: { + GoogleChatAppNamedSpaceType: ["google-chat-app-named-space"], + GoogleChatOrganizationHandleType: ["google-chat-organization-handle"], + }, + oneOfMap: {}, + typeMap: { + APIErrorResponse: APIErrorResponse, + GoogleChatAppNamedSpaceResponse: GoogleChatAppNamedSpaceResponse, + GoogleChatAppNamedSpaceResponseAttributes: + GoogleChatAppNamedSpaceResponseAttributes, + GoogleChatAppNamedSpaceResponseData: GoogleChatAppNamedSpaceResponseData, + GoogleChatCreateOrganizationHandleRequest: + GoogleChatCreateOrganizationHandleRequest, + GoogleChatCreateOrganizationHandleRequestAttributes: + GoogleChatCreateOrganizationHandleRequestAttributes, + GoogleChatCreateOrganizationHandleRequestData: + GoogleChatCreateOrganizationHandleRequestData, + GoogleChatOrganizationHandleResponse: GoogleChatOrganizationHandleResponse, + GoogleChatOrganizationHandleResponseAttributes: + GoogleChatOrganizationHandleResponseAttributes, + GoogleChatOrganizationHandleResponseData: + GoogleChatOrganizationHandleResponseData, + GoogleChatOrganizationHandlesResponse: + GoogleChatOrganizationHandlesResponse, + GoogleChatUpdateOrganizationHandleRequest: + GoogleChatUpdateOrganizationHandleRequest, + GoogleChatUpdateOrganizationHandleRequestAttributes: + GoogleChatUpdateOrganizationHandleRequestAttributes, + GoogleChatUpdateOrganizationHandleRequestData: + GoogleChatUpdateOrganizationHandleRequestData, + }, +}; diff --git a/services/google_chat_integration/tsconfig.json b/services/google_chat_integration/tsconfig.json new file mode 100644 index 000000000000..d6c32bfb893c --- /dev/null +++ b/services/google_chat_integration/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "strict": true, + /* Basic Options */ + "target": "es6", + "module": "commonjs", + "moduleResolution": "node", + "declaration": true, + + "esModuleInterop": true, + "resolveJsonModule": true, + + "noImplicitAny": true, + "noImplicitThis": true, + + /* Additional Checks */ + "noUnusedLocals": false /* Report errors on unused locals. */, // TODO: reenable (unused imports!) + "noUnusedParameters": false /* Report errors on unused parameters. */, // TODO: set to true again + "noImplicitReturns": true /* Report error when not all code paths in function return a value. */, + "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, + + "sourceMap": true, + "outDir": "./dist", + "lib": ["es6", "es7"] + }, + "exclude": ["dist", "node_modules", "tests"], + "include": ["src"] +} diff --git a/yarn.lock b/yarn.lock index 3600b0182d4c..0e8c326b6319 100644 --- a/yarn.lock +++ b/yarn.lock @@ -658,6 +658,15 @@ __metadata: languageName: unknown linkType: soft +"@datadog/datadog-api-client-google-chat-integration@workspace:services/google_chat_integration": + version: 0.0.0-use.local + resolution: "@datadog/datadog-api-client-google-chat-integration@workspace:services/google_chat_integration" + dependencies: + "@datadog/datadog-api-client": "npm:^2.0.0-beta.2" + typescript: "npm:5.8.3" + languageName: unknown + linkType: soft + "@datadog/datadog-api-client-high-availability-multi-region@workspace:services/high_availability_multi_region": version: 0.0.0-use.local resolution: "@datadog/datadog-api-client-high-availability-multi-region@workspace:services/high_availability_multi_region"