Skip to content

Commit a7bbe8a

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 2558d47 of spec repo
1 parent 0773181 commit a7bbe8a

File tree

5 files changed

+275
-0
lines changed

5 files changed

+275
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35701,6 +35701,7 @@ components:
3570135701
- $ref: '#/components/schemas/ObservabilityPipelineHttpClientSource'
3570235702
- $ref: '#/components/schemas/ObservabilityPipelineLogstashSource'
3570335703
- $ref: '#/components/schemas/ObservabilityPipelineSocketSource'
35704+
- $ref: '#/components/schemas/ObservabilityPipelineOpentelemetrySource'
3570435705
ObservabilityPipelineCrowdStrikeNextGenSiemDestination:
3570535706
description: The `crowdstrike_next_gen_siem` destination forwards logs to CrowdStrike
3570635707
Next Gen SIEM.
@@ -37180,6 +37181,45 @@ components:
3718037181
type: string
3718137182
x-enum-varnames:
3718237183
- OPENSEARCH
37184+
ObservabilityPipelineOpentelemetrySource:
37185+
description: The `opentelemetry` source receives telemetry data using the OpenTelemetry
37186+
Protocol (OTLP) over gRPC and HTTP.
37187+
properties:
37188+
grpc_address_key:
37189+
description: Environment variable name containing the gRPC server address
37190+
for receiving OTLP data. Must be a valid environment variable name (alphanumeric
37191+
characters and underscores only).
37192+
example: OTEL_GRPC_ADDRESS
37193+
type: string
37194+
http_address_key:
37195+
description: Environment variable name containing the HTTP server address
37196+
for receiving OTLP data. Must be a valid environment variable name (alphanumeric
37197+
characters and underscores only).
37198+
example: OTEL_HTTP_ADDRESS
37199+
type: string
37200+
id:
37201+
description: The unique identifier for this component. Used to reference
37202+
this component in other parts of the pipeline (e.g., as input to downstream
37203+
components).
37204+
example: opentelemetry-source
37205+
type: string
37206+
tls:
37207+
$ref: '#/components/schemas/ObservabilityPipelineTls'
37208+
type:
37209+
$ref: '#/components/schemas/ObservabilityPipelineOpentelemetrySourceType'
37210+
required:
37211+
- id
37212+
- type
37213+
type: object
37214+
ObservabilityPipelineOpentelemetrySourceType:
37215+
default: opentelemetry
37216+
description: The source type. The value should always be `opentelemetry`.
37217+
enum:
37218+
- opentelemetry
37219+
example: opentelemetry
37220+
type: string
37221+
x-enum-varnames:
37222+
- OPENTELEMETRY
3718337223
ObservabilityPipelineParseGrokProcessor:
3718437224
description: The `parse_grok` processor extracts structured fields from unstructured
3718537225
log messages using Grok patterns.

src/datadogV2/model/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5404,6 +5404,10 @@ pub mod model_observability_pipeline_socket_source_mode;
54045404
pub use self::model_observability_pipeline_socket_source_mode::ObservabilityPipelineSocketSourceMode;
54055405
pub mod model_observability_pipeline_socket_source_type;
54065406
pub use self::model_observability_pipeline_socket_source_type::ObservabilityPipelineSocketSourceType;
5407+
pub mod model_observability_pipeline_opentelemetry_source;
5408+
pub use self::model_observability_pipeline_opentelemetry_source::ObservabilityPipelineOpentelemetrySource;
5409+
pub mod model_observability_pipeline_opentelemetry_source_type;
5410+
pub use self::model_observability_pipeline_opentelemetry_source_type::ObservabilityPipelineOpentelemetrySourceType;
54075411
pub mod model_observability_pipeline_config_source_item;
54085412
pub use self::model_observability_pipeline_config_source_item::ObservabilityPipelineConfigSourceItem;
54095413
pub mod model_list_pipelines_response_meta;

src/datadogV2/model/model_observability_pipeline_config_source_item.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ pub enum ObservabilityPipelineConfigSourceItem {
5656
ObservabilityPipelineSocketSource(
5757
Box<crate::datadogV2::model::ObservabilityPipelineSocketSource>,
5858
),
59+
ObservabilityPipelineOpentelemetrySource(
60+
Box<crate::datadogV2::model::ObservabilityPipelineOpentelemetrySource>,
61+
),
5962
UnparsedObject(crate::datadog::UnparsedObject),
6063
}
6164

@@ -231,6 +234,18 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineConfigSourceItem {
231234
);
232235
}
233236
}
237+
if let Ok(_v) = serde_json::from_value::<
238+
Box<crate::datadogV2::model::ObservabilityPipelineOpentelemetrySource>,
239+
>(value.clone())
240+
{
241+
if !_v._unparsed {
242+
return Ok(
243+
ObservabilityPipelineConfigSourceItem::ObservabilityPipelineOpentelemetrySource(
244+
_v,
245+
),
246+
);
247+
}
248+
}
234249

235250
return Ok(ObservabilityPipelineConfigSourceItem::UnparsedObject(
236251
crate::datadog::UnparsedObject { value },
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2019-Present Datadog, Inc.
4+
use serde::de::{Error, MapAccess, Visitor};
5+
use serde::{Deserialize, Deserializer, Serialize};
6+
use serde_with::skip_serializing_none;
7+
use std::fmt::{self, Formatter};
8+
9+
/// The `opentelemetry` source receives telemetry data using the OpenTelemetry Protocol (OTLP) over gRPC and HTTP.
10+
#[non_exhaustive]
11+
#[skip_serializing_none]
12+
#[derive(Clone, Debug, PartialEq, Serialize)]
13+
pub struct ObservabilityPipelineOpentelemetrySource {
14+
/// Environment variable name containing the gRPC server address for receiving OTLP data. Must be a valid environment variable name (alphanumeric characters and underscores only).
15+
#[serde(rename = "grpc_address_key")]
16+
pub grpc_address_key: Option<String>,
17+
/// Environment variable name containing the HTTP server address for receiving OTLP data. Must be a valid environment variable name (alphanumeric characters and underscores only).
18+
#[serde(rename = "http_address_key")]
19+
pub http_address_key: Option<String>,
20+
/// The unique identifier for this component. Used to reference this component in other parts of the pipeline (e.g., as input to downstream components).
21+
#[serde(rename = "id")]
22+
pub id: String,
23+
/// Configuration for enabling TLS encryption between the pipeline component and external services.
24+
#[serde(rename = "tls")]
25+
pub tls: Option<crate::datadogV2::model::ObservabilityPipelineTls>,
26+
/// The source type. The value should always be `opentelemetry`.
27+
#[serde(rename = "type")]
28+
pub type_: crate::datadogV2::model::ObservabilityPipelineOpentelemetrySourceType,
29+
#[serde(flatten)]
30+
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
31+
#[serde(skip)]
32+
#[serde(default)]
33+
pub(crate) _unparsed: bool,
34+
}
35+
36+
impl ObservabilityPipelineOpentelemetrySource {
37+
pub fn new(
38+
id: String,
39+
type_: crate::datadogV2::model::ObservabilityPipelineOpentelemetrySourceType,
40+
) -> ObservabilityPipelineOpentelemetrySource {
41+
ObservabilityPipelineOpentelemetrySource {
42+
grpc_address_key: None,
43+
http_address_key: None,
44+
id,
45+
tls: None,
46+
type_,
47+
additional_properties: std::collections::BTreeMap::new(),
48+
_unparsed: false,
49+
}
50+
}
51+
52+
pub fn grpc_address_key(mut self, value: String) -> Self {
53+
self.grpc_address_key = Some(value);
54+
self
55+
}
56+
57+
pub fn http_address_key(mut self, value: String) -> Self {
58+
self.http_address_key = Some(value);
59+
self
60+
}
61+
62+
pub fn tls(mut self, value: crate::datadogV2::model::ObservabilityPipelineTls) -> Self {
63+
self.tls = Some(value);
64+
self
65+
}
66+
67+
pub fn additional_properties(
68+
mut self,
69+
value: std::collections::BTreeMap<String, serde_json::Value>,
70+
) -> Self {
71+
self.additional_properties = value;
72+
self
73+
}
74+
}
75+
76+
impl<'de> Deserialize<'de> for ObservabilityPipelineOpentelemetrySource {
77+
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
78+
where
79+
D: Deserializer<'de>,
80+
{
81+
struct ObservabilityPipelineOpentelemetrySourceVisitor;
82+
impl<'a> Visitor<'a> for ObservabilityPipelineOpentelemetrySourceVisitor {
83+
type Value = ObservabilityPipelineOpentelemetrySource;
84+
85+
fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
86+
f.write_str("a mapping")
87+
}
88+
89+
fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
90+
where
91+
M: MapAccess<'a>,
92+
{
93+
let mut grpc_address_key: Option<String> = None;
94+
let mut http_address_key: Option<String> = None;
95+
let mut id: Option<String> = None;
96+
let mut tls: Option<crate::datadogV2::model::ObservabilityPipelineTls> = None;
97+
let mut type_: Option<
98+
crate::datadogV2::model::ObservabilityPipelineOpentelemetrySourceType,
99+
> = None;
100+
let mut additional_properties: std::collections::BTreeMap<
101+
String,
102+
serde_json::Value,
103+
> = std::collections::BTreeMap::new();
104+
let mut _unparsed = false;
105+
106+
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
107+
match k.as_str() {
108+
"grpc_address_key" => {
109+
if v.is_null() {
110+
continue;
111+
}
112+
grpc_address_key =
113+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
114+
}
115+
"http_address_key" => {
116+
if v.is_null() {
117+
continue;
118+
}
119+
http_address_key =
120+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
121+
}
122+
"id" => {
123+
id = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
124+
}
125+
"tls" => {
126+
if v.is_null() {
127+
continue;
128+
}
129+
tls = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
130+
}
131+
"type" => {
132+
type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
133+
if let Some(ref _type_) = type_ {
134+
match _type_ {
135+
crate::datadogV2::model::ObservabilityPipelineOpentelemetrySourceType::UnparsedObject(_type_) => {
136+
_unparsed = true;
137+
},
138+
_ => {}
139+
}
140+
}
141+
}
142+
&_ => {
143+
if let Ok(value) = serde_json::from_value(v.clone()) {
144+
additional_properties.insert(k, value);
145+
}
146+
}
147+
}
148+
}
149+
let id = id.ok_or_else(|| M::Error::missing_field("id"))?;
150+
let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?;
151+
152+
let content = ObservabilityPipelineOpentelemetrySource {
153+
grpc_address_key,
154+
http_address_key,
155+
id,
156+
tls,
157+
type_,
158+
additional_properties,
159+
_unparsed,
160+
};
161+
162+
Ok(content)
163+
}
164+
}
165+
166+
deserializer.deserialize_any(ObservabilityPipelineOpentelemetrySourceVisitor)
167+
}
168+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2019-Present Datadog, Inc.
4+
5+
use serde::{Deserialize, Deserializer, Serialize, Serializer};
6+
7+
#[non_exhaustive]
8+
#[derive(Clone, Debug, Eq, PartialEq)]
9+
pub enum ObservabilityPipelineOpentelemetrySourceType {
10+
OPENTELEMETRY,
11+
UnparsedObject(crate::datadog::UnparsedObject),
12+
}
13+
14+
impl ToString for ObservabilityPipelineOpentelemetrySourceType {
15+
fn to_string(&self) -> String {
16+
match self {
17+
Self::OPENTELEMETRY => String::from("opentelemetry"),
18+
Self::UnparsedObject(v) => v.value.to_string(),
19+
}
20+
}
21+
}
22+
23+
impl Serialize for ObservabilityPipelineOpentelemetrySourceType {
24+
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
25+
where
26+
S: Serializer,
27+
{
28+
match self {
29+
Self::UnparsedObject(v) => v.serialize(serializer),
30+
_ => serializer.serialize_str(self.to_string().as_str()),
31+
}
32+
}
33+
}
34+
35+
impl<'de> Deserialize<'de> for ObservabilityPipelineOpentelemetrySourceType {
36+
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
37+
where
38+
D: Deserializer<'de>,
39+
{
40+
let s: String = String::deserialize(deserializer)?;
41+
Ok(match s.as_str() {
42+
"opentelemetry" => Self::OPENTELEMETRY,
43+
_ => Self::UnparsedObject(crate::datadog::UnparsedObject {
44+
value: serde_json::Value::String(s.into()),
45+
}),
46+
})
47+
}
48+
}

0 commit comments

Comments
 (0)