From f94af233924b9eaccf83715e4e6790875c1855f9 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 20 May 2026 21:55:42 +0000 Subject: [PATCH] Regenerate client from commit 091ce83 of spec repo --- .generator/schemas/v2/openapi.yaml | 154 ++++++++++++++++ .../v2/customer-org/DisableCustomerOrg.rb | 19 ++ features/scenarios_model_mapping.rb | 3 + features/v2/customer_org.feature | 23 +++ features/v2/undo.json | 6 + lib/datadog_api_client/configuration.rb | 1 + lib/datadog_api_client/inflector.rb | 8 + .../v2/api/customer_org_api.rb | 103 +++++++++++ .../v2/models/customer_org_disable_request.rb | 123 +++++++++++++ ...customer_org_disable_request_attributes.rb | 118 +++++++++++++ .../customer_org_disable_request_data.rb | 145 +++++++++++++++ .../models/customer_org_disable_response.rb | 123 +++++++++++++ ...ustomer_org_disable_response_attributes.rb | 123 +++++++++++++ .../customer_org_disable_response_data.rb | 165 ++++++++++++++++++ .../v2/models/customer_org_disable_type.rb | 26 +++ 15 files changed, 1140 insertions(+) create mode 100644 examples/v2/customer-org/DisableCustomerOrg.rb create mode 100644 features/v2/customer_org.feature create mode 100644 lib/datadog_api_client/v2/api/customer_org_api.rb create mode 100644 lib/datadog_api_client/v2/models/customer_org_disable_request.rb create mode 100644 lib/datadog_api_client/v2/models/customer_org_disable_request_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/customer_org_disable_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/customer_org_disable_response.rb create mode 100644 lib/datadog_api_client/v2/models/customer_org_disable_response_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/customer_org_disable_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/customer_org_disable_type.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 27ad049e17c7..41c9788ab1d1 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -23190,6 +23190,91 @@ components: required: - data type: object + CustomerOrgDisableRequest: + description: Request payload for disabling the authenticated customer organization. + properties: + data: + $ref: "#/components/schemas/CustomerOrgDisableRequestData" + required: + - data + type: object + CustomerOrgDisableRequestAttributes: + description: |- + Optional attributes for a customer org disable request. When supplied, `org_id` and + `org_uuid` must match the authenticated organization or the request is rejected. + properties: + org_id: + description: |- + Numeric Datadog organization identifier. If supplied, must match the + authenticated organization. + example: 123 + format: int64 + type: integer + org_uuid: + description: |- + Datadog organization UUID. If supplied, must match the authenticated + organization. + example: "abcdef01-2345-6789-abcd-ef0123456789" + type: string + type: object + CustomerOrgDisableRequestData: + description: Data object for a customer org disable request. + properties: + attributes: + $ref: "#/components/schemas/CustomerOrgDisableRequestAttributes" + id: + description: |- + Optional client-supplied identifier for the request. Useful for client-side + correlation; the server does not use this value. + example: "1" + type: string + type: + $ref: "#/components/schemas/CustomerOrgDisableType" + required: + - type + type: object + CustomerOrgDisableResponse: + description: Response describing the outcome of disabling the customer organization. + properties: + data: + $ref: "#/components/schemas/CustomerOrgDisableResponseData" + required: + - data + type: object + CustomerOrgDisableResponseAttributes: + description: Attributes describing the outcome of the disable action on the customer organization. + properties: + status: + description: Resulting lifecycle status of the organization after the disable action. + example: "disabled" + type: string + required: + - status + type: object + CustomerOrgDisableResponseData: + description: Data object returned after disabling the customer organization. + properties: + attributes: + $ref: "#/components/schemas/CustomerOrgDisableResponseAttributes" + id: + description: Identifier of the disabled organization. + example: "abcdef01-2345-6789-abcd-ef0123456789" + type: string + type: + $ref: "#/components/schemas/CustomerOrgDisableType" + required: + - type + - id + - attributes + type: object + CustomerOrgDisableType: + description: JSON:API resource type for a customer org disable action. + enum: + - customer_org_disable + example: "customer_org_disable" + type: string + x-enum-varnames: + - CUSTOMER_ORG_DISABLE DORACustomTags: description: A list of user-defined tags. The tags must follow the `key:value` pattern. Up to 100 may be added per event. example: @@ -107238,6 +107323,71 @@ paths: operator: OR permissions: - user_app_keys + /api/v2/customer/org/disable: + post: + description: |- + Disable the Datadog organization associated with the authenticated user or API key. + The request body uses JSON:API format. If `org_id` or `org_uuid` are supplied, they + must match the authenticated org or the request is rejected. Successful calls disable + the org and return the resulting state from the downstream service. Requires the + `org_management` permission. + operationId: DisableCustomerOrg + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + org_id: 123 + org_uuid: "abcdef01-2345-6789-abcd-ef0123456789" + id: "1" + type: "customer_org_disable" + schema: + $ref: "#/components/schemas/CustomerOrgDisableRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + status: "disabled" + id: "abcdef01-2345-6789-abcd-ef0123456789" + type: "customer_org_disable" + schema: + $ref: "#/components/schemas/CustomerOrgDisableResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Disable the authenticated customer organization + tags: + - Customer Org + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards: delete: description: Delete dashboards from an existing dashboard list. @@ -158499,6 +158649,10 @@ tags: - description: |- 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. name: Containers + - description: |- + Programmatic management of a customer's own Datadog organization. Use this API to perform + self-service organization lifecycle actions such as disabling the authenticated org. + name: Customer Org - description: |- 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. diff --git a/examples/v2/customer-org/DisableCustomerOrg.rb b/examples/v2/customer-org/DisableCustomerOrg.rb new file mode 100644 index 000000000000..dbe04abcab2c --- /dev/null +++ b/examples/v2/customer-org/DisableCustomerOrg.rb @@ -0,0 +1,19 @@ +# Disable the authenticated customer organization returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.disable_customer_org".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CustomerOrgAPI.new + +body = DatadogAPIClient::V2::CustomerOrgDisableRequest.new({ + data: DatadogAPIClient::V2::CustomerOrgDisableRequestData.new({ + attributes: DatadogAPIClient::V2::CustomerOrgDisableRequestAttributes.new({ + org_id: 123, + org_uuid: "abcdef01-2345-6789-abcd-ef0123456789", + }), + id: "1", + type: DatadogAPIClient::V2::CustomerOrgDisableType::CUSTOMER_ORG_DISABLE, + }), +}) +p api_instance.disable_customer_org(body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 9246b6c3a9d0..4e7772ce6cd7 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2599,6 +2599,9 @@ "query" => "String", "order_direction" => "OrderDirection", }, + "v2.DisableCustomerOrg" => { + "body" => "CustomerOrgDisableRequest", + }, "v2.DeleteDashboardListItems" => { "dashboard_list_id" => "Integer", "body" => "DashboardListDeleteItemsRequest", diff --git a/features/v2/customer_org.feature b/features/v2/customer_org.feature new file mode 100644 index 000000000000..9b9b8246c5cb --- /dev/null +++ b/features/v2/customer_org.feature @@ -0,0 +1,23 @@ +@endpoint(customer-org) @endpoint(customer-org-v2) +Feature: Customer Org + Programmatic management of a customer's own Datadog organization. Use this + API to perform self-service organization lifecycle actions such as + disabling the authenticated org. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "CustomerOrg" API + And operation "DisableCustomerOrg" enabled + And new "DisableCustomerOrg" request + And body with value {"data": {"attributes": {"org_id": 123, "org_uuid": "abcdef01-2345-6789-abcd-ef0123456789"}, "id": "1", "type": "customer_org_disable"}} + + @generated @skip @team:DataDog/governance-tooling-and-systems + Scenario: Disable the authenticated customer organization returns "Bad Request" response + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/governance-tooling-and-systems + Scenario: Disable the authenticated customer organization returns "OK" response + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index 02753f1a80a7..4892df5438aa 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1972,6 +1972,12 @@ "type": "idempotent" } }, + "DisableCustomerOrg": { + "tag": "Customer Org", + "undo": { + "type": "unsafe" + } + }, "DeleteDashboardListItems": { "tag": "Dashboard Lists", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 0cac7943cea0..10a2cf4f5433 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -352,6 +352,7 @@ def initialize "v2.list_cost_tag_metadata": false, "v2.list_cost_tag_metadata_metrics": false, "v2.list_cost_tag_metadata_orchestrators": false, + "v2.disable_customer_org": false, "v2.create_dashboard_secure_embed": false, "v2.delete_dashboard_secure_embed": false, "v2.get_dashboard_secure_embed": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 9e8451285fa8..6cab7da00f87 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2412,6 +2412,13 @@ def overrides "v2.custom_destination_update_request" => "CustomDestinationUpdateRequest", "v2.custom_destination_update_request_attributes" => "CustomDestinationUpdateRequestAttributes", "v2.custom_destination_update_request_definition" => "CustomDestinationUpdateRequestDefinition", + "v2.customer_org_disable_request" => "CustomerOrgDisableRequest", + "v2.customer_org_disable_request_attributes" => "CustomerOrgDisableRequestAttributes", + "v2.customer_org_disable_request_data" => "CustomerOrgDisableRequestData", + "v2.customer_org_disable_response" => "CustomerOrgDisableResponse", + "v2.customer_org_disable_response_attributes" => "CustomerOrgDisableResponseAttributes", + "v2.customer_org_disable_response_data" => "CustomerOrgDisableResponseData", + "v2.customer_org_disable_type" => "CustomerOrgDisableType", "v2.custom_framework_control" => "CustomFrameworkControl", "v2.custom_framework_data" => "CustomFrameworkData", "v2.custom_framework_data_attributes" => "CustomFrameworkDataAttributes", @@ -6794,6 +6801,7 @@ def overrides "v2.csm_agents_api" => "CSMAgentsAPI", "v2.csm_coverage_analysis_api" => "CSMCoverageAnalysisAPI", "v2.csm_threats_api" => "CSMThreatsAPI", + "v2.customer_org_api" => "CustomerOrgAPI", "v2.dashboard_lists_api" => "DashboardListsAPI", "v2.dashboard_secure_embed_api" => "DashboardSecureEmbedAPI", "v2.dashboards_api" => "DashboardsAPI", diff --git a/lib/datadog_api_client/v2/api/customer_org_api.rb b/lib/datadog_api_client/v2/api/customer_org_api.rb new file mode 100644 index 000000000000..d5725b028c79 --- /dev/null +++ b/lib/datadog_api_client/v2/api/customer_org_api.rb @@ -0,0 +1,103 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'cgi' + +module DatadogAPIClient::V2 + class CustomerOrgAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Disable the authenticated customer organization. + # + # @see #disable_customer_org_with_http_info + def disable_customer_org(body, opts = {}) + data, _status_code, _headers = disable_customer_org_with_http_info(body, opts) + data + end + + # Disable the authenticated customer organization. + # + # Disable the Datadog organization associated with the authenticated user or API key. + # The request body uses JSON:API format. If `org_id` or `org_uuid` are supplied, they + # must match the authenticated org or the request is rejected. Successful calls disable + # the org and return the resulting state from the downstream service. Requires the + # `org_management` permission. + # + # @param body [CustomerOrgDisableRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(CustomerOrgDisableResponse, Integer, Hash)>] CustomerOrgDisableResponse data, response status code and response headers + def disable_customer_org_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.disable_customer_org".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.disable_customer_org") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.disable_customer_org")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CustomerOrgAPI.disable_customer_org ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CustomerOrgAPI.disable_customer_org" + end + # resource path + local_var_path = '/api/v2/customer/org/disable' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'CustomerOrgDisableResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :disable_customer_org, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CustomerOrgAPI#disable_customer_org\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/models/customer_org_disable_request.rb b/lib/datadog_api_client/v2/models/customer_org_disable_request.rb new file mode 100644 index 000000000000..d34e53cb35d1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/customer_org_disable_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request payload for disabling the authenticated customer organization. + class CustomerOrgDisableRequest + include BaseGenericModel + + # Data object for a customer org disable request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'CustomerOrgDisableRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CustomerOrgDisableRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/customer_org_disable_request_attributes.rb b/lib/datadog_api_client/v2/models/customer_org_disable_request_attributes.rb new file mode 100644 index 000000000000..a11ebbb733d3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/customer_org_disable_request_attributes.rb @@ -0,0 +1,118 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Optional attributes for a customer org disable request. When supplied, `org_id` and + # `org_uuid` must match the authenticated organization or the request is rejected. + class CustomerOrgDisableRequestAttributes + include BaseGenericModel + + # Numeric Datadog organization identifier. If supplied, must match the + # authenticated organization. + attr_accessor :org_id + + # Datadog organization UUID. If supplied, must match the authenticated + # organization. + attr_accessor :org_uuid + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'org_id' => :'org_id', + :'org_uuid' => :'org_uuid' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'org_id' => :'Integer', + :'org_uuid' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CustomerOrgDisableRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'org_id') + self.org_id = attributes[:'org_id'] + end + + if attributes.key?(:'org_uuid') + self.org_uuid = attributes[:'org_uuid'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + org_id == o.org_id && + org_uuid == o.org_uuid && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [org_id, org_uuid, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/customer_org_disable_request_data.rb b/lib/datadog_api_client/v2/models/customer_org_disable_request_data.rb new file mode 100644 index 000000000000..093cafa90336 --- /dev/null +++ b/lib/datadog_api_client/v2/models/customer_org_disable_request_data.rb @@ -0,0 +1,145 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for a customer org disable request. + class CustomerOrgDisableRequestData + include BaseGenericModel + + # Optional attributes for a customer org disable request. When supplied, `org_id` and + # `org_uuid` must match the authenticated organization or the request is rejected. + attr_accessor :attributes + + # Optional client-supplied identifier for the request. Useful for client-side + # correlation; the server does not use this value. + attr_accessor :id + + # JSON:API resource type for a customer org disable action. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'CustomerOrgDisableRequestAttributes', + :'id' => :'String', + :'type' => :'CustomerOrgDisableType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CustomerOrgDisableRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/customer_org_disable_response.rb b/lib/datadog_api_client/v2/models/customer_org_disable_response.rb new file mode 100644 index 000000000000..ea2536313794 --- /dev/null +++ b/lib/datadog_api_client/v2/models/customer_org_disable_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response describing the outcome of disabling the customer organization. + class CustomerOrgDisableResponse + include BaseGenericModel + + # Data object returned after disabling the customer organization. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'CustomerOrgDisableResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CustomerOrgDisableResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/customer_org_disable_response_attributes.rb b/lib/datadog_api_client/v2/models/customer_org_disable_response_attributes.rb new file mode 100644 index 000000000000..2ae3069198d5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/customer_org_disable_response_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes describing the outcome of the disable action on the customer organization. + class CustomerOrgDisableResponseAttributes + include BaseGenericModel + + # Resulting lifecycle status of the organization after the disable action. + attr_reader :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'status' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CustomerOrgDisableResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @status.nil? + true + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/customer_org_disable_response_data.rb b/lib/datadog_api_client/v2/models/customer_org_disable_response_data.rb new file mode 100644 index 000000000000..3058e32789ba --- /dev/null +++ b/lib/datadog_api_client/v2/models/customer_org_disable_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object returned after disabling the customer organization. + class CustomerOrgDisableResponseData + include BaseGenericModel + + # Attributes describing the outcome of the disable action on the customer organization. + attr_reader :attributes + + # Identifier of the disabled organization. + attr_reader :id + + # JSON:API resource type for a customer org disable action. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'CustomerOrgDisableResponseAttributes', + :'id' => :'String', + :'type' => :'CustomerOrgDisableType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CustomerOrgDisableResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/customer_org_disable_type.rb b/lib/datadog_api_client/v2/models/customer_org_disable_type.rb new file mode 100644 index 000000000000..2ccc75686995 --- /dev/null +++ b/lib/datadog_api_client/v2/models/customer_org_disable_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # JSON:API resource type for a customer org disable action. + class CustomerOrgDisableType + include BaseEnumModel + + CUSTOMER_ORG_DISABLE = "customer_org_disable".freeze + end +end