Skip to content

Commit 3ef2816

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 127da32 of spec repo
1 parent 2e523af commit 3ef2816

File tree

4 files changed

+200
-2
lines changed

4 files changed

+200
-2
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36203,7 +36203,8 @@ components:
3620336203
type: object
3620436204
ObservabilityPipelineEnrichmentTableProcessor:
3620536205
description: The `enrichment_table` processor enriches logs using a static CSV
36206-
file or GeoIP database.
36206+
file, GeoIP database, or reference table. Exactly one of `file`, `geoip`,
36207+
or `reference_table` must be configured.
3620736208
properties:
3620836209
display_name:
3620936210
$ref: '#/components/schemas/ObservabilityPipelineComponentDisplayName'
@@ -36224,6 +36225,8 @@ components:
3622436225
targets.
3622536226
example: source:my-source
3622636227
type: string
36228+
reference_table:
36229+
$ref: '#/components/schemas/ObservabilityPipelineEnrichmentTableReferenceTable'
3622736230
target:
3622836231
description: Path where enrichment results should be stored in the log.
3622936232
example: enriched.geoip
@@ -36246,6 +36249,34 @@ components:
3624636249
type: string
3624736250
x-enum-varnames:
3624836251
- ENRICHMENT_TABLE
36252+
ObservabilityPipelineEnrichmentTableReferenceTable:
36253+
description: Uses a Datadog reference table to enrich logs.
36254+
properties:
36255+
app_key_key:
36256+
default: PROCESSOR_ENRICHMENT_TABLES_APP_KEY
36257+
description: Environment variable name containing the application key used
36258+
for reference table authentication.
36259+
type: string
36260+
columns:
36261+
description: List of column names to include from the reference table. If
36262+
not provided, all columns are included.
36263+
items:
36264+
type: string
36265+
nullable: true
36266+
type: array
36267+
key_field:
36268+
description: Path to the field in the log event to match against the reference
36269+
table.
36270+
example: log.user.id
36271+
type: string
36272+
table_id:
36273+
description: The unique identifier of the reference table.
36274+
example: 550e8400-e29b-41d4-a716-446655440000
36275+
type: string
36276+
required:
36277+
- key_field
36278+
- table_id
36279+
type: object
3624936280
ObservabilityPipelineFieldValue:
3625036281
description: Represents a static key-value pair used in various processors.
3625136282
properties:

src/datadogV2/model/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5316,6 +5316,8 @@ pub mod model_observability_pipeline_enrichment_table_file_schema_items_type;
53165316
pub use self::model_observability_pipeline_enrichment_table_file_schema_items_type::ObservabilityPipelineEnrichmentTableFileSchemaItemsType;
53175317
pub mod model_observability_pipeline_enrichment_table_geo_ip;
53185318
pub use self::model_observability_pipeline_enrichment_table_geo_ip::ObservabilityPipelineEnrichmentTableGeoIp;
5319+
pub mod model_observability_pipeline_enrichment_table_reference_table;
5320+
pub use self::model_observability_pipeline_enrichment_table_reference_table::ObservabilityPipelineEnrichmentTableReferenceTable;
53195321
pub mod model_observability_pipeline_enrichment_table_processor_type;
53205322
pub use self::model_observability_pipeline_enrichment_table_processor_type::ObservabilityPipelineEnrichmentTableProcessorType;
53215323
pub mod model_observability_pipeline_reduce_processor;

src/datadogV2/model/model_observability_pipeline_enrichment_table_processor.rs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use serde::{Deserialize, Deserializer, Serialize};
66
use serde_with::skip_serializing_none;
77
use std::fmt::{self, Formatter};
88

9-
/// The `enrichment_table` processor enriches logs using a static CSV file or GeoIP database.
9+
/// The `enrichment_table` processor enriches logs using a static CSV file, GeoIP database, or reference table. Exactly one of `file`, `geoip`, or `reference_table` must be configured.
1010
#[non_exhaustive]
1111
#[skip_serializing_none]
1212
#[derive(Clone, Debug, PartialEq, Serialize)]
@@ -29,6 +29,10 @@ pub struct ObservabilityPipelineEnrichmentTableProcessor {
2929
/// A Datadog search query used to determine which logs this processor targets.
3030
#[serde(rename = "include")]
3131
pub include: String,
32+
/// Uses a Datadog reference table to enrich logs.
33+
#[serde(rename = "reference_table")]
34+
pub reference_table:
35+
Option<crate::datadogV2::model::ObservabilityPipelineEnrichmentTableReferenceTable>,
3236
/// Path where enrichment results should be stored in the log.
3337
#[serde(rename = "target")]
3438
pub target: String,
@@ -57,6 +61,7 @@ impl ObservabilityPipelineEnrichmentTableProcessor {
5761
geoip: None,
5862
id,
5963
include,
64+
reference_table: None,
6065
target,
6166
type_,
6267
additional_properties: std::collections::BTreeMap::new(),
@@ -85,6 +90,14 @@ impl ObservabilityPipelineEnrichmentTableProcessor {
8590
self
8691
}
8792

93+
pub fn reference_table(
94+
mut self,
95+
value: crate::datadogV2::model::ObservabilityPipelineEnrichmentTableReferenceTable,
96+
) -> Self {
97+
self.reference_table = Some(value);
98+
self
99+
}
100+
88101
pub fn additional_properties(
89102
mut self,
90103
value: std::collections::BTreeMap<String, serde_json::Value>,
@@ -121,6 +134,9 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineEnrichmentTableProcessor {
121134
> = None;
122135
let mut id: Option<String> = None;
123136
let mut include: Option<String> = None;
137+
let mut reference_table: Option<
138+
crate::datadogV2::model::ObservabilityPipelineEnrichmentTableReferenceTable,
139+
> = None;
124140
let mut target: Option<String> = None;
125141
let mut type_: Option<
126142
crate::datadogV2::model::ObservabilityPipelineEnrichmentTableProcessorType,
@@ -161,6 +177,13 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineEnrichmentTableProcessor {
161177
"include" => {
162178
include = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
163179
}
180+
"reference_table" => {
181+
if v.is_null() {
182+
continue;
183+
}
184+
reference_table =
185+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
186+
}
164187
"target" => {
165188
target = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
166189
}
@@ -195,6 +218,7 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineEnrichmentTableProcessor {
195218
geoip,
196219
id,
197220
include,
221+
reference_table,
198222
target,
199223
type_,
200224
additional_properties,
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
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+
/// Uses a Datadog reference table to enrich logs.
10+
#[non_exhaustive]
11+
#[skip_serializing_none]
12+
#[derive(Clone, Debug, PartialEq, Serialize)]
13+
pub struct ObservabilityPipelineEnrichmentTableReferenceTable {
14+
/// Environment variable name containing the application key used for reference table authentication.
15+
#[serde(rename = "app_key_key")]
16+
pub app_key_key: Option<String>,
17+
/// List of column names to include from the reference table. If not provided, all columns are included.
18+
#[serde(
19+
rename = "columns",
20+
default,
21+
with = "::serde_with::rust::double_option"
22+
)]
23+
pub columns: Option<Option<Vec<String>>>,
24+
/// Path to the field in the log event to match against the reference table.
25+
#[serde(rename = "key_field")]
26+
pub key_field: String,
27+
/// The unique identifier of the reference table.
28+
#[serde(rename = "table_id")]
29+
pub table_id: String,
30+
#[serde(flatten)]
31+
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
32+
#[serde(skip)]
33+
#[serde(default)]
34+
pub(crate) _unparsed: bool,
35+
}
36+
37+
impl ObservabilityPipelineEnrichmentTableReferenceTable {
38+
pub fn new(
39+
key_field: String,
40+
table_id: String,
41+
) -> ObservabilityPipelineEnrichmentTableReferenceTable {
42+
ObservabilityPipelineEnrichmentTableReferenceTable {
43+
app_key_key: None,
44+
columns: None,
45+
key_field,
46+
table_id,
47+
additional_properties: std::collections::BTreeMap::new(),
48+
_unparsed: false,
49+
}
50+
}
51+
52+
pub fn app_key_key(mut self, value: String) -> Self {
53+
self.app_key_key = Some(value);
54+
self
55+
}
56+
57+
pub fn columns(mut self, value: Option<Vec<String>>) -> Self {
58+
self.columns = Some(value);
59+
self
60+
}
61+
62+
pub fn additional_properties(
63+
mut self,
64+
value: std::collections::BTreeMap<String, serde_json::Value>,
65+
) -> Self {
66+
self.additional_properties = value;
67+
self
68+
}
69+
}
70+
71+
impl<'de> Deserialize<'de> for ObservabilityPipelineEnrichmentTableReferenceTable {
72+
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
73+
where
74+
D: Deserializer<'de>,
75+
{
76+
struct ObservabilityPipelineEnrichmentTableReferenceTableVisitor;
77+
impl<'a> Visitor<'a> for ObservabilityPipelineEnrichmentTableReferenceTableVisitor {
78+
type Value = ObservabilityPipelineEnrichmentTableReferenceTable;
79+
80+
fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
81+
f.write_str("a mapping")
82+
}
83+
84+
fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
85+
where
86+
M: MapAccess<'a>,
87+
{
88+
let mut app_key_key: Option<String> = None;
89+
let mut columns: Option<Option<Vec<String>>> = None;
90+
let mut key_field: Option<String> = None;
91+
let mut table_id: Option<String> = None;
92+
let mut additional_properties: std::collections::BTreeMap<
93+
String,
94+
serde_json::Value,
95+
> = std::collections::BTreeMap::new();
96+
let mut _unparsed = false;
97+
98+
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
99+
match k.as_str() {
100+
"app_key_key" => {
101+
if v.is_null() {
102+
continue;
103+
}
104+
app_key_key =
105+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
106+
}
107+
"columns" => {
108+
columns = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
109+
}
110+
"key_field" => {
111+
key_field = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
112+
}
113+
"table_id" => {
114+
table_id = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
115+
}
116+
&_ => {
117+
if let Ok(value) = serde_json::from_value(v.clone()) {
118+
additional_properties.insert(k, value);
119+
}
120+
}
121+
}
122+
}
123+
let key_field = key_field.ok_or_else(|| M::Error::missing_field("key_field"))?;
124+
let table_id = table_id.ok_or_else(|| M::Error::missing_field("table_id"))?;
125+
126+
let content = ObservabilityPipelineEnrichmentTableReferenceTable {
127+
app_key_key,
128+
columns,
129+
key_field,
130+
table_id,
131+
additional_properties,
132+
_unparsed,
133+
};
134+
135+
Ok(content)
136+
}
137+
}
138+
139+
deserializer.deserialize_any(ObservabilityPipelineEnrichmentTableReferenceTableVisitor)
140+
}
141+
}

0 commit comments

Comments
 (0)