diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 9e32a13f42..927020d4c9 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -467,6 +467,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 @@ -25429,6 +25457,204 @@ components: type: string x-enum-varnames: - GLOBAL_VARIABLES + GoogleChatAppNamedSpaceResponse: + description: Response of a Google Chat app named space. + properties: + data: + $ref: '#/components/schemas/GoogleChatAppNamedSpaceResponseData' + required: + - data + type: object + GoogleChatAppNamedSpaceResponseAttributes: + description: Google Chat app named 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 app named space data from a response. + properties: + attributes: + $ref: '#/components/schemas/GoogleChatAppNamedSpaceResponseAttributes' + id: + description: The ID of the app named 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 app named 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: Response of a organization handle. + 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: Response with a list of organization handles. + 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 @@ -72559,6 +72785,167 @@ 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: + - $ref: '#/components/parameters/GoogleChatOrganizationBindingIdPathParameter' + - $ref: '#/components/parameters/GoogleChatHandleIdPathParameter' + 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/ms-teams/configuration/channel/{tenant_name}/{team_name}/{channel_name}: get: description: Get the tenant, team, and channel ID of a channel in the Datadog @@ -92012,6 +92399,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: 'The IP allowlist API is used to manage the IP addresses that can access the Datadog API and web UI. It does not block diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index ef7c7e17c8..fe3f1071b1 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -270,6 +270,13 @@ datadog\_api\_client.v2.api.gcp\_integration\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.google\_chat\_integration\_api module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.google_chat_integration_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.incident\_services\_api module ---------------------------------------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 471ae60b1b..c13c40944c 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -10728,6 +10728,111 @@ datadog\_api\_client.v2.model.global\_variable\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.google\_chat\_app\_named\_space\_response module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.google_chat_app_named_space_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.google\_chat\_app\_named\_space\_response\_attributes module +------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.google_chat_app_named_space_response_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.google\_chat\_app\_named\_space\_response\_data module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.google_chat_app_named_space_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.google\_chat\_app\_named\_space\_type module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.google_chat_app_named_space_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.google\_chat\_create\_organization\_handle\_request module +---------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.google_chat_create_organization_handle_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.google\_chat\_create\_organization\_handle\_request\_attributes module +---------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.google_chat_create_organization_handle_request_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.google\_chat\_create\_organization\_handle\_request\_data module +---------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.google_chat_create_organization_handle_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.google\_chat\_organization\_handle\_response module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.google_chat_organization_handle_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.google\_chat\_organization\_handle\_response\_attributes module +--------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.google_chat_organization_handle_response_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.google\_chat\_organization\_handle\_response\_data module +--------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.google_chat_organization_handle_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.google\_chat\_organization\_handle\_type module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.google_chat_organization_handle_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.google\_chat\_organization\_handles\_response module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.google_chat_organization_handles_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.google\_chat\_update\_organization\_handle\_request module +---------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.google_chat_update_organization_handle_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.google\_chat\_update\_organization\_handle\_request\_attributes module +---------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.google_chat_update_organization_handle_request_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.google\_chat\_update\_organization\_handle\_request\_data module +---------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.google_chat_update_organization_handle_request_data + :members: + :show-inheritance: + datadog\_api\_client.v2.model.google\_meet\_configuration\_reference module --------------------------------------------------------------------------- diff --git a/examples/v2/google-chat-integration/CreateOrganizationHandle.py b/examples/v2/google-chat-integration/CreateOrganizationHandle.py new file mode 100644 index 0000000000..71276b67df --- /dev/null +++ b/examples/v2/google-chat-integration/CreateOrganizationHandle.py @@ -0,0 +1,35 @@ +""" +Create organization handle returns "CREATED" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.google_chat_integration_api import GoogleChatIntegrationApi +from datadog_api_client.v2.model.google_chat_create_organization_handle_request import ( + GoogleChatCreateOrganizationHandleRequest, +) +from datadog_api_client.v2.model.google_chat_create_organization_handle_request_attributes import ( + GoogleChatCreateOrganizationHandleRequestAttributes, +) +from datadog_api_client.v2.model.google_chat_create_organization_handle_request_data import ( + GoogleChatCreateOrganizationHandleRequestData, +) +from datadog_api_client.v2.model.google_chat_organization_handle_type import GoogleChatOrganizationHandleType + +body = GoogleChatCreateOrganizationHandleRequest( + data=GoogleChatCreateOrganizationHandleRequestData( + attributes=GoogleChatCreateOrganizationHandleRequestAttributes( + name="Example-Google-Chat-Integration", + space_resource_name="spaces/AAQA-zFIks8", + ), + ), + type=GoogleChatOrganizationHandleType.GOOGLE_CHAT_ORGANIZATION_HANDLE_TYPE, +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = GoogleChatIntegrationApi(api_client) + response = api_instance.create_organization_handle( + organization_binding_id="e54cb570-c674-529c-769d-84b312288ed7", body=body + ) + + print(response) diff --git a/examples/v2/google-chat-integration/DeleteOrganizationHandle.py b/examples/v2/google-chat-integration/DeleteOrganizationHandle.py new file mode 100644 index 0000000000..ea02eea102 --- /dev/null +++ b/examples/v2/google-chat-integration/DeleteOrganizationHandle.py @@ -0,0 +1,18 @@ +""" +Delete organization handle returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.google_chat_integration_api import GoogleChatIntegrationApi + +# there is a valid "organization_handle" in the system +ORGANIZATION_HANDLE_DATA_ID = environ["ORGANIZATION_HANDLE_DATA_ID"] + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = GoogleChatIntegrationApi(api_client) + api_instance.delete_organization_handle( + organization_binding_id="e54cb570-c674-529c-769d-84b312288ed7", + handle_id=ORGANIZATION_HANDLE_DATA_ID, + ) diff --git a/examples/v2/google-chat-integration/GetOrganizationHandle.py b/examples/v2/google-chat-integration/GetOrganizationHandle.py new file mode 100644 index 0000000000..d86af45210 --- /dev/null +++ b/examples/v2/google-chat-integration/GetOrganizationHandle.py @@ -0,0 +1,20 @@ +""" +Get organization handle returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.google_chat_integration_api import GoogleChatIntegrationApi + +# there is a valid "organization_handle" in the system +ORGANIZATION_HANDLE_DATA_ID = environ["ORGANIZATION_HANDLE_DATA_ID"] + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = GoogleChatIntegrationApi(api_client) + response = api_instance.get_organization_handle( + organization_binding_id="e54cb570-c674-529c-769d-84b312288ed7", + handle_id=ORGANIZATION_HANDLE_DATA_ID, + ) + + print(response) diff --git a/examples/v2/google-chat-integration/GetSpaceByDisplayName.py b/examples/v2/google-chat-integration/GetSpaceByDisplayName.py new file mode 100644 index 0000000000..6ee2a9f3f9 --- /dev/null +++ b/examples/v2/google-chat-integration/GetSpaceByDisplayName.py @@ -0,0 +1,16 @@ +""" +Get space information by display name returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.google_chat_integration_api import GoogleChatIntegrationApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = GoogleChatIntegrationApi(api_client) + response = api_instance.get_space_by_display_name( + domain_name="datadog.ninja", + space_display_name="api-test-space", + ) + + print(response) diff --git a/examples/v2/google-chat-integration/ListOrganizationHandles.py b/examples/v2/google-chat-integration/ListOrganizationHandles.py new file mode 100644 index 0000000000..9443f34ddd --- /dev/null +++ b/examples/v2/google-chat-integration/ListOrganizationHandles.py @@ -0,0 +1,15 @@ +""" +Get all organization handles returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.google_chat_integration_api import GoogleChatIntegrationApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = GoogleChatIntegrationApi(api_client) + response = api_instance.list_organization_handles( + organization_binding_id="e54cb570-c674-529c-769d-84b312288ed7", + ) + + print(response) diff --git a/examples/v2/google-chat-integration/UpdateOrganizationHandle.py b/examples/v2/google-chat-integration/UpdateOrganizationHandle.py new file mode 100644 index 0000000000..e643d675b6 --- /dev/null +++ b/examples/v2/google-chat-integration/UpdateOrganizationHandle.py @@ -0,0 +1,39 @@ +""" +Update organization handle returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.google_chat_integration_api import GoogleChatIntegrationApi +from datadog_api_client.v2.model.google_chat_organization_handle_type import GoogleChatOrganizationHandleType +from datadog_api_client.v2.model.google_chat_update_organization_handle_request import ( + GoogleChatUpdateOrganizationHandleRequest, +) +from datadog_api_client.v2.model.google_chat_update_organization_handle_request_attributes import ( + GoogleChatUpdateOrganizationHandleRequestAttributes, +) +from datadog_api_client.v2.model.google_chat_update_organization_handle_request_data import ( + GoogleChatUpdateOrganizationHandleRequestData, +) + +# there is a valid "organization_handle" in the system +ORGANIZATION_HANDLE_DATA_ATTRIBUTES_NAME = environ["ORGANIZATION_HANDLE_DATA_ATTRIBUTES_NAME"] +ORGANIZATION_HANDLE_DATA_ID = environ["ORGANIZATION_HANDLE_DATA_ID"] + +body = GoogleChatUpdateOrganizationHandleRequest( + data=GoogleChatUpdateOrganizationHandleRequestData( + attributes=GoogleChatUpdateOrganizationHandleRequestAttributes( + name="fake-handle-name--updated", + ), + ), + type=GoogleChatOrganizationHandleType.GOOGLE_CHAT_ORGANIZATION_HANDLE_TYPE, +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = GoogleChatIntegrationApi(api_client) + response = api_instance.update_organization_handle( + organization_binding_id="e54cb570-c674-529c-769d-84b312288ed7", handle_id=ORGANIZATION_HANDLE_DATA_ID, body=body + ) + + print(response) diff --git a/src/datadog_api_client/v2/api/google_chat_integration_api.py b/src/datadog_api_client/v2/api/google_chat_integration_api.py new file mode 100644 index 0000000000..d01de12582 --- /dev/null +++ b/src/datadog_api_client/v2/api/google_chat_integration_api.py @@ -0,0 +1,330 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.v2.model.google_chat_app_named_space_response import GoogleChatAppNamedSpaceResponse +from datadog_api_client.v2.model.google_chat_organization_handles_response import GoogleChatOrganizationHandlesResponse +from datadog_api_client.v2.model.google_chat_organization_handle_response import GoogleChatOrganizationHandleResponse +from datadog_api_client.v2.model.google_chat_create_organization_handle_request import ( + GoogleChatCreateOrganizationHandleRequest, +) +from datadog_api_client.v2.model.google_chat_update_organization_handle_request import ( + GoogleChatUpdateOrganizationHandleRequest, +) + + +class GoogleChatIntegrationApi: + """ + Configure your `Datadog Google Chat integration `_ + directly through the Datadog API. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._create_organization_handle_endpoint = _Endpoint( + settings={ + "response_type": (GoogleChatOrganizationHandleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles", + "operation_id": "create_organization_handle", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "organization_binding_id": { + "required": True, + "openapi_types": (str,), + "attribute": "organization_binding_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (GoogleChatCreateOrganizationHandleRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._delete_organization_handle_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles/{handle_id}", + "operation_id": "delete_organization_handle", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "organization_binding_id": { + "required": True, + "openapi_types": (str,), + "attribute": "organization_binding_id", + "location": "path", + }, + "handle_id": { + "required": True, + "openapi_types": (str,), + "attribute": "handle_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._get_organization_handle_endpoint = _Endpoint( + settings={ + "response_type": (GoogleChatOrganizationHandleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles/{handle_id}", + "operation_id": "get_organization_handle", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "organization_binding_id": { + "required": True, + "openapi_types": (str,), + "attribute": "organization_binding_id", + "location": "path", + }, + "handle_id": { + "required": True, + "openapi_types": (str,), + "attribute": "handle_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._get_space_by_display_name_endpoint = _Endpoint( + settings={ + "response_type": (GoogleChatAppNamedSpaceResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/google-chat/organizations/app/named-spaces/{domain_name}/{space_display_name}", + "operation_id": "get_space_by_display_name", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "domain_name": { + "required": True, + "openapi_types": (str,), + "attribute": "domain_name", + "location": "path", + }, + "space_display_name": { + "required": True, + "openapi_types": (str,), + "attribute": "space_display_name", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_organization_handles_endpoint = _Endpoint( + settings={ + "response_type": (GoogleChatOrganizationHandlesResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles", + "operation_id": "list_organization_handles", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "organization_binding_id": { + "required": True, + "openapi_types": (str,), + "attribute": "organization_binding_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._update_organization_handle_endpoint = _Endpoint( + settings={ + "response_type": (GoogleChatOrganizationHandleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles/{handle_id}", + "operation_id": "update_organization_handle", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "organization_binding_id": { + "required": True, + "openapi_types": (str,), + "attribute": "organization_binding_id", + "location": "path", + }, + "handle_id": { + "required": True, + "openapi_types": (str,), + "attribute": "handle_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (GoogleChatUpdateOrganizationHandleRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def create_organization_handle( + self, + organization_binding_id: str, + body: GoogleChatCreateOrganizationHandleRequest, + ) -> GoogleChatOrganizationHandleResponse: + """Create organization handle. + + Create an organization handle in the Datadog Google Chat integration. + + :param organization_binding_id: Your organization binding ID. + :type organization_binding_id: str + :param body: Organization handle payload. + :type body: GoogleChatCreateOrganizationHandleRequest + :rtype: GoogleChatOrganizationHandleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["organization_binding_id"] = organization_binding_id + + kwargs["body"] = body + + return self._create_organization_handle_endpoint.call_with_http_info(**kwargs) + + def delete_organization_handle( + self, + organization_binding_id: str, + handle_id: str, + ) -> None: + """Delete organization handle. + + Delete an organization handle from the Datadog Google Chat integration. + + :param organization_binding_id: Your organization binding ID. + :type organization_binding_id: str + :param handle_id: Your organization handle ID. + :type handle_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["organization_binding_id"] = organization_binding_id + + kwargs["handle_id"] = handle_id + + return self._delete_organization_handle_endpoint.call_with_http_info(**kwargs) + + def get_organization_handle( + self, + organization_binding_id: str, + handle_id: str, + ) -> GoogleChatOrganizationHandleResponse: + """Get organization handle. + + Get an organization handle from the Datadog Google Chat integration. + + :param organization_binding_id: Your organization binding ID. + :type organization_binding_id: str + :param handle_id: Your organization handle ID. + :type handle_id: str + :rtype: GoogleChatOrganizationHandleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["organization_binding_id"] = organization_binding_id + + kwargs["handle_id"] = handle_id + + return self._get_organization_handle_endpoint.call_with_http_info(**kwargs) + + def get_space_by_display_name( + self, + domain_name: str, + space_display_name: str, + ) -> GoogleChatAppNamedSpaceResponse: + """Get space information by display name. + + Get the resource name and organization binding ID of a space in the Datadog Google Chat integration. + + :param domain_name: The Google Chat domain name. + :type domain_name: str + :param space_display_name: The Google Chat space display name. + :type space_display_name: str + :rtype: GoogleChatAppNamedSpaceResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["domain_name"] = domain_name + + kwargs["space_display_name"] = space_display_name + + return self._get_space_by_display_name_endpoint.call_with_http_info(**kwargs) + + def list_organization_handles( + self, + organization_binding_id: str, + ) -> GoogleChatOrganizationHandlesResponse: + """Get all organization handles. + + Get a list of all organization handles from the Datadog Google Chat integration. + + :param organization_binding_id: Your organization binding ID. + :type organization_binding_id: str + :rtype: GoogleChatOrganizationHandlesResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["organization_binding_id"] = organization_binding_id + + return self._list_organization_handles_endpoint.call_with_http_info(**kwargs) + + def update_organization_handle( + self, + organization_binding_id: str, + handle_id: str, + body: GoogleChatUpdateOrganizationHandleRequest, + ) -> GoogleChatOrganizationHandleResponse: + """Update organization handle. + + Update an organization handle from the Datadog Google Chat integration. + + :param organization_binding_id: Your organization binding ID. + :type organization_binding_id: str + :param handle_id: Your organization handle ID. + :type handle_id: str + :param body: Organization handle payload. + :type body: GoogleChatUpdateOrganizationHandleRequest + :rtype: GoogleChatOrganizationHandleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["organization_binding_id"] = organization_binding_id + + kwargs["handle_id"] = handle_id + + kwargs["body"] = body + + return self._update_organization_handle_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index 35ab810c4a..937e586f4f 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -36,6 +36,7 @@ from datadog_api_client.v2.api.fastly_integration_api import FastlyIntegrationApi from datadog_api_client.v2.api.fleet_automation_api import FleetAutomationApi from datadog_api_client.v2.api.gcp_integration_api import GCPIntegrationApi +from datadog_api_client.v2.api.google_chat_integration_api import GoogleChatIntegrationApi from datadog_api_client.v2.api.ip_allowlist_api import IPAllowlistApi from datadog_api_client.v2.api.incident_services_api import IncidentServicesApi from datadog_api_client.v2.api.incident_teams_api import IncidentTeamsApi @@ -125,6 +126,7 @@ "FastlyIntegrationApi", "FleetAutomationApi", "GCPIntegrationApi", + "GoogleChatIntegrationApi", "IPAllowlistApi", "IncidentServicesApi", "IncidentTeamsApi", diff --git a/src/datadog_api_client/v2/model/google_chat_app_named_space_response.py b/src/datadog_api_client/v2/model/google_chat_app_named_space_response.py new file mode 100644 index 0000000000..f8910a1616 --- /dev/null +++ b/src/datadog_api_client/v2/model/google_chat_app_named_space_response.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.google_chat_app_named_space_response_data import ( + GoogleChatAppNamedSpaceResponseData, + ) + + +class GoogleChatAppNamedSpaceResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.google_chat_app_named_space_response_data import ( + GoogleChatAppNamedSpaceResponseData, + ) + + return { + "data": (GoogleChatAppNamedSpaceResponseData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: GoogleChatAppNamedSpaceResponseData, **kwargs): + """ + Response of a Google Chat app named space. + + :param data: Google Chat app named space data from a response. + :type data: GoogleChatAppNamedSpaceResponseData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/google_chat_app_named_space_response_attributes.py b/src/datadog_api_client/v2/model/google_chat_app_named_space_response_attributes.py new file mode 100644 index 0000000000..06fae2d0bc --- /dev/null +++ b/src/datadog_api_client/v2/model/google_chat_app_named_space_response_attributes.py @@ -0,0 +1,79 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class GoogleChatAppNamedSpaceResponseAttributes(ModelNormal): + validations = { + "display_name": { + "max_length": 255, + }, + "organization_binding_id": { + "max_length": 255, + }, + "resource_name": { + "max_length": 255, + }, + "space_uri": { + "max_length": 255, + }, + } + + @cached_property + def openapi_types(_): + return { + "display_name": (str,), + "organization_binding_id": (str,), + "resource_name": (str,), + "space_uri": (str,), + } + + attribute_map = { + "display_name": "display_name", + "organization_binding_id": "organization_binding_id", + "resource_name": "resource_name", + "space_uri": "space_uri", + } + + def __init__( + self_, + display_name: Union[str, UnsetType] = unset, + organization_binding_id: Union[str, UnsetType] = unset, + resource_name: Union[str, UnsetType] = unset, + space_uri: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Google Chat app named space attributes. + + :param display_name: Google space display name. + :type display_name: str, optional + + :param organization_binding_id: Organization binding ID. + :type organization_binding_id: str, optional + + :param resource_name: Google space resource name. + :type resource_name: str, optional + + :param space_uri: Google space URI. + :type space_uri: str, optional + """ + if display_name is not unset: + kwargs["display_name"] = display_name + if organization_binding_id is not unset: + kwargs["organization_binding_id"] = organization_binding_id + if resource_name is not unset: + kwargs["resource_name"] = resource_name + if space_uri is not unset: + kwargs["space_uri"] = space_uri + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/google_chat_app_named_space_response_data.py b/src/datadog_api_client/v2/model/google_chat_app_named_space_response_data.py new file mode 100644 index 0000000000..b4e304a4e3 --- /dev/null +++ b/src/datadog_api_client/v2/model/google_chat_app_named_space_response_data.py @@ -0,0 +1,75 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.google_chat_app_named_space_response_attributes import ( + GoogleChatAppNamedSpaceResponseAttributes, + ) + from datadog_api_client.v2.model.google_chat_app_named_space_type import GoogleChatAppNamedSpaceType + + +class GoogleChatAppNamedSpaceResponseData(ModelNormal): + validations = { + "id": { + "max_length": 100, + "min_length": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.google_chat_app_named_space_response_attributes import ( + GoogleChatAppNamedSpaceResponseAttributes, + ) + from datadog_api_client.v2.model.google_chat_app_named_space_type import GoogleChatAppNamedSpaceType + + return { + "attributes": (GoogleChatAppNamedSpaceResponseAttributes,), + "id": (str,), + "type": (GoogleChatAppNamedSpaceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: Union[GoogleChatAppNamedSpaceResponseAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + type: Union[GoogleChatAppNamedSpaceType, UnsetType] = unset, + **kwargs, + ): + """ + Google Chat app named space data from a response. + + :param attributes: Google Chat app named space attributes. + :type attributes: GoogleChatAppNamedSpaceResponseAttributes, optional + + :param id: The ID of the app named space. + :type id: str, optional + + :param type: Google Chat app named space resource type. + :type type: GoogleChatAppNamedSpaceType, optional + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/google_chat_app_named_space_type.py b/src/datadog_api_client/v2/model/google_chat_app_named_space_type.py new file mode 100644 index 0000000000..8546206b7d --- /dev/null +++ b/src/datadog_api_client/v2/model/google_chat_app_named_space_type.py @@ -0,0 +1,37 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class GoogleChatAppNamedSpaceType(ModelSimple): + """ + Google Chat app named space resource type. + + :param value: If omitted defaults to "google-chat-app-named-space". Must be one of ["google-chat-app-named-space"]. + :type value: str + """ + + allowed_values = { + "google-chat-app-named-space", + } + GOOGLE_CHAT_APP_NAMED_SPACE_TYPE: ClassVar["GoogleChatAppNamedSpaceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +GoogleChatAppNamedSpaceType.GOOGLE_CHAT_APP_NAMED_SPACE_TYPE = GoogleChatAppNamedSpaceType( + "google-chat-app-named-space" +) diff --git a/src/datadog_api_client/v2/model/google_chat_create_organization_handle_request.py b/src/datadog_api_client/v2/model/google_chat_create_organization_handle_request.py new file mode 100644 index 0000000000..7e310b9cff --- /dev/null +++ b/src/datadog_api_client/v2/model/google_chat_create_organization_handle_request.py @@ -0,0 +1,54 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.google_chat_create_organization_handle_request_data import ( + GoogleChatCreateOrganizationHandleRequestData, + ) + from datadog_api_client.v2.model.google_chat_organization_handle_type import GoogleChatOrganizationHandleType + + +class GoogleChatCreateOrganizationHandleRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.google_chat_create_organization_handle_request_data import ( + GoogleChatCreateOrganizationHandleRequestData, + ) + from datadog_api_client.v2.model.google_chat_organization_handle_type import GoogleChatOrganizationHandleType + + return { + "data": (GoogleChatCreateOrganizationHandleRequestData,), + "type": (GoogleChatOrganizationHandleType,), + } + + attribute_map = { + "data": "data", + "type": "type", + } + + def __init__( + self_, data: GoogleChatCreateOrganizationHandleRequestData, type: GoogleChatOrganizationHandleType, **kwargs + ): + """ + Create organization handle request. + + :param data: Organization handle data for a create request. + :type data: GoogleChatCreateOrganizationHandleRequestData + + :param type: Organization handle resource type. + :type type: GoogleChatOrganizationHandleType + """ + super().__init__(kwargs) + + self_.data = data + self_.type = type diff --git a/src/datadog_api_client/v2/model/google_chat_create_organization_handle_request_attributes.py b/src/datadog_api_client/v2/model/google_chat_create_organization_handle_request_attributes.py new file mode 100644 index 0000000000..263991da3a --- /dev/null +++ b/src/datadog_api_client/v2/model/google_chat_create_organization_handle_request_attributes.py @@ -0,0 +1,48 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class GoogleChatCreateOrganizationHandleRequestAttributes(ModelNormal): + validations = { + "name": { + "max_length": 255, + }, + "space_resource_name": { + "max_length": 255, + }, + } + + @cached_property + def openapi_types(_): + return { + "name": (str,), + "space_resource_name": (str,), + } + + attribute_map = { + "name": "name", + "space_resource_name": "space_resource_name", + } + + def __init__(self_, name: str, space_resource_name: str, **kwargs): + """ + Organization handle attributes for a create request. + + :param name: Organization handle name. + :type name: str + + :param space_resource_name: Google space resource name. + :type space_resource_name: str + """ + super().__init__(kwargs) + + self_.name = name + self_.space_resource_name = space_resource_name diff --git a/src/datadog_api_client/v2/model/google_chat_create_organization_handle_request_data.py b/src/datadog_api_client/v2/model/google_chat_create_organization_handle_request_data.py new file mode 100644 index 0000000000..8ce87e8010 --- /dev/null +++ b/src/datadog_api_client/v2/model/google_chat_create_organization_handle_request_data.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.google_chat_create_organization_handle_request_attributes import ( + GoogleChatCreateOrganizationHandleRequestAttributes, + ) + + +class GoogleChatCreateOrganizationHandleRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.google_chat_create_organization_handle_request_attributes import ( + GoogleChatCreateOrganizationHandleRequestAttributes, + ) + + return { + "attributes": (GoogleChatCreateOrganizationHandleRequestAttributes,), + } + + attribute_map = { + "attributes": "attributes", + } + + def __init__(self_, attributes: GoogleChatCreateOrganizationHandleRequestAttributes, **kwargs): + """ + Organization handle data for a create request. + + :param attributes: Organization handle attributes for a create request. + :type attributes: GoogleChatCreateOrganizationHandleRequestAttributes + """ + super().__init__(kwargs) + + self_.attributes = attributes diff --git a/src/datadog_api_client/v2/model/google_chat_organization_handle_response.py b/src/datadog_api_client/v2/model/google_chat_organization_handle_response.py new file mode 100644 index 0000000000..7d94b313ab --- /dev/null +++ b/src/datadog_api_client/v2/model/google_chat_organization_handle_response.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.google_chat_organization_handle_response_data import ( + GoogleChatOrganizationHandleResponseData, + ) + + +class GoogleChatOrganizationHandleResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.google_chat_organization_handle_response_data import ( + GoogleChatOrganizationHandleResponseData, + ) + + return { + "data": (GoogleChatOrganizationHandleResponseData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: GoogleChatOrganizationHandleResponseData, **kwargs): + """ + Response of a organization handle. + + :param data: Organization handle data from a response. + :type data: GoogleChatOrganizationHandleResponseData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/google_chat_organization_handle_response_attributes.py b/src/datadog_api_client/v2/model/google_chat_organization_handle_response_attributes.py new file mode 100644 index 0000000000..6cdedbc820 --- /dev/null +++ b/src/datadog_api_client/v2/model/google_chat_organization_handle_response_attributes.py @@ -0,0 +1,68 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class GoogleChatOrganizationHandleResponseAttributes(ModelNormal): + validations = { + "name": { + "max_length": 255, + }, + "space_display_name": { + "max_length": 255, + }, + "space_resource_name": { + "max_length": 255, + }, + } + + @cached_property + def openapi_types(_): + return { + "name": (str,), + "space_display_name": (str,), + "space_resource_name": (str,), + } + + attribute_map = { + "name": "name", + "space_display_name": "space_display_name", + "space_resource_name": "space_resource_name", + } + + def __init__( + self_, + name: Union[str, UnsetType] = unset, + space_display_name: Union[str, UnsetType] = unset, + space_resource_name: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Organization handle attributes. + + :param name: Organization handle name. + :type name: str, optional + + :param space_display_name: Google space display name. + :type space_display_name: str, optional + + :param space_resource_name: Google space resource name. + :type space_resource_name: str, optional + """ + if name is not unset: + kwargs["name"] = name + if space_display_name is not unset: + kwargs["space_display_name"] = space_display_name + if space_resource_name is not unset: + kwargs["space_resource_name"] = space_resource_name + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/google_chat_organization_handle_response_data.py b/src/datadog_api_client/v2/model/google_chat_organization_handle_response_data.py new file mode 100644 index 0000000000..69799630fa --- /dev/null +++ b/src/datadog_api_client/v2/model/google_chat_organization_handle_response_data.py @@ -0,0 +1,75 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.google_chat_organization_handle_response_attributes import ( + GoogleChatOrganizationHandleResponseAttributes, + ) + from datadog_api_client.v2.model.google_chat_organization_handle_type import GoogleChatOrganizationHandleType + + +class GoogleChatOrganizationHandleResponseData(ModelNormal): + validations = { + "id": { + "max_length": 100, + "min_length": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.google_chat_organization_handle_response_attributes import ( + GoogleChatOrganizationHandleResponseAttributes, + ) + from datadog_api_client.v2.model.google_chat_organization_handle_type import GoogleChatOrganizationHandleType + + return { + "attributes": (GoogleChatOrganizationHandleResponseAttributes,), + "id": (str,), + "type": (GoogleChatOrganizationHandleType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: Union[GoogleChatOrganizationHandleResponseAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + type: Union[GoogleChatOrganizationHandleType, UnsetType] = unset, + **kwargs, + ): + """ + Organization handle data from a response. + + :param attributes: Organization handle attributes. + :type attributes: GoogleChatOrganizationHandleResponseAttributes, optional + + :param id: The ID of the organization handle. + :type id: str, optional + + :param type: Organization handle resource type. + :type type: GoogleChatOrganizationHandleType, optional + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/google_chat_organization_handle_type.py b/src/datadog_api_client/v2/model/google_chat_organization_handle_type.py new file mode 100644 index 0000000000..58070c2177 --- /dev/null +++ b/src/datadog_api_client/v2/model/google_chat_organization_handle_type.py @@ -0,0 +1,37 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class GoogleChatOrganizationHandleType(ModelSimple): + """ + Organization handle resource type. + + :param value: If omitted defaults to "google-chat-organization-handle". Must be one of ["google-chat-organization-handle"]. + :type value: str + """ + + allowed_values = { + "google-chat-organization-handle", + } + GOOGLE_CHAT_ORGANIZATION_HANDLE_TYPE: ClassVar["GoogleChatOrganizationHandleType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +GoogleChatOrganizationHandleType.GOOGLE_CHAT_ORGANIZATION_HANDLE_TYPE = GoogleChatOrganizationHandleType( + "google-chat-organization-handle" +) diff --git a/src/datadog_api_client/v2/model/google_chat_organization_handles_response.py b/src/datadog_api_client/v2/model/google_chat_organization_handles_response.py new file mode 100644 index 0000000000..5aa1e392e8 --- /dev/null +++ b/src/datadog_api_client/v2/model/google_chat_organization_handles_response.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.google_chat_organization_handle_response_data import ( + GoogleChatOrganizationHandleResponseData, + ) + + +class GoogleChatOrganizationHandlesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.google_chat_organization_handle_response_data import ( + GoogleChatOrganizationHandleResponseData, + ) + + return { + "data": ([GoogleChatOrganizationHandleResponseData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[GoogleChatOrganizationHandleResponseData], **kwargs): + """ + Response with a list of organization handles. + + :param data: An array of organization handles. + :type data: [GoogleChatOrganizationHandleResponseData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/google_chat_update_organization_handle_request.py b/src/datadog_api_client/v2/model/google_chat_update_organization_handle_request.py new file mode 100644 index 0000000000..0dd15b1a06 --- /dev/null +++ b/src/datadog_api_client/v2/model/google_chat_update_organization_handle_request.py @@ -0,0 +1,54 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.google_chat_update_organization_handle_request_data import ( + GoogleChatUpdateOrganizationHandleRequestData, + ) + from datadog_api_client.v2.model.google_chat_organization_handle_type import GoogleChatOrganizationHandleType + + +class GoogleChatUpdateOrganizationHandleRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.google_chat_update_organization_handle_request_data import ( + GoogleChatUpdateOrganizationHandleRequestData, + ) + from datadog_api_client.v2.model.google_chat_organization_handle_type import GoogleChatOrganizationHandleType + + return { + "data": (GoogleChatUpdateOrganizationHandleRequestData,), + "type": (GoogleChatOrganizationHandleType,), + } + + attribute_map = { + "data": "data", + "type": "type", + } + + def __init__( + self_, data: GoogleChatUpdateOrganizationHandleRequestData, type: GoogleChatOrganizationHandleType, **kwargs + ): + """ + Update organization handle request. + + :param data: Organization handle data for an update request. + :type data: GoogleChatUpdateOrganizationHandleRequestData + + :param type: Organization handle resource type. + :type type: GoogleChatOrganizationHandleType + """ + super().__init__(kwargs) + + self_.data = data + self_.type = type diff --git a/src/datadog_api_client/v2/model/google_chat_update_organization_handle_request_attributes.py b/src/datadog_api_client/v2/model/google_chat_update_organization_handle_request_attributes.py new file mode 100644 index 0000000000..3811067564 --- /dev/null +++ b/src/datadog_api_client/v2/model/google_chat_update_organization_handle_request_attributes.py @@ -0,0 +1,54 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class GoogleChatUpdateOrganizationHandleRequestAttributes(ModelNormal): + validations = { + "name": { + "max_length": 255, + }, + "space_resource_name": { + "max_length": 255, + }, + } + + @cached_property + def openapi_types(_): + return { + "name": (str,), + "space_resource_name": (str,), + } + + attribute_map = { + "name": "name", + "space_resource_name": "space_resource_name", + } + + def __init__( + self_, name: Union[str, UnsetType] = unset, space_resource_name: Union[str, UnsetType] = unset, **kwargs + ): + """ + Organization handle attributes for an update request. + + :param name: Organization handle name. + :type name: str, optional + + :param space_resource_name: Google space resource name. + :type space_resource_name: str, optional + """ + if name is not unset: + kwargs["name"] = name + if space_resource_name is not unset: + kwargs["space_resource_name"] = space_resource_name + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/google_chat_update_organization_handle_request_data.py b/src/datadog_api_client/v2/model/google_chat_update_organization_handle_request_data.py new file mode 100644 index 0000000000..c1d6a3466f --- /dev/null +++ b/src/datadog_api_client/v2/model/google_chat_update_organization_handle_request_data.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.google_chat_update_organization_handle_request_attributes import ( + GoogleChatUpdateOrganizationHandleRequestAttributes, + ) + + +class GoogleChatUpdateOrganizationHandleRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.google_chat_update_organization_handle_request_attributes import ( + GoogleChatUpdateOrganizationHandleRequestAttributes, + ) + + return { + "attributes": (GoogleChatUpdateOrganizationHandleRequestAttributes,), + } + + attribute_map = { + "attributes": "attributes", + } + + def __init__(self_, attributes: GoogleChatUpdateOrganizationHandleRequestAttributes, **kwargs): + """ + Organization handle data for an update request. + + :param attributes: Organization handle attributes for an update request. + :type attributes: GoogleChatUpdateOrganizationHandleRequestAttributes + """ + super().__init__(kwargs) + + self_.attributes = attributes diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 0cf8e3da30..d1a621d5d2 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -2055,6 +2055,39 @@ from datadog_api_client.v2.model.global_variable_json_patch_type import GlobalVariableJsonPatchType from datadog_api_client.v2.model.global_variable_response import GlobalVariableResponse from datadog_api_client.v2.model.global_variable_type import GlobalVariableType +from datadog_api_client.v2.model.google_chat_app_named_space_response import GoogleChatAppNamedSpaceResponse +from datadog_api_client.v2.model.google_chat_app_named_space_response_attributes import ( + GoogleChatAppNamedSpaceResponseAttributes, +) +from datadog_api_client.v2.model.google_chat_app_named_space_response_data import GoogleChatAppNamedSpaceResponseData +from datadog_api_client.v2.model.google_chat_app_named_space_type import GoogleChatAppNamedSpaceType +from datadog_api_client.v2.model.google_chat_create_organization_handle_request import ( + GoogleChatCreateOrganizationHandleRequest, +) +from datadog_api_client.v2.model.google_chat_create_organization_handle_request_attributes import ( + GoogleChatCreateOrganizationHandleRequestAttributes, +) +from datadog_api_client.v2.model.google_chat_create_organization_handle_request_data import ( + GoogleChatCreateOrganizationHandleRequestData, +) +from datadog_api_client.v2.model.google_chat_organization_handle_response import GoogleChatOrganizationHandleResponse +from datadog_api_client.v2.model.google_chat_organization_handle_response_attributes import ( + GoogleChatOrganizationHandleResponseAttributes, +) +from datadog_api_client.v2.model.google_chat_organization_handle_response_data import ( + GoogleChatOrganizationHandleResponseData, +) +from datadog_api_client.v2.model.google_chat_organization_handle_type import GoogleChatOrganizationHandleType +from datadog_api_client.v2.model.google_chat_organization_handles_response import GoogleChatOrganizationHandlesResponse +from datadog_api_client.v2.model.google_chat_update_organization_handle_request import ( + GoogleChatUpdateOrganizationHandleRequest, +) +from datadog_api_client.v2.model.google_chat_update_organization_handle_request_attributes import ( + GoogleChatUpdateOrganizationHandleRequestAttributes, +) +from datadog_api_client.v2.model.google_chat_update_organization_handle_request_data import ( + GoogleChatUpdateOrganizationHandleRequestData, +) from datadog_api_client.v2.model.google_meet_configuration_reference import GoogleMeetConfigurationReference from datadog_api_client.v2.model.google_meet_configuration_reference_data import GoogleMeetConfigurationReferenceData from datadog_api_client.v2.model.grey_noise_api_key import GreyNoiseAPIKey @@ -6862,6 +6895,21 @@ "GlobalVariableJsonPatchType", "GlobalVariableResponse", "GlobalVariableType", + "GoogleChatAppNamedSpaceResponse", + "GoogleChatAppNamedSpaceResponseAttributes", + "GoogleChatAppNamedSpaceResponseData", + "GoogleChatAppNamedSpaceType", + "GoogleChatCreateOrganizationHandleRequest", + "GoogleChatCreateOrganizationHandleRequestAttributes", + "GoogleChatCreateOrganizationHandleRequestData", + "GoogleChatOrganizationHandleResponse", + "GoogleChatOrganizationHandleResponseAttributes", + "GoogleChatOrganizationHandleResponseData", + "GoogleChatOrganizationHandleType", + "GoogleChatOrganizationHandlesResponse", + "GoogleChatUpdateOrganizationHandleRequest", + "GoogleChatUpdateOrganizationHandleRequestAttributes", + "GoogleChatUpdateOrganizationHandleRequestData", "GoogleMeetConfigurationReference", "GoogleMeetConfigurationReferenceData", "GreyNoiseAPIKey", diff --git a/tests/v2/cassettes/test_scenarios/test_create_organization_handle_returns_created_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_organization_handle_returns_created_response.frozen new file mode 100644 index 0000000000..91584ceeeb --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_organization_handle_returns_created_response.frozen @@ -0,0 +1 @@ +2026-01-15T02:21:36.242Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_organization_handle_returns_created_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_organization_handle_returns_created_response.yaml new file mode 100644 index 0000000000..5ef4b20259 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_organization_handle_returns_created_response.yaml @@ -0,0 +1,38 @@ +interactions: +- request: + body: '{"data":{"attributes":{"name":"Test-Create_organization_handle_returns_CREATED_response-1768443696","space_resource_name":"spaces/AAQA-zFIks8"}},"type":"google-chat-organization-handle"}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/google-chat/organizations/e54cb570-c674-529c-769d-84b312288ed7/organization-handles + response: + body: + string: '{"data":{"id":"816b3532-ebb4-4518-9087-b3fc02598eef","type":"google-chat-organization-handle","attributes":{"name":"Test-Create_organization_handle_returns_CREATED_response-1768443696","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/google-chat/organizations/%7Borganization_binding_id%7D/organization-handles/816b3532-ebb4-4518-9087-b3fc02598eef + response: + body: + string: '{"errors":[{"status":"400","title":"Invalid Parameter","detail":"invalid + parameter \"google_chat_organization_binding_id\" in \"path\"; expected type + \"uuid\""}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_organization_handle_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_organization_handle_returns_ok_response.frozen new file mode 100644 index 0000000000..86e3ac81c9 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_organization_handle_returns_ok_response.frozen @@ -0,0 +1 @@ +2026-01-15T02:21:36.964Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_organization_handle_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_organization_handle_returns_ok_response.yaml new file mode 100644 index 0000000000..79104dbd8e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_organization_handle_returns_ok_response.yaml @@ -0,0 +1,52 @@ +interactions: +- request: + body: '{"data":{"attributes":{"name":"Test-Delete_organization_handle_returns_OK_response-1768443696","space_resource_name":"spaces/AAQA-zFIks8"}},"type":"google-chat-organization-handle"}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/google-chat/organizations/e54cb570-c674-529c-769d-84b312288ed7/organization-handles + response: + body: + string: '{"data":{"id":"31073514-1747-41a2-9606-4a21ff5dfffd","type":"google-chat-organization-handle","attributes":{"name":"Test-Delete_organization_handle_returns_OK_response-1768443696","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/google-chat/organizations/e54cb570-c674-529c-769d-84b312288ed7/organization-handles/31073514-1747-41a2-9606-4a21ff5dfffd + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/google-chat/organizations/%7Borganization_binding_id%7D/organization-handles/31073514-1747-41a2-9606-4a21ff5dfffd + response: + body: + string: '{"errors":[{"status":"400","title":"Invalid Parameter","detail":"invalid + parameter \"google_chat_organization_binding_id\" in \"path\"; expected type + \"uuid\""}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_all_organization_handles_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_all_organization_handles_returns_ok_response.frozen new file mode 100644 index 0000000000..a580c93262 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_all_organization_handles_returns_ok_response.frozen @@ -0,0 +1 @@ +2026-01-15T02:21:37.737Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_all_organization_handles_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_all_organization_handles_returns_ok_response.yaml new file mode 100644 index 0000000000..5e6198f5ef --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_all_organization_handles_returns_ok_response.yaml @@ -0,0 +1,54 @@ +interactions: +- request: + body: '{"data":{"attributes":{"name":"Test-Get_all_organization_handles_returns_OK_response-1768443697","space_resource_name":"spaces/AAQA-zFIks8"}},"type":"google-chat-organization-handle"}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/google-chat/organizations/e54cb570-c674-529c-769d-84b312288ed7/organization-handles + response: + body: + string: '{"data":{"id":"c255808f-31ed-44e4-9daa-f36ba91e5da5","type":"google-chat-organization-handle","attributes":{"name":"Test-Get_all_organization_handles_returns_OK_response-1768443697","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/integration/google-chat/organizations/e54cb570-c674-529c-769d-84b312288ed7/organization-handles + response: + body: + string: '{"data":[{"id":"4cb25d88-09cb-41bd-91d2-2ce83e7f48e2","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Create_organization_handle_returns_CREATED_response-1768410894","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"0c523f11-00fc-4232-9302-a4194bec088a","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Create_organization_handle_returns_CREATED_response-1768411668","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"fd026c96-994d-47a3-affd-c7b8b439c664","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Create_organization_handle_returns_CREATED_response-1768413147","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"00f632d9-1463-4ab6-902a-14efa83d13c3","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Create_organization_handle_returns_CREATED_response-1768413200","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"6d7c571a-8ae2-4fc9-885f-e2c72d713a2f","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Create_organization_handle_returns_CREATED_response-1768413359","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"7de5d51a-cef9-43a5-82b0-5e5465cd985b","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Create_organization_handle_returns_CREATED_response-1768414434","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"2d97d54c-6a89-41c7-b37c-dec64c4ae4d7","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Create_organization_handle_returns_CREATED_response-1768415357","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"998878e7-91e8-4627-ae28-f816ece451a3","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Create_organization_handle_returns_CREATED_response-1768415410","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"1048964c-3e42-475d-812a-ae0e52626bfb","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Create_organization_handle_returns_CREATED_response-1768415444","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"669866bb-34e5-40f7-9da6-476bf9bbe8ca","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Create_organization_handle_returns_CREATED_response-1768415571","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"c47893d4-35c6-4ddb-bc76-707220f0211a","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Create_organization_handle_returns_CREATED_response-1768415637","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"55266f5b-3067-4631-883e-cfb1dc49256d","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Create_organization_handle_returns_CREATED_response-1768416992","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"c3cb3868-7d64-4a0c-bd7f-819f7de97e0b","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Create_organization_handle_returns_CREATED_response-1768417235","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"4e13aa5f-7e47-4b4f-b95f-aabea862aedc","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Create_organization_handle_returns_CREATED_response-1768417898","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"25f41f79-2f98-44cd-a89e-65921b62c3d5","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Create_organization_handle_returns_CREATED_response-1768433110","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"e1174e5c-d09d-4f89-bf9d-2ea97634fa8f","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Get_all_organization_handles_returns_OK_response-1768433111","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"c5401188-ae0e-4d78-9bb8-c97b089b88ab","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Create_organization_handle_returns_CREATED_response-1768433243","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"349bddd9-b6e6-4bfa-aa77-279469cb8c02","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Get_all_organization_handles_returns_OK_response-1768433245","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"607be0b6-1b63-4620-a6b6-22838e545e1d","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Get_organization_handle_returns_OK_response-1768433246","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"0bde990e-a2d8-4fbc-8185-db4b760503e3","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Create_organization_handle_returns_CREATED_response-1768433723","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"d83962e1-b506-4b44-b6af-f22cc64ebfb4","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Get_all_organization_handles_returns_OK_response-1768433724","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"7b253152-9ab3-416f-ab3d-33ae688addf0","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Get_organization_handle_returns_OK_response-1768433725","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"6413555c-fd47-4909-826d-a88e48a6c6fb","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Create_organization_handle_returns_CREATED_response-1768433747","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"3e63fd96-71af-4d89-97a3-de1c407072b5","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Get_all_organization_handles_returns_OK_response-1768433749","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"b1f31471-ffc6-4f00-adca-65834cbcd507","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Get_organization_handle_returns_OK_response-1768433750","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"6c7fea65-24cd-4e7e-a0a4-dc080d74343f","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Create_organization_handle_returns_CREATED_response-1768433851","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"4349abba-180b-462a-b277-274a56b39802","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Get_all_organization_handles_returns_OK_response-1768433852","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"308d6c06-a2b3-4316-b0d4-5cf10edab69e","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Get_organization_handle_returns_OK_response-1768433853","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"96f53b75-9f2e-4a1e-a6f0-ae485007d5b3","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Create_organization_handle_returns_CREATED_response-1768434195","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"30b2f976-6f38-462d-bc34-c4e4b33cc3cc","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Get_all_organization_handles_returns_OK_response-1768434196","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"27703fb9-7f3e-47dc-a1d2-b8d8a9963e76","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Get_organization_handle_returns_OK_response-1768434197","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"083e58b9-15a9-4aff-9cbc-b86834e52c2b","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Update_organization_handle_returns_OK_response-1768434198--updated","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"9b9cc0a6-29ab-47f8-96d4-bc30721ccaa1","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Create_organization_handle_returns_CREATED_response-1768434578","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"1e4e3dd4-1d90-4636-9ff9-eedb2f54addc","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Get_all_organization_handles_returns_OK_response-1768434580","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"868ec752-faf5-4f44-8b52-8c3a122472c2","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Get_organization_handle_returns_OK_response-1768434581","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"9de230e5-ab9e-4580-b35d-eeaa0aeff0b6","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Update_organization_handle_returns_OK_response-1768434582--updated","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"30e260a4-6f82-42de-a3e1-2502d423c866","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Create_organization_handle_returns_CREATED_response-1768440733","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"8fbbe4fa-deee-425e-bc71-ad86d6e1d9bc","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Get_all_organization_handles_returns_OK_response-1768440734","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"37cf2395-7004-479f-bd63-89c77b3668e6","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Get_organization_handle_returns_OK_response-1768440735","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"caf066bb-44a5-45c7-a039-1c7fe3eaaf8d","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Update_organization_handle_returns_OK_response-1768440736--updated","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"76752f89-bc33-4ee6-affc-693a0d37881f","type":"google-chat-organization-handle","attributes":{"name":"Test-Create_organization_handle_returns_CREATED_response-1768440799","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"9bda54c5-2410-4cdf-9147-a039b6b8f734","type":"google-chat-organization-handle","attributes":{"name":"Test-Get_all_organization_handles_returns_OK_response-1768440800","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"a37fe35d-e599-40fa-83aa-87d0fdfcc81b","type":"google-chat-organization-handle","attributes":{"name":"Test-Get_organization_handle_returns_OK_response-1768440801","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"e8eb5d83-6dcb-4664-a35b-eaa0d1e22136","type":"google-chat-organization-handle","attributes":{"name":"Test-Update_organization_handle_returns_OK_response-1768440803--updated","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"f2239624-d5fb-4c61-b069-7902fc0cbfc5","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Create_organization_handle_returns_CREATED_response-1768441148","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"31863558-31d4-42f6-b2a9-8e9dadf2ac80","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Get_all_organization_handles_returns_OK_response-1768441150","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"cae37ed4-cec4-465c-9af7-6e65c137ae21","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Get_organization_handle_returns_OK_response-1768441151","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"0b0465a9-e0a8-4efd-be4b-8dc5d0283dfb","type":"google-chat-organization-handle","attributes":{"name":"Test-Typescript-Update_organization_handle_returns_OK_response-1768441152--updated","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"816b3532-ebb4-4518-9087-b3fc02598eef","type":"google-chat-organization-handle","attributes":{"name":"Test-Create_organization_handle_returns_CREATED_response-1768443696","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}},{"id":"c255808f-31ed-44e4-9daa-f36ba91e5da5","type":"google-chat-organization-handle","attributes":{"name":"Test-Get_all_organization_handles_returns_OK_response-1768443697","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/google-chat/organizations/%7Borganization_binding_id%7D/organization-handles/c255808f-31ed-44e4-9daa-f36ba91e5da5 + response: + body: + string: '{"errors":[{"status":"400","title":"Invalid Parameter","detail":"invalid + parameter \"google_chat_organization_binding_id\" in \"path\"; expected type + \"uuid\""}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_organization_handle_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_organization_handle_returns_ok_response.frozen new file mode 100644 index 0000000000..d11e45dc1d --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_organization_handle_returns_ok_response.frozen @@ -0,0 +1 @@ +2026-01-15T02:21:38.766Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_organization_handle_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_organization_handle_returns_ok_response.yaml new file mode 100644 index 0000000000..39b649db8d --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_organization_handle_returns_ok_response.yaml @@ -0,0 +1,54 @@ +interactions: +- request: + body: '{"data":{"attributes":{"name":"Test-Get_organization_handle_returns_OK_response-1768443698","space_resource_name":"spaces/AAQA-zFIks8"}},"type":"google-chat-organization-handle"}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/google-chat/organizations/e54cb570-c674-529c-769d-84b312288ed7/organization-handles + response: + body: + string: '{"data":{"id":"7a4e4593-fd25-4171-9ed0-54e2542a8fcf","type":"google-chat-organization-handle","attributes":{"name":"Test-Get_organization_handle_returns_OK_response-1768443698","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/integration/google-chat/organizations/e54cb570-c674-529c-769d-84b312288ed7/organization-handles/7a4e4593-fd25-4171-9ed0-54e2542a8fcf + response: + body: + string: '{"data":{"id":"7a4e4593-fd25-4171-9ed0-54e2542a8fcf","type":"google-chat-organization-handle","attributes":{"name":"Test-Get_organization_handle_returns_OK_response-1768443698","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/google-chat/organizations/%7Borganization_binding_id%7D/organization-handles/7a4e4593-fd25-4171-9ed0-54e2542a8fcf + response: + body: + string: '{"errors":[{"status":"400","title":"Invalid Parameter","detail":"invalid + parameter \"google_chat_organization_binding_id\" in \"path\"; expected type + \"uuid\""}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_space_information_by_display_name_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_space_information_by_display_name_returns_ok_response.frozen new file mode 100644 index 0000000000..7449b5fb2b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_space_information_by_display_name_returns_ok_response.frozen @@ -0,0 +1 @@ +2026-01-15T02:21:39.795Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_space_information_by_display_name_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_space_information_by_display_name_returns_ok_response.yaml new file mode 100644 index 0000000000..23df9dd7d7 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_space_information_by_display_name_returns_ok_response.yaml @@ -0,0 +1,18 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/integration/google-chat/organizations/app/named-spaces/datadog.ninja/api-test-space + response: + body: + string: '{"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"}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_organization_handle_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_organization_handle_returns_ok_response.frozen new file mode 100644 index 0000000000..21a44de333 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_organization_handle_returns_ok_response.frozen @@ -0,0 +1 @@ +2026-01-15T02:21:40.120Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_organization_handle_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_organization_handle_returns_ok_response.yaml new file mode 100644 index 0000000000..8db5fa7189 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_organization_handle_returns_ok_response.yaml @@ -0,0 +1,56 @@ +interactions: +- request: + body: '{"data":{"attributes":{"name":"Test-Update_organization_handle_returns_OK_response-1768443700","space_resource_name":"spaces/AAQA-zFIks8"}},"type":"google-chat-organization-handle"}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/google-chat/organizations/e54cb570-c674-529c-769d-84b312288ed7/organization-handles + response: + body: + string: '{"data":{"id":"e4e62f90-9ec7-459b-ac0a-62157eefeb2c","type":"google-chat-organization-handle","attributes":{"name":"Test-Update_organization_handle_returns_OK_response-1768443700","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"name":"Test-Update_organization_handle_returns_OK_response-1768443700--updated"}},"type":"google-chat-organization-handle"}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/integration/google-chat/organizations/e54cb570-c674-529c-769d-84b312288ed7/organization-handles/e4e62f90-9ec7-459b-ac0a-62157eefeb2c + response: + body: + string: '{"data":{"id":"e4e62f90-9ec7-459b-ac0a-62157eefeb2c","type":"google-chat-organization-handle","attributes":{"name":"Test-Update_organization_handle_returns_OK_response-1768443700--updated","space_display_name":"api-test-space","space_resource_name":"spaces/AAQA-zFIks8"}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/google-chat/organizations/%7Borganization_binding_id%7D/organization-handles/e4e62f90-9ec7-459b-ac0a-62157eefeb2c + response: + body: + string: '{"errors":[{"status":"400","title":"Invalid Parameter","detail":"invalid + parameter \"google_chat_organization_binding_id\" in \"path\"; expected type + \"uuid\""}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/features/given.json b/tests/v2/features/given.json index 3a01a060c5..5b891d6285 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/given.json @@ -519,6 +519,22 @@ "tag": "GCP Integration", "operationId": "CreateGCPSTSAccount" }, + { + "parameters": [ + { + "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}" + }, + { + "name": "organization_binding_id", + "value": "\"e54cb570-c674-529c-769d-84b312288ed7\"" + } + ], + "step": "there is a valid \"organization_handle\" in the system", + "key": "organization_handle", + "tag": "Google Chat Integration", + "operationId": "CreateOrganizationHandle" + }, { "parameters": [ { diff --git a/tests/v2/features/google_chat_integration.feature b/tests/v2/features/google_chat_integration.feature new file mode 100644 index 0000000000..f722a7ea20 --- /dev/null +++ b/tests/v2/features/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/tests/v2/features/undo.json b/tests/v2/features/undo.json index 661482db86..bc320446cb 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -1993,6 +1993,53 @@ "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": "handle_id", + "source": "data.id" + }, + { + "name": "organization_binding_id", + "value": "\"e54cb570-c674-529c-769d-84b312288ed7\"" + } + ], + "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" + } + }, "GetChannelByName": { "tag": "Microsoft Teams Integration", "undo": {