diff --git a/.generated-info b/.generated-info index a4e38e6b3545..7bea1747369f 100644 --- a/.generated-info +++ b/.generated-info @@ -1,4 +1,4 @@ { - "spec_repo_commit": "dc49df4", - "generated": "2025-07-18 13:57:23.914" + "spec_repo_commit": "0f24b8e", + "generated": "2025-07-18 16:53:06.032" } diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 8f845b4f20d6..5a4d2ba1227a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -2016,11 +2016,13 @@ components: description: The definition of `ActionConnectionIntegration` object. oneOf: - $ref: '#/components/schemas/AWSIntegration' + - $ref: '#/components/schemas/DatadogIntegration' - $ref: '#/components/schemas/HTTPIntegration' ActionConnectionIntegrationUpdate: description: The definition of `ActionConnectionIntegrationUpdate` object. oneOf: - $ref: '#/components/schemas/AWSIntegrationUpdate' + - $ref: '#/components/schemas/DatadogIntegrationUpdate' - $ref: '#/components/schemas/HTTPIntegrationUpdate' ActionQuery: description: An action query. This query type is used to trigger an action, @@ -12378,6 +12380,103 @@ components: required: - databaseMonitoringTrigger type: object + DatadogAPIKey: + description: The definition of the `DatadogAPIKey` object. + properties: + api_key: + description: The `DatadogAPIKey` `api_key`. + example: '' + type: string + app_key: + description: The `DatadogAPIKey` `app_key`. + example: '' + type: string + datacenter: + description: The `DatadogAPIKey` `datacenter`. + example: '' + type: string + subdomain: + description: Custom subdomain used for Datadog URLs generated with this + Connection. For example, if this org uses `https://acme.datadoghq.com` + to access Datadog, set this field to `acme`. If this field is omitted, + generated URLs will use the default site URL for its datacenter (see [https://docs.datadoghq.com/getting_started/site](https://docs.datadoghq.com/getting_started/site)). + type: string + type: + $ref: '#/components/schemas/DatadogAPIKeyType' + required: + - type + - datacenter + - api_key + - app_key + type: object + DatadogAPIKeyType: + description: The definition of the `DatadogAPIKey` object. + enum: + - DatadogAPIKey + example: DatadogAPIKey + type: string + x-enum-varnames: + - DATADOGAPIKEY + DatadogAPIKeyUpdate: + description: The definition of the `DatadogAPIKey` object. + properties: + api_key: + description: The `DatadogAPIKeyUpdate` `api_key`. + type: string + app_key: + description: The `DatadogAPIKeyUpdate` `app_key`. + type: string + datacenter: + description: The `DatadogAPIKeyUpdate` `datacenter`. + type: string + subdomain: + description: Custom subdomain used for Datadog URLs generated with this + Connection. For example, if this org uses `https://acme.datadoghq.com` + to access Datadog, set this field to `acme`. If this field is omitted, + generated URLs will use the default site URL for its datacenter (see [https://docs.datadoghq.com/getting_started/site](https://docs.datadoghq.com/getting_started/site)). + type: string + type: + $ref: '#/components/schemas/DatadogAPIKeyType' + required: + - type + type: object + DatadogCredentials: + description: The definition of the `DatadogCredentials` object. + oneOf: + - $ref: '#/components/schemas/DatadogAPIKey' + DatadogCredentialsUpdate: + description: The definition of the `DatadogCredentialsUpdate` object. + oneOf: + - $ref: '#/components/schemas/DatadogAPIKeyUpdate' + DatadogIntegration: + description: The definition of the `DatadogIntegration` object. + properties: + credentials: + $ref: '#/components/schemas/DatadogCredentials' + type: + $ref: '#/components/schemas/DatadogIntegrationType' + required: + - type + - credentials + type: object + DatadogIntegrationType: + description: The definition of the `DatadogIntegrationType` object. + enum: + - Datadog + example: Datadog + type: string + x-enum-varnames: + - DATADOG + DatadogIntegrationUpdate: + description: The definition of the `DatadogIntegrationUpdate` object. + properties: + credentials: + $ref: '#/components/schemas/DatadogCredentialsUpdate' + type: + $ref: '#/components/schemas/DatadogIntegrationType' + required: + - type + type: object Dataset: description: Dataset object. properties: diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 208aa67f012a..351d58884662 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1602,6 +1602,14 @@ def overrides "v2.data_deletion_response_item" => "DataDeletionResponseItem", "v2.data_deletion_response_item_attributes" => "DataDeletionResponseItemAttributes", "v2.data_deletion_response_meta" => "DataDeletionResponseMeta", + "v2.datadog_api_key" => "DatadogAPIKey", + "v2.datadog_api_key_type" => "DatadogAPIKeyType", + "v2.datadog_api_key_update" => "DatadogAPIKeyUpdate", + "v2.datadog_credentials" => "DatadogCredentials", + "v2.datadog_credentials_update" => "DatadogCredentialsUpdate", + "v2.datadog_integration" => "DatadogIntegration", + "v2.datadog_integration_type" => "DatadogIntegrationType", + "v2.datadog_integration_update" => "DatadogIntegrationUpdate", "v2.data_relationships_teams" => "DataRelationshipsTeams", "v2.data_relationships_teams_data_items" => "DataRelationshipsTeamsDataItems", "v2.data_relationships_teams_data_items_type" => "DataRelationshipsTeamsDataItemsType", diff --git a/lib/datadog_api_client/v2/models/action_connection_integration.rb b/lib/datadog_api_client/v2/models/action_connection_integration.rb index 290f8f79d114..3ec25a6189df 100644 --- a/lib/datadog_api_client/v2/models/action_connection_integration.rb +++ b/lib/datadog_api_client/v2/models/action_connection_integration.rb @@ -27,6 +27,7 @@ class << self def openapi_one_of [ :'AWSIntegration', + :'DatadogIntegration', :'HTTPIntegration' ] end diff --git a/lib/datadog_api_client/v2/models/action_connection_integration_update.rb b/lib/datadog_api_client/v2/models/action_connection_integration_update.rb index 4a71d3332542..f4d4147f2b00 100644 --- a/lib/datadog_api_client/v2/models/action_connection_integration_update.rb +++ b/lib/datadog_api_client/v2/models/action_connection_integration_update.rb @@ -27,6 +27,7 @@ class << self def openapi_one_of [ :'AWSIntegrationUpdate', + :'DatadogIntegrationUpdate', :'HTTPIntegrationUpdate' ] end diff --git a/lib/datadog_api_client/v2/models/datadog_api_key.rb b/lib/datadog_api_client/v2/models/datadog_api_key.rb new file mode 100644 index 000000000000..d0e31d430b7e --- /dev/null +++ b/lib/datadog_api_client/v2/models/datadog_api_key.rb @@ -0,0 +1,196 @@ +=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 + # The definition of the `DatadogAPIKey` object. + class DatadogAPIKey + include BaseGenericModel + + # The `DatadogAPIKey` `api_key`. + attr_reader :api_key + + # The `DatadogAPIKey` `app_key`. + attr_reader :app_key + + # The `DatadogAPIKey` `datacenter`. + attr_reader :datacenter + + # Custom subdomain used for Datadog URLs generated with this Connection. For example, if this org uses `https://acme.datadoghq.com` to access Datadog, set this field to `acme`. If this field is omitted, generated URLs will use the default site URL for its datacenter (see [https://docs.datadoghq.com/getting_started/site](https://docs.datadoghq.com/getting_started/site)). + attr_accessor :subdomain + + # The definition of the `DatadogAPIKey` object. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'api_key' => :'api_key', + :'app_key' => :'app_key', + :'datacenter' => :'datacenter', + :'subdomain' => :'subdomain', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'api_key' => :'String', + :'app_key' => :'String', + :'datacenter' => :'String', + :'subdomain' => :'String', + :'type' => :'DatadogAPIKeyType' + } + 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::DatadogAPIKey` 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?(:'api_key') + self.api_key = attributes[:'api_key'] + end + + if attributes.key?(:'app_key') + self.app_key = attributes[:'app_key'] + end + + if attributes.key?(:'datacenter') + self.datacenter = attributes[:'datacenter'] + end + + if attributes.key?(:'subdomain') + self.subdomain = attributes[:'subdomain'] + 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 @api_key.nil? + return false if @app_key.nil? + return false if @datacenter.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param api_key [Object] Object to be assigned + # @!visibility private + def api_key=(api_key) + if api_key.nil? + fail ArgumentError, 'invalid value for "api_key", api_key cannot be nil.' + end + @api_key = api_key + end + + # Custom attribute writer method with validation + # @param app_key [Object] Object to be assigned + # @!visibility private + def app_key=(app_key) + if app_key.nil? + fail ArgumentError, 'invalid value for "app_key", app_key cannot be nil.' + end + @app_key = app_key + end + + # Custom attribute writer method with validation + # @param datacenter [Object] Object to be assigned + # @!visibility private + def datacenter=(datacenter) + if datacenter.nil? + fail ArgumentError, 'invalid value for "datacenter", datacenter cannot be nil.' + end + @datacenter = datacenter + 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 && + api_key == o.api_key && + app_key == o.app_key && + datacenter == o.datacenter && + subdomain == o.subdomain && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [api_key, app_key, datacenter, subdomain, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/datadog_api_key_type.rb b/lib/datadog_api_client/v2/models/datadog_api_key_type.rb new file mode 100644 index 000000000000..4e6c304d12c6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/datadog_api_key_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 + # The definition of the `DatadogAPIKey` object. + class DatadogAPIKeyType + include BaseEnumModel + + DATADOGAPIKEY = "DatadogAPIKey".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/datadog_api_key_update.rb b/lib/datadog_api_client/v2/models/datadog_api_key_update.rb new file mode 100644 index 000000000000..5238bc45fb85 --- /dev/null +++ b/lib/datadog_api_client/v2/models/datadog_api_key_update.rb @@ -0,0 +1,163 @@ +=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 + # The definition of the `DatadogAPIKey` object. + class DatadogAPIKeyUpdate + include BaseGenericModel + + # The `DatadogAPIKeyUpdate` `api_key`. + attr_accessor :api_key + + # The `DatadogAPIKeyUpdate` `app_key`. + attr_accessor :app_key + + # The `DatadogAPIKeyUpdate` `datacenter`. + attr_accessor :datacenter + + # Custom subdomain used for Datadog URLs generated with this Connection. For example, if this org uses `https://acme.datadoghq.com` to access Datadog, set this field to `acme`. If this field is omitted, generated URLs will use the default site URL for its datacenter (see [https://docs.datadoghq.com/getting_started/site](https://docs.datadoghq.com/getting_started/site)). + attr_accessor :subdomain + + # The definition of the `DatadogAPIKey` object. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'api_key' => :'api_key', + :'app_key' => :'app_key', + :'datacenter' => :'datacenter', + :'subdomain' => :'subdomain', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'api_key' => :'String', + :'app_key' => :'String', + :'datacenter' => :'String', + :'subdomain' => :'String', + :'type' => :'DatadogAPIKeyType' + } + 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::DatadogAPIKeyUpdate` 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?(:'api_key') + self.api_key = attributes[:'api_key'] + end + + if attributes.key?(:'app_key') + self.app_key = attributes[:'app_key'] + end + + if attributes.key?(:'datacenter') + self.datacenter = attributes[:'datacenter'] + end + + if attributes.key?(:'subdomain') + self.subdomain = attributes[:'subdomain'] + 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 && + api_key == o.api_key && + app_key == o.app_key && + datacenter == o.datacenter && + subdomain == o.subdomain && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [api_key, app_key, datacenter, subdomain, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/datadog_credentials.rb b/lib/datadog_api_client/v2/models/datadog_credentials.rb new file mode 100644 index 000000000000..7eb7dcdbd759 --- /dev/null +++ b/lib/datadog_api_client/v2/models/datadog_credentials.rb @@ -0,0 +1,62 @@ +=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 + # The definition of the `DatadogCredentials` object. + module DatadogCredentials + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'DatadogAPIKey' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/datadog_credentials_update.rb b/lib/datadog_api_client/v2/models/datadog_credentials_update.rb new file mode 100644 index 000000000000..a031fcec96ae --- /dev/null +++ b/lib/datadog_api_client/v2/models/datadog_credentials_update.rb @@ -0,0 +1,62 @@ +=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 + # The definition of the `DatadogCredentialsUpdate` object. + module DatadogCredentialsUpdate + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'DatadogAPIKeyUpdate' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/datadog_integration.rb b/lib/datadog_api_client/v2/models/datadog_integration.rb new file mode 100644 index 000000000000..b9d73b38187e --- /dev/null +++ b/lib/datadog_api_client/v2/models/datadog_integration.rb @@ -0,0 +1,144 @@ +=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 + # The definition of the `DatadogIntegration` object. + class DatadogIntegration + include BaseGenericModel + + # The definition of the `DatadogCredentials` object. + attr_reader :credentials + + # The definition of the `DatadogIntegrationType` object. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'credentials' => :'credentials', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'credentials' => :'DatadogCredentials', + :'type' => :'DatadogIntegrationType' + } + 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::DatadogIntegration` 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?(:'credentials') + self.credentials = attributes[:'credentials'] + 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 @credentials.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param credentials [Object] Object to be assigned + # @!visibility private + def credentials=(credentials) + if credentials.nil? + fail ArgumentError, 'invalid value for "credentials", credentials cannot be nil.' + end + @credentials = credentials + 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 && + credentials == o.credentials && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [credentials, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/datadog_integration_type.rb b/lib/datadog_api_client/v2/models/datadog_integration_type.rb new file mode 100644 index 000000000000..6e49098b33cc --- /dev/null +++ b/lib/datadog_api_client/v2/models/datadog_integration_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 + # The definition of the `DatadogIntegrationType` object. + class DatadogIntegrationType + include BaseEnumModel + + DATADOG = "Datadog".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/datadog_integration_update.rb b/lib/datadog_api_client/v2/models/datadog_integration_update.rb new file mode 100644 index 000000000000..b2fada72aec8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/datadog_integration_update.rb @@ -0,0 +1,133 @@ +=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 + # The definition of the `DatadogIntegrationUpdate` object. + class DatadogIntegrationUpdate + include BaseGenericModel + + # The definition of the `DatadogCredentialsUpdate` object. + attr_accessor :credentials + + # The definition of the `DatadogIntegrationType` object. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'credentials' => :'credentials', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'credentials' => :'DatadogCredentialsUpdate', + :'type' => :'DatadogIntegrationType' + } + 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::DatadogIntegrationUpdate` 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?(:'credentials') + self.credentials = attributes[:'credentials'] + 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 && + credentials == o.credentials && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [credentials, type, additional_properties].hash + end + end +end