From 6a097136d09db2c3c70779d0e46a668637259959 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 22 Jun 2026 20:29:28 +0000 Subject: [PATCH] Regenerate client from commit 9acd650 of spec repo --- .generator/schemas/v2/openapi.yaml | 123 +++++++++ ...rce-bearer-auth-returns-OK-response.frozen | 1 + ...source-bearer-auth-returns-OK-response.yml | 27 ++ .../ValidatePipeline_337125830.rb | 56 ++++ features/v2/observability_pipelines.feature | 8 + lib/datadog_api_client/inflector.rb | 8 + ...servability_pipeline_config_source_item.rb | 1 + ...observability_pipeline_websocket_source.rb | 248 ++++++++++++++++++ ...pipeline_websocket_source_auth_strategy.rb | 29 ++ ...rvability_pipeline_websocket_source_tls.rb | 63 +++++ ...y_pipeline_websocket_source_tls_enabled.rb | 123 +++++++++ ...eline_websocket_source_tls_enabled_mode.rb | 26 ++ ...e_websocket_source_tls_with_client_cert.rb | 174 ++++++++++++ ...socket_source_tls_with_client_cert_mode.rb | 26 ++ ...vability_pipeline_websocket_source_type.rb | 26 ++ 15 files changed, 939 insertions(+) create mode 100644 cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-websocket-source-bearer-auth-returns-OK-response.frozen create mode 100644 cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-websocket-source-bearer-auth-returns-OK-response.yml create mode 100644 examples/v2/observability-pipelines/ValidatePipeline_337125830.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_websocket_source.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_auth_strategy.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_enabled.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_enabled_mode.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_with_client_cert.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_with_client_cert_mode.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_type.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 99b25f0ac87f..6cf281e9b3a2 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -63949,6 +63949,7 @@ components: - $ref: "#/components/schemas/ObservabilityPipelineSplunkTcpSource" - $ref: "#/components/schemas/ObservabilityPipelineSumoLogicSource" - $ref: "#/components/schemas/ObservabilityPipelineSyslogNgSource" + - $ref: "#/components/schemas/ObservabilityPipelineWebsocketSource" - $ref: "#/components/schemas/ObservabilityPipelineOpentelemetrySource" ObservabilityPipelineCrowdStrikeNextGenSiemDestination: description: |- @@ -68605,6 +68606,128 @@ components: required: - crt_file type: object + ObservabilityPipelineWebsocketSource: + description: |- + The `websocket` source ingests logs from a WebSocket server using the `ws://` or `wss://` protocol. + + **Supported pipeline types:** logs. + properties: + auth_strategy: + $ref: "#/components/schemas/ObservabilityPipelineWebsocketSourceAuthStrategy" + custom_key: + description: Name of the environment variable or secret that holds the custom authorization header value. Used when `auth_strategy` is `custom`. + example: WS_AUTH_CUSTOM_HEADER + type: string + decoding: + $ref: "#/components/schemas/ObservabilityPipelineDecoding" + id: + description: The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). + example: websocket-source + type: string + password_key: + description: Name of the environment variable or secret that holds the password. Used when `auth_strategy` is `basic`. + example: WS_AUTH_PASSWORD + type: string + tls: + $ref: "#/components/schemas/ObservabilityPipelineWebsocketSourceTls" + token_key: + description: Name of the environment variable or secret that holds the bearer token. Used when `auth_strategy` is `bearer`. + example: WS_BEARER_TOKEN + type: string + type: + $ref: "#/components/schemas/ObservabilityPipelineWebsocketSourceType" + uri_key: + description: Name of the environment variable or secret that holds the WebSocket server URI (`ws://` or `wss://`). + example: WS_URI + type: string + username_key: + description: Name of the environment variable or secret that holds the username. Used when `auth_strategy` is `basic`. + example: WS_AUTH_USERNAME + type: string + required: + - id + - type + - decoding + - auth_strategy + type: object + x-pipeline-types: [logs] + ObservabilityPipelineWebsocketSourceAuthStrategy: + description: Authentication strategy for the WebSocket source connection. + enum: + - none + - basic + - bearer + - custom + example: bearer + type: string + x-enum-varnames: + - NONE + - BASIC + - BEARER + - CUSTOM + ObservabilityPipelineWebsocketSourceTls: + description: TLS configuration for the WebSocket source. Use `enabled` for standard `wss://` connections, or `with_client_cert` to present a client certificate for mutual TLS. + oneOf: + - $ref: "#/components/schemas/ObservabilityPipelineWebsocketSourceTlsEnabled" + - $ref: "#/components/schemas/ObservabilityPipelineWebsocketSourceTlsWithClientCert" + ObservabilityPipelineWebsocketSourceTlsEnabled: + description: TLS configuration that enables encryption without a client certificate. Use this for standard `wss://` connections that do not require mutual TLS. + properties: + mode: + $ref: "#/components/schemas/ObservabilityPipelineWebsocketSourceTlsEnabledMode" + required: + - mode + type: object + ObservabilityPipelineWebsocketSourceTlsEnabledMode: + description: TLS mode. Must be `enabled`. + enum: + - enabled + example: enabled + type: string + x-enum-varnames: + - ENABLED + ObservabilityPipelineWebsocketSourceTlsWithClientCert: + description: TLS configuration that enables encryption and presents a client certificate for mutual TLS authentication. + properties: + ca_file: + description: Path to the Certificate Authority (CA) file used to validate the remote server's TLS certificate. + example: /path/to/ca.crt + type: string + crt_file: + description: Path to the TLS client certificate file used to identify this source to the remote server. + example: /path/to/client.crt + type: string + key_file: + description: Path to the private key file associated with the client certificate. + example: /path/to/client.key + type: string + key_pass_key: + description: Name of the environment variable or secret that holds the passphrase for the private key file. + example: WS_TLS_KEY_PASSPHRASE + type: string + mode: + $ref: "#/components/schemas/ObservabilityPipelineWebsocketSourceTlsWithClientCertMode" + required: + - mode + - crt_file + type: object + ObservabilityPipelineWebsocketSourceTlsWithClientCertMode: + description: TLS mode. Must be `with_client_cert`. + enum: + - with_client_cert + example: with_client_cert + type: string + x-enum-varnames: + - WITH_CLIENT_CERT + ObservabilityPipelineWebsocketSourceType: + default: websocket + description: The source type. The value should always be `websocket`. + enum: + - websocket + example: websocket + type: string + x-enum-varnames: + - WEBSOCKET OktaAPIToken: description: The definition of the `OktaAPIToken` object. properties: diff --git a/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-websocket-source-bearer-auth-returns-OK-response.frozen b/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-websocket-source-bearer-auth-returns-OK-response.frozen new file mode 100644 index 000000000000..e092c16a233e --- /dev/null +++ b/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-websocket-source-bearer-auth-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-06-22T19:51:31.598Z \ No newline at end of file diff --git a/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-websocket-source-bearer-auth-returns-OK-response.yml b/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-websocket-source-bearer-auth-returns-OK-response.yml new file mode 100644 index 000000000000..a54a8bded108 --- /dev/null +++ b/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-websocket-source-bearer-auth-returns-OK-response.yml @@ -0,0 +1,27 @@ +http_interactions: +- recorded_at: Mon, 22 Jun 2026 19:51:31 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"config":{"destinations":[{"id":"datadog-logs-destination","inputs":["my-processor-group"],"type":"datadog_logs"}],"processor_groups":[{"enabled":true,"id":"my-processor-group","include":"service:my-service","inputs":["websocket-source"],"processors":[{"enabled":true,"id":"filter-processor","include":"status:error","type":"filter"}]}],"sources":[{"auth_strategy":"bearer","decoding":"json","id":"websocket-source","tls":{"mode":"enabled"},"token_key":"WS_BEARER_TOKEN","type":"websocket","uri_key":"WS_URI"}]},"name":"Pipeline + with WebSocket Source"},"type":"pipelines"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/obs-pipelines/pipelines/validate + response: + body: + encoding: UTF-8 + string: '{"errors":[]} + + ' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v2/observability-pipelines/ValidatePipeline_337125830.rb b/examples/v2/observability-pipelines/ValidatePipeline_337125830.rb new file mode 100644 index 000000000000..71a7792d58bb --- /dev/null +++ b/examples/v2/observability-pipelines/ValidatePipeline_337125830.rb @@ -0,0 +1,56 @@ +# Validate an observability pipeline with websocket source bearer auth returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ObservabilityPipelinesAPI.new + +body = DatadogAPIClient::V2::ObservabilityPipelineSpec.new({ + data: DatadogAPIClient::V2::ObservabilityPipelineSpecData.new({ + attributes: DatadogAPIClient::V2::ObservabilityPipelineDataAttributes.new({ + config: DatadogAPIClient::V2::ObservabilityPipelineConfig.new({ + destinations: [ + DatadogAPIClient::V2::ObservabilityPipelineDatadogLogsDestination.new({ + id: "datadog-logs-destination", + inputs: [ + "my-processor-group", + ], + type: DatadogAPIClient::V2::ObservabilityPipelineDatadogLogsDestinationType::DATADOG_LOGS, + }), + ], + processor_groups: [ + DatadogAPIClient::V2::ObservabilityPipelineConfigProcessorGroup.new({ + enabled: true, + id: "my-processor-group", + include: "service:my-service", + inputs: [ + "websocket-source", + ], + processors: [ + DatadogAPIClient::V2::ObservabilityPipelineFilterProcessor.new({ + enabled: true, + id: "filter-processor", + include: "status:error", + type: DatadogAPIClient::V2::ObservabilityPipelineFilterProcessorType::FILTER, + }), + ], + }), + ], + sources: [ + DatadogAPIClient::V2::ObservabilityPipelineWebsocketSource.new({ + id: "websocket-source", + type: DatadogAPIClient::V2::ObservabilityPipelineWebsocketSourceType::WEBSOCKET, + decoding: DatadogAPIClient::V2::ObservabilityPipelineDecoding::DECODE_JSON, + auth_strategy: DatadogAPIClient::V2::ObservabilityPipelineWebsocketSourceAuthStrategy::BEARER, + token_key: "WS_BEARER_TOKEN", + uri_key: "WS_URI", + tls: DatadogAPIClient::V2::ObservabilityPipelineWebsocketSourceTlsEnabled.new({ + mode: DatadogAPIClient::V2::ObservabilityPipelineWebsocketSourceTlsEnabledMode::ENABLED, + }), + }), + ], + }), + name: "Pipeline with WebSocket Source", + }), + type: "pipelines", + }), +}) +p api_instance.validate_pipeline(body) diff --git a/features/v2/observability_pipelines.feature b/features/v2/observability_pipelines.feature index 487d6971f822..59706b1ac887 100644 --- a/features/v2/observability_pipelines.feature +++ b/features/v2/observability_pipelines.feature @@ -278,3 +278,11 @@ Feature: Observability Pipelines When the request is sent Then the response status is 200 OK And the response "errors" has length 0 + + @team:DataDog/observability-pipelines + Scenario: Validate an observability pipeline with websocket source bearer auth returns "OK" response + Given new "ValidatePipeline" request + And body with value {"data": {"attributes": {"config": {"destinations": [{"id": "datadog-logs-destination", "inputs": ["my-processor-group"], "type": "datadog_logs"}], "processor_groups": [{"enabled": true, "id": "my-processor-group", "include": "service:my-service", "inputs": ["websocket-source"], "processors": [{"enabled": true, "id": "filter-processor", "include": "status:error", "type": "filter"}]}], "sources": [{"id": "websocket-source", "type": "websocket", "decoding": "json", "auth_strategy": "bearer", "token_key": "WS_BEARER_TOKEN", "uri_key": "WS_URI", "tls": {"mode": "enabled"}}]}, "name": "Pipeline with WebSocket Source"}, "type": "pipelines"}} + When the request is sent + Then the response status is 200 OK + And the response "errors" has length 0 diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 1912c3a1f419..d78f190abc93 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -5182,6 +5182,14 @@ def overrides "v2.observability_pipeline_throttle_processor" => "ObservabilityPipelineThrottleProcessor", "v2.observability_pipeline_throttle_processor_type" => "ObservabilityPipelineThrottleProcessorType", "v2.observability_pipeline_tls" => "ObservabilityPipelineTls", + "v2.observability_pipeline_websocket_source" => "ObservabilityPipelineWebsocketSource", + "v2.observability_pipeline_websocket_source_auth_strategy" => "ObservabilityPipelineWebsocketSourceAuthStrategy", + "v2.observability_pipeline_websocket_source_tls" => "ObservabilityPipelineWebsocketSourceTls", + "v2.observability_pipeline_websocket_source_tls_enabled" => "ObservabilityPipelineWebsocketSourceTlsEnabled", + "v2.observability_pipeline_websocket_source_tls_enabled_mode" => "ObservabilityPipelineWebsocketSourceTlsEnabledMode", + "v2.observability_pipeline_websocket_source_tls_with_client_cert" => "ObservabilityPipelineWebsocketSourceTlsWithClientCert", + "v2.observability_pipeline_websocket_source_tls_with_client_cert_mode" => "ObservabilityPipelineWebsocketSourceTlsWithClientCertMode", + "v2.observability_pipeline_websocket_source_type" => "ObservabilityPipelineWebsocketSourceType", "v2.oci_config" => "OCIConfig", "v2.oci_config_attributes" => "OCIConfigAttributes", "v2.oci_configs_response" => "OCIConfigsResponse", diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_config_source_item.rb b/lib/datadog_api_client/v2/models/observability_pipeline_config_source_item.rb index 74579da90735..67797d23ff0d 100644 --- a/lib/datadog_api_client/v2/models/observability_pipeline_config_source_item.rb +++ b/lib/datadog_api_client/v2/models/observability_pipeline_config_source_item.rb @@ -42,6 +42,7 @@ def openapi_one_of :'ObservabilityPipelineSplunkTcpSource', :'ObservabilityPipelineSumoLogicSource', :'ObservabilityPipelineSyslogNgSource', + :'ObservabilityPipelineWebsocketSource', :'ObservabilityPipelineOpentelemetrySource' ] end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source.rb b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source.rb new file mode 100644 index 000000000000..a3cfd8630d45 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source.rb @@ -0,0 +1,248 @@ +=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 `websocket` source ingests logs from a WebSocket server using the `ws://` or `wss://` protocol. + # + # **Supported pipeline types:** logs. + class ObservabilityPipelineWebsocketSource + include BaseGenericModel + + # Authentication strategy for the WebSocket source connection. + attr_reader :auth_strategy + + # Name of the environment variable or secret that holds the custom authorization header value. Used when `auth_strategy` is `custom`. + attr_accessor :custom_key + + # The decoding format used to interpret incoming logs. + attr_reader :decoding + + # The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). + attr_reader :id + + # Name of the environment variable or secret that holds the password. Used when `auth_strategy` is `basic`. + attr_accessor :password_key + + # TLS configuration for the WebSocket source. Use `enabled` for standard `wss://` connections, or `with_client_cert` to present a client certificate for mutual TLS. + attr_accessor :tls + + # Name of the environment variable or secret that holds the bearer token. Used when `auth_strategy` is `bearer`. + attr_accessor :token_key + + # The source type. The value should always be `websocket`. + attr_reader :type + + # Name of the environment variable or secret that holds the WebSocket server URI (`ws://` or `wss://`). + attr_accessor :uri_key + + # Name of the environment variable or secret that holds the username. Used when `auth_strategy` is `basic`. + attr_accessor :username_key + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'auth_strategy' => :'auth_strategy', + :'custom_key' => :'custom_key', + :'decoding' => :'decoding', + :'id' => :'id', + :'password_key' => :'password_key', + :'tls' => :'tls', + :'token_key' => :'token_key', + :'type' => :'type', + :'uri_key' => :'uri_key', + :'username_key' => :'username_key' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'auth_strategy' => :'ObservabilityPipelineWebsocketSourceAuthStrategy', + :'custom_key' => :'String', + :'decoding' => :'ObservabilityPipelineDecoding', + :'id' => :'String', + :'password_key' => :'String', + :'tls' => :'ObservabilityPipelineWebsocketSourceTls', + :'token_key' => :'String', + :'type' => :'ObservabilityPipelineWebsocketSourceType', + :'uri_key' => :'String', + :'username_key' => :'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::ObservabilityPipelineWebsocketSource` 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?(:'auth_strategy') + self.auth_strategy = attributes[:'auth_strategy'] + end + + if attributes.key?(:'custom_key') + self.custom_key = attributes[:'custom_key'] + end + + if attributes.key?(:'decoding') + self.decoding = attributes[:'decoding'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'password_key') + self.password_key = attributes[:'password_key'] + end + + if attributes.key?(:'tls') + self.tls = attributes[:'tls'] + end + + if attributes.key?(:'token_key') + self.token_key = attributes[:'token_key'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'uri_key') + self.uri_key = attributes[:'uri_key'] + end + + if attributes.key?(:'username_key') + self.username_key = attributes[:'username_key'] + 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 @auth_strategy.nil? + return false if @decoding.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param auth_strategy [Object] Object to be assigned + # @!visibility private + def auth_strategy=(auth_strategy) + if auth_strategy.nil? + fail ArgumentError, 'invalid value for "auth_strategy", auth_strategy cannot be nil.' + end + @auth_strategy = auth_strategy + end + + # Custom attribute writer method with validation + # @param decoding [Object] Object to be assigned + # @!visibility private + def decoding=(decoding) + if decoding.nil? + fail ArgumentError, 'invalid value for "decoding", decoding cannot be nil.' + end + @decoding = decoding + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + auth_strategy == o.auth_strategy && + custom_key == o.custom_key && + decoding == o.decoding && + id == o.id && + password_key == o.password_key && + tls == o.tls && + token_key == o.token_key && + type == o.type && + uri_key == o.uri_key && + username_key == o.username_key && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [auth_strategy, custom_key, decoding, id, password_key, tls, token_key, type, uri_key, username_key, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_auth_strategy.rb b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_auth_strategy.rb new file mode 100644 index 000000000000..5c6d20678067 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_auth_strategy.rb @@ -0,0 +1,29 @@ +=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 + # Authentication strategy for the WebSocket source connection. + class ObservabilityPipelineWebsocketSourceAuthStrategy + include BaseEnumModel + + NONE = "none".freeze + BASIC = "basic".freeze + BEARER = "bearer".freeze + CUSTOM = "custom".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls.rb b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls.rb new file mode 100644 index 000000000000..f5f8af2efc65 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls.rb @@ -0,0 +1,63 @@ +=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 + # TLS configuration for the WebSocket source. Use `enabled` for standard `wss://` connections, or `with_client_cert` to present a client certificate for mutual TLS. + module ObservabilityPipelineWebsocketSourceTls + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'ObservabilityPipelineWebsocketSourceTlsEnabled', + :'ObservabilityPipelineWebsocketSourceTlsWithClientCert' + ] + 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_websocket_source_tls_enabled.rb b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_enabled.rb new file mode 100644 index 000000000000..913ab70afc98 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_enabled.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # TLS configuration that enables encryption without a client certificate. Use this for standard `wss://` connections that do not require mutual TLS. + class ObservabilityPipelineWebsocketSourceTlsEnabled + include BaseGenericModel + + # TLS mode. Must be `enabled`. + attr_reader :mode + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'mode' => :'mode' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'mode' => :'ObservabilityPipelineWebsocketSourceTlsEnabledMode' + } + 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::ObservabilityPipelineWebsocketSourceTlsEnabled` 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?(:'mode') + self.mode = attributes[:'mode'] + 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 @mode.nil? + true + end + + # Custom attribute writer method with validation + # @param mode [Object] Object to be assigned + # @!visibility private + def mode=(mode) + if mode.nil? + fail ArgumentError, 'invalid value for "mode", mode cannot be nil.' + end + @mode = mode + 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 && + mode == o.mode && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [mode, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_enabled_mode.rb b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_enabled_mode.rb new file mode 100644 index 000000000000..ddf9994f4ea8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_enabled_mode.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 + # TLS mode. Must be `enabled`. + class ObservabilityPipelineWebsocketSourceTlsEnabledMode + include BaseEnumModel + + ENABLED = "enabled".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_with_client_cert.rb b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_with_client_cert.rb new file mode 100644 index 000000000000..a26dec8b2faa --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_with_client_cert.rb @@ -0,0 +1,174 @@ +=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 + # TLS configuration that enables encryption and presents a client certificate for mutual TLS authentication. + class ObservabilityPipelineWebsocketSourceTlsWithClientCert + include BaseGenericModel + + # Path to the Certificate Authority (CA) file used to validate the remote server's TLS certificate. + attr_accessor :ca_file + + # Path to the TLS client certificate file used to identify this source to the remote server. + attr_reader :crt_file + + # Path to the private key file associated with the client certificate. + attr_accessor :key_file + + # Name of the environment variable or secret that holds the passphrase for the private key file. + attr_accessor :key_pass_key + + # TLS mode. Must be `with_client_cert`. + attr_reader :mode + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'ca_file' => :'ca_file', + :'crt_file' => :'crt_file', + :'key_file' => :'key_file', + :'key_pass_key' => :'key_pass_key', + :'mode' => :'mode' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'ca_file' => :'String', + :'crt_file' => :'String', + :'key_file' => :'String', + :'key_pass_key' => :'String', + :'mode' => :'ObservabilityPipelineWebsocketSourceTlsWithClientCertMode' + } + 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::ObservabilityPipelineWebsocketSourceTlsWithClientCert` 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?(:'ca_file') + self.ca_file = attributes[:'ca_file'] + end + + if attributes.key?(:'crt_file') + self.crt_file = attributes[:'crt_file'] + end + + if attributes.key?(:'key_file') + self.key_file = attributes[:'key_file'] + end + + if attributes.key?(:'key_pass_key') + self.key_pass_key = attributes[:'key_pass_key'] + end + + if attributes.key?(:'mode') + self.mode = attributes[:'mode'] + 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 @crt_file.nil? + return false if @mode.nil? + true + end + + # Custom attribute writer method with validation + # @param crt_file [Object] Object to be assigned + # @!visibility private + def crt_file=(crt_file) + if crt_file.nil? + fail ArgumentError, 'invalid value for "crt_file", crt_file cannot be nil.' + end + @crt_file = crt_file + end + + # Custom attribute writer method with validation + # @param mode [Object] Object to be assigned + # @!visibility private + def mode=(mode) + if mode.nil? + fail ArgumentError, 'invalid value for "mode", mode cannot be nil.' + end + @mode = mode + 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 && + ca_file == o.ca_file && + crt_file == o.crt_file && + key_file == o.key_file && + key_pass_key == o.key_pass_key && + mode == o.mode && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [ca_file, crt_file, key_file, key_pass_key, mode, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_with_client_cert_mode.rb b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_with_client_cert_mode.rb new file mode 100644 index 000000000000..6d5c26f4a41b --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_with_client_cert_mode.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 + # TLS mode. Must be `with_client_cert`. + class ObservabilityPipelineWebsocketSourceTlsWithClientCertMode + include BaseEnumModel + + WITH_CLIENT_CERT = "with_client_cert".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_type.rb b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_type.rb new file mode 100644 index 000000000000..6461f0837f5d --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_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 source type. The value should always be `websocket`. + class ObservabilityPipelineWebsocketSourceType + include BaseEnumModel + + WEBSOCKET = "websocket".freeze + end +end