Skip to content

Commit 1efe957

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Make metadata optional for GCS destination (#641)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent eb78ef4 commit 1efe957

File tree

4 files changed

+22
-14
lines changed

4 files changed

+22
-14
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-05-13 17:47:36.777678",
8-
"spec_repo_commit": "b673a489"
7+
"regenerated": "2025-05-14 09:52:33.683433",
8+
"spec_repo_commit": "996fd99d"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-05-13 17:47:36.793298",
13-
"spec_repo_commit": "b673a489"
12+
"regenerated": "2025-05-14 09:52:33.700097",
13+
"spec_repo_commit": "996fd99d"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24406,7 +24406,8 @@ components:
2440624406
description: Optional prefix for object keys within the GCS bucket.
2440724407
type: string
2440824408
metadata:
24409-
description: Custom metadata key-value pairs added to each object.
24409+
description: Custom metadata to attach to each object uploaded to the GCS
24410+
bucket.
2441024411
items:
2441124412
$ref: '#/components/schemas/ObservabilityPipelineMetadataEntry'
2441224413
type: array
@@ -24422,7 +24423,6 @@ components:
2442224423
- auth
2442324424
- storage_class
2442424425
- acl
24425-
- metadata
2442624426
type: object
2442724427
ObservabilityPipelineGoogleCloudStorageDestinationAcl:
2442824428
description: Access control list setting for objects written to the bucket.
@@ -24701,8 +24701,7 @@ components:
2470124701
x-enum-varnames:
2470224702
- LOGSTASH
2470324703
ObservabilityPipelineMetadataEntry:
24704-
description: A custom metadata entry to attach to each object uploaded to the
24705-
GCS bucket.
24704+
description: A custom metadata entry.
2470624705
properties:
2470724706
name:
2470824707
description: The metadata key.

src/datadogV2/model/model_observability_pipeline_google_cloud_storage_destination.rs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ pub struct ObservabilityPipelineGoogleCloudStorageDestination {
3232
/// Optional prefix for object keys within the GCS bucket.
3333
#[serde(rename = "key_prefix")]
3434
pub key_prefix: Option<String>,
35-
/// Custom metadata key-value pairs added to each object.
35+
/// Custom metadata to attach to each object uploaded to the GCS bucket.
3636
#[serde(rename = "metadata")]
37-
pub metadata: Vec<crate::datadogV2::model::ObservabilityPipelineMetadataEntry>,
37+
pub metadata: Option<Vec<crate::datadogV2::model::ObservabilityPipelineMetadataEntry>>,
3838
/// Storage class used for objects stored in GCS.
3939
#[serde(rename = "storage_class")]
4040
pub storage_class:
@@ -56,7 +56,6 @@ impl ObservabilityPipelineGoogleCloudStorageDestination {
5656
bucket: String,
5757
id: String,
5858
inputs: Vec<String>,
59-
metadata: Vec<crate::datadogV2::model::ObservabilityPipelineMetadataEntry>,
6059
storage_class: crate::datadogV2::model::ObservabilityPipelineGoogleCloudStorageDestinationStorageClass,
6160
type_: crate::datadogV2::model::ObservabilityPipelineGoogleCloudStorageDestinationType,
6261
) -> ObservabilityPipelineGoogleCloudStorageDestination {
@@ -67,7 +66,7 @@ impl ObservabilityPipelineGoogleCloudStorageDestination {
6766
id,
6867
inputs,
6968
key_prefix: None,
70-
metadata,
69+
metadata: None,
7170
storage_class,
7271
type_,
7372
additional_properties: std::collections::BTreeMap::new(),
@@ -80,6 +79,14 @@ impl ObservabilityPipelineGoogleCloudStorageDestination {
8079
self
8180
}
8281

82+
pub fn metadata(
83+
mut self,
84+
value: Vec<crate::datadogV2::model::ObservabilityPipelineMetadataEntry>,
85+
) -> Self {
86+
self.metadata = Some(value);
87+
self
88+
}
89+
8390
pub fn additional_properties(
8491
mut self,
8592
value: std::collections::BTreeMap<String, serde_json::Value>,
@@ -159,6 +166,9 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineGoogleCloudStorageDestinatio
159166
key_prefix = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
160167
}
161168
"metadata" => {
169+
if v.is_null() {
170+
continue;
171+
}
162172
metadata = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
163173
}
164174
"storage_class" => {
@@ -196,7 +206,6 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineGoogleCloudStorageDestinatio
196206
let bucket = bucket.ok_or_else(|| M::Error::missing_field("bucket"))?;
197207
let id = id.ok_or_else(|| M::Error::missing_field("id"))?;
198208
let inputs = inputs.ok_or_else(|| M::Error::missing_field("inputs"))?;
199-
let metadata = metadata.ok_or_else(|| M::Error::missing_field("metadata"))?;
200209
let storage_class =
201210
storage_class.ok_or_else(|| M::Error::missing_field("storage_class"))?;
202211
let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?;

src/datadogV2/model/model_observability_pipeline_metadata_entry.rs

Lines changed: 1 addition & 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-
/// A custom metadata entry to attach to each object uploaded to the GCS bucket.
9+
/// A custom metadata entry.
1010
#[non_exhaustive]
1111
#[skip_serializing_none]
1212
#[derive(Clone, Debug, PartialEq, Serialize)]

0 commit comments

Comments
 (0)