Skip to content

Commit c8f9d9a

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Make google auth optional for Observability Pipelines (#1036)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 354dc51 commit c8f9d9a

File tree

4 files changed

+43
-20
lines changed

4 files changed

+43
-20
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34514,7 +34514,6 @@ components:
3451434514
- id
3451534515
- type
3451634516
- inputs
34517-
- auth
3451834517
- customer_id
3451934518
type: object
3452034519
ObservabilityPipelineGoogleChronicleDestinationEncoding:
@@ -34580,9 +34579,7 @@ components:
3458034579
- type
3458134580
- inputs
3458234581
- bucket
34583-
- auth
3458434582
- storage_class
34585-
- acl
3458634583
type: object
3458734584
ObservabilityPipelineGoogleCloudStorageDestinationAcl:
3458834585
description: Access control list setting for objects written to the bucket.
@@ -34713,7 +34710,6 @@ components:
3471334710
required:
3471434711
- id
3471534712
- type
34716-
- auth
3471734713
- decoding
3471834714
- project
3471934715
- subscription

src/datadogV2/model/model_observability_pipeline_google_chronicle_destination.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::fmt::{self, Formatter};
1313
pub struct ObservabilityPipelineGoogleChronicleDestination {
1414
/// GCP credentials used to authenticate with Google Cloud Storage.
1515
#[serde(rename = "auth")]
16-
pub auth: crate::datadogV2::model::ObservabilityPipelineGcpAuth,
16+
pub auth: Option<crate::datadogV2::model::ObservabilityPipelineGcpAuth>,
1717
/// The Google Chronicle customer ID.
1818
#[serde(rename = "customer_id")]
1919
pub customer_id: String,
@@ -42,14 +42,13 @@ pub struct ObservabilityPipelineGoogleChronicleDestination {
4242

4343
impl ObservabilityPipelineGoogleChronicleDestination {
4444
pub fn new(
45-
auth: crate::datadogV2::model::ObservabilityPipelineGcpAuth,
4645
customer_id: String,
4746
id: String,
4847
inputs: Vec<String>,
4948
type_: crate::datadogV2::model::ObservabilityPipelineGoogleChronicleDestinationType,
5049
) -> ObservabilityPipelineGoogleChronicleDestination {
5150
ObservabilityPipelineGoogleChronicleDestination {
52-
auth,
51+
auth: None,
5352
customer_id,
5453
encoding: None,
5554
id,
@@ -61,6 +60,11 @@ impl ObservabilityPipelineGoogleChronicleDestination {
6160
}
6261
}
6362

63+
pub fn auth(mut self, value: crate::datadogV2::model::ObservabilityPipelineGcpAuth) -> Self {
64+
self.auth = Some(value);
65+
self
66+
}
67+
6468
pub fn encoding(
6569
mut self,
6670
value: crate::datadogV2::model::ObservabilityPipelineGoogleChronicleDestinationEncoding,
@@ -118,6 +122,9 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineGoogleChronicleDestination {
118122
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
119123
match k.as_str() {
120124
"auth" => {
125+
if v.is_null() {
126+
continue;
127+
}
121128
auth = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
122129
}
123130
"customer_id" => {
@@ -168,7 +175,6 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineGoogleChronicleDestination {
168175
}
169176
}
170177
}
171-
let auth = auth.ok_or_else(|| M::Error::missing_field("auth"))?;
172178
let customer_id =
173179
customer_id.ok_or_else(|| M::Error::missing_field("customer_id"))?;
174180
let id = id.ok_or_else(|| M::Error::missing_field("id"))?;

src/datadogV2/model/model_observability_pipeline_google_cloud_storage_destination.rs

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ use std::fmt::{self, Formatter};
1414
pub struct ObservabilityPipelineGoogleCloudStorageDestination {
1515
/// Access control list setting for objects written to the bucket.
1616
#[serde(rename = "acl")]
17-
pub acl: crate::datadogV2::model::ObservabilityPipelineGoogleCloudStorageDestinationAcl,
17+
pub acl: Option<crate::datadogV2::model::ObservabilityPipelineGoogleCloudStorageDestinationAcl>,
1818
/// GCP credentials used to authenticate with Google Cloud Storage.
1919
#[serde(rename = "auth")]
20-
pub auth: crate::datadogV2::model::ObservabilityPipelineGcpAuth,
20+
pub auth: Option<crate::datadogV2::model::ObservabilityPipelineGcpAuth>,
2121
/// Name of the GCS bucket.
2222
#[serde(rename = "bucket")]
2323
pub bucket: String,
@@ -49,17 +49,15 @@ pub struct ObservabilityPipelineGoogleCloudStorageDestination {
4949

5050
impl ObservabilityPipelineGoogleCloudStorageDestination {
5151
pub fn new(
52-
acl: crate::datadogV2::model::ObservabilityPipelineGoogleCloudStorageDestinationAcl,
53-
auth: crate::datadogV2::model::ObservabilityPipelineGcpAuth,
5452
bucket: String,
5553
id: String,
5654
inputs: Vec<String>,
5755
storage_class: crate::datadogV2::model::ObservabilityPipelineGoogleCloudStorageDestinationStorageClass,
5856
type_: crate::datadogV2::model::ObservabilityPipelineGoogleCloudStorageDestinationType,
5957
) -> ObservabilityPipelineGoogleCloudStorageDestination {
6058
ObservabilityPipelineGoogleCloudStorageDestination {
61-
acl,
62-
auth,
59+
acl: None,
60+
auth: None,
6361
bucket,
6462
id,
6563
inputs,
@@ -72,6 +70,19 @@ impl ObservabilityPipelineGoogleCloudStorageDestination {
7270
}
7371
}
7472

73+
pub fn acl(
74+
mut self,
75+
value: crate::datadogV2::model::ObservabilityPipelineGoogleCloudStorageDestinationAcl,
76+
) -> Self {
77+
self.acl = Some(value);
78+
self
79+
}
80+
81+
pub fn auth(mut self, value: crate::datadogV2::model::ObservabilityPipelineGcpAuth) -> Self {
82+
self.auth = Some(value);
83+
self
84+
}
85+
7586
pub fn key_prefix(mut self, value: String) -> Self {
7687
self.key_prefix = Some(value);
7788
self
@@ -135,6 +146,9 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineGoogleCloudStorageDestinatio
135146
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
136147
match k.as_str() {
137148
"acl" => {
149+
if v.is_null() {
150+
continue;
151+
}
138152
acl = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
139153
if let Some(ref _acl) = acl {
140154
match _acl {
@@ -146,6 +160,9 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineGoogleCloudStorageDestinatio
146160
}
147161
}
148162
"auth" => {
163+
if v.is_null() {
164+
continue;
165+
}
149166
auth = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
150167
}
151168
"bucket" => {
@@ -199,8 +216,6 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineGoogleCloudStorageDestinatio
199216
}
200217
}
201218
}
202-
let acl = acl.ok_or_else(|| M::Error::missing_field("acl"))?;
203-
let auth = auth.ok_or_else(|| M::Error::missing_field("auth"))?;
204219
let bucket = bucket.ok_or_else(|| M::Error::missing_field("bucket"))?;
205220
let id = id.ok_or_else(|| M::Error::missing_field("id"))?;
206221
let inputs = inputs.ok_or_else(|| M::Error::missing_field("inputs"))?;

src/datadogV2/model/model_observability_pipeline_google_pub_sub_source.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::fmt::{self, Formatter};
1313
pub struct ObservabilityPipelineGooglePubSubSource {
1414
/// GCP credentials used to authenticate with Google Cloud Storage.
1515
#[serde(rename = "auth")]
16-
pub auth: crate::datadogV2::model::ObservabilityPipelineGcpAuth,
16+
pub auth: Option<crate::datadogV2::model::ObservabilityPipelineGcpAuth>,
1717
/// The decoding format used to interpret incoming logs.
1818
#[serde(rename = "decoding")]
1919
pub decoding: crate::datadogV2::model::ObservabilityPipelineDecoding,
@@ -41,15 +41,14 @@ pub struct ObservabilityPipelineGooglePubSubSource {
4141

4242
impl ObservabilityPipelineGooglePubSubSource {
4343
pub fn new(
44-
auth: crate::datadogV2::model::ObservabilityPipelineGcpAuth,
4544
decoding: crate::datadogV2::model::ObservabilityPipelineDecoding,
4645
id: String,
4746
project: String,
4847
subscription: String,
4948
type_: crate::datadogV2::model::ObservabilityPipelineGooglePubSubSourceType,
5049
) -> ObservabilityPipelineGooglePubSubSource {
5150
ObservabilityPipelineGooglePubSubSource {
52-
auth,
51+
auth: None,
5352
decoding,
5453
id,
5554
project,
@@ -61,6 +60,11 @@ impl ObservabilityPipelineGooglePubSubSource {
6160
}
6261
}
6362

63+
pub fn auth(mut self, value: crate::datadogV2::model::ObservabilityPipelineGcpAuth) -> Self {
64+
self.auth = Some(value);
65+
self
66+
}
67+
6468
pub fn tls(mut self, value: crate::datadogV2::model::ObservabilityPipelineTls) -> Self {
6569
self.tls = Some(value);
6670
self
@@ -111,6 +115,9 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineGooglePubSubSource {
111115
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
112116
match k.as_str() {
113117
"auth" => {
118+
if v.is_null() {
119+
continue;
120+
}
114121
auth = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
115122
}
116123
"decoding" => {
@@ -158,7 +165,6 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineGooglePubSubSource {
158165
}
159166
}
160167
}
161-
let auth = auth.ok_or_else(|| M::Error::missing_field("auth"))?;
162168
let decoding = decoding.ok_or_else(|| M::Error::missing_field("decoding"))?;
163169
let id = id.ok_or_else(|| M::Error::missing_field("id"))?;
164170
let project = project.ok_or_else(|| M::Error::missing_field("project"))?;

0 commit comments

Comments
 (0)