From 2790e487495e74a1fec0e61233ba474330d3f961 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 19 Jun 2026 11:45:55 +0000 Subject: [PATCH] Regenerate client from commit 7040bb9 of spec repo --- .generator/schemas/v2/openapi.yaml | 76 ++++++++- lib/datadog_api_client/inflector.rb | 2 + .../v2/models/logs_archive_destination_s3.rb | 2 +- .../v2/models/logs_archive_integration_s3.rb | 153 +++++------------- .../logs_archive_integration_s3_access_key.rb | 123 ++++++++++++++ .../logs_archive_integration_s3_role.rb | 144 +++++++++++++++++ 6 files changed, 379 insertions(+), 121 deletions(-) create mode 100644 lib/datadog_api_client/v2/models/logs_archive_integration_s3_access_key.rb create mode 100644 lib/datadog_api_client/v2/models/logs_archive_integration_s3_role.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 65d674fb23d1..b6eb8423df35 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -56750,19 +56750,35 @@ components: - client_email type: object LogsArchiveIntegrationS3: - description: The S3 Archive's integration destination. + description: >- + The S3 Archive's integration destination. You must provide one of the following: `access_key_id` alone, or both `account_id` and `role_name` together. + oneOf: + - $ref: "#/components/schemas/LogsArchiveIntegrationS3AccessKey" + - $ref: "#/components/schemas/LogsArchiveIntegrationS3Role" + LogsArchiveIntegrationS3AccessKey: + description: The S3 Archive's integration destination using an access key. + properties: + access_key_id: + description: The access key ID for the integration. + example: AKIAIOSFODNN7EXAMPLE + type: string + required: + - access_key_id + type: object + LogsArchiveIntegrationS3Role: + description: The S3 Archive's integration destination using an IAM role. properties: account_id: description: The account ID for the integration. example: "123456789012" type: string role_name: - description: The path of the integration. + description: The name of the role to assume for the integration. example: role-name type: string required: - - role_name - account_id + - role_name type: object LogsArchiveOrder: description: A ordered list of archive IDs. @@ -148590,6 +148606,18 @@ paths: - team:intake - team:app type: archives + s3_access_key_id: + value: + data: + attributes: + destination: + bucket: my-bucket + integration: + access_key_id: AKIAIOSFODNN7EXAMPLE + type: s3 + name: Nginx Archive + query: source:nginx + type: archives schema: $ref: "#/components/schemas/LogsArchiveCreateRequest" description: The definition of the new archive. @@ -148615,6 +148643,21 @@ paths: state: WORKING id: 00000000-0000-0000-0000-000000000002 type: archives + s3_access_key_id: + value: + data: + attributes: + destination: + bucket: my-bucket + integration: + access_key_id: AKIAIOSFODNN7EXAMPLE + type: s3 + include_tags: false + name: Nginx Archive + query: source:nginx + state: WORKING + id: 00000000-0000-0000-0000-000000000002 + type: archives schema: $ref: "#/components/schemas/LogsArchive" description: OK @@ -148764,6 +148807,18 @@ paths: - team:intake - team:app type: archives + s3_access_key_id: + value: + data: + attributes: + destination: + bucket: my-bucket + integration: + access_key_id: AKIAIOSFODNN7EXAMPLE + type: s3 + name: Nginx Archive + query: source:nginx + type: archives schema: $ref: "#/components/schemas/LogsArchiveCreateRequest" description: New definition of the archive. @@ -148789,6 +148844,21 @@ paths: state: WORKING id: 00000000-0000-0000-0000-000000000004 type: archives + s3_access_key_id: + value: + data: + attributes: + destination: + bucket: my-bucket + integration: + access_key_id: AKIAIOSFODNN7EXAMPLE + type: s3 + include_tags: false + name: Nginx Archive + query: source:nginx + state: WORKING + id: 00000000-0000-0000-0000-000000000004 + type: archives schema: $ref: "#/components/schemas/LogsArchive" description: OK diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 1912c3a1f419..933cf84a9f8b 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -4447,6 +4447,8 @@ def overrides "v2.logs_archive_integration_azure" => "LogsArchiveIntegrationAzure", "v2.logs_archive_integration_gcs" => "LogsArchiveIntegrationGCS", "v2.logs_archive_integration_s3" => "LogsArchiveIntegrationS3", + "v2.logs_archive_integration_s3_access_key" => "LogsArchiveIntegrationS3AccessKey", + "v2.logs_archive_integration_s3_role" => "LogsArchiveIntegrationS3Role", "v2.logs_archive_order" => "LogsArchiveOrder", "v2.logs_archive_order_attributes" => "LogsArchiveOrderAttributes", "v2.logs_archive_order_definition" => "LogsArchiveOrderDefinition", diff --git a/lib/datadog_api_client/v2/models/logs_archive_destination_s3.rb b/lib/datadog_api_client/v2/models/logs_archive_destination_s3.rb index 6da62c43547e..daad7a516102 100644 --- a/lib/datadog_api_client/v2/models/logs_archive_destination_s3.rb +++ b/lib/datadog_api_client/v2/models/logs_archive_destination_s3.rb @@ -27,7 +27,7 @@ class LogsArchiveDestinationS3 # The S3 encryption settings. attr_accessor :encryption - # The S3 Archive's integration destination. + # The S3 Archive's integration destination. You must provide one of the following: `access_key_id` alone, or both `account_id` and `role_name` together. attr_reader :integration # The archive path. diff --git a/lib/datadog_api_client/v2/models/logs_archive_integration_s3.rb b/lib/datadog_api_client/v2/models/logs_archive_integration_s3.rb index fd73c2112c68..66130b8c6f94 100644 --- a/lib/datadog_api_client/v2/models/logs_archive_integration_s3.rb +++ b/lib/datadog_api_client/v2/models/logs_archive_integration_s3.rb @@ -17,128 +17,47 @@ require 'time' module DatadogAPIClient::V2 - # The S3 Archive's integration destination. - class LogsArchiveIntegrationS3 - include BaseGenericModel - - # The account ID for the integration. - attr_reader :account_id - - # The path of the integration. - attr_reader :role_name - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'account_id' => :'account_id', - :'role_name' => :'role_name' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'account_id' => :'String', - :'role_name' => :'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::LogsArchiveIntegrationS3` initialize method" + # The S3 Archive's integration destination. You must provide one of the following: `access_key_id` alone, or both `account_id` and `role_name` together. + module LogsArchiveIntegrationS3 + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'LogsArchiveIntegrationS3AccessKey', + :'LogsArchiveIntegrationS3Role' + ] 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 + # 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 attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'role_name') - self.role_name = attributes[:'role_name'] - 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 @account_id.nil? - return false if @role_name.nil? - true - end - - # Custom attribute writer method with validation - # @param account_id [Object] Object to be assigned - # @!visibility private - def account_id=(account_id) - if account_id.nil? - fail ArgumentError, 'invalid value for "account_id", account_id cannot be nil.' - end - @account_id = account_id - end - - # Custom attribute writer method with validation - # @param role_name [Object] Object to be assigned - # @!visibility private - def role_name=(role_name) - if role_name.nil? - fail ArgumentError, 'invalid value for "role_name", role_name cannot be nil.' - end - @role_name = role_name - 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}")) + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) 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 && - account_id == o.account_id && - role_name == o.role_name && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [account_id, role_name, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/logs_archive_integration_s3_access_key.rb b/lib/datadog_api_client/v2/models/logs_archive_integration_s3_access_key.rb new file mode 100644 index 000000000000..95398bb975ba --- /dev/null +++ b/lib/datadog_api_client/v2/models/logs_archive_integration_s3_access_key.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 + # The S3 Archive's integration destination using an access key. + class LogsArchiveIntegrationS3AccessKey + include BaseGenericModel + + # The access key ID for the integration. + attr_reader :access_key_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'access_key_id' => :'access_key_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'access_key_id' => :'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::LogsArchiveIntegrationS3AccessKey` 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?(:'access_key_id') + self.access_key_id = attributes[:'access_key_id'] + 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 @access_key_id.nil? + true + end + + # Custom attribute writer method with validation + # @param access_key_id [Object] Object to be assigned + # @!visibility private + def access_key_id=(access_key_id) + if access_key_id.nil? + fail ArgumentError, 'invalid value for "access_key_id", access_key_id cannot be nil.' + end + @access_key_id = access_key_id + 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 && + access_key_id == o.access_key_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [access_key_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/logs_archive_integration_s3_role.rb b/lib/datadog_api_client/v2/models/logs_archive_integration_s3_role.rb new file mode 100644 index 000000000000..0d85e7e8976b --- /dev/null +++ b/lib/datadog_api_client/v2/models/logs_archive_integration_s3_role.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 S3 Archive's integration destination using an IAM role. + class LogsArchiveIntegrationS3Role + include BaseGenericModel + + # The account ID for the integration. + attr_reader :account_id + + # The name of the role to assume for the integration. + attr_reader :role_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'account_id' => :'account_id', + :'role_name' => :'role_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'account_id' => :'String', + :'role_name' => :'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::LogsArchiveIntegrationS3Role` 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?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'role_name') + self.role_name = attributes[:'role_name'] + 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 @account_id.nil? + return false if @role_name.nil? + true + end + + # Custom attribute writer method with validation + # @param account_id [Object] Object to be assigned + # @!visibility private + def account_id=(account_id) + if account_id.nil? + fail ArgumentError, 'invalid value for "account_id", account_id cannot be nil.' + end + @account_id = account_id + end + + # Custom attribute writer method with validation + # @param role_name [Object] Object to be assigned + # @!visibility private + def role_name=(role_name) + if role_name.nil? + fail ArgumentError, 'invalid value for "role_name", role_name cannot be nil.' + end + @role_name = role_name + 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 && + account_id == o.account_id && + role_name == o.role_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [account_id, role_name, additional_properties].hash + end + end +end