Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 31 additions & 5 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -71890,7 +71916,7 @@ components:
minimum: 0
type: integer
tls:
$ref: "#/components/schemas/ObservabilityPipelineTls"
$ref: "#/components/schemas/ObservabilityPipelineClientTls"
type:
$ref: "#/components/schemas/ObservabilityPipelineSyslogNgDestinationType"
required:
Expand Down
2 changes: 2 additions & 0 deletions src/datadogV2/model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
162 changes: 162 additions & 0 deletions src/datadogV2/model/model_observability_pipeline_client_tls.rs
Original file line number Diff line number Diff line change
@@ -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<String>,
/// 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<String>,
/// 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<String>,
/// 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<String>,
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
#[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<String, serde_json::Value>,
) -> Self {
self.additional_properties = value;
self
}
}

impl<'de> Deserialize<'de> for ObservabilityPipelineClientTls {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
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<M>(self, mut map: M) -> Result<Self::Value, M::Error>
where
M: MapAccess<'a>,
{
let mut ca_file: Option<String> = None;
let mut crt_file: Option<String> = None;
let mut key_file: Option<String> = None;
let mut key_pass_key: Option<String> = None;
let mut server_name: Option<String> = 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::<String, serde_json::Value>()? {
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)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub struct ObservabilityPipelineCloudPremDestination {
pub inputs: Vec<String>,
/// Configuration for enabling TLS encryption between the pipeline component and external services.
#[serde(rename = "tls")]
pub tls: Option<crate::datadogV2::model::ObservabilityPipelineTls>,
pub tls: Option<crate::datadogV2::model::ObservabilityPipelineClientTls>,
/// The destination type. The value should always be `cloud_prem`.
#[serde(rename = "type")]
pub type_: crate::datadogV2::model::ObservabilityPipelineCloudPremDestinationType,
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -106,7 +106,7 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineCloudPremDestination {
let mut endpoint_url_key: Option<String> = None;
let mut id: Option<String> = None;
let mut inputs: Option<Vec<String>> = None;
let mut tls: Option<crate::datadogV2::model::ObservabilityPipelineTls> = None;
let mut tls: Option<crate::datadogV2::model::ObservabilityPipelineClientTls> = None;
let mut type_: Option<
crate::datadogV2::model::ObservabilityPipelineCloudPremDestinationType,
> = None;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub struct ObservabilityPipelineHttpClientDestination {
pub password_key: Option<String>,
/// Configuration for enabling TLS encryption between the pipeline component and external services.
#[serde(rename = "tls")]
pub tls: Option<crate::datadogV2::model::ObservabilityPipelineTls>,
pub tls: Option<crate::datadogV2::model::ObservabilityPipelineClientTls>,
/// 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<String>,
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -183,7 +183,7 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineHttpClientDestination {
let mut id: Option<String> = None;
let mut inputs: Option<Vec<String>> = None;
let mut password_key: Option<String> = None;
let mut tls: Option<crate::datadogV2::model::ObservabilityPipelineTls> = None;
let mut tls: Option<crate::datadogV2::model::ObservabilityPipelineClientTls> = None;
let mut token_key: Option<String> = None;
let mut type_: Option<
crate::datadogV2::model::ObservabilityPipelineHttpClientDestinationType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub struct ObservabilityPipelineHttpClientSource {
pub scrape_timeout_secs: Option<i64>,
/// Configuration for enabling TLS encryption between the pipeline component and external services.
#[serde(rename = "tls")]
pub tls: Option<crate::datadogV2::model::ObservabilityPipelineTls>,
pub tls: Option<crate::datadogV2::model::ObservabilityPipelineClientTls>,
/// 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<String>,
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -166,7 +166,7 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineHttpClientSource {
let mut password_key: Option<String> = None;
let mut scrape_interval_secs: Option<i64> = None;
let mut scrape_timeout_secs: Option<i64> = None;
let mut tls: Option<crate::datadogV2::model::ObservabilityPipelineTls> = None;
let mut tls: Option<crate::datadogV2::model::ObservabilityPipelineClientTls> = None;
let mut token_key: Option<String> = None;
let mut type_: Option<
crate::datadogV2::model::ObservabilityPipelineHttpClientSourceType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<crate::datadogV2::model::ObservabilityPipelineTls>,
pub tls: Option<crate::datadogV2::model::ObservabilityPipelineClientTls>,
/// The destination type. The value should always be `socket`.
#[serde(rename = "type")]
pub type_: crate::datadogV2::model::ObservabilityPipelineSocketDestinationType,
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -130,7 +130,7 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineSocketDestination {
let mut mode: Option<
crate::datadogV2::model::ObservabilityPipelineSocketDestinationMode,
> = None;
let mut tls: Option<crate::datadogV2::model::ObservabilityPipelineTls> = None;
let mut tls: Option<crate::datadogV2::model::ObservabilityPipelineClientTls> = None;
let mut type_: Option<
crate::datadogV2::model::ObservabilityPipelineSocketDestinationType,
> = None;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub struct ObservabilityPipelineSyslogNgDestination {
pub keepalive: Option<i64>,
/// Configuration for enabling TLS encryption between the pipeline component and external services.
#[serde(rename = "tls")]
pub tls: Option<crate::datadogV2::model::ObservabilityPipelineTls>,
pub tls: Option<crate::datadogV2::model::ObservabilityPipelineClientTls>,
/// The destination type. The value should always be `syslog_ng`.
#[serde(rename = "type")]
pub type_: crate::datadogV2::model::ObservabilityPipelineSyslogNgDestinationType,
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -116,7 +116,7 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineSyslogNgDestination {
let mut id: Option<String> = None;
let mut inputs: Option<Vec<String>> = None;
let mut keepalive: Option<i64> = None;
let mut tls: Option<crate::datadogV2::model::ObservabilityPipelineTls> = None;
let mut tls: Option<crate::datadogV2::model::ObservabilityPipelineClientTls> = None;
let mut type_: Option<
crate::datadogV2::model::ObservabilityPipelineSyslogNgDestinationType,
> = None;
Expand Down
Loading