Skip to content

Commit f51de45

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 091ce83 of spec repo
1 parent 15d3503 commit f51de45

15 files changed

Lines changed: 1242 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23190,6 +23190,91 @@ components:
2319023190
required:
2319123191
- data
2319223192
type: object
23193+
CustomerOrgDisableRequest:
23194+
description: Request payload for disabling the authenticated customer organization.
23195+
properties:
23196+
data:
23197+
$ref: "#/components/schemas/CustomerOrgDisableRequestData"
23198+
required:
23199+
- data
23200+
type: object
23201+
CustomerOrgDisableRequestAttributes:
23202+
description: |-
23203+
Optional attributes for a customer org disable request. When supplied, `org_id` and
23204+
`org_uuid` must match the authenticated organization or the request is rejected.
23205+
properties:
23206+
org_id:
23207+
description: |-
23208+
Numeric Datadog organization identifier. If supplied, must match the
23209+
authenticated organization.
23210+
example: 123
23211+
format: int64
23212+
type: integer
23213+
org_uuid:
23214+
description: |-
23215+
Datadog organization UUID. If supplied, must match the authenticated
23216+
organization.
23217+
example: "abcdef01-2345-6789-abcd-ef0123456789"
23218+
type: string
23219+
type: object
23220+
CustomerOrgDisableRequestData:
23221+
description: Data object for a customer org disable request.
23222+
properties:
23223+
attributes:
23224+
$ref: "#/components/schemas/CustomerOrgDisableRequestAttributes"
23225+
id:
23226+
description: |-
23227+
Optional client-supplied identifier for the request. Useful for client-side
23228+
correlation; the server does not use this value.
23229+
example: "1"
23230+
type: string
23231+
type:
23232+
$ref: "#/components/schemas/CustomerOrgDisableType"
23233+
required:
23234+
- type
23235+
type: object
23236+
CustomerOrgDisableResponse:
23237+
description: Response describing the outcome of disabling the customer organization.
23238+
properties:
23239+
data:
23240+
$ref: "#/components/schemas/CustomerOrgDisableResponseData"
23241+
required:
23242+
- data
23243+
type: object
23244+
CustomerOrgDisableResponseAttributes:
23245+
description: Attributes describing the outcome of the disable action on the customer organization.
23246+
properties:
23247+
status:
23248+
description: Resulting lifecycle status of the organization after the disable action.
23249+
example: "disabled"
23250+
type: string
23251+
required:
23252+
- status
23253+
type: object
23254+
CustomerOrgDisableResponseData:
23255+
description: Data object returned after disabling the customer organization.
23256+
properties:
23257+
attributes:
23258+
$ref: "#/components/schemas/CustomerOrgDisableResponseAttributes"
23259+
id:
23260+
description: Identifier of the disabled organization.
23261+
example: "abcdef01-2345-6789-abcd-ef0123456789"
23262+
type: string
23263+
type:
23264+
$ref: "#/components/schemas/CustomerOrgDisableType"
23265+
required:
23266+
- type
23267+
- id
23268+
- attributes
23269+
type: object
23270+
CustomerOrgDisableType:
23271+
description: JSON:API resource type for a customer org disable action.
23272+
enum:
23273+
- customer_org_disable
23274+
example: "customer_org_disable"
23275+
type: string
23276+
x-enum-varnames:
23277+
- CUSTOMER_ORG_DISABLE
2319323278
DORACustomTags:
2319423279
description: A list of user-defined tags. The tags must follow the `key:value` pattern. Up to 100 may be added per event.
2319523280
example:
@@ -107238,6 +107323,71 @@ paths:
107238107323
operator: OR
107239107324
permissions:
107240107325
- user_app_keys
107326+
/api/v2/customer/org/disable:
107327+
post:
107328+
description: |-
107329+
Disable the Datadog organization associated with the authenticated user or API key.
107330+
The request body uses JSON:API format. If `org_id` or `org_uuid` are supplied, they
107331+
must match the authenticated org or the request is rejected. Successful calls disable
107332+
the org and return the resulting state from the downstream service. Requires the
107333+
`org_management` permission.
107334+
operationId: DisableCustomerOrg
107335+
requestBody:
107336+
content:
107337+
application/json:
107338+
examples:
107339+
default:
107340+
value:
107341+
data:
107342+
attributes:
107343+
org_id: 123
107344+
org_uuid: "abcdef01-2345-6789-abcd-ef0123456789"
107345+
id: "1"
107346+
type: "customer_org_disable"
107347+
schema:
107348+
$ref: "#/components/schemas/CustomerOrgDisableRequest"
107349+
required: true
107350+
responses:
107351+
"200":
107352+
content:
107353+
application/json:
107354+
examples:
107355+
default:
107356+
value:
107357+
data:
107358+
attributes:
107359+
status: "disabled"
107360+
id: "abcdef01-2345-6789-abcd-ef0123456789"
107361+
type: "customer_org_disable"
107362+
schema:
107363+
$ref: "#/components/schemas/CustomerOrgDisableResponse"
107364+
description: OK
107365+
"400":
107366+
content:
107367+
application/json:
107368+
schema:
107369+
$ref: "#/components/schemas/JSONAPIErrorResponse"
107370+
description: Bad Request
107371+
"401":
107372+
content:
107373+
application/json:
107374+
schema:
107375+
$ref: "#/components/schemas/JSONAPIErrorResponse"
107376+
description: Unauthorized
107377+
"403":
107378+
content:
107379+
application/json:
107380+
schema:
107381+
$ref: "#/components/schemas/JSONAPIErrorResponse"
107382+
description: Forbidden
107383+
"429":
107384+
$ref: "#/components/responses/TooManyRequestsResponse"
107385+
summary: Disable the authenticated customer organization
107386+
tags:
107387+
- Customer Org
107388+
x-unstable: |-
107389+
**Note**: This endpoint is in preview and is subject to change.
107390+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
107241107391
/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards:
107242107392
delete:
107243107393
description: Delete dashboards from an existing dashboard list.
@@ -158499,6 +158649,10 @@ tags:
158499158649
- description: |-
158500158650
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.
158501158651
name: Containers
158652+
- description: |-
158653+
Programmatic management of a customer's own Datadog organization. Use this API to perform
158654+
self-service organization lifecycle actions such as disabling the authenticated org.
158655+
name: Customer Org
158502158656
- description: |-
158503158657
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.
158504158658

api/datadog/configuration.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,7 @@ func NewConfiguration() *Configuration {
817817
"v2.ListCostTagMetadata": false,
818818
"v2.ListCostTagMetadataMetrics": false,
819819
"v2.ListCostTagMetadataOrchestrators": false,
820+
"v2.DisableCustomerOrg": false,
820821
"v2.CreateDashboardSecureEmbed": false,
821822
"v2.DeleteDashboardSecureEmbed": false,
822823
"v2.GetDashboardSecureEmbed": false,

api/datadogV2/api_customer_org.go

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
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+
5+
package datadogV2
6+
7+
import (
8+
_context "context"
9+
_fmt "fmt"
10+
_log "log"
11+
_nethttp "net/http"
12+
_neturl "net/url"
13+
14+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
15+
)
16+
17+
// CustomerOrgApi service type
18+
type CustomerOrgApi datadog.Service
19+
20+
// DisableCustomerOrg Disable the authenticated customer organization.
21+
// Disable the Datadog organization associated with the authenticated user or API key.
22+
// The request body uses JSON:API format. If `org_id` or `org_uuid` are supplied, they
23+
// must match the authenticated org or the request is rejected. Successful calls disable
24+
// the org and return the resulting state from the downstream service. Requires the
25+
// `org_management` permission.
26+
func (a *CustomerOrgApi) DisableCustomerOrg(ctx _context.Context, body CustomerOrgDisableRequest) (CustomerOrgDisableResponse, *_nethttp.Response, error) {
27+
var (
28+
localVarHTTPMethod = _nethttp.MethodPost
29+
localVarPostBody interface{}
30+
localVarReturnValue CustomerOrgDisableResponse
31+
)
32+
33+
operationId := "v2.DisableCustomerOrg"
34+
isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId)
35+
if !isOperationEnabled {
36+
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)}
37+
}
38+
if isOperationEnabled && a.Client.Cfg.Debug {
39+
_log.Printf("WARNING: Using unstable operation '%s'", operationId)
40+
}
41+
42+
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CustomerOrgApi.DisableCustomerOrg")
43+
if err != nil {
44+
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
45+
}
46+
47+
localVarPath := localBasePath + "/api/v2/customer/org/disable"
48+
49+
localVarHeaderParams := make(map[string]string)
50+
localVarQueryParams := _neturl.Values{}
51+
localVarFormParams := _neturl.Values{}
52+
localVarHeaderParams["Content-Type"] = "application/json"
53+
localVarHeaderParams["Accept"] = "application/json"
54+
55+
// body params
56+
localVarPostBody = &body
57+
if a.Client.Cfg.DelegatedTokenConfig != nil {
58+
err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig)
59+
if err != nil {
60+
return localVarReturnValue, nil, err
61+
}
62+
} else {
63+
datadog.SetAuthKeys(
64+
ctx,
65+
&localVarHeaderParams,
66+
[2]string{"apiKeyAuth", "DD-API-KEY"},
67+
[2]string{"appKeyAuth", "DD-APPLICATION-KEY"},
68+
)
69+
}
70+
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
71+
if err != nil {
72+
return localVarReturnValue, nil, err
73+
}
74+
75+
localVarHTTPResponse, err := a.Client.CallAPI(req)
76+
if err != nil || localVarHTTPResponse == nil {
77+
return localVarReturnValue, localVarHTTPResponse, err
78+
}
79+
80+
localVarBody, err := datadog.ReadBody(localVarHTTPResponse)
81+
if err != nil {
82+
return localVarReturnValue, localVarHTTPResponse, err
83+
}
84+
85+
if localVarHTTPResponse.StatusCode >= 300 {
86+
newErr := datadog.GenericOpenAPIError{
87+
ErrorBody: localVarBody,
88+
ErrorMessage: localVarHTTPResponse.Status,
89+
}
90+
if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 {
91+
var v JSONAPIErrorResponse
92+
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
93+
if err != nil {
94+
return localVarReturnValue, localVarHTTPResponse, newErr
95+
}
96+
newErr.ErrorModel = v
97+
return localVarReturnValue, localVarHTTPResponse, newErr
98+
}
99+
if localVarHTTPResponse.StatusCode == 429 {
100+
var v APIErrorResponse
101+
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
102+
if err != nil {
103+
return localVarReturnValue, localVarHTTPResponse, newErr
104+
}
105+
newErr.ErrorModel = v
106+
}
107+
return localVarReturnValue, localVarHTTPResponse, newErr
108+
}
109+
110+
err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
111+
if err != nil {
112+
newErr := datadog.GenericOpenAPIError{
113+
ErrorBody: localVarBody,
114+
ErrorMessage: err.Error(),
115+
}
116+
return localVarReturnValue, localVarHTTPResponse, newErr
117+
}
118+
119+
return localVarReturnValue, localVarHTTPResponse, nil
120+
}
121+
122+
// NewCustomerOrgApi Returns NewCustomerOrgApi.
123+
func NewCustomerOrgApi(client *datadog.APIClient) *CustomerOrgApi {
124+
return &CustomerOrgApi{
125+
Client: client,
126+
}
127+
}

api/datadogV2/doc.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@
301301
// - [ConfluentCloudApi.UpdateConfluentResource]
302302
// - [ContainerImagesApi.ListContainerImages]
303303
// - [ContainersApi.ListContainers]
304+
// - [CustomerOrgApi.DisableCustomerOrg]
304305
// - [DORAMetricsApi.CreateDORADeployment]
305306
// - [DORAMetricsApi.CreateDORAFailure]
306307
// - [DORAMetricsApi.CreateDORAIncident]

0 commit comments

Comments
 (0)