diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index d2192b74841..184c50dcc6b 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -35178,6 +35178,43 @@ components: type: string x-enum-varnames: - ADD_FIELDS + ObservabilityPipelineAddHostnameProcessor: + description: The `add_hostname` processor adds the hostname to log events. + properties: + display_name: + $ref: '#/components/schemas/ObservabilityPipelineComponentDisplayName' + enabled: + description: Whether this processor is enabled. + example: true + type: boolean + id: + description: The unique identifier for this component. Used to reference + this component in other parts of the pipeline (for example, as the `input` + to downstream components). + example: add-hostname-processor + type: string + include: + description: A Datadog search query used to determine which logs this processor + targets. + example: service:my-service + type: string + type: + $ref: '#/components/schemas/ObservabilityPipelineAddHostnameProcessorType' + required: + - id + - type + - include + - enabled + type: object + ObservabilityPipelineAddHostnameProcessorType: + default: add_hostname + description: The processor type. The value should always be `add_hostname`. + enum: + - add_hostname + example: add_hostname + type: string + x-enum-varnames: + - ADD_HOSTNAME ObservabilityPipelineAmazonDataFirehoseSource: description: The `amazon_data_firehose` source ingests logs from AWS Data Firehose. properties: @@ -35600,24 +35637,27 @@ components: ObservabilityPipelineConfigProcessorItem: description: A processor for the pipeline. oneOf: + - $ref: '#/components/schemas/ObservabilityPipelineAddEnvVarsProcessor' + - $ref: '#/components/schemas/ObservabilityPipelineAddFieldsProcessor' + - $ref: '#/components/schemas/ObservabilityPipelineAddHostnameProcessor' + - $ref: '#/components/schemas/ObservabilityPipelineCustomProcessor' + - $ref: '#/components/schemas/ObservabilityPipelineDatadogTagsProcessor' + - $ref: '#/components/schemas/ObservabilityPipelineDedupeProcessor' + - $ref: '#/components/schemas/ObservabilityPipelineEnrichmentTableProcessor' - $ref: '#/components/schemas/ObservabilityPipelineFilterProcessor' + - $ref: '#/components/schemas/ObservabilityPipelineGenerateMetricsProcessor' + - $ref: '#/components/schemas/ObservabilityPipelineOcsfMapperProcessor' + - $ref: '#/components/schemas/ObservabilityPipelineParseGrokProcessor' - $ref: '#/components/schemas/ObservabilityPipelineParseJSONProcessor' + - $ref: '#/components/schemas/ObservabilityPipelineParseXMLProcessor' - $ref: '#/components/schemas/ObservabilityPipelineQuotaProcessor' - - $ref: '#/components/schemas/ObservabilityPipelineAddFieldsProcessor' + - $ref: '#/components/schemas/ObservabilityPipelineReduceProcessor' - $ref: '#/components/schemas/ObservabilityPipelineRemoveFieldsProcessor' - $ref: '#/components/schemas/ObservabilityPipelineRenameFieldsProcessor' - - $ref: '#/components/schemas/ObservabilityPipelineGenerateMetricsProcessor' - $ref: '#/components/schemas/ObservabilityPipelineSampleProcessor' - - $ref: '#/components/schemas/ObservabilityPipelineParseGrokProcessor' - $ref: '#/components/schemas/ObservabilityPipelineSensitiveDataScannerProcessor' - - $ref: '#/components/schemas/ObservabilityPipelineOcsfMapperProcessor' - - $ref: '#/components/schemas/ObservabilityPipelineAddEnvVarsProcessor' - - $ref: '#/components/schemas/ObservabilityPipelineDedupeProcessor' - - $ref: '#/components/schemas/ObservabilityPipelineEnrichmentTableProcessor' - - $ref: '#/components/schemas/ObservabilityPipelineReduceProcessor' + - $ref: '#/components/schemas/ObservabilityPipelineSplitArrayProcessor' - $ref: '#/components/schemas/ObservabilityPipelineThrottleProcessor' - - $ref: '#/components/schemas/ObservabilityPipelineCustomProcessor' - - $ref: '#/components/schemas/ObservabilityPipelineDatadogTagsProcessor' ObservabilityPipelineConfigSourceItem: description: A data source for the pipeline. oneOf: @@ -37279,6 +37319,72 @@ components: type: string x-enum-varnames: - PARSE_JSON + ObservabilityPipelineParseXMLProcessor: + description: The `parse_xml` processor parses XML from a specified field and + extracts it into the event. + properties: + always_use_text_key: + description: Whether to always use a text key for element content. + type: boolean + attr_prefix: + description: The prefix to use for XML attributes in the parsed output. + type: string + display_name: + $ref: '#/components/schemas/ObservabilityPipelineComponentDisplayName' + enabled: + description: Whether this processor is enabled. + example: true + type: boolean + field: + description: The name of the log field that contains an XML string. + example: message + type: string + id: + description: The unique identifier for this component. Used to reference + this component in other parts of the pipeline (for example, as the `input` + to downstream components). + example: parse-xml-processor + type: string + include: + description: A Datadog search query used to determine which logs this processor + targets. + example: service:my-service + type: string + include_attr: + description: Whether to include XML attributes in the parsed output. + type: boolean + parse_bool: + description: Whether to parse boolean values from strings. + type: boolean + parse_null: + description: Whether to parse null values. + type: boolean + parse_number: + description: Whether to parse numeric values from strings. + type: boolean + text_key: + description: The key name to use for text content within XML elements. Must + be at least 1 character if specified. + minLength: 1 + type: string + type: + $ref: '#/components/schemas/ObservabilityPipelineParseXMLProcessorType' + required: + - id + - type + - include + - field + - enabled + type: object + ObservabilityPipelineParseXMLProcessorType: + default: parse_xml + description: The processor type. The value should always be `parse_xml`. + enum: + - parse_xml + example: parse_xml + type: string + x-enum-varnames: + - PARSE_XML ObservabilityPipelinePipelineKafkaSourceSaslMechanism: description: SASL mechanism used for Kafka authentication. enum: @@ -38442,6 +38548,68 @@ components: - type - attributes type: object + ObservabilityPipelineSplitArrayProcessor: + description: The `split_array` processor splits array fields into separate events + based on configured rules. + properties: + arrays: + description: A list of array split configurations. + items: + $ref: '#/components/schemas/ObservabilityPipelineSplitArrayProcessorArrayConfig' + maxItems: 15 + minItems: 1 + type: array + display_name: + $ref: '#/components/schemas/ObservabilityPipelineComponentDisplayName' + enabled: + description: Whether this processor is enabled. + example: true + type: boolean + id: + description: The unique identifier for this component. Used to reference + this component in other parts of the pipeline (for example, as the `input` + to downstream components). + example: split-array-processor + type: string + include: + description: A Datadog search query used to determine which logs this processor + targets. For split_array, this should typically be `*`. + example: '*' + type: string + type: + $ref: '#/components/schemas/ObservabilityPipelineSplitArrayProcessorType' + required: + - id + - type + - include + - arrays + - enabled + type: object + ObservabilityPipelineSplitArrayProcessorArrayConfig: + description: Configuration for a single array split operation. + properties: + field: + description: The path to the array field to split. + example: tags + type: string + include: + description: A Datadog search query used to determine which logs this array + split operation targets. + example: '*' + type: string + required: + - include + - field + type: object + ObservabilityPipelineSplitArrayProcessorType: + default: split_array + description: The processor type. The value should always be `split_array`. + enum: + - split_array + example: split_array + type: string + x-enum-varnames: + - SPLIT_ARRAY ObservabilityPipelineSplunkHecDestination: description: The `splunk_hec` destination forwards logs to Splunk using the HTTP Event Collector (HEC). diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 022391df787..cdf0e5c43e8 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3139,6 +3139,8 @@ def overrides "v2.observability_pipeline_add_env_vars_processor_variable" => "ObservabilityPipelineAddEnvVarsProcessorVariable", "v2.observability_pipeline_add_fields_processor" => "ObservabilityPipelineAddFieldsProcessor", "v2.observability_pipeline_add_fields_processor_type" => "ObservabilityPipelineAddFieldsProcessorType", + "v2.observability_pipeline_add_hostname_processor" => "ObservabilityPipelineAddHostnameProcessor", + "v2.observability_pipeline_add_hostname_processor_type" => "ObservabilityPipelineAddHostnameProcessorType", "v2.observability_pipeline_amazon_data_firehose_source" => "ObservabilityPipelineAmazonDataFirehoseSource", "v2.observability_pipeline_amazon_data_firehose_source_type" => "ObservabilityPipelineAmazonDataFirehoseSourceType", "v2.observability_pipeline_amazon_open_search_destination" => "ObservabilityPipelineAmazonOpenSearchDestination", @@ -3252,6 +3254,8 @@ def overrides "v2.observability_pipeline_parse_grok_processor_type" => "ObservabilityPipelineParseGrokProcessorType", "v2.observability_pipeline_parse_json_processor" => "ObservabilityPipelineParseJSONProcessor", "v2.observability_pipeline_parse_json_processor_type" => "ObservabilityPipelineParseJSONProcessorType", + "v2.observability_pipeline_parse_xml_processor" => "ObservabilityPipelineParseXMLProcessor", + "v2.observability_pipeline_parse_xml_processor_type" => "ObservabilityPipelineParseXMLProcessorType", "v2.observability_pipeline_pipeline_kafka_source_sasl_mechanism" => "ObservabilityPipelinePipelineKafkaSourceSaslMechanism", "v2.observability_pipeline_quota_processor" => "ObservabilityPipelineQuotaProcessor", "v2.observability_pipeline_quota_processor_limit" => "ObservabilityPipelineQuotaProcessorLimit", @@ -3333,6 +3337,9 @@ def overrides "v2.observability_pipeline_socket_source_type" => "ObservabilityPipelineSocketSourceType", "v2.observability_pipeline_spec" => "ObservabilityPipelineSpec", "v2.observability_pipeline_spec_data" => "ObservabilityPipelineSpecData", + "v2.observability_pipeline_split_array_processor" => "ObservabilityPipelineSplitArrayProcessor", + "v2.observability_pipeline_split_array_processor_array_config" => "ObservabilityPipelineSplitArrayProcessorArrayConfig", + "v2.observability_pipeline_split_array_processor_type" => "ObservabilityPipelineSplitArrayProcessorType", "v2.observability_pipeline_splunk_hec_destination" => "ObservabilityPipelineSplunkHecDestination", "v2.observability_pipeline_splunk_hec_destination_encoding" => "ObservabilityPipelineSplunkHecDestinationEncoding", "v2.observability_pipeline_splunk_hec_destination_type" => "ObservabilityPipelineSplunkHecDestinationType", diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_add_hostname_processor.rb b/lib/datadog_api_client/v2/models/observability_pipeline_add_hostname_processor.rb new file mode 100644 index 00000000000..79b62c26b11 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_add_hostname_processor.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 `add_hostname` processor adds the hostname to log events. + class ObservabilityPipelineAddHostnameProcessor + include BaseGenericModel + + # The display name for a component. + attr_accessor :display_name + + # Whether this processor is enabled. + attr_reader :enabled + + # The unique identifier for this component. Used to reference this component in other parts of the pipeline (for example, as the `input` to downstream components). + attr_reader :id + + # A Datadog search query used to determine which logs this processor targets. + attr_reader :include + + # The processor type. The value should always be `add_hostname`. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'display_name' => :'display_name', + :'enabled' => :'enabled', + :'id' => :'id', + :'include' => :'include', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'display_name' => :'String', + :'enabled' => :'Boolean', + :'id' => :'String', + :'include' => :'String', + :'type' => :'ObservabilityPipelineAddHostnameProcessorType' + } + 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::ObservabilityPipelineAddHostnameProcessor` 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?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'include') + self.include = attributes[:'include'] + 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 @enabled.nil? + return false if @id.nil? + return false if @include.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param enabled [Object] Object to be assigned + # @!visibility private + def enabled=(enabled) + if enabled.nil? + fail ArgumentError, 'invalid value for "enabled", enabled cannot be nil.' + end + @enabled = enabled + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param include [Object] Object to be assigned + # @!visibility private + def include=(include) + if include.nil? + fail ArgumentError, 'invalid value for "include", include cannot be nil.' + end + @include = include + 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 && + display_name == o.display_name && + enabled == o.enabled && + id == o.id && + include == o.include && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [display_name, enabled, id, include, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_add_hostname_processor_type.rb b/lib/datadog_api_client/v2/models/observability_pipeline_add_hostname_processor_type.rb new file mode 100644 index 00000000000..5eca2a92ffb --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_add_hostname_processor_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 processor type. The value should always be `add_hostname`. + class ObservabilityPipelineAddHostnameProcessorType + include BaseEnumModel + + ADD_HOSTNAME = "add_hostname".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_config_processor_item.rb b/lib/datadog_api_client/v2/models/observability_pipeline_config_processor_item.rb index 334f6e14d8a..81425314ebe 100644 --- a/lib/datadog_api_client/v2/models/observability_pipeline_config_processor_item.rb +++ b/lib/datadog_api_client/v2/models/observability_pipeline_config_processor_item.rb @@ -26,24 +26,27 @@ class << self # List of class defined in oneOf (OpenAPI v3) def openapi_one_of [ + :'ObservabilityPipelineAddEnvVarsProcessor', + :'ObservabilityPipelineAddFieldsProcessor', + :'ObservabilityPipelineAddHostnameProcessor', + :'ObservabilityPipelineCustomProcessor', + :'ObservabilityPipelineDatadogTagsProcessor', + :'ObservabilityPipelineDedupeProcessor', + :'ObservabilityPipelineEnrichmentTableProcessor', :'ObservabilityPipelineFilterProcessor', + :'ObservabilityPipelineGenerateMetricsProcessor', + :'ObservabilityPipelineOcsfMapperProcessor', + :'ObservabilityPipelineParseGrokProcessor', :'ObservabilityPipelineParseJSONProcessor', + :'ObservabilityPipelineParseXMLProcessor', :'ObservabilityPipelineQuotaProcessor', - :'ObservabilityPipelineAddFieldsProcessor', + :'ObservabilityPipelineReduceProcessor', :'ObservabilityPipelineRemoveFieldsProcessor', :'ObservabilityPipelineRenameFieldsProcessor', - :'ObservabilityPipelineGenerateMetricsProcessor', :'ObservabilityPipelineSampleProcessor', - :'ObservabilityPipelineParseGrokProcessor', :'ObservabilityPipelineSensitiveDataScannerProcessor', - :'ObservabilityPipelineOcsfMapperProcessor', - :'ObservabilityPipelineAddEnvVarsProcessor', - :'ObservabilityPipelineDedupeProcessor', - :'ObservabilityPipelineEnrichmentTableProcessor', - :'ObservabilityPipelineReduceProcessor', - :'ObservabilityPipelineThrottleProcessor', - :'ObservabilityPipelineCustomProcessor', - :'ObservabilityPipelineDatadogTagsProcessor' + :'ObservabilityPipelineSplitArrayProcessor', + :'ObservabilityPipelineThrottleProcessor' ] end # Builds the object diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_parse_xml_processor.rb b/lib/datadog_api_client/v2/models/observability_pipeline_parse_xml_processor.rb new file mode 100644 index 00000000000..4ef12815814 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_parse_xml_processor.rb @@ -0,0 +1,298 @@ +=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 `parse_xml` processor parses XML from a specified field and extracts it into the event. + class ObservabilityPipelineParseXMLProcessor + include BaseGenericModel + + # Whether to always use a text key for element content. + attr_accessor :always_use_text_key + + # The prefix to use for XML attributes in the parsed output. + attr_accessor :attr_prefix + + # The display name for a component. + attr_accessor :display_name + + # Whether this processor is enabled. + attr_reader :enabled + + # The name of the log field that contains an XML string. + attr_reader :field + + # The unique identifier for this component. Used to reference this component in other parts of the pipeline (for example, as the `input` to downstream components). + attr_reader :id + + # A Datadog search query used to determine which logs this processor targets. + attr_reader :include + + # Whether to include XML attributes in the parsed output. + attr_accessor :include_attr + + # Whether to parse boolean values from strings. + attr_accessor :parse_bool + + # Whether to parse null values. + attr_accessor :parse_null + + # Whether to parse numeric values from strings. + attr_accessor :parse_number + + # The key name to use for text content within XML elements. Must be at least 1 character if specified. + attr_reader :text_key + + # The processor type. The value should always be `parse_xml`. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'always_use_text_key' => :'always_use_text_key', + :'attr_prefix' => :'attr_prefix', + :'display_name' => :'display_name', + :'enabled' => :'enabled', + :'field' => :'field', + :'id' => :'id', + :'include' => :'include', + :'include_attr' => :'include_attr', + :'parse_bool' => :'parse_bool', + :'parse_null' => :'parse_null', + :'parse_number' => :'parse_number', + :'text_key' => :'text_key', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'always_use_text_key' => :'Boolean', + :'attr_prefix' => :'String', + :'display_name' => :'String', + :'enabled' => :'Boolean', + :'field' => :'String', + :'id' => :'String', + :'include' => :'String', + :'include_attr' => :'Boolean', + :'parse_bool' => :'Boolean', + :'parse_null' => :'Boolean', + :'parse_number' => :'Boolean', + :'text_key' => :'String', + :'type' => :'ObservabilityPipelineParseXMLProcessorType' + } + 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::ObservabilityPipelineParseXMLProcessor` 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?(:'always_use_text_key') + self.always_use_text_key = attributes[:'always_use_text_key'] + end + + if attributes.key?(:'attr_prefix') + self.attr_prefix = attributes[:'attr_prefix'] + end + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'field') + self.field = attributes[:'field'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'include') + self.include = attributes[:'include'] + end + + if attributes.key?(:'include_attr') + self.include_attr = attributes[:'include_attr'] + end + + if attributes.key?(:'parse_bool') + self.parse_bool = attributes[:'parse_bool'] + end + + if attributes.key?(:'parse_null') + self.parse_null = attributes[:'parse_null'] + end + + if attributes.key?(:'parse_number') + self.parse_number = attributes[:'parse_number'] + end + + if attributes.key?(:'text_key') + self.text_key = attributes[:'text_key'] + 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 @enabled.nil? + return false if @field.nil? + return false if @id.nil? + return false if @include.nil? + return false if !@text_key.nil? && @text_key.to_s.length < 1 + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param enabled [Object] Object to be assigned + # @!visibility private + def enabled=(enabled) + if enabled.nil? + fail ArgumentError, 'invalid value for "enabled", enabled cannot be nil.' + end + @enabled = enabled + end + + # Custom attribute writer method with validation + # @param field [Object] Object to be assigned + # @!visibility private + def field=(field) + if field.nil? + fail ArgumentError, 'invalid value for "field", field cannot be nil.' + end + @field = field + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param include [Object] Object to be assigned + # @!visibility private + def include=(include) + if include.nil? + fail ArgumentError, 'invalid value for "include", include cannot be nil.' + end + @include = include + end + + # Custom attribute writer method with validation + # @param text_key [Object] Object to be assigned + # @!visibility private + def text_key=(text_key) + if !text_key.nil? && text_key.to_s.length < 1 + fail ArgumentError, 'invalid value for "text_key", the character length must be great than or equal to 1.' + end + @text_key = text_key + 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 && + always_use_text_key == o.always_use_text_key && + attr_prefix == o.attr_prefix && + display_name == o.display_name && + enabled == o.enabled && + field == o.field && + id == o.id && + include == o.include && + include_attr == o.include_attr && + parse_bool == o.parse_bool && + parse_null == o.parse_null && + parse_number == o.parse_number && + text_key == o.text_key && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [always_use_text_key, attr_prefix, display_name, enabled, field, id, include, include_attr, parse_bool, parse_null, parse_number, text_key, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_parse_xml_processor_type.rb b/lib/datadog_api_client/v2/models/observability_pipeline_parse_xml_processor_type.rb new file mode 100644 index 00000000000..c75fd6adfa8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_parse_xml_processor_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 processor type. The value should always be `parse_xml`. + class ObservabilityPipelineParseXMLProcessorType + include BaseEnumModel + + PARSE_XML = "parse_xml".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_split_array_processor.rb b/lib/datadog_api_client/v2/models/observability_pipeline_split_array_processor.rb new file mode 100644 index 00000000000..43ad55c6ebc --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_split_array_processor.rb @@ -0,0 +1,227 @@ +=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 `split_array` processor splits array fields into separate events based on configured rules. + class ObservabilityPipelineSplitArrayProcessor + include BaseGenericModel + + # A list of array split configurations. + attr_reader :arrays + + # The display name for a component. + attr_accessor :display_name + + # Whether this processor is enabled. + attr_reader :enabled + + # The unique identifier for this component. Used to reference this component in other parts of the pipeline (for example, as the `input` to downstream components). + attr_reader :id + + # A Datadog search query used to determine which logs this processor targets. For split_array, this should typically be `*`. + attr_reader :include + + # The processor type. The value should always be `split_array`. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'arrays' => :'arrays', + :'display_name' => :'display_name', + :'enabled' => :'enabled', + :'id' => :'id', + :'include' => :'include', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'arrays' => :'Array', + :'display_name' => :'String', + :'enabled' => :'Boolean', + :'id' => :'String', + :'include' => :'String', + :'type' => :'ObservabilityPipelineSplitArrayProcessorType' + } + 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::ObservabilityPipelineSplitArrayProcessor` 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?(:'arrays') + if (value = attributes[:'arrays']).is_a?(Array) + self.arrays = value + end + end + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'include') + self.include = attributes[:'include'] + 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 @arrays.nil? + return false if @arrays.length > 15 + return false if @arrays.length < 1 + return false if @enabled.nil? + return false if @id.nil? + return false if @include.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param arrays [Object] Object to be assigned + # @!visibility private + def arrays=(arrays) + if arrays.nil? + fail ArgumentError, 'invalid value for "arrays", arrays cannot be nil.' + end + if arrays.length > 15 + fail ArgumentError, 'invalid value for "arrays", number of items must be less than or equal to 15.' + end + if arrays.length < 1 + fail ArgumentError, 'invalid value for "arrays", number of items must be greater than or equal to 1.' + end + @arrays = arrays + end + + # Custom attribute writer method with validation + # @param enabled [Object] Object to be assigned + # @!visibility private + def enabled=(enabled) + if enabled.nil? + fail ArgumentError, 'invalid value for "enabled", enabled cannot be nil.' + end + @enabled = enabled + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param include [Object] Object to be assigned + # @!visibility private + def include=(include) + if include.nil? + fail ArgumentError, 'invalid value for "include", include cannot be nil.' + end + @include = include + 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 && + arrays == o.arrays && + display_name == o.display_name && + enabled == o.enabled && + id == o.id && + include == o.include && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [arrays, display_name, enabled, id, include, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_split_array_processor_array_config.rb b/lib/datadog_api_client/v2/models/observability_pipeline_split_array_processor_array_config.rb new file mode 100644 index 00000000000..50595a66851 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_split_array_processor_array_config.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 + # Configuration for a single array split operation. + class ObservabilityPipelineSplitArrayProcessorArrayConfig + include BaseGenericModel + + # The path to the array field to split. + attr_reader :field + + # A Datadog search query used to determine which logs this array split operation targets. + attr_reader :include + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'field' => :'field', + :'include' => :'include' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'field' => :'String', + :'include' => :'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::ObservabilityPipelineSplitArrayProcessorArrayConfig` 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?(:'field') + self.field = attributes[:'field'] + end + + if attributes.key?(:'include') + self.include = attributes[:'include'] + 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 @field.nil? + return false if @include.nil? + true + end + + # Custom attribute writer method with validation + # @param field [Object] Object to be assigned + # @!visibility private + def field=(field) + if field.nil? + fail ArgumentError, 'invalid value for "field", field cannot be nil.' + end + @field = field + end + + # Custom attribute writer method with validation + # @param include [Object] Object to be assigned + # @!visibility private + def include=(include) + if include.nil? + fail ArgumentError, 'invalid value for "include", include cannot be nil.' + end + @include = include + 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 && + field == o.field && + include == o.include && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [field, include, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_split_array_processor_type.rb b/lib/datadog_api_client/v2/models/observability_pipeline_split_array_processor_type.rb new file mode 100644 index 00000000000..fcb416f78ac --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_split_array_processor_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 processor type. The value should always be `split_array`. + class ObservabilityPipelineSplitArrayProcessorType + include BaseEnumModel + + SPLIT_ARRAY = "split_array".freeze + end +end