Skip to content

Commit fab4f0d

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 6876f24 of spec repo
1 parent dffc362 commit fab4f0d

File tree

5 files changed

+227
-0
lines changed

5 files changed

+227
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29098,6 +29098,7 @@ components:
2909829098
- $ref: '#/components/schemas/ObservabilityPipelineGooglePubSubSource'
2909929099
- $ref: '#/components/schemas/ObservabilityPipelineHttpClientSource'
2910029100
- $ref: '#/components/schemas/ObservabilityPipelineLogstashSource'
29101+
- $ref: '#/components/schemas/ObservabilityPipelineOpentelemetrySource'
2910129102
- $ref: '#/components/schemas/ObservabilityPipelineSocketSource'
2910229103
ObservabilityPipelineCrowdStrikeNextGenSiemDestination:
2910329104
description: The `crowdstrike_next_gen_siem` destination forwards logs to CrowdStrike
@@ -30547,6 +30548,33 @@ components:
3054730548
type: string
3054830549
x-enum-varnames:
3054930550
- OPENSEARCH
30551+
ObservabilityPipelineOpentelemetrySource:
30552+
description: The `opentelemetry` source receives OpenTelemetry data through
30553+
gRPC or HTTP.
30554+
properties:
30555+
id:
30556+
description: The unique identifier for this component. Used to reference
30557+
this component in other parts of the pipeline (e.g., as input to downstream
30558+
components).
30559+
example: opentelemetry-source
30560+
type: string
30561+
tls:
30562+
$ref: '#/components/schemas/ObservabilityPipelineTls'
30563+
type:
30564+
$ref: '#/components/schemas/ObservabilityPipelineOpentelemetrySourceType'
30565+
required:
30566+
- id
30567+
- type
30568+
type: object
30569+
ObservabilityPipelineOpentelemetrySourceType:
30570+
default: opentelemetry
30571+
description: The source type. The value should always be `opentelemetry`.
30572+
enum:
30573+
- opentelemetry
30574+
example: opentelemetry
30575+
type: string
30576+
x-enum-varnames:
30577+
- OPENTELEMETRY
3055030578
ObservabilityPipelineParseGrokProcessor:
3055130579
description: The `parse_grok` processor extracts structured fields from unstructured
3055230580
log messages using Grok patterns.

src/datadogV2/model/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4538,6 +4538,10 @@ pub mod model_observability_pipeline_logstash_source;
45384538
pub use self::model_observability_pipeline_logstash_source::ObservabilityPipelineLogstashSource;
45394539
pub mod model_observability_pipeline_logstash_source_type;
45404540
pub use self::model_observability_pipeline_logstash_source_type::ObservabilityPipelineLogstashSourceType;
4541+
pub mod model_observability_pipeline_opentelemetry_source;
4542+
pub use self::model_observability_pipeline_opentelemetry_source::ObservabilityPipelineOpentelemetrySource;
4543+
pub mod model_observability_pipeline_opentelemetry_source_type;
4544+
pub use self::model_observability_pipeline_opentelemetry_source_type::ObservabilityPipelineOpentelemetrySourceType;
45414545
pub mod model_observability_pipeline_socket_source;
45424546
pub use self::model_observability_pipeline_socket_source::ObservabilityPipelineSocketSource;
45434547
pub mod model_observability_pipeline_socket_source_framing_newline_delimited;

src/datadogV2/model/model_observability_pipeline_config_source_item.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ pub enum ObservabilityPipelineConfigSourceItem {
5353
ObservabilityPipelineLogstashSource(
5454
Box<crate::datadogV2::model::ObservabilityPipelineLogstashSource>,
5555
),
56+
ObservabilityPipelineOpentelemetrySource(
57+
Box<crate::datadogV2::model::ObservabilityPipelineOpentelemetrySource>,
58+
),
5659
ObservabilityPipelineSocketSource(
5760
Box<crate::datadogV2::model::ObservabilityPipelineSocketSource>,
5861
),
@@ -221,6 +224,18 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineConfigSourceItem {
221224
);
222225
}
223226
}
227+
if let Ok(_v) = serde_json::from_value::<
228+
Box<crate::datadogV2::model::ObservabilityPipelineOpentelemetrySource>,
229+
>(value.clone())
230+
{
231+
if !_v._unparsed {
232+
return Ok(
233+
ObservabilityPipelineConfigSourceItem::ObservabilityPipelineOpentelemetrySource(
234+
_v,
235+
),
236+
);
237+
}
238+
}
224239
if let Ok(_v) = serde_json::from_value::<
225240
Box<crate::datadogV2::model::ObservabilityPipelineSocketSource>,
226241
>(value.clone())
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
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 OpenTelemetry data through gRPC or HTTP.
10+
#[non_exhaustive]
11+
#[skip_serializing_none]
12+
#[derive(Clone, Debug, PartialEq, Serialize)]
13+
pub struct ObservabilityPipelineOpentelemetrySource {
14+
/// The unique identifier for this component. Used to reference this component in other parts of the pipeline (e.g., as input to downstream components).
15+
#[serde(rename = "id")]
16+
pub id: String,
17+
/// Configuration for enabling TLS encryption between the pipeline component and external services.
18+
#[serde(rename = "tls")]
19+
pub tls: Option<crate::datadogV2::model::ObservabilityPipelineTls>,
20+
/// The source type. The value should always be `opentelemetry`.
21+
#[serde(rename = "type")]
22+
pub type_: crate::datadogV2::model::ObservabilityPipelineOpentelemetrySourceType,
23+
#[serde(flatten)]
24+
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
25+
#[serde(skip)]
26+
#[serde(default)]
27+
pub(crate) _unparsed: bool,
28+
}
29+
30+
impl ObservabilityPipelineOpentelemetrySource {
31+
pub fn new(
32+
id: String,
33+
type_: crate::datadogV2::model::ObservabilityPipelineOpentelemetrySourceType,
34+
) -> ObservabilityPipelineOpentelemetrySource {
35+
ObservabilityPipelineOpentelemetrySource {
36+
id,
37+
tls: None,
38+
type_,
39+
additional_properties: std::collections::BTreeMap::new(),
40+
_unparsed: false,
41+
}
42+
}
43+
44+
pub fn tls(mut self, value: crate::datadogV2::model::ObservabilityPipelineTls) -> Self {
45+
self.tls = Some(value);
46+
self
47+
}
48+
49+
pub fn additional_properties(
50+
mut self,
51+
value: std::collections::BTreeMap<String, serde_json::Value>,
52+
) -> Self {
53+
self.additional_properties = value;
54+
self
55+
}
56+
}
57+
58+
impl<'de> Deserialize<'de> for ObservabilityPipelineOpentelemetrySource {
59+
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
60+
where
61+
D: Deserializer<'de>,
62+
{
63+
struct ObservabilityPipelineOpentelemetrySourceVisitor;
64+
impl<'a> Visitor<'a> for ObservabilityPipelineOpentelemetrySourceVisitor {
65+
type Value = ObservabilityPipelineOpentelemetrySource;
66+
67+
fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
68+
f.write_str("a mapping")
69+
}
70+
71+
fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
72+
where
73+
M: MapAccess<'a>,
74+
{
75+
let mut id: Option<String> = None;
76+
let mut tls: Option<crate::datadogV2::model::ObservabilityPipelineTls> = None;
77+
let mut type_: Option<
78+
crate::datadogV2::model::ObservabilityPipelineOpentelemetrySourceType,
79+
> = None;
80+
let mut additional_properties: std::collections::BTreeMap<
81+
String,
82+
serde_json::Value,
83+
> = std::collections::BTreeMap::new();
84+
let mut _unparsed = false;
85+
86+
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
87+
match k.as_str() {
88+
"id" => {
89+
id = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
90+
}
91+
"tls" => {
92+
if v.is_null() {
93+
continue;
94+
}
95+
tls = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
96+
}
97+
"type" => {
98+
type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
99+
if let Some(ref _type_) = type_ {
100+
match _type_ {
101+
crate::datadogV2::model::ObservabilityPipelineOpentelemetrySourceType::UnparsedObject(_type_) => {
102+
_unparsed = true;
103+
},
104+
_ => {}
105+
}
106+
}
107+
}
108+
&_ => {
109+
if let Ok(value) = serde_json::from_value(v.clone()) {
110+
additional_properties.insert(k, value);
111+
}
112+
}
113+
}
114+
}
115+
let id = id.ok_or_else(|| M::Error::missing_field("id"))?;
116+
let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?;
117+
118+
let content = ObservabilityPipelineOpentelemetrySource {
119+
id,
120+
tls,
121+
type_,
122+
additional_properties,
123+
_unparsed,
124+
};
125+
126+
Ok(content)
127+
}
128+
}
129+
130+
deserializer.deserialize_any(ObservabilityPipelineOpentelemetrySourceVisitor)
131+
}
132+
}
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)