Skip to content

Commit 7e443d6

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 16b6798 of spec repo (#4124)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 31ebd91 commit 7e443d6

17 files changed

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

api/datadog/configuration.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,7 @@ func NewConfiguration() *Configuration {
10051005
"v2.GetScopesRestriction": false,
10061006
"v2.RegisterOAuthClient": false,
10071007
"v2.UpsertScopesRestriction": false,
1008+
"v2.DisableCustomerOrg": false,
10081009
"v2.BulkUpdateOrgGroupMemberships": false,
10091010
"v2.CreateOrgGroup": false,
10101011
"v2.CreateOrgGroupPolicy": 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_uuid` is supplied, it must match
23+
// the authenticated org or the request is rejected. Successful calls disable the org
24+
// 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/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 || localVarHTTPResponse.StatusCode == 500 {
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
@@ -324,6 +324,7 @@
324324
// - [ConfluentCloudApi.UpdateConfluentResource]
325325
// - [ContainerImagesApi.ListContainerImages]
326326
// - [ContainersApi.ListContainers]
327+
// - [CustomerOrgApi.DisableCustomerOrg]
327328
// - [DORAMetricsApi.CreateDORADeployment]
328329
// - [DORAMetricsApi.CreateDORAFailure]
329330
// - [DORAMetricsApi.CreateDORAIncident]

0 commit comments

Comments
 (0)