From 1a5b24156b38a7c525135184c6cf26095c6485e4 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 26 Aug 2026 10:11:07 +0000 Subject: [PATCH] Regenerate client from commit 6cb59b9 of spec repo --- .generator/schemas/v2/openapi.yaml | 177 ++++++++++++++++++ lib/datadog_api_client/inflector.rb | 15 ++ .../v2/models/azure_storage_destination.rb | 13 +- ...vability_pipeline_amazon_s3_destination.rb | 13 +- ...eline_amazon_s3_destination_compression.rb | 64 +++++++ ..._amazon_s3_destination_compression_gzip.rb | 152 +++++++++++++++ ...on_s3_destination_compression_gzip_type.rb | 26 +++ ..._amazon_s3_destination_compression_zstd.rb | 152 +++++++++++++++ ...on_s3_destination_compression_zstd_type.rb | 26 +++ ...e_azure_storage_destination_compression.rb | 64 +++++++ ...re_storage_destination_compression_gzip.rb | 152 +++++++++++++++ ...orage_destination_compression_gzip_type.rb | 26 +++ ...re_storage_destination_compression_zstd.rb | 152 +++++++++++++++ ...orage_destination_compression_zstd_type.rb | 26 +++ ...peline_google_cloud_storage_destination.rb | 13 +- ...e_cloud_storage_destination_compression.rb | 64 +++++++ ...ud_storage_destination_compression_gzip.rb | 152 +++++++++++++++ ...orage_destination_compression_gzip_type.rb | 26 +++ ...ud_storage_destination_compression_zstd.rb | 152 +++++++++++++++ ...orage_destination_compression_zstd_type.rb | 26 +++ 20 files changed, 1488 insertions(+), 3 deletions(-) create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_amazon_s3_destination_compression.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_amazon_s3_destination_compression_gzip.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_amazon_s3_destination_compression_gzip_type.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_amazon_s3_destination_compression_zstd.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_amazon_s3_destination_compression_zstd_type.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_azure_storage_destination_compression.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_azure_storage_destination_compression_gzip.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_azure_storage_destination_compression_gzip_type.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_azure_storage_destination_compression_zstd.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_azure_storage_destination_compression_zstd_type.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_google_cloud_storage_destination_compression.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_google_cloud_storage_destination_compression_gzip.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_google_cloud_storage_destination_compression_gzip_type.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_google_cloud_storage_destination_compression_zstd.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_google_cloud_storage_destination_compression_zstd_type.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e24a358f1bdc..508cd0331226 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -13003,6 +13003,8 @@ components: type: string buffer: $ref: "#/components/schemas/ObservabilityPipelineBufferOptions" + compression: + $ref: "#/components/schemas/ObservabilityPipelineAzureStorageDestinationCompression" connection_string_key: description: Name of the environment variable or secret that holds the Azure Storage connection string. example: AZURE_STORAGE_CONNECTION_STRING @@ -71528,6 +71530,8 @@ components: type: string buffer: $ref: "#/components/schemas/ObservabilityPipelineBufferOptions" + compression: + $ref: "#/components/schemas/ObservabilityPipelineAmazonS3DestinationCompression" id: description: Unique identifier for the destination component. example: amazon-s3-destination @@ -71569,6 +71573,63 @@ components: - storage_class type: object x-pipeline-types: [logs] + ObservabilityPipelineAmazonS3DestinationCompression: + description: |- + Compression configuration for archived logs. When omitted, logs are compressed with gzip + for backward compatibility. + oneOf: + - $ref: "#/components/schemas/ObservabilityPipelineAmazonS3DestinationCompressionZstd" + - $ref: "#/components/schemas/ObservabilityPipelineAmazonS3DestinationCompressionGzip" + ObservabilityPipelineAmazonS3DestinationCompressionGzip: + description: Gzip compression. + properties: + algorithm: + $ref: "#/components/schemas/ObservabilityPipelineAmazonS3DestinationCompressionGzipType" + level: + description: Gzip compression level. Valid values range from `1` to `9`. + example: 6 + format: int64 + maximum: 9 + minimum: 1 + type: integer + required: + - algorithm + - level + type: object + ObservabilityPipelineAmazonS3DestinationCompressionGzipType: + default: gzip + description: The compression type. Always `gzip`. + enum: + - gzip + example: gzip + type: string + x-enum-varnames: + - GZIP + ObservabilityPipelineAmazonS3DestinationCompressionZstd: + description: Zstd compression. + properties: + algorithm: + $ref: "#/components/schemas/ObservabilityPipelineAmazonS3DestinationCompressionZstdType" + level: + description: Zstd compression level. Valid values range from `1` to` 21`. + example: 3 + format: int64 + maximum: 21 + minimum: 1 + type: integer + required: + - algorithm + - level + type: object + ObservabilityPipelineAmazonS3DestinationCompressionZstdType: + default: zstd + description: The compression type. Always `zstd`. + enum: + - zstd + example: zstd + type: string + x-enum-varnames: + - ZSTD ObservabilityPipelineAmazonS3DestinationServerSideEncryption: description: Server-side encryption type for Amazon S3. enum: @@ -71930,6 +71991,63 @@ components: description: A session identifier used for logging and tracing the assumed role session. type: string type: object + ObservabilityPipelineAzureStorageDestinationCompression: + description: |- + Compression configuration for archived logs. When omitted, logs are compressed with gzip + for backward compatibility. + oneOf: + - $ref: "#/components/schemas/ObservabilityPipelineAzureStorageDestinationCompressionZstd" + - $ref: "#/components/schemas/ObservabilityPipelineAzureStorageDestinationCompressionGzip" + ObservabilityPipelineAzureStorageDestinationCompressionGzip: + description: Gzip compression. + properties: + algorithm: + $ref: "#/components/schemas/ObservabilityPipelineAzureStorageDestinationCompressionGzipType" + level: + description: Gzip compression level. Valid values range from `1` to `9`. + example: 6 + format: int64 + maximum: 9 + minimum: 1 + type: integer + required: + - algorithm + - level + type: object + ObservabilityPipelineAzureStorageDestinationCompressionGzipType: + default: gzip + description: The compression type. Always `gzip`. + enum: + - gzip + example: gzip + type: string + x-enum-varnames: + - GZIP + ObservabilityPipelineAzureStorageDestinationCompressionZstd: + description: Zstd compression. + properties: + algorithm: + $ref: "#/components/schemas/ObservabilityPipelineAzureStorageDestinationCompressionZstdType" + level: + description: Zstd compression level. Valid values range from `1` to `21`. + example: 3 + format: int64 + maximum: 21 + minimum: 1 + type: integer + required: + - algorithm + - level + type: object + ObservabilityPipelineAzureStorageDestinationCompressionZstdType: + default: zstd + description: The compression type. Always `zstd`. + enum: + - zstd + example: zstd + type: string + x-enum-varnames: + - ZSTD ObservabilityPipelineBufferOptions: description: Configuration for buffer settings on destination components. oneOf: @@ -73708,6 +73826,8 @@ components: type: string buffer: $ref: "#/components/schemas/ObservabilityPipelineBufferOptions" + compression: + $ref: "#/components/schemas/ObservabilityPipelineGoogleCloudStorageDestinationCompression" id: description: Unique identifier for the destination component. example: gcs-destination @@ -73757,6 +73877,63 @@ components: - AUTHENTICATEDNOT_READ - BUCKETNOT_OWNERNOT_READ - BUCKETNOT_OWNERNOT_FULLNOT_CONTROL + ObservabilityPipelineGoogleCloudStorageDestinationCompression: + description: |- + Compression configuration for archived logs. When omitted, logs are compressed with gzip + for backward compatibility. + oneOf: + - $ref: "#/components/schemas/ObservabilityPipelineGoogleCloudStorageDestinationCompressionZstd" + - $ref: "#/components/schemas/ObservabilityPipelineGoogleCloudStorageDestinationCompressionGzip" + ObservabilityPipelineGoogleCloudStorageDestinationCompressionGzip: + description: Gzip compression. + properties: + algorithm: + $ref: "#/components/schemas/ObservabilityPipelineGoogleCloudStorageDestinationCompressionGzipType" + level: + description: Gzip compression level. Valid values range from `1` to `9`. + example: 6 + format: int64 + maximum: 9 + minimum: 1 + type: integer + required: + - algorithm + - level + type: object + ObservabilityPipelineGoogleCloudStorageDestinationCompressionGzipType: + default: gzip + description: The compression type. Always `gzip`. + enum: + - gzip + example: gzip + type: string + x-enum-varnames: + - GZIP + ObservabilityPipelineGoogleCloudStorageDestinationCompressionZstd: + description: Zstd compression. + properties: + algorithm: + $ref: "#/components/schemas/ObservabilityPipelineGoogleCloudStorageDestinationCompressionZstdType" + level: + description: Zstd compression level. Valid values range from `1` to `21`. + example: 3 + format: int64 + maximum: 21 + minimum: 1 + type: integer + required: + - algorithm + - level + type: object + ObservabilityPipelineGoogleCloudStorageDestinationCompressionZstdType: + default: zstd + description: The compression type. Always `zstd`. + enum: + - zstd + example: zstd + type: string + x-enum-varnames: + - ZSTD ObservabilityPipelineGoogleCloudStorageDestinationStorageClass: description: Storage class used for objects stored in GCS. enum: diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index ee23e2cd6ba1..619f9521e74d 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -5421,6 +5421,11 @@ def overrides "v2.observability_pipeline_amazon_open_search_destination_auth_strategy" => "ObservabilityPipelineAmazonOpenSearchDestinationAuthStrategy", "v2.observability_pipeline_amazon_open_search_destination_type" => "ObservabilityPipelineAmazonOpenSearchDestinationType", "v2.observability_pipeline_amazon_s3_destination" => "ObservabilityPipelineAmazonS3Destination", + "v2.observability_pipeline_amazon_s3_destination_compression" => "ObservabilityPipelineAmazonS3DestinationCompression", + "v2.observability_pipeline_amazon_s3_destination_compression_gzip" => "ObservabilityPipelineAmazonS3DestinationCompressionGzip", + "v2.observability_pipeline_amazon_s3_destination_compression_gzip_type" => "ObservabilityPipelineAmazonS3DestinationCompressionGzipType", + "v2.observability_pipeline_amazon_s3_destination_compression_zstd" => "ObservabilityPipelineAmazonS3DestinationCompressionZstd", + "v2.observability_pipeline_amazon_s3_destination_compression_zstd_type" => "ObservabilityPipelineAmazonS3DestinationCompressionZstdType", "v2.observability_pipeline_amazon_s3_destination_server_side_encryption" => "ObservabilityPipelineAmazonS3DestinationServerSideEncryption", "v2.observability_pipeline_amazon_s3_destination_storage_class" => "ObservabilityPipelineAmazonS3DestinationStorageClass", "v2.observability_pipeline_amazon_s3_destination_type" => "ObservabilityPipelineAmazonS3DestinationType", @@ -5445,6 +5450,11 @@ def overrides "v2.observability_pipeline_amazon_security_lake_destination" => "ObservabilityPipelineAmazonSecurityLakeDestination", "v2.observability_pipeline_amazon_security_lake_destination_type" => "ObservabilityPipelineAmazonSecurityLakeDestinationType", "v2.observability_pipeline_aws_auth" => "ObservabilityPipelineAwsAuth", + "v2.observability_pipeline_azure_storage_destination_compression" => "ObservabilityPipelineAzureStorageDestinationCompression", + "v2.observability_pipeline_azure_storage_destination_compression_gzip" => "ObservabilityPipelineAzureStorageDestinationCompressionGzip", + "v2.observability_pipeline_azure_storage_destination_compression_gzip_type" => "ObservabilityPipelineAzureStorageDestinationCompressionGzipType", + "v2.observability_pipeline_azure_storage_destination_compression_zstd" => "ObservabilityPipelineAzureStorageDestinationCompressionZstd", + "v2.observability_pipeline_azure_storage_destination_compression_zstd_type" => "ObservabilityPipelineAzureStorageDestinationCompressionZstdType", "v2.observability_pipeline_buffer_options" => "ObservabilityPipelineBufferOptions", "v2.observability_pipeline_buffer_options_disk_type" => "ObservabilityPipelineBufferOptionsDiskType", "v2.observability_pipeline_buffer_options_memory_type" => "ObservabilityPipelineBufferOptionsMemoryType", @@ -5544,6 +5554,11 @@ def overrides "v2.observability_pipeline_google_chronicle_destination_type" => "ObservabilityPipelineGoogleChronicleDestinationType", "v2.observability_pipeline_google_cloud_storage_destination" => "ObservabilityPipelineGoogleCloudStorageDestination", "v2.observability_pipeline_google_cloud_storage_destination_acl" => "ObservabilityPipelineGoogleCloudStorageDestinationAcl", + "v2.observability_pipeline_google_cloud_storage_destination_compression" => "ObservabilityPipelineGoogleCloudStorageDestinationCompression", + "v2.observability_pipeline_google_cloud_storage_destination_compression_gzip" => "ObservabilityPipelineGoogleCloudStorageDestinationCompressionGzip", + "v2.observability_pipeline_google_cloud_storage_destination_compression_gzip_type" => "ObservabilityPipelineGoogleCloudStorageDestinationCompressionGzipType", + "v2.observability_pipeline_google_cloud_storage_destination_compression_zstd" => "ObservabilityPipelineGoogleCloudStorageDestinationCompressionZstd", + "v2.observability_pipeline_google_cloud_storage_destination_compression_zstd_type" => "ObservabilityPipelineGoogleCloudStorageDestinationCompressionZstdType", "v2.observability_pipeline_google_cloud_storage_destination_storage_class" => "ObservabilityPipelineGoogleCloudStorageDestinationStorageClass", "v2.observability_pipeline_google_cloud_storage_destination_type" => "ObservabilityPipelineGoogleCloudStorageDestinationType", "v2.observability_pipeline_google_pub_sub_destination" => "ObservabilityPipelineGooglePubSubDestination", diff --git a/lib/datadog_api_client/v2/models/azure_storage_destination.rb b/lib/datadog_api_client/v2/models/azure_storage_destination.rb index 10c15612ecca..62fd869e2fee 100644 --- a/lib/datadog_api_client/v2/models/azure_storage_destination.rb +++ b/lib/datadog_api_client/v2/models/azure_storage_destination.rb @@ -29,6 +29,10 @@ class AzureStorageDestination # Configuration for buffer settings on destination components. attr_accessor :buffer + # Compression configuration for archived logs. When omitted, logs are compressed with gzip + # for backward compatibility. + attr_accessor :compression + # Name of the environment variable or secret that holds the Azure Storage connection string. attr_accessor :connection_string_key @@ -52,6 +56,7 @@ def self.attribute_map { :'blob_prefix' => :'blob_prefix', :'buffer' => :'buffer', + :'compression' => :'compression', :'connection_string_key' => :'connection_string_key', :'container_name' => :'container_name', :'id' => :'id', @@ -66,6 +71,7 @@ def self.openapi_types { :'blob_prefix' => :'String', :'buffer' => :'ObservabilityPipelineBufferOptions', + :'compression' => :'ObservabilityPipelineAzureStorageDestinationCompression', :'connection_string_key' => :'String', :'container_name' => :'String', :'id' => :'String', @@ -100,6 +106,10 @@ def initialize(attributes = {}) self.buffer = attributes[:'buffer'] end + if attributes.key?(:'compression') + self.compression = attributes[:'compression'] + end + if attributes.key?(:'connection_string_key') self.connection_string_key = attributes[:'connection_string_key'] end @@ -202,6 +212,7 @@ def ==(o) self.class == o.class && blob_prefix == o.blob_prefix && buffer == o.buffer && + compression == o.compression && connection_string_key == o.connection_string_key && container_name == o.container_name && id == o.id && @@ -214,7 +225,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [blob_prefix, buffer, connection_string_key, container_name, id, inputs, type, additional_properties].hash + [blob_prefix, buffer, compression, connection_string_key, container_name, id, inputs, type, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_amazon_s3_destination.rb b/lib/datadog_api_client/v2/models/observability_pipeline_amazon_s3_destination.rb index 7acc8c4412d4..307b1483eb77 100644 --- a/lib/datadog_api_client/v2/models/observability_pipeline_amazon_s3_destination.rb +++ b/lib/datadog_api_client/v2/models/observability_pipeline_amazon_s3_destination.rb @@ -33,6 +33,10 @@ class ObservabilityPipelineAmazonS3Destination # Configuration for buffer settings on destination components. attr_accessor :buffer + # Compression configuration for archived logs. When omitted, logs are compressed with gzip + # for backward compatibility. + attr_accessor :compression + # Unique identifier for the destination component. attr_reader :id @@ -70,6 +74,7 @@ def self.attribute_map :'auth' => :'auth', :'bucket' => :'bucket', :'buffer' => :'buffer', + :'compression' => :'compression', :'id' => :'id', :'inputs' => :'inputs', :'key_prefix' => :'key_prefix', @@ -89,6 +94,7 @@ def self.openapi_types :'auth' => :'ObservabilityPipelineAwsAuth', :'bucket' => :'String', :'buffer' => :'ObservabilityPipelineBufferOptions', + :'compression' => :'ObservabilityPipelineAmazonS3DestinationCompression', :'id' => :'String', :'inputs' => :'Array', :'key_prefix' => :'String', @@ -131,6 +137,10 @@ def initialize(attributes = {}) self.buffer = attributes[:'buffer'] end + if attributes.key?(:'compression') + self.compression = attributes[:'compression'] + end + if attributes.key?(:'id') self.id = attributes[:'id'] end @@ -272,6 +282,7 @@ def ==(o) auth == o.auth && bucket == o.bucket && buffer == o.buffer && + compression == o.compression && id == o.id && inputs == o.inputs && key_prefix == o.key_prefix && @@ -288,7 +299,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [auth, bucket, buffer, id, inputs, key_prefix, region, server_side_encryption, ssekms_key_id, storage_class, tls, type, additional_properties].hash + [auth, bucket, buffer, compression, id, inputs, key_prefix, region, server_side_encryption, ssekms_key_id, storage_class, tls, type, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_amazon_s3_destination_compression.rb b/lib/datadog_api_client/v2/models/observability_pipeline_amazon_s3_destination_compression.rb new file mode 100644 index 000000000000..910b7cbcaafd --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_amazon_s3_destination_compression.rb @@ -0,0 +1,64 @@ +=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 + # Compression configuration for archived logs. When omitted, logs are compressed with gzip + # for backward compatibility. + module ObservabilityPipelineAmazonS3DestinationCompression + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'ObservabilityPipelineAmazonS3DestinationCompressionZstd', + :'ObservabilityPipelineAmazonS3DestinationCompressionGzip' + ] + 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/observability_pipeline_amazon_s3_destination_compression_gzip.rb b/lib/datadog_api_client/v2/models/observability_pipeline_amazon_s3_destination_compression_gzip.rb new file mode 100644 index 000000000000..92e82aa4cd5f --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_amazon_s3_destination_compression_gzip.rb @@ -0,0 +1,152 @@ +=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 + # Gzip compression. + class ObservabilityPipelineAmazonS3DestinationCompressionGzip + include BaseGenericModel + + # The compression type. Always `gzip`. + attr_reader :algorithm + + # Gzip compression level. Valid values range from `1` to `9`. + attr_reader :level + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'algorithm' => :'algorithm', + :'level' => :'level' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'algorithm' => :'ObservabilityPipelineAmazonS3DestinationCompressionGzipType', + :'level' => :'Integer' + } + 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::ObservabilityPipelineAmazonS3DestinationCompressionGzip` 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?(:'algorithm') + self.algorithm = attributes[:'algorithm'] + end + + if attributes.key?(:'level') + self.level = attributes[:'level'] + 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 @algorithm.nil? + return false if @level.nil? + return false if @level > 9 + return false if @level < 1 + true + end + + # Custom attribute writer method with validation + # @param algorithm [Object] Object to be assigned + # @!visibility private + def algorithm=(algorithm) + if algorithm.nil? + fail ArgumentError, 'invalid value for "algorithm", algorithm cannot be nil.' + end + @algorithm = algorithm + end + + # Custom attribute writer method with validation + # @param level [Object] Object to be assigned + # @!visibility private + def level=(level) + if level.nil? + fail ArgumentError, 'invalid value for "level", level cannot be nil.' + end + if level > 9 + fail ArgumentError, 'invalid value for "level", must be smaller than or equal to 9.' + end + if level < 1 + fail ArgumentError, 'invalid value for "level", must be greater than or equal to 1.' + end + @level = level + 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 && + algorithm == o.algorithm && + level == o.level && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [algorithm, level, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_amazon_s3_destination_compression_gzip_type.rb b/lib/datadog_api_client/v2/models/observability_pipeline_amazon_s3_destination_compression_gzip_type.rb new file mode 100644 index 000000000000..5667a14b8ba5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_amazon_s3_destination_compression_gzip_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 compression type. Always `gzip`. + class ObservabilityPipelineAmazonS3DestinationCompressionGzipType + include BaseEnumModel + + GZIP = "gzip".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_amazon_s3_destination_compression_zstd.rb b/lib/datadog_api_client/v2/models/observability_pipeline_amazon_s3_destination_compression_zstd.rb new file mode 100644 index 000000000000..073c278663cd --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_amazon_s3_destination_compression_zstd.rb @@ -0,0 +1,152 @@ +=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 + # Zstd compression. + class ObservabilityPipelineAmazonS3DestinationCompressionZstd + include BaseGenericModel + + # The compression type. Always `zstd`. + attr_reader :algorithm + + # Zstd compression level. Valid values range from `1` to` 21`. + attr_reader :level + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'algorithm' => :'algorithm', + :'level' => :'level' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'algorithm' => :'ObservabilityPipelineAmazonS3DestinationCompressionZstdType', + :'level' => :'Integer' + } + 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::ObservabilityPipelineAmazonS3DestinationCompressionZstd` 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?(:'algorithm') + self.algorithm = attributes[:'algorithm'] + end + + if attributes.key?(:'level') + self.level = attributes[:'level'] + 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 @algorithm.nil? + return false if @level.nil? + return false if @level > 21 + return false if @level < 1 + true + end + + # Custom attribute writer method with validation + # @param algorithm [Object] Object to be assigned + # @!visibility private + def algorithm=(algorithm) + if algorithm.nil? + fail ArgumentError, 'invalid value for "algorithm", algorithm cannot be nil.' + end + @algorithm = algorithm + end + + # Custom attribute writer method with validation + # @param level [Object] Object to be assigned + # @!visibility private + def level=(level) + if level.nil? + fail ArgumentError, 'invalid value for "level", level cannot be nil.' + end + if level > 21 + fail ArgumentError, 'invalid value for "level", must be smaller than or equal to 21.' + end + if level < 1 + fail ArgumentError, 'invalid value for "level", must be greater than or equal to 1.' + end + @level = level + 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 && + algorithm == o.algorithm && + level == o.level && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [algorithm, level, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_amazon_s3_destination_compression_zstd_type.rb b/lib/datadog_api_client/v2/models/observability_pipeline_amazon_s3_destination_compression_zstd_type.rb new file mode 100644 index 000000000000..206fa74af0e3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_amazon_s3_destination_compression_zstd_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 compression type. Always `zstd`. + class ObservabilityPipelineAmazonS3DestinationCompressionZstdType + include BaseEnumModel + + ZSTD = "zstd".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_azure_storage_destination_compression.rb b/lib/datadog_api_client/v2/models/observability_pipeline_azure_storage_destination_compression.rb new file mode 100644 index 000000000000..8ee32c9095a2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_azure_storage_destination_compression.rb @@ -0,0 +1,64 @@ +=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 + # Compression configuration for archived logs. When omitted, logs are compressed with gzip + # for backward compatibility. + module ObservabilityPipelineAzureStorageDestinationCompression + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'ObservabilityPipelineAzureStorageDestinationCompressionZstd', + :'ObservabilityPipelineAzureStorageDestinationCompressionGzip' + ] + 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/observability_pipeline_azure_storage_destination_compression_gzip.rb b/lib/datadog_api_client/v2/models/observability_pipeline_azure_storage_destination_compression_gzip.rb new file mode 100644 index 000000000000..f7a0c1e284e6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_azure_storage_destination_compression_gzip.rb @@ -0,0 +1,152 @@ +=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 + # Gzip compression. + class ObservabilityPipelineAzureStorageDestinationCompressionGzip + include BaseGenericModel + + # The compression type. Always `gzip`. + attr_reader :algorithm + + # Gzip compression level. Valid values range from `1` to `9`. + attr_reader :level + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'algorithm' => :'algorithm', + :'level' => :'level' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'algorithm' => :'ObservabilityPipelineAzureStorageDestinationCompressionGzipType', + :'level' => :'Integer' + } + 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::ObservabilityPipelineAzureStorageDestinationCompressionGzip` 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?(:'algorithm') + self.algorithm = attributes[:'algorithm'] + end + + if attributes.key?(:'level') + self.level = attributes[:'level'] + 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 @algorithm.nil? + return false if @level.nil? + return false if @level > 9 + return false if @level < 1 + true + end + + # Custom attribute writer method with validation + # @param algorithm [Object] Object to be assigned + # @!visibility private + def algorithm=(algorithm) + if algorithm.nil? + fail ArgumentError, 'invalid value for "algorithm", algorithm cannot be nil.' + end + @algorithm = algorithm + end + + # Custom attribute writer method with validation + # @param level [Object] Object to be assigned + # @!visibility private + def level=(level) + if level.nil? + fail ArgumentError, 'invalid value for "level", level cannot be nil.' + end + if level > 9 + fail ArgumentError, 'invalid value for "level", must be smaller than or equal to 9.' + end + if level < 1 + fail ArgumentError, 'invalid value for "level", must be greater than or equal to 1.' + end + @level = level + 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 && + algorithm == o.algorithm && + level == o.level && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [algorithm, level, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_azure_storage_destination_compression_gzip_type.rb b/lib/datadog_api_client/v2/models/observability_pipeline_azure_storage_destination_compression_gzip_type.rb new file mode 100644 index 000000000000..d6675236749b --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_azure_storage_destination_compression_gzip_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 compression type. Always `gzip`. + class ObservabilityPipelineAzureStorageDestinationCompressionGzipType + include BaseEnumModel + + GZIP = "gzip".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_azure_storage_destination_compression_zstd.rb b/lib/datadog_api_client/v2/models/observability_pipeline_azure_storage_destination_compression_zstd.rb new file mode 100644 index 000000000000..d3945dc4d1df --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_azure_storage_destination_compression_zstd.rb @@ -0,0 +1,152 @@ +=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 + # Zstd compression. + class ObservabilityPipelineAzureStorageDestinationCompressionZstd + include BaseGenericModel + + # The compression type. Always `zstd`. + attr_reader :algorithm + + # Zstd compression level. Valid values range from `1` to `21`. + attr_reader :level + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'algorithm' => :'algorithm', + :'level' => :'level' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'algorithm' => :'ObservabilityPipelineAzureStorageDestinationCompressionZstdType', + :'level' => :'Integer' + } + 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::ObservabilityPipelineAzureStorageDestinationCompressionZstd` 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?(:'algorithm') + self.algorithm = attributes[:'algorithm'] + end + + if attributes.key?(:'level') + self.level = attributes[:'level'] + 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 @algorithm.nil? + return false if @level.nil? + return false if @level > 21 + return false if @level < 1 + true + end + + # Custom attribute writer method with validation + # @param algorithm [Object] Object to be assigned + # @!visibility private + def algorithm=(algorithm) + if algorithm.nil? + fail ArgumentError, 'invalid value for "algorithm", algorithm cannot be nil.' + end + @algorithm = algorithm + end + + # Custom attribute writer method with validation + # @param level [Object] Object to be assigned + # @!visibility private + def level=(level) + if level.nil? + fail ArgumentError, 'invalid value for "level", level cannot be nil.' + end + if level > 21 + fail ArgumentError, 'invalid value for "level", must be smaller than or equal to 21.' + end + if level < 1 + fail ArgumentError, 'invalid value for "level", must be greater than or equal to 1.' + end + @level = level + 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 && + algorithm == o.algorithm && + level == o.level && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [algorithm, level, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_azure_storage_destination_compression_zstd_type.rb b/lib/datadog_api_client/v2/models/observability_pipeline_azure_storage_destination_compression_zstd_type.rb new file mode 100644 index 000000000000..2c8310b20672 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_azure_storage_destination_compression_zstd_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 compression type. Always `zstd`. + class ObservabilityPipelineAzureStorageDestinationCompressionZstdType + include BaseEnumModel + + ZSTD = "zstd".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_google_cloud_storage_destination.rb b/lib/datadog_api_client/v2/models/observability_pipeline_google_cloud_storage_destination.rb index fa01150eb40a..e008a3cd3f05 100644 --- a/lib/datadog_api_client/v2/models/observability_pipeline_google_cloud_storage_destination.rb +++ b/lib/datadog_api_client/v2/models/observability_pipeline_google_cloud_storage_destination.rb @@ -36,6 +36,10 @@ class ObservabilityPipelineGoogleCloudStorageDestination # Configuration for buffer settings on destination components. attr_accessor :buffer + # Compression configuration for archived logs. When omitted, logs are compressed with gzip + # for backward compatibility. + attr_accessor :compression + # Unique identifier for the destination component. attr_reader :id @@ -64,6 +68,7 @@ def self.attribute_map :'auth' => :'auth', :'bucket' => :'bucket', :'buffer' => :'buffer', + :'compression' => :'compression', :'id' => :'id', :'inputs' => :'inputs', :'key_prefix' => :'key_prefix', @@ -81,6 +86,7 @@ def self.openapi_types :'auth' => :'ObservabilityPipelineGcpAuth', :'bucket' => :'String', :'buffer' => :'ObservabilityPipelineBufferOptions', + :'compression' => :'ObservabilityPipelineGoogleCloudStorageDestinationCompression', :'id' => :'String', :'inputs' => :'Array', :'key_prefix' => :'String', @@ -124,6 +130,10 @@ def initialize(attributes = {}) self.buffer = attributes[:'buffer'] end + if attributes.key?(:'compression') + self.compression = attributes[:'compression'] + end + if attributes.key?(:'id') self.id = attributes[:'id'] end @@ -245,6 +255,7 @@ def ==(o) auth == o.auth && bucket == o.bucket && buffer == o.buffer && + compression == o.compression && id == o.id && inputs == o.inputs && key_prefix == o.key_prefix && @@ -258,7 +269,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [acl, auth, bucket, buffer, id, inputs, key_prefix, metadata, storage_class, type, additional_properties].hash + [acl, auth, bucket, buffer, compression, id, inputs, key_prefix, metadata, storage_class, type, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_google_cloud_storage_destination_compression.rb b/lib/datadog_api_client/v2/models/observability_pipeline_google_cloud_storage_destination_compression.rb new file mode 100644 index 000000000000..b01cc82b973d --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_google_cloud_storage_destination_compression.rb @@ -0,0 +1,64 @@ +=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 + # Compression configuration for archived logs. When omitted, logs are compressed with gzip + # for backward compatibility. + module ObservabilityPipelineGoogleCloudStorageDestinationCompression + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'ObservabilityPipelineGoogleCloudStorageDestinationCompressionZstd', + :'ObservabilityPipelineGoogleCloudStorageDestinationCompressionGzip' + ] + 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/observability_pipeline_google_cloud_storage_destination_compression_gzip.rb b/lib/datadog_api_client/v2/models/observability_pipeline_google_cloud_storage_destination_compression_gzip.rb new file mode 100644 index 000000000000..1e4eacb3373b --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_google_cloud_storage_destination_compression_gzip.rb @@ -0,0 +1,152 @@ +=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 + # Gzip compression. + class ObservabilityPipelineGoogleCloudStorageDestinationCompressionGzip + include BaseGenericModel + + # The compression type. Always `gzip`. + attr_reader :algorithm + + # Gzip compression level. Valid values range from `1` to `9`. + attr_reader :level + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'algorithm' => :'algorithm', + :'level' => :'level' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'algorithm' => :'ObservabilityPipelineGoogleCloudStorageDestinationCompressionGzipType', + :'level' => :'Integer' + } + 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::ObservabilityPipelineGoogleCloudStorageDestinationCompressionGzip` 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?(:'algorithm') + self.algorithm = attributes[:'algorithm'] + end + + if attributes.key?(:'level') + self.level = attributes[:'level'] + 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 @algorithm.nil? + return false if @level.nil? + return false if @level > 9 + return false if @level < 1 + true + end + + # Custom attribute writer method with validation + # @param algorithm [Object] Object to be assigned + # @!visibility private + def algorithm=(algorithm) + if algorithm.nil? + fail ArgumentError, 'invalid value for "algorithm", algorithm cannot be nil.' + end + @algorithm = algorithm + end + + # Custom attribute writer method with validation + # @param level [Object] Object to be assigned + # @!visibility private + def level=(level) + if level.nil? + fail ArgumentError, 'invalid value for "level", level cannot be nil.' + end + if level > 9 + fail ArgumentError, 'invalid value for "level", must be smaller than or equal to 9.' + end + if level < 1 + fail ArgumentError, 'invalid value for "level", must be greater than or equal to 1.' + end + @level = level + 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 && + algorithm == o.algorithm && + level == o.level && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [algorithm, level, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_google_cloud_storage_destination_compression_gzip_type.rb b/lib/datadog_api_client/v2/models/observability_pipeline_google_cloud_storage_destination_compression_gzip_type.rb new file mode 100644 index 000000000000..0d15b6828520 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_google_cloud_storage_destination_compression_gzip_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 compression type. Always `gzip`. + class ObservabilityPipelineGoogleCloudStorageDestinationCompressionGzipType + include BaseEnumModel + + GZIP = "gzip".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_google_cloud_storage_destination_compression_zstd.rb b/lib/datadog_api_client/v2/models/observability_pipeline_google_cloud_storage_destination_compression_zstd.rb new file mode 100644 index 000000000000..ae9d1ca42210 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_google_cloud_storage_destination_compression_zstd.rb @@ -0,0 +1,152 @@ +=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 + # Zstd compression. + class ObservabilityPipelineGoogleCloudStorageDestinationCompressionZstd + include BaseGenericModel + + # The compression type. Always `zstd`. + attr_reader :algorithm + + # Zstd compression level. Valid values range from `1` to `21`. + attr_reader :level + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'algorithm' => :'algorithm', + :'level' => :'level' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'algorithm' => :'ObservabilityPipelineGoogleCloudStorageDestinationCompressionZstdType', + :'level' => :'Integer' + } + 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::ObservabilityPipelineGoogleCloudStorageDestinationCompressionZstd` 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?(:'algorithm') + self.algorithm = attributes[:'algorithm'] + end + + if attributes.key?(:'level') + self.level = attributes[:'level'] + 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 @algorithm.nil? + return false if @level.nil? + return false if @level > 21 + return false if @level < 1 + true + end + + # Custom attribute writer method with validation + # @param algorithm [Object] Object to be assigned + # @!visibility private + def algorithm=(algorithm) + if algorithm.nil? + fail ArgumentError, 'invalid value for "algorithm", algorithm cannot be nil.' + end + @algorithm = algorithm + end + + # Custom attribute writer method with validation + # @param level [Object] Object to be assigned + # @!visibility private + def level=(level) + if level.nil? + fail ArgumentError, 'invalid value for "level", level cannot be nil.' + end + if level > 21 + fail ArgumentError, 'invalid value for "level", must be smaller than or equal to 21.' + end + if level < 1 + fail ArgumentError, 'invalid value for "level", must be greater than or equal to 1.' + end + @level = level + 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 && + algorithm == o.algorithm && + level == o.level && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [algorithm, level, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_google_cloud_storage_destination_compression_zstd_type.rb b/lib/datadog_api_client/v2/models/observability_pipeline_google_cloud_storage_destination_compression_zstd_type.rb new file mode 100644 index 000000000000..34b37455a116 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_google_cloud_storage_destination_compression_zstd_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 compression type. Always `zstd`. + class ObservabilityPipelineGoogleCloudStorageDestinationCompressionZstdType + include BaseEnumModel + + ZSTD = "zstd".freeze + end +end