Skip to content

Commit 953e2b2

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add OpenAPI spec for v2 customer org disable endpoint (#1632)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 260e9b3 commit 953e2b2

19 files changed

Lines changed: 1371 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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Disable the authenticated customer organization returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_customer_org::CustomerOrgAPI;
4+
use datadog_api_client::datadogV2::model::CustomerOrgDisableRequest;
5+
use datadog_api_client::datadogV2::model::CustomerOrgDisableRequestAttributes;
6+
use datadog_api_client::datadogV2::model::CustomerOrgDisableRequestData;
7+
use datadog_api_client::datadogV2::model::CustomerOrgDisableType;
8+
9+
#[tokio::main]
10+
async fn main() {
11+
let body = CustomerOrgDisableRequest::new(
12+
CustomerOrgDisableRequestData::new(CustomerOrgDisableType::CUSTOMER_ORG_DISABLE)
13+
.attributes(
14+
CustomerOrgDisableRequestAttributes::new()
15+
.org_uuid("abcdef01-2345-6789-abcd-ef0123456789".to_string()),
16+
)
17+
.id("1".to_string()),
18+
);
19+
let mut configuration = datadog::Configuration::new();
20+
configuration.set_unstable_operation_enabled("v2.DisableCustomerOrg", true);
21+
let api = CustomerOrgAPI::with_config(configuration);
22+
let resp = api.disable_customer_org(body).await;
23+
if let Ok(value) = resp {
24+
println!("{:#?}", value);
25+
} else {
26+
println!("{:#?}", resp.unwrap_err());
27+
}
28+
}

src/datadog/configuration.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,7 @@ impl Default for Configuration {
560560
("v2.get_scopes_restriction".to_owned(), false),
561561
("v2.register_o_auth_client".to_owned(), false),
562562
("v2.upsert_scopes_restriction".to_owned(), false),
563+
("v2.disable_customer_org".to_owned(), false),
563564
("v2.bulk_update_org_group_memberships".to_owned(), false),
564565
("v2.create_org_group".to_owned(), false),
565566
("v2.create_org_group_policy".to_owned(), false),

0 commit comments

Comments
 (0)