Skip to content

Commit 8cc4c59

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 16b6798 of spec repo (DataDog#3366)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent f7ade66 commit 8cc4c59

17 files changed

Lines changed: 1202 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: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Disable the authenticated customer organization returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.disable_customer_org".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::CustomerOrgAPI.new
8+
9+
body = DatadogAPIClient::V2::CustomerOrgDisableRequest.new({
10+
data: DatadogAPIClient::V2::CustomerOrgDisableRequestData.new({
11+
attributes: DatadogAPIClient::V2::CustomerOrgDisableRequestAttributes.new({
12+
org_uuid: "abcdef01-2345-6789-abcd-ef0123456789",
13+
}),
14+
id: "1",
15+
type: DatadogAPIClient::V2::CustomerOrgDisableType::CUSTOMER_ORG_DISABLE,
16+
}),
17+
})
18+
p api_instance.disable_customer_org(body)

features/scenarios_model_mapping.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4177,6 +4177,9 @@
41774177
"v2.UploadIdPMetadata" => {
41784178
"idp_file" => "File",
41794179
},
4180+
"v2.DisableCustomerOrg" => {
4181+
"body" => "CustomerOrgDisableRequest",
4182+
},
41804183
"v2.ListOrgConnections" => {
41814184
"sink_org_id" => "String",
41824185
"source_org_id" => "String",

features/v2/customer_org.feature

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@endpoint(customer-org) @endpoint(customer-org-v2)
2+
Feature: Customer Org
3+
Programmatic management of a customer's Datadog organization. Use this API
4+
to perform self-service organization lifecycle actions such as disabling
5+
the authenticated org.
6+
7+
Background:
8+
Given a valid "apiKeyAuth" key in the system
9+
And a valid "appKeyAuth" key in the system
10+
And an instance of "CustomerOrg" API
11+
And operation "DisableCustomerOrg" enabled
12+
And new "DisableCustomerOrg" request
13+
And body with value {"data": {"attributes": {"org_uuid": "abcdef01-2345-6789-abcd-ef0123456789"}, "id": "1", "type": "customer_org_disable"}}
14+
15+
@generated @skip @team:DataDog/org-management
16+
Scenario: Disable the authenticated customer organization returns "Bad Request" response
17+
When the request is sent
18+
Then the response status is 400 Bad Request
19+
20+
@generated @skip @team:DataDog/org-management
21+
Scenario: Disable the authenticated customer organization returns "OK" response
22+
When the request is sent
23+
Then the response status is 200 OK

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5202,6 +5202,12 @@
52025202
"type": "safe"
52035203
}
52045204
},
5205+
"DisableCustomerOrg": {
5206+
"tag": "Customer Org",
5207+
"undo": {
5208+
"type": "unsafe"
5209+
}
5210+
},
52055211
"ListOrgConfigs": {
52065212
"tag": "Organizations",
52075213
"undo": {

lib/datadog_api_client/configuration.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,7 @@ def initialize
540540
"v2.get_scopes_restriction": false,
541541
"v2.register_o_auth_client": false,
542542
"v2.upsert_scopes_restriction": false,
543+
"v2.disable_customer_org": false,
543544
"v2.bulk_update_org_group_memberships": false,
544545
"v2.create_org_group": false,
545546
"v2.create_org_group_policy": false,

lib/datadog_api_client/inflector.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2582,6 +2582,15 @@ def overrides
25822582
"v2.custom_destination_update_request" => "CustomDestinationUpdateRequest",
25832583
"v2.custom_destination_update_request_attributes" => "CustomDestinationUpdateRequestAttributes",
25842584
"v2.custom_destination_update_request_definition" => "CustomDestinationUpdateRequestDefinition",
2585+
"v2.customer_org_disable_request" => "CustomerOrgDisableRequest",
2586+
"v2.customer_org_disable_request_attributes" => "CustomerOrgDisableRequestAttributes",
2587+
"v2.customer_org_disable_request_data" => "CustomerOrgDisableRequestData",
2588+
"v2.customer_org_disable_response" => "CustomerOrgDisableResponse",
2589+
"v2.customer_org_disable_response_attributes" => "CustomerOrgDisableResponseAttributes",
2590+
"v2.customer_org_disable_response_data" => "CustomerOrgDisableResponseData",
2591+
"v2.customer_org_disable_response_type" => "CustomerOrgDisableResponseType",
2592+
"v2.customer_org_disable_status" => "CustomerOrgDisableStatus",
2593+
"v2.customer_org_disable_type" => "CustomerOrgDisableType",
25852594
"v2.custom_framework_control" => "CustomFrameworkControl",
25862595
"v2.custom_framework_data" => "CustomFrameworkData",
25872596
"v2.custom_framework_data_attributes" => "CustomFrameworkDataAttributes",
@@ -7390,6 +7399,7 @@ def overrides
73907399
"v2.csm_agents_api" => "CSMAgentsAPI",
73917400
"v2.csm_coverage_analysis_api" => "CSMCoverageAnalysisAPI",
73927401
"v2.csm_threats_api" => "CSMThreatsAPI",
7402+
"v2.customer_org_api" => "CustomerOrgAPI",
73937403
"v2.dashboard_lists_api" => "DashboardListsAPI",
73947404
"v2.dashboard_secure_embed_api" => "DashboardSecureEmbedAPI",
73957405
"v2.dashboards_api" => "DashboardsAPI",
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
=begin
2+
#Datadog API V2 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
Contact: support@datadoghq.com
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'cgi'
17+
18+
module DatadogAPIClient::V2
19+
class CustomerOrgAPI
20+
attr_accessor :api_client
21+
22+
def initialize(api_client = DatadogAPIClient::APIClient.default)
23+
@api_client = api_client
24+
end
25+
26+
# Disable the authenticated customer organization.
27+
#
28+
# @see #disable_customer_org_with_http_info
29+
def disable_customer_org(body, opts = {})
30+
data, _status_code, _headers = disable_customer_org_with_http_info(body, opts)
31+
data
32+
end
33+
34+
# Disable the authenticated customer organization.
35+
#
36+
# Disable the Datadog organization associated with the authenticated user or API key.
37+
# The request body uses JSON:API format. If `org_uuid` is supplied, it must match
38+
# the authenticated org or the request is rejected. Successful calls disable the org
39+
# and return the resulting state from the downstream service. Requires the
40+
# `org_management` permission.
41+
#
42+
# @param body [CustomerOrgDisableRequest]
43+
# @param opts [Hash] the optional parameters
44+
# @return [Array<(CustomerOrgDisableResponse, Integer, Hash)>] CustomerOrgDisableResponse data, response status code and response headers
45+
def disable_customer_org_with_http_info(body, opts = {})
46+
unstable_enabled = @api_client.config.unstable_operations["v2.disable_customer_org".to_sym]
47+
if unstable_enabled
48+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.disable_customer_org")
49+
else
50+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.disable_customer_org"))
51+
end
52+
53+
if @api_client.config.debugging
54+
@api_client.config.logger.debug 'Calling API: CustomerOrgAPI.disable_customer_org ...'
55+
end
56+
# verify the required parameter 'body' is set
57+
if @api_client.config.client_side_validation && body.nil?
58+
fail ArgumentError, "Missing the required parameter 'body' when calling CustomerOrgAPI.disable_customer_org"
59+
end
60+
# resource path
61+
local_var_path = '/api/v2/org/disable'
62+
63+
# query parameters
64+
query_params = opts[:query_params] || {}
65+
66+
# header parameters
67+
header_params = opts[:header_params] || {}
68+
# HTTP header 'Accept' (if needed)
69+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
70+
# HTTP header 'Content-Type'
71+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
72+
73+
# form parameters
74+
form_params = opts[:form_params] || {}
75+
76+
# http body (model)
77+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
78+
79+
# return_type
80+
return_type = opts[:debug_return_type] || 'CustomerOrgDisableResponse'
81+
82+
# auth_names
83+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
84+
85+
new_options = opts.merge(
86+
:operation => :disable_customer_org,
87+
:header_params => header_params,
88+
:query_params => query_params,
89+
:form_params => form_params,
90+
:body => post_body,
91+
:auth_names => auth_names,
92+
:return_type => return_type,
93+
:api_version => "V2"
94+
)
95+
96+
data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
97+
if @api_client.config.debugging
98+
@api_client.config.logger.debug "API called: CustomerOrgAPI#disable_customer_org\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
99+
end
100+
return data, status_code, headers
101+
end
102+
end
103+
end

0 commit comments

Comments
 (0)