diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 53a4ea6a1..442e3f4f7 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -67238,6 +67238,32 @@ components: type: string x-enum-varnames: - CLICKHOUSE + ObservabilityPipelineClientTls: + description: Configuration for enabling TLS encryption between the pipeline component and external services. + properties: + ca_file: + description: Path to the Certificate Authority (CA) file used to validate the server’s TLS certificate. + type: string + crt_file: + description: Path to the TLS client certificate file used to authenticate the pipeline component with upstream or downstream services. + example: "/path/to/cert.crt" + type: string + key_file: + description: Path to the private key file associated with the TLS client certificate. Used for mutual TLS authentication. + type: string + key_pass_key: + description: Name of the environment variable or secret that holds the passphrase for the private key file. + example: TLS_KEY_PASSPHRASE + type: string + server_name: + description: Server name to use for Server Name Indication (SNI) and to verify against the certificate presented by the remote host. Use this when the address you connect to doesn't match the certificate's Common Name or Subject Alternative Name. + example: server.example.com + maxLength: 253 + minLength: 1 + type: string + required: + - crt_file + type: object ObservabilityPipelineCloudPremDestination: description: |- The `cloud_prem` destination sends logs to Datadog CloudPrem. @@ -67262,7 +67288,7 @@ components: type: string type: array tls: - $ref: "#/components/schemas/ObservabilityPipelineTls" + $ref: "#/components/schemas/ObservabilityPipelineClientTls" description: Configuration for TLS encryption. type: $ref: "#/components/schemas/ObservabilityPipelineCloudPremDestinationType" @@ -68977,7 +69003,7 @@ components: example: HTTP_AUTH_PASSWORD type: string tls: - $ref: "#/components/schemas/ObservabilityPipelineTls" + $ref: "#/components/schemas/ObservabilityPipelineClientTls" token_key: description: Name of the environment variable or secret that holds the bearer token (used when `auth_strategy` is `bearer`). example: HTTP_AUTH_TOKEN @@ -69075,7 +69101,7 @@ components: format: int64 type: integer tls: - $ref: "#/components/schemas/ObservabilityPipelineTls" + $ref: "#/components/schemas/ObservabilityPipelineClientTls" token_key: description: Name of the environment variable or secret that holds the bearer token (used when `auth_strategy` is `bearer`). example: HTTP_AUTH_TOKEN @@ -71158,7 +71184,7 @@ components: mode: $ref: "#/components/schemas/ObservabilityPipelineSocketDestinationMode" tls: - $ref: "#/components/schemas/ObservabilityPipelineTls" + $ref: "#/components/schemas/ObservabilityPipelineClientTls" description: TLS configuration. Relevant only when `mode` is `tcp`. type: $ref: "#/components/schemas/ObservabilityPipelineSocketDestinationType" @@ -71890,7 +71916,7 @@ components: minimum: 0 type: integer tls: - $ref: "#/components/schemas/ObservabilityPipelineTls" + $ref: "#/components/schemas/ObservabilityPipelineClientTls" type: $ref: "#/components/schemas/ObservabilityPipelineSyslogNgDestinationType" required: diff --git a/src/datadogV2/model/mod.rs b/src/datadogV2/model/mod.rs index af41cedad..d5c40717a 100644 --- a/src/datadogV2/model/mod.rs +++ b/src/datadogV2/model/mod.rs @@ -7338,6 +7338,8 @@ pub mod model_observability_pipeline_http_client_destination_compression_algorit pub use self::model_observability_pipeline_http_client_destination_compression_algorithm::ObservabilityPipelineHttpClientDestinationCompressionAlgorithm; pub mod model_observability_pipeline_http_client_destination_encoding; pub use self::model_observability_pipeline_http_client_destination_encoding::ObservabilityPipelineHttpClientDestinationEncoding; +pub mod model_observability_pipeline_client_tls; +pub use self::model_observability_pipeline_client_tls::ObservabilityPipelineClientTls; pub mod model_observability_pipeline_http_client_destination_type; pub use self::model_observability_pipeline_http_client_destination_type::ObservabilityPipelineHttpClientDestinationType; pub mod model_observability_pipeline_amazon_open_search_destination; diff --git a/src/datadogV2/model/model_observability_pipeline_client_tls.rs b/src/datadogV2/model/model_observability_pipeline_client_tls.rs new file mode 100644 index 000000000..db2894809 --- /dev/null +++ b/src/datadogV2/model/model_observability_pipeline_client_tls.rs @@ -0,0 +1,162 @@ +// 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 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Configuration for enabling TLS encryption between the pipeline component and external services. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct ObservabilityPipelineClientTls { + /// Path to the Certificate Authority (CA) file used to validate the server’s TLS certificate. + #[serde(rename = "ca_file")] + pub ca_file: Option, + /// Path to the TLS client certificate file used to authenticate the pipeline component with upstream or downstream services. + #[serde(rename = "crt_file")] + pub crt_file: String, + /// Path to the private key file associated with the TLS client certificate. Used for mutual TLS authentication. + #[serde(rename = "key_file")] + pub key_file: Option, + /// Name of the environment variable or secret that holds the passphrase for the private key file. + #[serde(rename = "key_pass_key")] + pub key_pass_key: Option, + /// Server name to use for Server Name Indication (SNI) and to verify against the certificate presented by the remote host. Use this when the address you connect to doesn't match the certificate's Common Name or Subject Alternative Name. + #[serde(rename = "server_name")] + pub server_name: Option, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl ObservabilityPipelineClientTls { + pub fn new(crt_file: String) -> ObservabilityPipelineClientTls { + ObservabilityPipelineClientTls { + ca_file: None, + crt_file, + key_file: None, + key_pass_key: None, + server_name: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn ca_file(mut self, value: String) -> Self { + self.ca_file = Some(value); + self + } + + pub fn key_file(mut self, value: String) -> Self { + self.key_file = Some(value); + self + } + + pub fn key_pass_key(mut self, value: String) -> Self { + self.key_pass_key = Some(value); + self + } + + pub fn server_name(mut self, value: String) -> Self { + self.server_name = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for ObservabilityPipelineClientTls { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct ObservabilityPipelineClientTlsVisitor; + impl<'a> Visitor<'a> for ObservabilityPipelineClientTlsVisitor { + type Value = ObservabilityPipelineClientTls; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut ca_file: Option = None; + let mut crt_file: Option = None; + let mut key_file: Option = None; + let mut key_pass_key: Option = None; + let mut server_name: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "ca_file" => { + if v.is_null() { + continue; + } + ca_file = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "crt_file" => { + crt_file = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "key_file" => { + if v.is_null() { + continue; + } + key_file = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "key_pass_key" => { + if v.is_null() { + continue; + } + key_pass_key = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "server_name" => { + if v.is_null() { + continue; + } + server_name = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let crt_file = crt_file.ok_or_else(|| M::Error::missing_field("crt_file"))?; + + let content = ObservabilityPipelineClientTls { + ca_file, + crt_file, + key_file, + key_pass_key, + server_name, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(ObservabilityPipelineClientTlsVisitor) + } +} diff --git a/src/datadogV2/model/model_observability_pipeline_cloud_prem_destination.rs b/src/datadogV2/model/model_observability_pipeline_cloud_prem_destination.rs index 6e225b7f7..03f809a72 100644 --- a/src/datadogV2/model/model_observability_pipeline_cloud_prem_destination.rs +++ b/src/datadogV2/model/model_observability_pipeline_cloud_prem_destination.rs @@ -27,7 +27,7 @@ pub struct ObservabilityPipelineCloudPremDestination { pub inputs: Vec, /// Configuration for enabling TLS encryption between the pipeline component and external services. #[serde(rename = "tls")] - pub tls: Option, + pub tls: Option, /// The destination type. The value should always be `cloud_prem`. #[serde(rename = "type")] pub type_: crate::datadogV2::model::ObservabilityPipelineCloudPremDestinationType, @@ -69,7 +69,7 @@ impl ObservabilityPipelineCloudPremDestination { self } - pub fn tls(mut self, value: crate::datadogV2::model::ObservabilityPipelineTls) -> Self { + pub fn tls(mut self, value: crate::datadogV2::model::ObservabilityPipelineClientTls) -> Self { self.tls = Some(value); self } @@ -106,7 +106,7 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineCloudPremDestination { let mut endpoint_url_key: Option = None; let mut id: Option = None; let mut inputs: Option> = None; - let mut tls: Option = None; + let mut tls: Option = None; let mut type_: Option< crate::datadogV2::model::ObservabilityPipelineCloudPremDestinationType, > = None; diff --git a/src/datadogV2/model/model_observability_pipeline_http_client_destination.rs b/src/datadogV2/model/model_observability_pipeline_http_client_destination.rs index 11fce5f97..96a9506c0 100644 --- a/src/datadogV2/model/model_observability_pipeline_http_client_destination.rs +++ b/src/datadogV2/model/model_observability_pipeline_http_client_destination.rs @@ -41,7 +41,7 @@ pub struct ObservabilityPipelineHttpClientDestination { pub password_key: Option, /// Configuration for enabling TLS encryption between the pipeline component and external services. #[serde(rename = "tls")] - pub tls: Option, + pub tls: Option, /// Name of the environment variable or secret that holds the bearer token (used when `auth_strategy` is `bearer`). #[serde(rename = "token_key")] pub token_key: Option, @@ -121,7 +121,7 @@ impl ObservabilityPipelineHttpClientDestination { self } - pub fn tls(mut self, value: crate::datadogV2::model::ObservabilityPipelineTls) -> Self { + pub fn tls(mut self, value: crate::datadogV2::model::ObservabilityPipelineClientTls) -> Self { self.tls = Some(value); self } @@ -183,7 +183,7 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineHttpClientDestination { let mut id: Option = None; let mut inputs: Option> = None; let mut password_key: Option = None; - let mut tls: Option = None; + let mut tls: Option = None; let mut token_key: Option = None; let mut type_: Option< crate::datadogV2::model::ObservabilityPipelineHttpClientDestinationType, diff --git a/src/datadogV2/model/model_observability_pipeline_http_client_source.rs b/src/datadogV2/model/model_observability_pipeline_http_client_source.rs index 824ce376e..2766dc65f 100644 --- a/src/datadogV2/model/model_observability_pipeline_http_client_source.rs +++ b/src/datadogV2/model/model_observability_pipeline_http_client_source.rs @@ -40,7 +40,7 @@ pub struct ObservabilityPipelineHttpClientSource { pub scrape_timeout_secs: Option, /// Configuration for enabling TLS encryption between the pipeline component and external services. #[serde(rename = "tls")] - pub tls: Option, + pub tls: Option, /// Name of the environment variable or secret that holds the bearer token (used when `auth_strategy` is `bearer`). #[serde(rename = "token_key")] pub token_key: Option, @@ -114,7 +114,7 @@ impl ObservabilityPipelineHttpClientSource { self } - pub fn tls(mut self, value: crate::datadogV2::model::ObservabilityPipelineTls) -> Self { + pub fn tls(mut self, value: crate::datadogV2::model::ObservabilityPipelineClientTls) -> Self { self.tls = Some(value); self } @@ -166,7 +166,7 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineHttpClientSource { let mut password_key: Option = None; let mut scrape_interval_secs: Option = None; let mut scrape_timeout_secs: Option = None; - let mut tls: Option = None; + let mut tls: Option = None; let mut token_key: Option = None; let mut type_: Option< crate::datadogV2::model::ObservabilityPipelineHttpClientSourceType, diff --git a/src/datadogV2/model/model_observability_pipeline_socket_destination.rs b/src/datadogV2/model/model_observability_pipeline_socket_destination.rs index d35c1ba52..5264c8375 100644 --- a/src/datadogV2/model/model_observability_pipeline_socket_destination.rs +++ b/src/datadogV2/model/model_observability_pipeline_socket_destination.rs @@ -36,7 +36,7 @@ pub struct ObservabilityPipelineSocketDestination { pub mode: crate::datadogV2::model::ObservabilityPipelineSocketDestinationMode, /// Configuration for enabling TLS encryption between the pipeline component and external services. #[serde(rename = "tls")] - pub tls: Option, + pub tls: Option, /// The destination type. The value should always be `socket`. #[serde(rename = "type")] pub type_: crate::datadogV2::model::ObservabilityPipelineSocketDestinationType, @@ -84,7 +84,7 @@ impl ObservabilityPipelineSocketDestination { self } - pub fn tls(mut self, value: crate::datadogV2::model::ObservabilityPipelineTls) -> Self { + pub fn tls(mut self, value: crate::datadogV2::model::ObservabilityPipelineClientTls) -> Self { self.tls = Some(value); self } @@ -130,7 +130,7 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineSocketDestination { let mut mode: Option< crate::datadogV2::model::ObservabilityPipelineSocketDestinationMode, > = None; - let mut tls: Option = None; + let mut tls: Option = None; let mut type_: Option< crate::datadogV2::model::ObservabilityPipelineSocketDestinationType, > = None; diff --git a/src/datadogV2/model/model_observability_pipeline_syslog_ng_destination.rs b/src/datadogV2/model/model_observability_pipeline_syslog_ng_destination.rs index 8f530769b..70574b3d3 100644 --- a/src/datadogV2/model/model_observability_pipeline_syslog_ng_destination.rs +++ b/src/datadogV2/model/model_observability_pipeline_syslog_ng_destination.rs @@ -30,7 +30,7 @@ pub struct ObservabilityPipelineSyslogNgDestination { pub keepalive: Option, /// Configuration for enabling TLS encryption between the pipeline component and external services. #[serde(rename = "tls")] - pub tls: Option, + pub tls: Option, /// The destination type. The value should always be `syslog_ng`. #[serde(rename = "type")] pub type_: crate::datadogV2::model::ObservabilityPipelineSyslogNgDestinationType, @@ -78,7 +78,7 @@ impl ObservabilityPipelineSyslogNgDestination { self } - pub fn tls(mut self, value: crate::datadogV2::model::ObservabilityPipelineTls) -> Self { + pub fn tls(mut self, value: crate::datadogV2::model::ObservabilityPipelineClientTls) -> Self { self.tls = Some(value); self } @@ -116,7 +116,7 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineSyslogNgDestination { let mut id: Option = None; let mut inputs: Option> = None; let mut keepalive: Option = None; - let mut tls: Option = None; + let mut tls: Option = None; let mut type_: Option< crate::datadogV2::model::ObservabilityPipelineSyslogNgDestinationType, > = None;