Skip to content

Commit 494d8a4

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 16b6798 of spec repo (#3560)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 9b48b84 commit 494d8a4

19 files changed

Lines changed: 778 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26647,6 +26647,100 @@ components:
2664726647
required:
2664826648
- data
2664926649
type: object
26650+
CustomerOrgDisableRequest:
26651+
description: Request payload for disabling the authenticated customer organization.
26652+
properties:
26653+
data:
26654+
$ref: "#/components/schemas/CustomerOrgDisableRequestData"
26655+
required:
26656+
- data
26657+
type: object
26658+
CustomerOrgDisableRequestAttributes:
26659+
description: |-
26660+
Optional attributes for a customer org disable request. When supplied, `org_uuid`
26661+
must match the authenticated organization or the request is rejected.
26662+
properties:
26663+
org_uuid:
26664+
description: |-
26665+
Datadog organization UUID. If supplied, must match the authenticated
26666+
organization.
26667+
example: "abcdef01-2345-6789-abcd-ef0123456789"
26668+
type: string
26669+
type: object
26670+
CustomerOrgDisableRequestData:
26671+
description: Data object for a customer org disable request.
26672+
properties:
26673+
attributes:
26674+
$ref: "#/components/schemas/CustomerOrgDisableRequestAttributes"
26675+
id:
26676+
description: |-
26677+
Optional client-supplied identifier for the request. Useful for client-side
26678+
correlation; the server does not use this value.
26679+
example: "1"
26680+
type: string
26681+
type:
26682+
$ref: "#/components/schemas/CustomerOrgDisableType"
26683+
required:
26684+
- type
26685+
type: object
26686+
CustomerOrgDisableResponse:
26687+
description: Response describing the outcome of disabling the customer organization.
26688+
properties:
26689+
data:
26690+
$ref: "#/components/schemas/CustomerOrgDisableResponseData"
26691+
required:
26692+
- data
26693+
type: object
26694+
CustomerOrgDisableResponseAttributes:
26695+
description: Attributes describing the outcome of the disable action on the customer organization.
26696+
properties:
26697+
status:
26698+
$ref: "#/components/schemas/CustomerOrgDisableStatus"
26699+
required:
26700+
- status
26701+
type: object
26702+
CustomerOrgDisableResponseData:
26703+
description: Data object returned after disabling the customer organization.
26704+
properties:
26705+
attributes:
26706+
$ref: "#/components/schemas/CustomerOrgDisableResponseAttributes"
26707+
id:
26708+
description: Identifier of the disabled organization.
26709+
example: "abcdef01-2345-6789-abcd-ef0123456789"
26710+
type: string
26711+
type:
26712+
$ref: "#/components/schemas/CustomerOrgDisableResponseType"
26713+
required:
26714+
- type
26715+
- id
26716+
- attributes
26717+
type: object
26718+
CustomerOrgDisableResponseType:
26719+
description: JSON:API resource type for a customer org disable response.
26720+
enum:
26721+
- org_disable
26722+
example: "org_disable"
26723+
type: string
26724+
x-enum-varnames:
26725+
- ORG_DISABLE
26726+
CustomerOrgDisableStatus:
26727+
description: Resulting lifecycle status of the organization after the disable action.
26728+
enum:
26729+
- disabled
26730+
- pending_disable
26731+
example: "disabled"
26732+
type: string
26733+
x-enum-varnames:
26734+
- DISABLED
26735+
- PENDING_DISABLE
26736+
CustomerOrgDisableType:
26737+
description: JSON:API resource type for a customer org disable request.
26738+
enum:
26739+
- customer_org_disable
26740+
example: "customer_org_disable"
26741+
type: string
26742+
x-enum-varnames:
26743+
- CUSTOMER_ORG_DISABLE
2665026744
DORACustomTags:
2665126745
description: A list of user-defined tags. The tags must follow the `key:value` pattern. Up to 100 may be added per event.
2665226746
example:
@@ -144869,6 +144963,81 @@ paths:
144869144963
permissions:
144870144964
- org_management
144871144965
- org_connections_write
144966+
/api/v2/org/disable:
144967+
post:
144968+
description: |-
144969+
Disable the Datadog organization associated with the authenticated user or API key.
144970+
The request body uses JSON:API format. If `org_uuid` is supplied, it must match
144971+
the authenticated org or the request is rejected. Successful calls disable the org
144972+
and return the resulting state from the downstream service. Requires the
144973+
`org_management` permission.
144974+
operationId: DisableCustomerOrg
144975+
requestBody:
144976+
content:
144977+
application/json:
144978+
examples:
144979+
default:
144980+
value:
144981+
data:
144982+
attributes:
144983+
org_uuid: "abcdef01-2345-6789-abcd-ef0123456789"
144984+
id: "1"
144985+
type: "customer_org_disable"
144986+
schema:
144987+
$ref: "#/components/schemas/CustomerOrgDisableRequest"
144988+
required: true
144989+
responses:
144990+
"200":
144991+
content:
144992+
application/json:
144993+
examples:
144994+
default:
144995+
value:
144996+
data:
144997+
attributes:
144998+
status: "disabled"
144999+
id: "abcdef01-2345-6789-abcd-ef0123456789"
145000+
type: "org_disable"
145001+
schema:
145002+
$ref: "#/components/schemas/CustomerOrgDisableResponse"
145003+
description: OK
145004+
"400":
145005+
content:
145006+
application/json:
145007+
schema:
145008+
$ref: "#/components/schemas/JSONAPIErrorResponse"
145009+
description: Bad Request
145010+
"401":
145011+
content:
145012+
application/json:
145013+
schema:
145014+
$ref: "#/components/schemas/JSONAPIErrorResponse"
145015+
description: Unauthorized
145016+
"403":
145017+
content:
145018+
application/json:
145019+
schema:
145020+
$ref: "#/components/schemas/JSONAPIErrorResponse"
145021+
description: Forbidden
145022+
"429":
145023+
$ref: "#/components/responses/TooManyRequestsResponse"
145024+
"500":
145025+
content:
145026+
application/json:
145027+
schema:
145028+
$ref: "#/components/schemas/JSONAPIErrorResponse"
145029+
description: Internal Server Error
145030+
security:
145031+
- apiKeyAuth: []
145032+
appKeyAuth: []
145033+
- AuthZ:
145034+
- org_management
145035+
summary: Disable the authenticated customer organization
145036+
tags:
145037+
- Customer Org
145038+
x-unstable: |-
145039+
**Note**: This endpoint is in preview and is subject to change.
145040+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
144872145041
/api/v2/org_configs:
144873145042
get:
144874145043
description: Returns all Org Configs (name, description, and value).
@@ -178361,6 +178530,10 @@ tags:
178361178530
- description: |-
178362178531
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.
178363178532
name: Containers
178533+
- description: |-
178534+
Programmatic management of a customer's Datadog organization. Use this API to perform
178535+
self-service organization lifecycle actions such as disabling the authenticated org.
178536+
name: Customer Org
178364178537
- description: |-
178365178538
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.
178366178539

docs/datadog_api_client.v2.api.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,13 @@ datadog\_api\_client.v2.api.csm\_threats\_api module
235235
:members:
236236
:show-inheritance:
237237

238+
datadog\_api\_client.v2.api.customer\_org\_api module
239+
-----------------------------------------------------
240+
241+
.. automodule:: datadog_api_client.v2.api.customer_org_api
242+
:members:
243+
:show-inheritance:
244+
238245
datadog\_api\_client.v2.api.dashboard\_lists\_api module
239246
--------------------------------------------------------
240247

docs/datadog_api_client.v2.model.rst

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10469,6 +10469,69 @@ datadog\_api\_client.v2.model.custom\_ruleset\_response module
1046910469
:members:
1047010470
:show-inheritance:
1047110471

10472+
datadog\_api\_client.v2.model.customer\_org\_disable\_request module
10473+
--------------------------------------------------------------------
10474+
10475+
.. automodule:: datadog_api_client.v2.model.customer_org_disable_request
10476+
:members:
10477+
:show-inheritance:
10478+
10479+
datadog\_api\_client.v2.model.customer\_org\_disable\_request\_attributes module
10480+
--------------------------------------------------------------------------------
10481+
10482+
.. automodule:: datadog_api_client.v2.model.customer_org_disable_request_attributes
10483+
:members:
10484+
:show-inheritance:
10485+
10486+
datadog\_api\_client.v2.model.customer\_org\_disable\_request\_data module
10487+
--------------------------------------------------------------------------
10488+
10489+
.. automodule:: datadog_api_client.v2.model.customer_org_disable_request_data
10490+
:members:
10491+
:show-inheritance:
10492+
10493+
datadog\_api\_client.v2.model.customer\_org\_disable\_response module
10494+
---------------------------------------------------------------------
10495+
10496+
.. automodule:: datadog_api_client.v2.model.customer_org_disable_response
10497+
:members:
10498+
:show-inheritance:
10499+
10500+
datadog\_api\_client.v2.model.customer\_org\_disable\_response\_attributes module
10501+
---------------------------------------------------------------------------------
10502+
10503+
.. automodule:: datadog_api_client.v2.model.customer_org_disable_response_attributes
10504+
:members:
10505+
:show-inheritance:
10506+
10507+
datadog\_api\_client.v2.model.customer\_org\_disable\_response\_data module
10508+
---------------------------------------------------------------------------
10509+
10510+
.. automodule:: datadog_api_client.v2.model.customer_org_disable_response_data
10511+
:members:
10512+
:show-inheritance:
10513+
10514+
datadog\_api\_client.v2.model.customer\_org\_disable\_response\_type module
10515+
---------------------------------------------------------------------------
10516+
10517+
.. automodule:: datadog_api_client.v2.model.customer_org_disable_response_type
10518+
:members:
10519+
:show-inheritance:
10520+
10521+
datadog\_api\_client.v2.model.customer\_org\_disable\_status module
10522+
-------------------------------------------------------------------
10523+
10524+
.. automodule:: datadog_api_client.v2.model.customer_org_disable_status
10525+
:members:
10526+
:show-inheritance:
10527+
10528+
datadog\_api\_client.v2.model.customer\_org\_disable\_type module
10529+
-----------------------------------------------------------------
10530+
10531+
.. automodule:: datadog_api_client.v2.model.customer_org_disable_type
10532+
:members:
10533+
:show-inheritance:
10534+
1047210535
datadog\_api\_client.v2.model.cvss module
1047310536
-----------------------------------------
1047410537

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"""
2+
Disable the authenticated customer organization returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.customer_org_api import CustomerOrgApi
7+
from datadog_api_client.v2.model.customer_org_disable_request import CustomerOrgDisableRequest
8+
from datadog_api_client.v2.model.customer_org_disable_request_attributes import CustomerOrgDisableRequestAttributes
9+
from datadog_api_client.v2.model.customer_org_disable_request_data import CustomerOrgDisableRequestData
10+
from datadog_api_client.v2.model.customer_org_disable_type import CustomerOrgDisableType
11+
12+
body = CustomerOrgDisableRequest(
13+
data=CustomerOrgDisableRequestData(
14+
attributes=CustomerOrgDisableRequestAttributes(
15+
org_uuid="abcdef01-2345-6789-abcd-ef0123456789",
16+
),
17+
id="1",
18+
type=CustomerOrgDisableType.CUSTOMER_ORG_DISABLE,
19+
),
20+
)
21+
22+
configuration = Configuration()
23+
configuration.unstable_operations["disable_customer_org"] = True
24+
with ApiClient(configuration) as api_client:
25+
api_instance = CustomerOrgApi(api_client)
26+
response = api_instance.disable_customer_org(body=body)
27+
28+
print(response)

src/datadog_api_client/configuration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,7 @@ def __init__(
598598
"v2.get_scopes_restriction": False,
599599
"v2.register_o_auth_client": False,
600600
"v2.upsert_scopes_restriction": False,
601+
"v2.disable_customer_org": False,
601602
"v2.bulk_update_org_group_memberships": False,
602603
"v2.create_org_group": False,
603604
"v2.create_org_group_policy": False,
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import Any, Dict
7+
8+
from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint
9+
from datadog_api_client.configuration import Configuration
10+
from datadog_api_client.v2.model.customer_org_disable_response import CustomerOrgDisableResponse
11+
from datadog_api_client.v2.model.customer_org_disable_request import CustomerOrgDisableRequest
12+
13+
14+
class CustomerOrgApi:
15+
"""
16+
Programmatic management of a customer's Datadog organization. Use this API to perform
17+
self-service organization lifecycle actions such as disabling the authenticated org.
18+
"""
19+
20+
def __init__(self, api_client=None):
21+
if api_client is None:
22+
api_client = ApiClient(Configuration())
23+
self.api_client = api_client
24+
25+
self._disable_customer_org_endpoint = _Endpoint(
26+
settings={
27+
"response_type": (CustomerOrgDisableResponse,),
28+
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
29+
"endpoint_path": "/api/v2/org/disable",
30+
"operation_id": "disable_customer_org",
31+
"http_method": "POST",
32+
"version": "v2",
33+
},
34+
params_map={
35+
"body": {
36+
"required": True,
37+
"openapi_types": (CustomerOrgDisableRequest,),
38+
"location": "body",
39+
},
40+
},
41+
headers_map={"accept": ["application/json"], "content_type": ["application/json"]},
42+
api_client=api_client,
43+
)
44+
45+
def disable_customer_org(
46+
self,
47+
body: CustomerOrgDisableRequest,
48+
) -> CustomerOrgDisableResponse:
49+
"""Disable the authenticated customer organization.
50+
51+
Disable the Datadog organization associated with the authenticated user or API key.
52+
The request body uses JSON:API format. If ``org_uuid`` is supplied, it must match
53+
the authenticated org or the request is rejected. Successful calls disable the org
54+
and return the resulting state from the downstream service. Requires the
55+
``org_management`` permission.
56+
57+
:type body: CustomerOrgDisableRequest
58+
:rtype: CustomerOrgDisableResponse
59+
"""
60+
kwargs: Dict[str, Any] = {}
61+
kwargs["body"] = body
62+
63+
return self._disable_customer_org_endpoint.call_with_http_info(**kwargs)

src/datadog_api_client/v2/apis/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
from datadog_api_client.v2.api.confluent_cloud_api import ConfluentCloudApi
3232
from datadog_api_client.v2.api.container_images_api import ContainerImagesApi
3333
from datadog_api_client.v2.api.containers_api import ContainersApi
34+
from datadog_api_client.v2.api.customer_org_api import CustomerOrgApi
3435
from datadog_api_client.v2.api.dora_metrics_api import DORAMetricsApi
3536
from datadog_api_client.v2.api.dashboard_lists_api import DashboardListsApi
3637
from datadog_api_client.v2.api.dashboard_secure_embed_api import DashboardSecureEmbedApi
@@ -156,6 +157,7 @@
156157
"ConfluentCloudApi",
157158
"ContainerImagesApi",
158159
"ContainersApi",
160+
"CustomerOrgApi",
159161
"DORAMetricsApi",
160162
"DashboardListsApi",
161163
"DashboardSecureEmbedApi",

0 commit comments

Comments
 (0)