@@ -32,9 +32,9 @@ pub struct ObservabilityPipelineGoogleCloudStorageDestination {
32
32
/// Optional prefix for object keys within the GCS bucket.
33
33
#[ serde( rename = "key_prefix" ) ]
34
34
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 .
36
36
#[ serde( rename = "metadata" ) ]
37
- pub metadata : Vec < crate :: datadogV2:: model:: ObservabilityPipelineMetadataEntry > ,
37
+ pub metadata : Option < Vec < crate :: datadogV2:: model:: ObservabilityPipelineMetadataEntry > > ,
38
38
/// Storage class used for objects stored in GCS.
39
39
#[ serde( rename = "storage_class" ) ]
40
40
pub storage_class :
@@ -56,7 +56,6 @@ impl ObservabilityPipelineGoogleCloudStorageDestination {
56
56
bucket : String ,
57
57
id : String ,
58
58
inputs : Vec < String > ,
59
- metadata : Vec < crate :: datadogV2:: model:: ObservabilityPipelineMetadataEntry > ,
60
59
storage_class : crate :: datadogV2:: model:: ObservabilityPipelineGoogleCloudStorageDestinationStorageClass ,
61
60
type_ : crate :: datadogV2:: model:: ObservabilityPipelineGoogleCloudStorageDestinationType ,
62
61
) -> ObservabilityPipelineGoogleCloudStorageDestination {
@@ -67,7 +66,7 @@ impl ObservabilityPipelineGoogleCloudStorageDestination {
67
66
id,
68
67
inputs,
69
68
key_prefix : None ,
70
- metadata,
69
+ metadata : None ,
71
70
storage_class,
72
71
type_,
73
72
additional_properties : std:: collections:: BTreeMap :: new ( ) ,
@@ -80,6 +79,14 @@ impl ObservabilityPipelineGoogleCloudStorageDestination {
80
79
self
81
80
}
82
81
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
+
83
90
pub fn additional_properties (
84
91
mut self ,
85
92
value : std:: collections:: BTreeMap < String , serde_json:: Value > ,
@@ -159,6 +166,9 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineGoogleCloudStorageDestinatio
159
166
key_prefix = Some ( serde_json:: from_value ( v) . map_err ( M :: Error :: custom) ?) ;
160
167
}
161
168
"metadata" => {
169
+ if v. is_null ( ) {
170
+ continue ;
171
+ }
162
172
metadata = Some ( serde_json:: from_value ( v) . map_err ( M :: Error :: custom) ?) ;
163
173
}
164
174
"storage_class" => {
@@ -196,7 +206,6 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineGoogleCloudStorageDestinatio
196
206
let bucket = bucket. ok_or_else ( || M :: Error :: missing_field ( "bucket" ) ) ?;
197
207
let id = id. ok_or_else ( || M :: Error :: missing_field ( "id" ) ) ?;
198
208
let inputs = inputs. ok_or_else ( || M :: Error :: missing_field ( "inputs" ) ) ?;
199
- let metadata = metadata. ok_or_else ( || M :: Error :: missing_field ( "metadata" ) ) ?;
200
209
let storage_class =
201
210
storage_class. ok_or_else ( || M :: Error :: missing_field ( "storage_class" ) ) ?;
202
211
let type_ = type_. ok_or_else ( || M :: Error :: missing_field ( "type_" ) ) ?;
0 commit comments