From 11d98f9802078e0c054de9ca406d9d47b84a89c6 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 20 May 2026 21:56:01 +0000 Subject: [PATCH] Regenerate client from commit 091ce83 of spec repo --- .generator/schemas/v2/openapi.yaml | 154 ++++++++++++++++++ docs/datadog_api_client.v2.api.rst | 7 + docs/datadog_api_client.v2.model.rst | 49 ++++++ .../v2/customer-org/DisableCustomerOrg.py | 29 ++++ src/datadog_api_client/configuration.py | 1 + .../v2/api/customer_org_api.py | 63 +++++++ src/datadog_api_client/v2/apis/__init__.py | 2 + .../v2/model/customer_org_disable_request.py | 40 +++++ ...customer_org_disable_request_attributes.py | 46 ++++++ .../customer_org_disable_request_data.py | 68 ++++++++ .../v2/model/customer_org_disable_response.py | 40 +++++ ...ustomer_org_disable_response_attributes.py | 33 ++++ .../customer_org_disable_response_data.py | 60 +++++++ .../v2/model/customer_org_disable_type.py | 35 ++++ src/datadog_api_client/v2/models/__init__.py | 14 ++ tests/v2/features/customer_org.feature | 23 +++ tests/v2/features/undo.json | 6 + 17 files changed, 670 insertions(+) create mode 100644 examples/v2/customer-org/DisableCustomerOrg.py create mode 100644 src/datadog_api_client/v2/api/customer_org_api.py create mode 100644 src/datadog_api_client/v2/model/customer_org_disable_request.py create mode 100644 src/datadog_api_client/v2/model/customer_org_disable_request_attributes.py create mode 100644 src/datadog_api_client/v2/model/customer_org_disable_request_data.py create mode 100644 src/datadog_api_client/v2/model/customer_org_disable_response.py create mode 100644 src/datadog_api_client/v2/model/customer_org_disable_response_attributes.py create mode 100644 src/datadog_api_client/v2/model/customer_org_disable_response_data.py create mode 100644 src/datadog_api_client/v2/model/customer_org_disable_type.py create mode 100644 tests/v2/features/customer_org.feature diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 27ad049e17..41c9788ab1 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -23190,6 +23190,91 @@ components: required: - data type: object + CustomerOrgDisableRequest: + description: Request payload for disabling the authenticated customer organization. + properties: + data: + $ref: "#/components/schemas/CustomerOrgDisableRequestData" + required: + - data + type: object + CustomerOrgDisableRequestAttributes: + description: |- + Optional attributes for a customer org disable request. When supplied, `org_id` and + `org_uuid` must match the authenticated organization or the request is rejected. + properties: + org_id: + description: |- + Numeric Datadog organization identifier. If supplied, must match the + authenticated organization. + example: 123 + format: int64 + type: integer + org_uuid: + description: |- + Datadog organization UUID. If supplied, must match the authenticated + organization. + example: "abcdef01-2345-6789-abcd-ef0123456789" + type: string + type: object + CustomerOrgDisableRequestData: + description: Data object for a customer org disable request. + properties: + attributes: + $ref: "#/components/schemas/CustomerOrgDisableRequestAttributes" + id: + description: |- + Optional client-supplied identifier for the request. Useful for client-side + correlation; the server does not use this value. + example: "1" + type: string + type: + $ref: "#/components/schemas/CustomerOrgDisableType" + required: + - type + type: object + CustomerOrgDisableResponse: + description: Response describing the outcome of disabling the customer organization. + properties: + data: + $ref: "#/components/schemas/CustomerOrgDisableResponseData" + required: + - data + type: object + CustomerOrgDisableResponseAttributes: + description: Attributes describing the outcome of the disable action on the customer organization. + properties: + status: + description: Resulting lifecycle status of the organization after the disable action. + example: "disabled" + type: string + required: + - status + type: object + CustomerOrgDisableResponseData: + description: Data object returned after disabling the customer organization. + properties: + attributes: + $ref: "#/components/schemas/CustomerOrgDisableResponseAttributes" + id: + description: Identifier of the disabled organization. + example: "abcdef01-2345-6789-abcd-ef0123456789" + type: string + type: + $ref: "#/components/schemas/CustomerOrgDisableType" + required: + - type + - id + - attributes + type: object + CustomerOrgDisableType: + description: JSON:API resource type for a customer org disable action. + enum: + - customer_org_disable + example: "customer_org_disable" + type: string + x-enum-varnames: + - CUSTOMER_ORG_DISABLE DORACustomTags: description: A list of user-defined tags. The tags must follow the `key:value` pattern. Up to 100 may be added per event. example: @@ -107238,6 +107323,71 @@ paths: operator: OR permissions: - user_app_keys + /api/v2/customer/org/disable: + post: + description: |- + Disable the Datadog organization associated with the authenticated user or API key. + The request body uses JSON:API format. If `org_id` or `org_uuid` are supplied, they + must match the authenticated org or the request is rejected. Successful calls disable + the org and return the resulting state from the downstream service. Requires the + `org_management` permission. + operationId: DisableCustomerOrg + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + org_id: 123 + org_uuid: "abcdef01-2345-6789-abcd-ef0123456789" + id: "1" + type: "customer_org_disable" + schema: + $ref: "#/components/schemas/CustomerOrgDisableRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + status: "disabled" + id: "abcdef01-2345-6789-abcd-ef0123456789" + type: "customer_org_disable" + schema: + $ref: "#/components/schemas/CustomerOrgDisableResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Disable the authenticated customer organization + tags: + - Customer Org + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards: delete: description: Delete dashboards from an existing dashboard list. @@ -158499,6 +158649,10 @@ tags: - description: |- The Containers API allows you to query container data for your organization. See the [Container Monitoring page](https://docs.datadoghq.com/containers/) for more information. name: Containers + - description: |- + Programmatic management of a customer's own Datadog organization. Use this API to perform + self-service organization lifecycle actions such as disabling the authenticated org. + name: Customer Org - description: |- Search, send, or delete events for DORA Metrics to measure and improve your software delivery performance. See the [DORA Metrics page](https://docs.datadoghq.com/dora_metrics/) for more information. diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index f97716ab7f..c41f01ad0a 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -221,6 +221,13 @@ datadog\_api\_client.v2.api.csm\_threats\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.customer\_org\_api module +----------------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.customer_org_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.dashboard\_lists\_api module -------------------------------------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index e2cb0822f5..3230d5182a 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -9384,6 +9384,55 @@ datadog\_api\_client.v2.model.custom\_ruleset\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.customer\_org\_disable\_request module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.customer_org_disable_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.customer\_org\_disable\_request\_attributes module +-------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.customer_org_disable_request_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.customer\_org\_disable\_request\_data module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.customer_org_disable_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.customer\_org\_disable\_response module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.customer_org_disable_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.customer\_org\_disable\_response\_attributes module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.customer_org_disable_response_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.customer\_org\_disable\_response\_data module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.customer_org_disable_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.customer\_org\_disable\_type module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.customer_org_disable_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.cvss module ----------------------------------------- diff --git a/examples/v2/customer-org/DisableCustomerOrg.py b/examples/v2/customer-org/DisableCustomerOrg.py new file mode 100644 index 0000000000..dc13918625 --- /dev/null +++ b/examples/v2/customer-org/DisableCustomerOrg.py @@ -0,0 +1,29 @@ +""" +Disable the authenticated customer organization returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.customer_org_api import CustomerOrgApi +from datadog_api_client.v2.model.customer_org_disable_request import CustomerOrgDisableRequest +from datadog_api_client.v2.model.customer_org_disable_request_attributes import CustomerOrgDisableRequestAttributes +from datadog_api_client.v2.model.customer_org_disable_request_data import CustomerOrgDisableRequestData +from datadog_api_client.v2.model.customer_org_disable_type import CustomerOrgDisableType + +body = CustomerOrgDisableRequest( + data=CustomerOrgDisableRequestData( + attributes=CustomerOrgDisableRequestAttributes( + org_id=123, + org_uuid="abcdef01-2345-6789-abcd-ef0123456789", + ), + id="1", + type=CustomerOrgDisableType.CUSTOMER_ORG_DISABLE, + ), +) + +configuration = Configuration() +configuration.unstable_operations["disable_customer_org"] = True +with ApiClient(configuration) as api_client: + api_instance = CustomerOrgApi(api_client) + response = api_instance.disable_customer_org(body=body) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 93b7cb8b2e..d9809cf1cf 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -410,6 +410,7 @@ def __init__( "v2.list_cost_tag_metadata": False, "v2.list_cost_tag_metadata_metrics": False, "v2.list_cost_tag_metadata_orchestrators": False, + "v2.disable_customer_org": False, "v2.create_dashboard_secure_embed": False, "v2.delete_dashboard_secure_embed": False, "v2.get_dashboard_secure_embed": False, diff --git a/src/datadog_api_client/v2/api/customer_org_api.py b/src/datadog_api_client/v2/api/customer_org_api.py new file mode 100644 index 0000000000..d9a9375352 --- /dev/null +++ b/src/datadog_api_client/v2/api/customer_org_api.py @@ -0,0 +1,63 @@ +# 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.customer_org_disable_response import CustomerOrgDisableResponse +from datadog_api_client.v2.model.customer_org_disable_request import CustomerOrgDisableRequest + + +class CustomerOrgApi: + """ + Programmatic management of a customer's own Datadog organization. Use this API to perform + self-service organization lifecycle actions such as disabling the authenticated org. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._disable_customer_org_endpoint = _Endpoint( + settings={ + "response_type": (CustomerOrgDisableResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/customer/org/disable", + "operation_id": "disable_customer_org", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (CustomerOrgDisableRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def disable_customer_org( + self, + body: CustomerOrgDisableRequest, + ) -> CustomerOrgDisableResponse: + """Disable the authenticated customer organization. + + Disable the Datadog organization associated with the authenticated user or API key. + The request body uses JSON:API format. If ``org_id`` or ``org_uuid`` are supplied, they + must match the authenticated org or the request is rejected. Successful calls disable + the org and return the resulting state from the downstream service. Requires the + ``org_management`` permission. + + :type body: CustomerOrgDisableRequest + :rtype: CustomerOrgDisableResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._disable_customer_org_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 4bec61e66e..67dc3ffeef 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -29,6 +29,7 @@ from datadog_api_client.v2.api.confluent_cloud_api import ConfluentCloudApi from datadog_api_client.v2.api.container_images_api import ContainerImagesApi from datadog_api_client.v2.api.containers_api import ContainersApi +from datadog_api_client.v2.api.customer_org_api import CustomerOrgApi from datadog_api_client.v2.api.dora_metrics_api import DORAMetricsApi from datadog_api_client.v2.api.dashboard_lists_api import DashboardListsApi from datadog_api_client.v2.api.dashboard_secure_embed_api import DashboardSecureEmbedApi @@ -144,6 +145,7 @@ "ConfluentCloudApi", "ContainerImagesApi", "ContainersApi", + "CustomerOrgApi", "DORAMetricsApi", "DashboardListsApi", "DashboardSecureEmbedApi", diff --git a/src/datadog_api_client/v2/model/customer_org_disable_request.py b/src/datadog_api_client/v2/model/customer_org_disable_request.py new file mode 100644 index 0000000000..8406349107 --- /dev/null +++ b/src/datadog_api_client/v2/model/customer_org_disable_request.py @@ -0,0 +1,40 @@ +# 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.customer_org_disable_request_data import CustomerOrgDisableRequestData + + +class CustomerOrgDisableRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.customer_org_disable_request_data import CustomerOrgDisableRequestData + + return { + "data": (CustomerOrgDisableRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: CustomerOrgDisableRequestData, **kwargs): + """ + Request payload for disabling the authenticated customer organization. + + :param data: Data object for a customer org disable request. + :type data: CustomerOrgDisableRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/customer_org_disable_request_attributes.py b/src/datadog_api_client/v2/model/customer_org_disable_request_attributes.py new file mode 100644 index 0000000000..fb5062f0aa --- /dev/null +++ b/src/datadog_api_client/v2/model/customer_org_disable_request_attributes.py @@ -0,0 +1,46 @@ +# 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 CustomerOrgDisableRequestAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "org_id": (int,), + "org_uuid": (str,), + } + + attribute_map = { + "org_id": "org_id", + "org_uuid": "org_uuid", + } + + def __init__(self_, org_id: Union[int, UnsetType] = unset, org_uuid: Union[str, UnsetType] = unset, **kwargs): + """ + Optional attributes for a customer org disable request. When supplied, ``org_id`` and + ``org_uuid`` must match the authenticated organization or the request is rejected. + + :param org_id: Numeric Datadog organization identifier. If supplied, must match the + authenticated organization. + :type org_id: int, optional + + :param org_uuid: Datadog organization UUID. If supplied, must match the authenticated + organization. + :type org_uuid: str, optional + """ + if org_id is not unset: + kwargs["org_id"] = org_id + if org_uuid is not unset: + kwargs["org_uuid"] = org_uuid + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/customer_org_disable_request_data.py b/src/datadog_api_client/v2/model/customer_org_disable_request_data.py new file mode 100644 index 0000000000..bd0669c6d2 --- /dev/null +++ b/src/datadog_api_client/v2/model/customer_org_disable_request_data.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, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.customer_org_disable_request_attributes import CustomerOrgDisableRequestAttributes + from datadog_api_client.v2.model.customer_org_disable_type import CustomerOrgDisableType + + +class CustomerOrgDisableRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.customer_org_disable_request_attributes import ( + CustomerOrgDisableRequestAttributes, + ) + from datadog_api_client.v2.model.customer_org_disable_type import CustomerOrgDisableType + + return { + "attributes": (CustomerOrgDisableRequestAttributes,), + "id": (str,), + "type": (CustomerOrgDisableType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + type: CustomerOrgDisableType, + attributes: Union[CustomerOrgDisableRequestAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Data object for a customer org disable request. + + :param attributes: Optional attributes for a customer org disable request. When supplied, ``org_id`` and + ``org_uuid`` must match the authenticated organization or the request is rejected. + :type attributes: CustomerOrgDisableRequestAttributes, optional + + :param id: Optional client-supplied identifier for the request. Useful for client-side + correlation; the server does not use this value. + :type id: str, optional + + :param type: JSON:API resource type for a customer org disable action. + :type type: CustomerOrgDisableType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/customer_org_disable_response.py b/src/datadog_api_client/v2/model/customer_org_disable_response.py new file mode 100644 index 0000000000..2b5c955381 --- /dev/null +++ b/src/datadog_api_client/v2/model/customer_org_disable_response.py @@ -0,0 +1,40 @@ +# 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.customer_org_disable_response_data import CustomerOrgDisableResponseData + + +class CustomerOrgDisableResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.customer_org_disable_response_data import CustomerOrgDisableResponseData + + return { + "data": (CustomerOrgDisableResponseData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: CustomerOrgDisableResponseData, **kwargs): + """ + Response describing the outcome of disabling the customer organization. + + :param data: Data object returned after disabling the customer organization. + :type data: CustomerOrgDisableResponseData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/customer_org_disable_response_attributes.py b/src/datadog_api_client/v2/model/customer_org_disable_response_attributes.py new file mode 100644 index 0000000000..78bc40fa9e --- /dev/null +++ b/src/datadog_api_client/v2/model/customer_org_disable_response_attributes.py @@ -0,0 +1,33 @@ +# 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 CustomerOrgDisableResponseAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "status": (str,), + } + + attribute_map = { + "status": "status", + } + + def __init__(self_, status: str, **kwargs): + """ + Attributes describing the outcome of the disable action on the customer organization. + + :param status: Resulting lifecycle status of the organization after the disable action. + :type status: str + """ + super().__init__(kwargs) + + self_.status = status diff --git a/src/datadog_api_client/v2/model/customer_org_disable_response_data.py b/src/datadog_api_client/v2/model/customer_org_disable_response_data.py new file mode 100644 index 0000000000..12ff64d295 --- /dev/null +++ b/src/datadog_api_client/v2/model/customer_org_disable_response_data.py @@ -0,0 +1,60 @@ +# 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.customer_org_disable_response_attributes import ( + CustomerOrgDisableResponseAttributes, + ) + from datadog_api_client.v2.model.customer_org_disable_type import CustomerOrgDisableType + + +class CustomerOrgDisableResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.customer_org_disable_response_attributes import ( + CustomerOrgDisableResponseAttributes, + ) + from datadog_api_client.v2.model.customer_org_disable_type import CustomerOrgDisableType + + return { + "attributes": (CustomerOrgDisableResponseAttributes,), + "id": (str,), + "type": (CustomerOrgDisableType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, attributes: CustomerOrgDisableResponseAttributes, id: str, type: CustomerOrgDisableType, **kwargs + ): + """ + Data object returned after disabling the customer organization. + + :param attributes: Attributes describing the outcome of the disable action on the customer organization. + :type attributes: CustomerOrgDisableResponseAttributes + + :param id: Identifier of the disabled organization. + :type id: str + + :param type: JSON:API resource type for a customer org disable action. + :type type: CustomerOrgDisableType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/customer_org_disable_type.py b/src/datadog_api_client/v2/model/customer_org_disable_type.py new file mode 100644 index 0000000000..70a37b30c8 --- /dev/null +++ b/src/datadog_api_client/v2/model/customer_org_disable_type.py @@ -0,0 +1,35 @@ +# 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 CustomerOrgDisableType(ModelSimple): + """ + JSON:API resource type for a customer org disable action. + + :param value: If omitted defaults to "customer_org_disable". Must be one of ["customer_org_disable"]. + :type value: str + """ + + allowed_values = { + "customer_org_disable", + } + CUSTOMER_ORG_DISABLE: ClassVar["CustomerOrgDisableType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CustomerOrgDisableType.CUSTOMER_ORG_DISABLE = CustomerOrgDisableType("customer_org_disable") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 2ec6194598..acf1a10dad 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -1827,6 +1827,13 @@ from datadog_api_client.v2.model.custom_ruleset_request_data import CustomRulesetRequestData from datadog_api_client.v2.model.custom_ruleset_request_data_attributes import CustomRulesetRequestDataAttributes from datadog_api_client.v2.model.custom_ruleset_response import CustomRulesetResponse +from datadog_api_client.v2.model.customer_org_disable_request import CustomerOrgDisableRequest +from datadog_api_client.v2.model.customer_org_disable_request_attributes import CustomerOrgDisableRequestAttributes +from datadog_api_client.v2.model.customer_org_disable_request_data import CustomerOrgDisableRequestData +from datadog_api_client.v2.model.customer_org_disable_response import CustomerOrgDisableResponse +from datadog_api_client.v2.model.customer_org_disable_response_attributes import CustomerOrgDisableResponseAttributes +from datadog_api_client.v2.model.customer_org_disable_response_data import CustomerOrgDisableResponseData +from datadog_api_client.v2.model.customer_org_disable_type import CustomerOrgDisableType from datadog_api_client.v2.model.dora_deployment_fetch_response import DORADeploymentFetchResponse from datadog_api_client.v2.model.dora_deployment_object import DORADeploymentObject from datadog_api_client.v2.model.dora_deployment_object_attributes import DORADeploymentObjectAttributes @@ -9311,6 +9318,13 @@ "CustomRulesetRequestData", "CustomRulesetRequestDataAttributes", "CustomRulesetResponse", + "CustomerOrgDisableRequest", + "CustomerOrgDisableRequestAttributes", + "CustomerOrgDisableRequestData", + "CustomerOrgDisableResponse", + "CustomerOrgDisableResponseAttributes", + "CustomerOrgDisableResponseData", + "CustomerOrgDisableType", "DORADeploymentFetchResponse", "DORADeploymentObject", "DORADeploymentObjectAttributes", diff --git a/tests/v2/features/customer_org.feature b/tests/v2/features/customer_org.feature new file mode 100644 index 0000000000..9b9b8246c5 --- /dev/null +++ b/tests/v2/features/customer_org.feature @@ -0,0 +1,23 @@ +@endpoint(customer-org) @endpoint(customer-org-v2) +Feature: Customer Org + Programmatic management of a customer's own Datadog organization. Use this + API to perform self-service organization lifecycle actions such as + disabling the authenticated org. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "CustomerOrg" API + And operation "DisableCustomerOrg" enabled + And new "DisableCustomerOrg" request + And body with value {"data": {"attributes": {"org_id": 123, "org_uuid": "abcdef01-2345-6789-abcd-ef0123456789"}, "id": "1", "type": "customer_org_disable"}} + + @generated @skip @team:DataDog/governance-tooling-and-systems + Scenario: Disable the authenticated customer organization returns "Bad Request" response + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/governance-tooling-and-systems + Scenario: Disable the authenticated customer organization returns "OK" response + When the request is sent + Then the response status is 200 OK diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 02753f1a80..4892df5438 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -1972,6 +1972,12 @@ "type": "idempotent" } }, + "DisableCustomerOrg": { + "tag": "Customer Org", + "undo": { + "type": "unsafe" + } + }, "DeleteDashboardListItems": { "tag": "Dashboard Lists", "undo": {