google_cloud_datastream_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate lazy_static;
25extern crate location;
26extern crate longrunning;
27extern crate lro;
28extern crate reqwest;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36/// Request message for 'discover' ConnectionProfile request.
37#[derive(Clone, Default, PartialEq)]
38#[non_exhaustive]
39pub struct DiscoverConnectionProfileRequest {
40    /// Required. The parent resource of the connection profile type. Must be in
41    /// the format `projects/*/locations/*`.
42    pub parent: std::string::String,
43
44    /// The connection profile on which to run discover.
45    pub target: std::option::Option<crate::model::discover_connection_profile_request::Target>,
46
47    /// The depth of the retrieved hierarchy of data objects.
48    pub hierarchy:
49        std::option::Option<crate::model::discover_connection_profile_request::Hierarchy>,
50
51    /// The data object to populate with child data objects and metadata.
52    pub data_object:
53        std::option::Option<crate::model::discover_connection_profile_request::DataObject>,
54
55    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
56}
57
58impl DiscoverConnectionProfileRequest {
59    pub fn new() -> Self {
60        std::default::Default::default()
61    }
62
63    /// Sets the value of [parent][crate::model::DiscoverConnectionProfileRequest::parent].
64    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
65        self.parent = v.into();
66        self
67    }
68
69    /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target].
70    ///
71    /// Note that all the setters affecting `target` are mutually
72    /// exclusive.
73    pub fn set_target<
74        T: std::convert::Into<
75                std::option::Option<crate::model::discover_connection_profile_request::Target>,
76            >,
77    >(
78        mut self,
79        v: T,
80    ) -> Self {
81        self.target = v.into();
82        self
83    }
84
85    /// The value of [target][crate::model::DiscoverConnectionProfileRequest::target]
86    /// if it holds a `ConnectionProfile`, `None` if the field is not set or
87    /// holds a different branch.
88    pub fn connection_profile(
89        &self,
90    ) -> std::option::Option<&std::boxed::Box<crate::model::ConnectionProfile>> {
91        #[allow(unreachable_patterns)]
92        self.target.as_ref().and_then(|v| match v {
93            crate::model::discover_connection_profile_request::Target::ConnectionProfile(v) => {
94                std::option::Option::Some(v)
95            }
96            _ => std::option::Option::None,
97        })
98    }
99
100    /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target]
101    /// to hold a `ConnectionProfile`.
102    ///
103    /// Note that all the setters affecting `target` are
104    /// mutually exclusive.
105    pub fn set_connection_profile<
106        T: std::convert::Into<std::boxed::Box<crate::model::ConnectionProfile>>,
107    >(
108        mut self,
109        v: T,
110    ) -> Self {
111        self.target = std::option::Option::Some(
112            crate::model::discover_connection_profile_request::Target::ConnectionProfile(v.into()),
113        );
114        self
115    }
116
117    /// The value of [target][crate::model::DiscoverConnectionProfileRequest::target]
118    /// if it holds a `ConnectionProfileName`, `None` if the field is not set or
119    /// holds a different branch.
120    pub fn connection_profile_name(&self) -> std::option::Option<&std::string::String> {
121        #[allow(unreachable_patterns)]
122        self.target.as_ref().and_then(|v| match v {
123            crate::model::discover_connection_profile_request::Target::ConnectionProfileName(v) => {
124                std::option::Option::Some(v)
125            }
126            _ => std::option::Option::None,
127        })
128    }
129
130    /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target]
131    /// to hold a `ConnectionProfileName`.
132    ///
133    /// Note that all the setters affecting `target` are
134    /// mutually exclusive.
135    pub fn set_connection_profile_name<T: std::convert::Into<std::string::String>>(
136        mut self,
137        v: T,
138    ) -> Self {
139        self.target = std::option::Option::Some(
140            crate::model::discover_connection_profile_request::Target::ConnectionProfileName(
141                v.into(),
142            ),
143        );
144        self
145    }
146
147    /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy].
148    ///
149    /// Note that all the setters affecting `hierarchy` are mutually
150    /// exclusive.
151    pub fn set_hierarchy<
152        T: std::convert::Into<
153                std::option::Option<crate::model::discover_connection_profile_request::Hierarchy>,
154            >,
155    >(
156        mut self,
157        v: T,
158    ) -> Self {
159        self.hierarchy = v.into();
160        self
161    }
162
163    /// The value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
164    /// if it holds a `FullHierarchy`, `None` if the field is not set or
165    /// holds a different branch.
166    pub fn full_hierarchy(&self) -> std::option::Option<&bool> {
167        #[allow(unreachable_patterns)]
168        self.hierarchy.as_ref().and_then(|v| match v {
169            crate::model::discover_connection_profile_request::Hierarchy::FullHierarchy(v) => {
170                std::option::Option::Some(v)
171            }
172            _ => std::option::Option::None,
173        })
174    }
175
176    /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
177    /// to hold a `FullHierarchy`.
178    ///
179    /// Note that all the setters affecting `hierarchy` are
180    /// mutually exclusive.
181    pub fn set_full_hierarchy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
182        self.hierarchy = std::option::Option::Some(
183            crate::model::discover_connection_profile_request::Hierarchy::FullHierarchy(v.into()),
184        );
185        self
186    }
187
188    /// The value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
189    /// if it holds a `HierarchyDepth`, `None` if the field is not set or
190    /// holds a different branch.
191    pub fn hierarchy_depth(&self) -> std::option::Option<&i32> {
192        #[allow(unreachable_patterns)]
193        self.hierarchy.as_ref().and_then(|v| match v {
194            crate::model::discover_connection_profile_request::Hierarchy::HierarchyDepth(v) => {
195                std::option::Option::Some(v)
196            }
197            _ => std::option::Option::None,
198        })
199    }
200
201    /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
202    /// to hold a `HierarchyDepth`.
203    ///
204    /// Note that all the setters affecting `hierarchy` are
205    /// mutually exclusive.
206    pub fn set_hierarchy_depth<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
207        self.hierarchy = std::option::Option::Some(
208            crate::model::discover_connection_profile_request::Hierarchy::HierarchyDepth(v.into()),
209        );
210        self
211    }
212
213    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object].
214    ///
215    /// Note that all the setters affecting `data_object` are mutually
216    /// exclusive.
217    pub fn set_data_object<
218        T: std::convert::Into<
219                std::option::Option<crate::model::discover_connection_profile_request::DataObject>,
220            >,
221    >(
222        mut self,
223        v: T,
224    ) -> Self {
225        self.data_object = v.into();
226        self
227    }
228
229    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
230    /// if it holds a `OracleRdbms`, `None` if the field is not set or
231    /// holds a different branch.
232    pub fn oracle_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
233        #[allow(unreachable_patterns)]
234        self.data_object.as_ref().and_then(|v| match v {
235            crate::model::discover_connection_profile_request::DataObject::OracleRdbms(v) => {
236                std::option::Option::Some(v)
237            }
238            _ => std::option::Option::None,
239        })
240    }
241
242    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
243    /// to hold a `OracleRdbms`.
244    ///
245    /// Note that all the setters affecting `data_object` are
246    /// mutually exclusive.
247    pub fn set_oracle_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>>(
248        mut self,
249        v: T,
250    ) -> Self {
251        self.data_object = std::option::Option::Some(
252            crate::model::discover_connection_profile_request::DataObject::OracleRdbms(v.into()),
253        );
254        self
255    }
256
257    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
258    /// if it holds a `MysqlRdbms`, `None` if the field is not set or
259    /// holds a different branch.
260    pub fn mysql_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
261        #[allow(unreachable_patterns)]
262        self.data_object.as_ref().and_then(|v| match v {
263            crate::model::discover_connection_profile_request::DataObject::MysqlRdbms(v) => {
264                std::option::Option::Some(v)
265            }
266            _ => std::option::Option::None,
267        })
268    }
269
270    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
271    /// to hold a `MysqlRdbms`.
272    ///
273    /// Note that all the setters affecting `data_object` are
274    /// mutually exclusive.
275    pub fn set_mysql_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>>(
276        mut self,
277        v: T,
278    ) -> Self {
279        self.data_object = std::option::Option::Some(
280            crate::model::discover_connection_profile_request::DataObject::MysqlRdbms(v.into()),
281        );
282        self
283    }
284
285    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
286    /// if it holds a `PostgresqlRdbms`, `None` if the field is not set or
287    /// holds a different branch.
288    pub fn postgresql_rdbms(
289        &self,
290    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
291        #[allow(unreachable_patterns)]
292        self.data_object.as_ref().and_then(|v| match v {
293            crate::model::discover_connection_profile_request::DataObject::PostgresqlRdbms(v) => {
294                std::option::Option::Some(v)
295            }
296            _ => std::option::Option::None,
297        })
298    }
299
300    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
301    /// to hold a `PostgresqlRdbms`.
302    ///
303    /// Note that all the setters affecting `data_object` are
304    /// mutually exclusive.
305    pub fn set_postgresql_rdbms<
306        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
307    >(
308        mut self,
309        v: T,
310    ) -> Self {
311        self.data_object = std::option::Option::Some(
312            crate::model::discover_connection_profile_request::DataObject::PostgresqlRdbms(
313                v.into(),
314            ),
315        );
316        self
317    }
318
319    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
320    /// if it holds a `SqlServerRdbms`, `None` if the field is not set or
321    /// holds a different branch.
322    pub fn sql_server_rdbms(
323        &self,
324    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
325        #[allow(unreachable_patterns)]
326        self.data_object.as_ref().and_then(|v| match v {
327            crate::model::discover_connection_profile_request::DataObject::SqlServerRdbms(v) => {
328                std::option::Option::Some(v)
329            }
330            _ => std::option::Option::None,
331        })
332    }
333
334    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
335    /// to hold a `SqlServerRdbms`.
336    ///
337    /// Note that all the setters affecting `data_object` are
338    /// mutually exclusive.
339    pub fn set_sql_server_rdbms<
340        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
341    >(
342        mut self,
343        v: T,
344    ) -> Self {
345        self.data_object = std::option::Option::Some(
346            crate::model::discover_connection_profile_request::DataObject::SqlServerRdbms(v.into()),
347        );
348        self
349    }
350
351    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
352    /// if it holds a `SalesforceOrg`, `None` if the field is not set or
353    /// holds a different branch.
354    pub fn salesforce_org(
355        &self,
356    ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceOrg>> {
357        #[allow(unreachable_patterns)]
358        self.data_object.as_ref().and_then(|v| match v {
359            crate::model::discover_connection_profile_request::DataObject::SalesforceOrg(v) => {
360                std::option::Option::Some(v)
361            }
362            _ => std::option::Option::None,
363        })
364    }
365
366    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
367    /// to hold a `SalesforceOrg`.
368    ///
369    /// Note that all the setters affecting `data_object` are
370    /// mutually exclusive.
371    pub fn set_salesforce_org<
372        T: std::convert::Into<std::boxed::Box<crate::model::SalesforceOrg>>,
373    >(
374        mut self,
375        v: T,
376    ) -> Self {
377        self.data_object = std::option::Option::Some(
378            crate::model::discover_connection_profile_request::DataObject::SalesforceOrg(v.into()),
379        );
380        self
381    }
382
383    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
384    /// if it holds a `MongodbCluster`, `None` if the field is not set or
385    /// holds a different branch.
386    pub fn mongodb_cluster(
387        &self,
388    ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbCluster>> {
389        #[allow(unreachable_patterns)]
390        self.data_object.as_ref().and_then(|v| match v {
391            crate::model::discover_connection_profile_request::DataObject::MongodbCluster(v) => {
392                std::option::Option::Some(v)
393            }
394            _ => std::option::Option::None,
395        })
396    }
397
398    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
399    /// to hold a `MongodbCluster`.
400    ///
401    /// Note that all the setters affecting `data_object` are
402    /// mutually exclusive.
403    pub fn set_mongodb_cluster<
404        T: std::convert::Into<std::boxed::Box<crate::model::MongodbCluster>>,
405    >(
406        mut self,
407        v: T,
408    ) -> Self {
409        self.data_object = std::option::Option::Some(
410            crate::model::discover_connection_profile_request::DataObject::MongodbCluster(v.into()),
411        );
412        self
413    }
414}
415
416impl wkt::message::Message for DiscoverConnectionProfileRequest {
417    fn typename() -> &'static str {
418        "type.googleapis.com/google.cloud.datastream.v1.DiscoverConnectionProfileRequest"
419    }
420}
421
422#[doc(hidden)]
423impl<'de> serde::de::Deserialize<'de> for DiscoverConnectionProfileRequest {
424    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
425    where
426        D: serde::Deserializer<'de>,
427    {
428        #[allow(non_camel_case_types)]
429        #[doc(hidden)]
430        #[derive(PartialEq, Eq, Hash)]
431        enum __FieldTag {
432            __parent,
433            __connection_profile,
434            __connection_profile_name,
435            __full_hierarchy,
436            __hierarchy_depth,
437            __oracle_rdbms,
438            __mysql_rdbms,
439            __postgresql_rdbms,
440            __sql_server_rdbms,
441            __salesforce_org,
442            __mongodb_cluster,
443            Unknown(std::string::String),
444        }
445        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
446            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
447            where
448                D: serde::Deserializer<'de>,
449            {
450                struct Visitor;
451                impl<'de> serde::de::Visitor<'de> for Visitor {
452                    type Value = __FieldTag;
453                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
454                        formatter.write_str("a field name for DiscoverConnectionProfileRequest")
455                    }
456                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
457                    where
458                        E: serde::de::Error,
459                    {
460                        use std::result::Result::Ok;
461                        use std::string::ToString;
462                        match value {
463                            "parent" => Ok(__FieldTag::__parent),
464                            "connectionProfile" => Ok(__FieldTag::__connection_profile),
465                            "connection_profile" => Ok(__FieldTag::__connection_profile),
466                            "connectionProfileName" => Ok(__FieldTag::__connection_profile_name),
467                            "connection_profile_name" => Ok(__FieldTag::__connection_profile_name),
468                            "fullHierarchy" => Ok(__FieldTag::__full_hierarchy),
469                            "full_hierarchy" => Ok(__FieldTag::__full_hierarchy),
470                            "hierarchyDepth" => Ok(__FieldTag::__hierarchy_depth),
471                            "hierarchy_depth" => Ok(__FieldTag::__hierarchy_depth),
472                            "oracleRdbms" => Ok(__FieldTag::__oracle_rdbms),
473                            "oracle_rdbms" => Ok(__FieldTag::__oracle_rdbms),
474                            "mysqlRdbms" => Ok(__FieldTag::__mysql_rdbms),
475                            "mysql_rdbms" => Ok(__FieldTag::__mysql_rdbms),
476                            "postgresqlRdbms" => Ok(__FieldTag::__postgresql_rdbms),
477                            "postgresql_rdbms" => Ok(__FieldTag::__postgresql_rdbms),
478                            "sqlServerRdbms" => Ok(__FieldTag::__sql_server_rdbms),
479                            "sql_server_rdbms" => Ok(__FieldTag::__sql_server_rdbms),
480                            "salesforceOrg" => Ok(__FieldTag::__salesforce_org),
481                            "salesforce_org" => Ok(__FieldTag::__salesforce_org),
482                            "mongodbCluster" => Ok(__FieldTag::__mongodb_cluster),
483                            "mongodb_cluster" => Ok(__FieldTag::__mongodb_cluster),
484                            _ => Ok(__FieldTag::Unknown(value.to_string())),
485                        }
486                    }
487                }
488                deserializer.deserialize_identifier(Visitor)
489            }
490        }
491        struct Visitor;
492        impl<'de> serde::de::Visitor<'de> for Visitor {
493            type Value = DiscoverConnectionProfileRequest;
494            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
495                formatter.write_str("struct DiscoverConnectionProfileRequest")
496            }
497            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
498            where
499                A: serde::de::MapAccess<'de>,
500            {
501                #[allow(unused_imports)]
502                use serde::de::Error;
503                use std::option::Option::Some;
504                let mut fields = std::collections::HashSet::new();
505                let mut result = Self::Value::new();
506                while let Some(tag) = map.next_key::<__FieldTag>()? {
507                    #[allow(clippy::match_single_binding)]
508                    match tag {
509                        __FieldTag::__parent => {
510                            if !fields.insert(__FieldTag::__parent) {
511                                return std::result::Result::Err(A::Error::duplicate_field(
512                                    "multiple values for parent",
513                                ));
514                            }
515                            result.parent = map
516                                .next_value::<std::option::Option<std::string::String>>()?
517                                .unwrap_or_default();
518                        }
519                        __FieldTag::__connection_profile => {
520                            if !fields.insert(__FieldTag::__connection_profile) {
521                                return std::result::Result::Err(A::Error::duplicate_field(
522                                    "multiple values for connection_profile",
523                                ));
524                            }
525                            if result.target.is_some() {
526                                return std::result::Result::Err(A::Error::duplicate_field(
527                                    "multiple values for `target`, a oneof with full ID .google.cloud.datastream.v1.DiscoverConnectionProfileRequest.connection_profile, latest field was connectionProfile",
528                                ));
529                            }
530                            result.target = std::option::Option::Some(
531                                crate::model::discover_connection_profile_request::Target::ConnectionProfile(
532                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::ConnectionProfile>>>()?.unwrap_or_default()
533                                ),
534                            );
535                        }
536                        __FieldTag::__connection_profile_name => {
537                            if !fields.insert(__FieldTag::__connection_profile_name) {
538                                return std::result::Result::Err(A::Error::duplicate_field(
539                                    "multiple values for connection_profile_name",
540                                ));
541                            }
542                            if result.target.is_some() {
543                                return std::result::Result::Err(A::Error::duplicate_field(
544                                    "multiple values for `target`, a oneof with full ID .google.cloud.datastream.v1.DiscoverConnectionProfileRequest.connection_profile_name, latest field was connectionProfileName",
545                                ));
546                            }
547                            result.target = std::option::Option::Some(
548                                crate::model::discover_connection_profile_request::Target::ConnectionProfileName(
549                                    map.next_value::<std::option::Option<std::string::String>>()?.unwrap_or_default()
550                                ),
551                            );
552                        }
553                        __FieldTag::__full_hierarchy => {
554                            if !fields.insert(__FieldTag::__full_hierarchy) {
555                                return std::result::Result::Err(A::Error::duplicate_field(
556                                    "multiple values for full_hierarchy",
557                                ));
558                            }
559                            if result.hierarchy.is_some() {
560                                return std::result::Result::Err(A::Error::duplicate_field(
561                                    "multiple values for `hierarchy`, a oneof with full ID .google.cloud.datastream.v1.DiscoverConnectionProfileRequest.full_hierarchy, latest field was fullHierarchy",
562                                ));
563                            }
564                            result.hierarchy = std::option::Option::Some(
565                                crate::model::discover_connection_profile_request::Hierarchy::FullHierarchy(
566                                    map.next_value::<std::option::Option<bool>>()?.unwrap_or_default()
567                                ),
568                            );
569                        }
570                        __FieldTag::__hierarchy_depth => {
571                            if !fields.insert(__FieldTag::__hierarchy_depth) {
572                                return std::result::Result::Err(A::Error::duplicate_field(
573                                    "multiple values for hierarchy_depth",
574                                ));
575                            }
576                            struct __With(std::option::Option<i32>);
577                            impl<'de> serde::de::Deserialize<'de> for __With {
578                                fn deserialize<D>(
579                                    deserializer: D,
580                                ) -> std::result::Result<Self, D::Error>
581                                where
582                                    D: serde::de::Deserializer<'de>,
583                                {
584                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
585                                }
586                            }
587                            if result.hierarchy.is_some() {
588                                return std::result::Result::Err(A::Error::duplicate_field(
589                                    "multiple values for `hierarchy`, a oneof with full ID .google.cloud.datastream.v1.DiscoverConnectionProfileRequest.hierarchy_depth, latest field was hierarchyDepth",
590                                ));
591                            }
592                            result.hierarchy = std::option::Option::Some(
593                                crate::model::discover_connection_profile_request::Hierarchy::HierarchyDepth(
594                                    map.next_value::<__With>()?.0.unwrap_or_default()
595                                ),
596                            );
597                        }
598                        __FieldTag::__oracle_rdbms => {
599                            if !fields.insert(__FieldTag::__oracle_rdbms) {
600                                return std::result::Result::Err(A::Error::duplicate_field(
601                                    "multiple values for oracle_rdbms",
602                                ));
603                            }
604                            if result.data_object.is_some() {
605                                return std::result::Result::Err(A::Error::duplicate_field(
606                                    "multiple values for `data_object`, a oneof with full ID .google.cloud.datastream.v1.DiscoverConnectionProfileRequest.oracle_rdbms, latest field was oracleRdbms",
607                                ));
608                            }
609                            result.data_object = std::option::Option::Some(
610                                crate::model::discover_connection_profile_request::DataObject::OracleRdbms(
611                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::OracleRdbms>>>()?.unwrap_or_default()
612                                ),
613                            );
614                        }
615                        __FieldTag::__mysql_rdbms => {
616                            if !fields.insert(__FieldTag::__mysql_rdbms) {
617                                return std::result::Result::Err(A::Error::duplicate_field(
618                                    "multiple values for mysql_rdbms",
619                                ));
620                            }
621                            if result.data_object.is_some() {
622                                return std::result::Result::Err(A::Error::duplicate_field(
623                                    "multiple values for `data_object`, a oneof with full ID .google.cloud.datastream.v1.DiscoverConnectionProfileRequest.mysql_rdbms, latest field was mysqlRdbms",
624                                ));
625                            }
626                            result.data_object = std::option::Option::Some(
627                                crate::model::discover_connection_profile_request::DataObject::MysqlRdbms(
628                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::MysqlRdbms>>>()?.unwrap_or_default()
629                                ),
630                            );
631                        }
632                        __FieldTag::__postgresql_rdbms => {
633                            if !fields.insert(__FieldTag::__postgresql_rdbms) {
634                                return std::result::Result::Err(A::Error::duplicate_field(
635                                    "multiple values for postgresql_rdbms",
636                                ));
637                            }
638                            if result.data_object.is_some() {
639                                return std::result::Result::Err(A::Error::duplicate_field(
640                                    "multiple values for `data_object`, a oneof with full ID .google.cloud.datastream.v1.DiscoverConnectionProfileRequest.postgresql_rdbms, latest field was postgresqlRdbms",
641                                ));
642                            }
643                            result.data_object = std::option::Option::Some(
644                                crate::model::discover_connection_profile_request::DataObject::PostgresqlRdbms(
645                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::PostgresqlRdbms>>>()?.unwrap_or_default()
646                                ),
647                            );
648                        }
649                        __FieldTag::__sql_server_rdbms => {
650                            if !fields.insert(__FieldTag::__sql_server_rdbms) {
651                                return std::result::Result::Err(A::Error::duplicate_field(
652                                    "multiple values for sql_server_rdbms",
653                                ));
654                            }
655                            if result.data_object.is_some() {
656                                return std::result::Result::Err(A::Error::duplicate_field(
657                                    "multiple values for `data_object`, a oneof with full ID .google.cloud.datastream.v1.DiscoverConnectionProfileRequest.sql_server_rdbms, latest field was sqlServerRdbms",
658                                ));
659                            }
660                            result.data_object = std::option::Option::Some(
661                                crate::model::discover_connection_profile_request::DataObject::SqlServerRdbms(
662                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::SqlServerRdbms>>>()?.unwrap_or_default()
663                                ),
664                            );
665                        }
666                        __FieldTag::__salesforce_org => {
667                            if !fields.insert(__FieldTag::__salesforce_org) {
668                                return std::result::Result::Err(A::Error::duplicate_field(
669                                    "multiple values for salesforce_org",
670                                ));
671                            }
672                            if result.data_object.is_some() {
673                                return std::result::Result::Err(A::Error::duplicate_field(
674                                    "multiple values for `data_object`, a oneof with full ID .google.cloud.datastream.v1.DiscoverConnectionProfileRequest.salesforce_org, latest field was salesforceOrg",
675                                ));
676                            }
677                            result.data_object = std::option::Option::Some(
678                                crate::model::discover_connection_profile_request::DataObject::SalesforceOrg(
679                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::SalesforceOrg>>>()?.unwrap_or_default()
680                                ),
681                            );
682                        }
683                        __FieldTag::__mongodb_cluster => {
684                            if !fields.insert(__FieldTag::__mongodb_cluster) {
685                                return std::result::Result::Err(A::Error::duplicate_field(
686                                    "multiple values for mongodb_cluster",
687                                ));
688                            }
689                            if result.data_object.is_some() {
690                                return std::result::Result::Err(A::Error::duplicate_field(
691                                    "multiple values for `data_object`, a oneof with full ID .google.cloud.datastream.v1.DiscoverConnectionProfileRequest.mongodb_cluster, latest field was mongodbCluster",
692                                ));
693                            }
694                            result.data_object = std::option::Option::Some(
695                                crate::model::discover_connection_profile_request::DataObject::MongodbCluster(
696                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::MongodbCluster>>>()?.unwrap_or_default()
697                                ),
698                            );
699                        }
700                        __FieldTag::Unknown(key) => {
701                            let value = map.next_value::<serde_json::Value>()?;
702                            result._unknown_fields.insert(key, value);
703                        }
704                    }
705                }
706                std::result::Result::Ok(result)
707            }
708        }
709        deserializer.deserialize_any(Visitor)
710    }
711}
712
713#[doc(hidden)]
714impl serde::ser::Serialize for DiscoverConnectionProfileRequest {
715    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
716    where
717        S: serde::ser::Serializer,
718    {
719        use serde::ser::SerializeMap;
720        #[allow(unused_imports)]
721        use std::option::Option::Some;
722        let mut state = serializer.serialize_map(std::option::Option::None)?;
723        if !self.parent.is_empty() {
724            state.serialize_entry("parent", &self.parent)?;
725        }
726        if let Some(value) = self.connection_profile() {
727            state.serialize_entry("connectionProfile", value)?;
728        }
729        if let Some(value) = self.connection_profile_name() {
730            state.serialize_entry("connectionProfileName", value)?;
731        }
732        if let Some(value) = self.full_hierarchy() {
733            state.serialize_entry("fullHierarchy", value)?;
734        }
735        if let Some(value) = self.hierarchy_depth() {
736            struct __With<'a>(&'a i32);
737            impl<'a> serde::ser::Serialize for __With<'a> {
738                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
739                where
740                    S: serde::ser::Serializer,
741                {
742                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
743                }
744            }
745            state.serialize_entry("hierarchyDepth", &__With(value))?;
746        }
747        if let Some(value) = self.oracle_rdbms() {
748            state.serialize_entry("oracleRdbms", value)?;
749        }
750        if let Some(value) = self.mysql_rdbms() {
751            state.serialize_entry("mysqlRdbms", value)?;
752        }
753        if let Some(value) = self.postgresql_rdbms() {
754            state.serialize_entry("postgresqlRdbms", value)?;
755        }
756        if let Some(value) = self.sql_server_rdbms() {
757            state.serialize_entry("sqlServerRdbms", value)?;
758        }
759        if let Some(value) = self.salesforce_org() {
760            state.serialize_entry("salesforceOrg", value)?;
761        }
762        if let Some(value) = self.mongodb_cluster() {
763            state.serialize_entry("mongodbCluster", value)?;
764        }
765        if !self._unknown_fields.is_empty() {
766            for (key, value) in self._unknown_fields.iter() {
767                state.serialize_entry(key, &value)?;
768            }
769        }
770        state.end()
771    }
772}
773
774impl std::fmt::Debug for DiscoverConnectionProfileRequest {
775    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
776        let mut debug_struct = f.debug_struct("DiscoverConnectionProfileRequest");
777        debug_struct.field("parent", &self.parent);
778        debug_struct.field("target", &self.target);
779        debug_struct.field("hierarchy", &self.hierarchy);
780        debug_struct.field("data_object", &self.data_object);
781        if !self._unknown_fields.is_empty() {
782            debug_struct.field("_unknown_fields", &self._unknown_fields);
783        }
784        debug_struct.finish()
785    }
786}
787
788/// Defines additional types related to [DiscoverConnectionProfileRequest].
789pub mod discover_connection_profile_request {
790    #[allow(unused_imports)]
791    use super::*;
792
793    /// The connection profile on which to run discover.
794    #[derive(Clone, Debug, PartialEq)]
795    #[non_exhaustive]
796    pub enum Target {
797        /// An ad-hoc connection profile configuration.
798        ConnectionProfile(std::boxed::Box<crate::model::ConnectionProfile>),
799        /// A reference to an existing connection profile.
800        ConnectionProfileName(std::string::String),
801    }
802
803    /// The depth of the retrieved hierarchy of data objects.
804    #[derive(Clone, Debug, PartialEq)]
805    #[non_exhaustive]
806    pub enum Hierarchy {
807        /// Whether to retrieve the full hierarchy of data objects (TRUE) or only the
808        /// current level (FALSE).
809        FullHierarchy(bool),
810        /// The number of hierarchy levels below the current level to be retrieved.
811        HierarchyDepth(i32),
812    }
813
814    /// The data object to populate with child data objects and metadata.
815    #[derive(Clone, Debug, PartialEq)]
816    #[non_exhaustive]
817    pub enum DataObject {
818        /// Oracle RDBMS to enrich with child data objects and metadata.
819        OracleRdbms(std::boxed::Box<crate::model::OracleRdbms>),
820        /// MySQL RDBMS to enrich with child data objects and metadata.
821        MysqlRdbms(std::boxed::Box<crate::model::MysqlRdbms>),
822        /// PostgreSQL RDBMS to enrich with child data objects and metadata.
823        PostgresqlRdbms(std::boxed::Box<crate::model::PostgresqlRdbms>),
824        /// SQLServer RDBMS to enrich with child data objects and metadata.
825        SqlServerRdbms(std::boxed::Box<crate::model::SqlServerRdbms>),
826        /// Salesforce organization to enrich with child data objects and metadata.
827        SalesforceOrg(std::boxed::Box<crate::model::SalesforceOrg>),
828        /// MongoDB cluster to enrich with child data objects and metadata.
829        MongodbCluster(std::boxed::Box<crate::model::MongodbCluster>),
830    }
831}
832
833/// Response from a discover request.
834#[derive(Clone, Default, PartialEq)]
835#[non_exhaustive]
836pub struct DiscoverConnectionProfileResponse {
837    /// The data object that has been enriched by the discover API call.
838    pub data_object:
839        std::option::Option<crate::model::discover_connection_profile_response::DataObject>,
840
841    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
842}
843
844impl DiscoverConnectionProfileResponse {
845    pub fn new() -> Self {
846        std::default::Default::default()
847    }
848
849    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object].
850    ///
851    /// Note that all the setters affecting `data_object` are mutually
852    /// exclusive.
853    pub fn set_data_object<
854        T: std::convert::Into<
855                std::option::Option<crate::model::discover_connection_profile_response::DataObject>,
856            >,
857    >(
858        mut self,
859        v: T,
860    ) -> Self {
861        self.data_object = v.into();
862        self
863    }
864
865    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
866    /// if it holds a `OracleRdbms`, `None` if the field is not set or
867    /// holds a different branch.
868    pub fn oracle_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
869        #[allow(unreachable_patterns)]
870        self.data_object.as_ref().and_then(|v| match v {
871            crate::model::discover_connection_profile_response::DataObject::OracleRdbms(v) => {
872                std::option::Option::Some(v)
873            }
874            _ => std::option::Option::None,
875        })
876    }
877
878    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
879    /// to hold a `OracleRdbms`.
880    ///
881    /// Note that all the setters affecting `data_object` are
882    /// mutually exclusive.
883    pub fn set_oracle_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>>(
884        mut self,
885        v: T,
886    ) -> Self {
887        self.data_object = std::option::Option::Some(
888            crate::model::discover_connection_profile_response::DataObject::OracleRdbms(v.into()),
889        );
890        self
891    }
892
893    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
894    /// if it holds a `MysqlRdbms`, `None` if the field is not set or
895    /// holds a different branch.
896    pub fn mysql_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
897        #[allow(unreachable_patterns)]
898        self.data_object.as_ref().and_then(|v| match v {
899            crate::model::discover_connection_profile_response::DataObject::MysqlRdbms(v) => {
900                std::option::Option::Some(v)
901            }
902            _ => std::option::Option::None,
903        })
904    }
905
906    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
907    /// to hold a `MysqlRdbms`.
908    ///
909    /// Note that all the setters affecting `data_object` are
910    /// mutually exclusive.
911    pub fn set_mysql_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>>(
912        mut self,
913        v: T,
914    ) -> Self {
915        self.data_object = std::option::Option::Some(
916            crate::model::discover_connection_profile_response::DataObject::MysqlRdbms(v.into()),
917        );
918        self
919    }
920
921    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
922    /// if it holds a `PostgresqlRdbms`, `None` if the field is not set or
923    /// holds a different branch.
924    pub fn postgresql_rdbms(
925        &self,
926    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
927        #[allow(unreachable_patterns)]
928        self.data_object.as_ref().and_then(|v| match v {
929            crate::model::discover_connection_profile_response::DataObject::PostgresqlRdbms(v) => {
930                std::option::Option::Some(v)
931            }
932            _ => std::option::Option::None,
933        })
934    }
935
936    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
937    /// to hold a `PostgresqlRdbms`.
938    ///
939    /// Note that all the setters affecting `data_object` are
940    /// mutually exclusive.
941    pub fn set_postgresql_rdbms<
942        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
943    >(
944        mut self,
945        v: T,
946    ) -> Self {
947        self.data_object = std::option::Option::Some(
948            crate::model::discover_connection_profile_response::DataObject::PostgresqlRdbms(
949                v.into(),
950            ),
951        );
952        self
953    }
954
955    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
956    /// if it holds a `SqlServerRdbms`, `None` if the field is not set or
957    /// holds a different branch.
958    pub fn sql_server_rdbms(
959        &self,
960    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
961        #[allow(unreachable_patterns)]
962        self.data_object.as_ref().and_then(|v| match v {
963            crate::model::discover_connection_profile_response::DataObject::SqlServerRdbms(v) => {
964                std::option::Option::Some(v)
965            }
966            _ => std::option::Option::None,
967        })
968    }
969
970    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
971    /// to hold a `SqlServerRdbms`.
972    ///
973    /// Note that all the setters affecting `data_object` are
974    /// mutually exclusive.
975    pub fn set_sql_server_rdbms<
976        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
977    >(
978        mut self,
979        v: T,
980    ) -> Self {
981        self.data_object = std::option::Option::Some(
982            crate::model::discover_connection_profile_response::DataObject::SqlServerRdbms(
983                v.into(),
984            ),
985        );
986        self
987    }
988
989    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
990    /// if it holds a `SalesforceOrg`, `None` if the field is not set or
991    /// holds a different branch.
992    pub fn salesforce_org(
993        &self,
994    ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceOrg>> {
995        #[allow(unreachable_patterns)]
996        self.data_object.as_ref().and_then(|v| match v {
997            crate::model::discover_connection_profile_response::DataObject::SalesforceOrg(v) => {
998                std::option::Option::Some(v)
999            }
1000            _ => std::option::Option::None,
1001        })
1002    }
1003
1004    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
1005    /// to hold a `SalesforceOrg`.
1006    ///
1007    /// Note that all the setters affecting `data_object` are
1008    /// mutually exclusive.
1009    pub fn set_salesforce_org<
1010        T: std::convert::Into<std::boxed::Box<crate::model::SalesforceOrg>>,
1011    >(
1012        mut self,
1013        v: T,
1014    ) -> Self {
1015        self.data_object = std::option::Option::Some(
1016            crate::model::discover_connection_profile_response::DataObject::SalesforceOrg(v.into()),
1017        );
1018        self
1019    }
1020
1021    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
1022    /// if it holds a `MongodbCluster`, `None` if the field is not set or
1023    /// holds a different branch.
1024    pub fn mongodb_cluster(
1025        &self,
1026    ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbCluster>> {
1027        #[allow(unreachable_patterns)]
1028        self.data_object.as_ref().and_then(|v| match v {
1029            crate::model::discover_connection_profile_response::DataObject::MongodbCluster(v) => {
1030                std::option::Option::Some(v)
1031            }
1032            _ => std::option::Option::None,
1033        })
1034    }
1035
1036    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
1037    /// to hold a `MongodbCluster`.
1038    ///
1039    /// Note that all the setters affecting `data_object` are
1040    /// mutually exclusive.
1041    pub fn set_mongodb_cluster<
1042        T: std::convert::Into<std::boxed::Box<crate::model::MongodbCluster>>,
1043    >(
1044        mut self,
1045        v: T,
1046    ) -> Self {
1047        self.data_object = std::option::Option::Some(
1048            crate::model::discover_connection_profile_response::DataObject::MongodbCluster(
1049                v.into(),
1050            ),
1051        );
1052        self
1053    }
1054}
1055
1056impl wkt::message::Message for DiscoverConnectionProfileResponse {
1057    fn typename() -> &'static str {
1058        "type.googleapis.com/google.cloud.datastream.v1.DiscoverConnectionProfileResponse"
1059    }
1060}
1061
1062#[doc(hidden)]
1063impl<'de> serde::de::Deserialize<'de> for DiscoverConnectionProfileResponse {
1064    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1065    where
1066        D: serde::Deserializer<'de>,
1067    {
1068        #[allow(non_camel_case_types)]
1069        #[doc(hidden)]
1070        #[derive(PartialEq, Eq, Hash)]
1071        enum __FieldTag {
1072            __oracle_rdbms,
1073            __mysql_rdbms,
1074            __postgresql_rdbms,
1075            __sql_server_rdbms,
1076            __salesforce_org,
1077            __mongodb_cluster,
1078            Unknown(std::string::String),
1079        }
1080        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1081            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1082            where
1083                D: serde::Deserializer<'de>,
1084            {
1085                struct Visitor;
1086                impl<'de> serde::de::Visitor<'de> for Visitor {
1087                    type Value = __FieldTag;
1088                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1089                        formatter.write_str("a field name for DiscoverConnectionProfileResponse")
1090                    }
1091                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1092                    where
1093                        E: serde::de::Error,
1094                    {
1095                        use std::result::Result::Ok;
1096                        use std::string::ToString;
1097                        match value {
1098                            "oracleRdbms" => Ok(__FieldTag::__oracle_rdbms),
1099                            "oracle_rdbms" => Ok(__FieldTag::__oracle_rdbms),
1100                            "mysqlRdbms" => Ok(__FieldTag::__mysql_rdbms),
1101                            "mysql_rdbms" => Ok(__FieldTag::__mysql_rdbms),
1102                            "postgresqlRdbms" => Ok(__FieldTag::__postgresql_rdbms),
1103                            "postgresql_rdbms" => Ok(__FieldTag::__postgresql_rdbms),
1104                            "sqlServerRdbms" => Ok(__FieldTag::__sql_server_rdbms),
1105                            "sql_server_rdbms" => Ok(__FieldTag::__sql_server_rdbms),
1106                            "salesforceOrg" => Ok(__FieldTag::__salesforce_org),
1107                            "salesforce_org" => Ok(__FieldTag::__salesforce_org),
1108                            "mongodbCluster" => Ok(__FieldTag::__mongodb_cluster),
1109                            "mongodb_cluster" => Ok(__FieldTag::__mongodb_cluster),
1110                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1111                        }
1112                    }
1113                }
1114                deserializer.deserialize_identifier(Visitor)
1115            }
1116        }
1117        struct Visitor;
1118        impl<'de> serde::de::Visitor<'de> for Visitor {
1119            type Value = DiscoverConnectionProfileResponse;
1120            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1121                formatter.write_str("struct DiscoverConnectionProfileResponse")
1122            }
1123            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1124            where
1125                A: serde::de::MapAccess<'de>,
1126            {
1127                #[allow(unused_imports)]
1128                use serde::de::Error;
1129                use std::option::Option::Some;
1130                let mut fields = std::collections::HashSet::new();
1131                let mut result = Self::Value::new();
1132                while let Some(tag) = map.next_key::<__FieldTag>()? {
1133                    #[allow(clippy::match_single_binding)]
1134                    match tag {
1135                        __FieldTag::__oracle_rdbms => {
1136                            if !fields.insert(__FieldTag::__oracle_rdbms) {
1137                                return std::result::Result::Err(A::Error::duplicate_field(
1138                                    "multiple values for oracle_rdbms",
1139                                ));
1140                            }
1141                            if result.data_object.is_some() {
1142                                return std::result::Result::Err(A::Error::duplicate_field(
1143                                    "multiple values for `data_object`, a oneof with full ID .google.cloud.datastream.v1.DiscoverConnectionProfileResponse.oracle_rdbms, latest field was oracleRdbms",
1144                                ));
1145                            }
1146                            result.data_object = std::option::Option::Some(
1147                                crate::model::discover_connection_profile_response::DataObject::OracleRdbms(
1148                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::OracleRdbms>>>()?.unwrap_or_default()
1149                                ),
1150                            );
1151                        }
1152                        __FieldTag::__mysql_rdbms => {
1153                            if !fields.insert(__FieldTag::__mysql_rdbms) {
1154                                return std::result::Result::Err(A::Error::duplicate_field(
1155                                    "multiple values for mysql_rdbms",
1156                                ));
1157                            }
1158                            if result.data_object.is_some() {
1159                                return std::result::Result::Err(A::Error::duplicate_field(
1160                                    "multiple values for `data_object`, a oneof with full ID .google.cloud.datastream.v1.DiscoverConnectionProfileResponse.mysql_rdbms, latest field was mysqlRdbms",
1161                                ));
1162                            }
1163                            result.data_object = std::option::Option::Some(
1164                                crate::model::discover_connection_profile_response::DataObject::MysqlRdbms(
1165                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::MysqlRdbms>>>()?.unwrap_or_default()
1166                                ),
1167                            );
1168                        }
1169                        __FieldTag::__postgresql_rdbms => {
1170                            if !fields.insert(__FieldTag::__postgresql_rdbms) {
1171                                return std::result::Result::Err(A::Error::duplicate_field(
1172                                    "multiple values for postgresql_rdbms",
1173                                ));
1174                            }
1175                            if result.data_object.is_some() {
1176                                return std::result::Result::Err(A::Error::duplicate_field(
1177                                    "multiple values for `data_object`, a oneof with full ID .google.cloud.datastream.v1.DiscoverConnectionProfileResponse.postgresql_rdbms, latest field was postgresqlRdbms",
1178                                ));
1179                            }
1180                            result.data_object = std::option::Option::Some(
1181                                crate::model::discover_connection_profile_response::DataObject::PostgresqlRdbms(
1182                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::PostgresqlRdbms>>>()?.unwrap_or_default()
1183                                ),
1184                            );
1185                        }
1186                        __FieldTag::__sql_server_rdbms => {
1187                            if !fields.insert(__FieldTag::__sql_server_rdbms) {
1188                                return std::result::Result::Err(A::Error::duplicate_field(
1189                                    "multiple values for sql_server_rdbms",
1190                                ));
1191                            }
1192                            if result.data_object.is_some() {
1193                                return std::result::Result::Err(A::Error::duplicate_field(
1194                                    "multiple values for `data_object`, a oneof with full ID .google.cloud.datastream.v1.DiscoverConnectionProfileResponse.sql_server_rdbms, latest field was sqlServerRdbms",
1195                                ));
1196                            }
1197                            result.data_object = std::option::Option::Some(
1198                                crate::model::discover_connection_profile_response::DataObject::SqlServerRdbms(
1199                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::SqlServerRdbms>>>()?.unwrap_or_default()
1200                                ),
1201                            );
1202                        }
1203                        __FieldTag::__salesforce_org => {
1204                            if !fields.insert(__FieldTag::__salesforce_org) {
1205                                return std::result::Result::Err(A::Error::duplicate_field(
1206                                    "multiple values for salesforce_org",
1207                                ));
1208                            }
1209                            if result.data_object.is_some() {
1210                                return std::result::Result::Err(A::Error::duplicate_field(
1211                                    "multiple values for `data_object`, a oneof with full ID .google.cloud.datastream.v1.DiscoverConnectionProfileResponse.salesforce_org, latest field was salesforceOrg",
1212                                ));
1213                            }
1214                            result.data_object = std::option::Option::Some(
1215                                crate::model::discover_connection_profile_response::DataObject::SalesforceOrg(
1216                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::SalesforceOrg>>>()?.unwrap_or_default()
1217                                ),
1218                            );
1219                        }
1220                        __FieldTag::__mongodb_cluster => {
1221                            if !fields.insert(__FieldTag::__mongodb_cluster) {
1222                                return std::result::Result::Err(A::Error::duplicate_field(
1223                                    "multiple values for mongodb_cluster",
1224                                ));
1225                            }
1226                            if result.data_object.is_some() {
1227                                return std::result::Result::Err(A::Error::duplicate_field(
1228                                    "multiple values for `data_object`, a oneof with full ID .google.cloud.datastream.v1.DiscoverConnectionProfileResponse.mongodb_cluster, latest field was mongodbCluster",
1229                                ));
1230                            }
1231                            result.data_object = std::option::Option::Some(
1232                                crate::model::discover_connection_profile_response::DataObject::MongodbCluster(
1233                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::MongodbCluster>>>()?.unwrap_or_default()
1234                                ),
1235                            );
1236                        }
1237                        __FieldTag::Unknown(key) => {
1238                            let value = map.next_value::<serde_json::Value>()?;
1239                            result._unknown_fields.insert(key, value);
1240                        }
1241                    }
1242                }
1243                std::result::Result::Ok(result)
1244            }
1245        }
1246        deserializer.deserialize_any(Visitor)
1247    }
1248}
1249
1250#[doc(hidden)]
1251impl serde::ser::Serialize for DiscoverConnectionProfileResponse {
1252    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1253    where
1254        S: serde::ser::Serializer,
1255    {
1256        use serde::ser::SerializeMap;
1257        #[allow(unused_imports)]
1258        use std::option::Option::Some;
1259        let mut state = serializer.serialize_map(std::option::Option::None)?;
1260        if let Some(value) = self.oracle_rdbms() {
1261            state.serialize_entry("oracleRdbms", value)?;
1262        }
1263        if let Some(value) = self.mysql_rdbms() {
1264            state.serialize_entry("mysqlRdbms", value)?;
1265        }
1266        if let Some(value) = self.postgresql_rdbms() {
1267            state.serialize_entry("postgresqlRdbms", value)?;
1268        }
1269        if let Some(value) = self.sql_server_rdbms() {
1270            state.serialize_entry("sqlServerRdbms", value)?;
1271        }
1272        if let Some(value) = self.salesforce_org() {
1273            state.serialize_entry("salesforceOrg", value)?;
1274        }
1275        if let Some(value) = self.mongodb_cluster() {
1276            state.serialize_entry("mongodbCluster", value)?;
1277        }
1278        if !self._unknown_fields.is_empty() {
1279            for (key, value) in self._unknown_fields.iter() {
1280                state.serialize_entry(key, &value)?;
1281            }
1282        }
1283        state.end()
1284    }
1285}
1286
1287impl std::fmt::Debug for DiscoverConnectionProfileResponse {
1288    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1289        let mut debug_struct = f.debug_struct("DiscoverConnectionProfileResponse");
1290        debug_struct.field("data_object", &self.data_object);
1291        if !self._unknown_fields.is_empty() {
1292            debug_struct.field("_unknown_fields", &self._unknown_fields);
1293        }
1294        debug_struct.finish()
1295    }
1296}
1297
1298/// Defines additional types related to [DiscoverConnectionProfileResponse].
1299pub mod discover_connection_profile_response {
1300    #[allow(unused_imports)]
1301    use super::*;
1302
1303    /// The data object that has been enriched by the discover API call.
1304    #[derive(Clone, Debug, PartialEq)]
1305    #[non_exhaustive]
1306    pub enum DataObject {
1307        /// Enriched Oracle RDBMS object.
1308        OracleRdbms(std::boxed::Box<crate::model::OracleRdbms>),
1309        /// Enriched MySQL RDBMS object.
1310        MysqlRdbms(std::boxed::Box<crate::model::MysqlRdbms>),
1311        /// Enriched PostgreSQL RDBMS object.
1312        PostgresqlRdbms(std::boxed::Box<crate::model::PostgresqlRdbms>),
1313        /// Enriched SQLServer RDBMS object.
1314        SqlServerRdbms(std::boxed::Box<crate::model::SqlServerRdbms>),
1315        /// Enriched Salesforce organization.
1316        SalesforceOrg(std::boxed::Box<crate::model::SalesforceOrg>),
1317        /// Enriched MongoDB cluster.
1318        MongodbCluster(std::boxed::Box<crate::model::MongodbCluster>),
1319    }
1320}
1321
1322/// Request message for 'FetchStaticIps' request.
1323#[derive(Clone, Default, PartialEq)]
1324#[non_exhaustive]
1325pub struct FetchStaticIpsRequest {
1326    /// Required. The resource name for the location for which static IPs should be
1327    /// returned. Must be in the format `projects/*/locations/*`.
1328    pub name: std::string::String,
1329
1330    /// Maximum number of Ips to return, will likely not be specified.
1331    pub page_size: i32,
1332
1333    /// A page token, received from a previous `ListStaticIps` call.
1334    /// will likely not be specified.
1335    pub page_token: std::string::String,
1336
1337    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1338}
1339
1340impl FetchStaticIpsRequest {
1341    pub fn new() -> Self {
1342        std::default::Default::default()
1343    }
1344
1345    /// Sets the value of [name][crate::model::FetchStaticIpsRequest::name].
1346    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1347        self.name = v.into();
1348        self
1349    }
1350
1351    /// Sets the value of [page_size][crate::model::FetchStaticIpsRequest::page_size].
1352    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1353        self.page_size = v.into();
1354        self
1355    }
1356
1357    /// Sets the value of [page_token][crate::model::FetchStaticIpsRequest::page_token].
1358    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1359        self.page_token = v.into();
1360        self
1361    }
1362}
1363
1364impl wkt::message::Message for FetchStaticIpsRequest {
1365    fn typename() -> &'static str {
1366        "type.googleapis.com/google.cloud.datastream.v1.FetchStaticIpsRequest"
1367    }
1368}
1369
1370#[doc(hidden)]
1371impl<'de> serde::de::Deserialize<'de> for FetchStaticIpsRequest {
1372    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1373    where
1374        D: serde::Deserializer<'de>,
1375    {
1376        #[allow(non_camel_case_types)]
1377        #[doc(hidden)]
1378        #[derive(PartialEq, Eq, Hash)]
1379        enum __FieldTag {
1380            __name,
1381            __page_size,
1382            __page_token,
1383            Unknown(std::string::String),
1384        }
1385        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1386            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1387            where
1388                D: serde::Deserializer<'de>,
1389            {
1390                struct Visitor;
1391                impl<'de> serde::de::Visitor<'de> for Visitor {
1392                    type Value = __FieldTag;
1393                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1394                        formatter.write_str("a field name for FetchStaticIpsRequest")
1395                    }
1396                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1397                    where
1398                        E: serde::de::Error,
1399                    {
1400                        use std::result::Result::Ok;
1401                        use std::string::ToString;
1402                        match value {
1403                            "name" => Ok(__FieldTag::__name),
1404                            "pageSize" => Ok(__FieldTag::__page_size),
1405                            "page_size" => Ok(__FieldTag::__page_size),
1406                            "pageToken" => Ok(__FieldTag::__page_token),
1407                            "page_token" => Ok(__FieldTag::__page_token),
1408                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1409                        }
1410                    }
1411                }
1412                deserializer.deserialize_identifier(Visitor)
1413            }
1414        }
1415        struct Visitor;
1416        impl<'de> serde::de::Visitor<'de> for Visitor {
1417            type Value = FetchStaticIpsRequest;
1418            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1419                formatter.write_str("struct FetchStaticIpsRequest")
1420            }
1421            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1422            where
1423                A: serde::de::MapAccess<'de>,
1424            {
1425                #[allow(unused_imports)]
1426                use serde::de::Error;
1427                use std::option::Option::Some;
1428                let mut fields = std::collections::HashSet::new();
1429                let mut result = Self::Value::new();
1430                while let Some(tag) = map.next_key::<__FieldTag>()? {
1431                    #[allow(clippy::match_single_binding)]
1432                    match tag {
1433                        __FieldTag::__name => {
1434                            if !fields.insert(__FieldTag::__name) {
1435                                return std::result::Result::Err(A::Error::duplicate_field(
1436                                    "multiple values for name",
1437                                ));
1438                            }
1439                            result.name = map
1440                                .next_value::<std::option::Option<std::string::String>>()?
1441                                .unwrap_or_default();
1442                        }
1443                        __FieldTag::__page_size => {
1444                            if !fields.insert(__FieldTag::__page_size) {
1445                                return std::result::Result::Err(A::Error::duplicate_field(
1446                                    "multiple values for page_size",
1447                                ));
1448                            }
1449                            struct __With(std::option::Option<i32>);
1450                            impl<'de> serde::de::Deserialize<'de> for __With {
1451                                fn deserialize<D>(
1452                                    deserializer: D,
1453                                ) -> std::result::Result<Self, D::Error>
1454                                where
1455                                    D: serde::de::Deserializer<'de>,
1456                                {
1457                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
1458                                }
1459                            }
1460                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
1461                        }
1462                        __FieldTag::__page_token => {
1463                            if !fields.insert(__FieldTag::__page_token) {
1464                                return std::result::Result::Err(A::Error::duplicate_field(
1465                                    "multiple values for page_token",
1466                                ));
1467                            }
1468                            result.page_token = map
1469                                .next_value::<std::option::Option<std::string::String>>()?
1470                                .unwrap_or_default();
1471                        }
1472                        __FieldTag::Unknown(key) => {
1473                            let value = map.next_value::<serde_json::Value>()?;
1474                            result._unknown_fields.insert(key, value);
1475                        }
1476                    }
1477                }
1478                std::result::Result::Ok(result)
1479            }
1480        }
1481        deserializer.deserialize_any(Visitor)
1482    }
1483}
1484
1485#[doc(hidden)]
1486impl serde::ser::Serialize for FetchStaticIpsRequest {
1487    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1488    where
1489        S: serde::ser::Serializer,
1490    {
1491        use serde::ser::SerializeMap;
1492        #[allow(unused_imports)]
1493        use std::option::Option::Some;
1494        let mut state = serializer.serialize_map(std::option::Option::None)?;
1495        if !self.name.is_empty() {
1496            state.serialize_entry("name", &self.name)?;
1497        }
1498        if !wkt::internal::is_default(&self.page_size) {
1499            struct __With<'a>(&'a i32);
1500            impl<'a> serde::ser::Serialize for __With<'a> {
1501                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1502                where
1503                    S: serde::ser::Serializer,
1504                {
1505                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
1506                }
1507            }
1508            state.serialize_entry("pageSize", &__With(&self.page_size))?;
1509        }
1510        if !self.page_token.is_empty() {
1511            state.serialize_entry("pageToken", &self.page_token)?;
1512        }
1513        if !self._unknown_fields.is_empty() {
1514            for (key, value) in self._unknown_fields.iter() {
1515                state.serialize_entry(key, &value)?;
1516            }
1517        }
1518        state.end()
1519    }
1520}
1521
1522impl std::fmt::Debug for FetchStaticIpsRequest {
1523    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1524        let mut debug_struct = f.debug_struct("FetchStaticIpsRequest");
1525        debug_struct.field("name", &self.name);
1526        debug_struct.field("page_size", &self.page_size);
1527        debug_struct.field("page_token", &self.page_token);
1528        if !self._unknown_fields.is_empty() {
1529            debug_struct.field("_unknown_fields", &self._unknown_fields);
1530        }
1531        debug_struct.finish()
1532    }
1533}
1534
1535/// Response message for a 'FetchStaticIps' response.
1536#[derive(Clone, Default, PartialEq)]
1537#[non_exhaustive]
1538pub struct FetchStaticIpsResponse {
1539    /// list of static ips by account
1540    pub static_ips: std::vec::Vec<std::string::String>,
1541
1542    /// A token that can be sent as `page_token` to retrieve the next page.
1543    /// If this field is omitted, there are no subsequent pages.
1544    pub next_page_token: std::string::String,
1545
1546    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1547}
1548
1549impl FetchStaticIpsResponse {
1550    pub fn new() -> Self {
1551        std::default::Default::default()
1552    }
1553
1554    /// Sets the value of [static_ips][crate::model::FetchStaticIpsResponse::static_ips].
1555    pub fn set_static_ips<T, V>(mut self, v: T) -> Self
1556    where
1557        T: std::iter::IntoIterator<Item = V>,
1558        V: std::convert::Into<std::string::String>,
1559    {
1560        use std::iter::Iterator;
1561        self.static_ips = v.into_iter().map(|i| i.into()).collect();
1562        self
1563    }
1564
1565    /// Sets the value of [next_page_token][crate::model::FetchStaticIpsResponse::next_page_token].
1566    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1567        self.next_page_token = v.into();
1568        self
1569    }
1570}
1571
1572impl wkt::message::Message for FetchStaticIpsResponse {
1573    fn typename() -> &'static str {
1574        "type.googleapis.com/google.cloud.datastream.v1.FetchStaticIpsResponse"
1575    }
1576}
1577
1578#[doc(hidden)]
1579impl<'de> serde::de::Deserialize<'de> for FetchStaticIpsResponse {
1580    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1581    where
1582        D: serde::Deserializer<'de>,
1583    {
1584        #[allow(non_camel_case_types)]
1585        #[doc(hidden)]
1586        #[derive(PartialEq, Eq, Hash)]
1587        enum __FieldTag {
1588            __static_ips,
1589            __next_page_token,
1590            Unknown(std::string::String),
1591        }
1592        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1593            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1594            where
1595                D: serde::Deserializer<'de>,
1596            {
1597                struct Visitor;
1598                impl<'de> serde::de::Visitor<'de> for Visitor {
1599                    type Value = __FieldTag;
1600                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1601                        formatter.write_str("a field name for FetchStaticIpsResponse")
1602                    }
1603                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1604                    where
1605                        E: serde::de::Error,
1606                    {
1607                        use std::result::Result::Ok;
1608                        use std::string::ToString;
1609                        match value {
1610                            "staticIps" => Ok(__FieldTag::__static_ips),
1611                            "static_ips" => Ok(__FieldTag::__static_ips),
1612                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
1613                            "next_page_token" => Ok(__FieldTag::__next_page_token),
1614                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1615                        }
1616                    }
1617                }
1618                deserializer.deserialize_identifier(Visitor)
1619            }
1620        }
1621        struct Visitor;
1622        impl<'de> serde::de::Visitor<'de> for Visitor {
1623            type Value = FetchStaticIpsResponse;
1624            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1625                formatter.write_str("struct FetchStaticIpsResponse")
1626            }
1627            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1628            where
1629                A: serde::de::MapAccess<'de>,
1630            {
1631                #[allow(unused_imports)]
1632                use serde::de::Error;
1633                use std::option::Option::Some;
1634                let mut fields = std::collections::HashSet::new();
1635                let mut result = Self::Value::new();
1636                while let Some(tag) = map.next_key::<__FieldTag>()? {
1637                    #[allow(clippy::match_single_binding)]
1638                    match tag {
1639                        __FieldTag::__static_ips => {
1640                            if !fields.insert(__FieldTag::__static_ips) {
1641                                return std::result::Result::Err(A::Error::duplicate_field(
1642                                    "multiple values for static_ips",
1643                                ));
1644                            }
1645                            result.static_ips = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
1646                        }
1647                        __FieldTag::__next_page_token => {
1648                            if !fields.insert(__FieldTag::__next_page_token) {
1649                                return std::result::Result::Err(A::Error::duplicate_field(
1650                                    "multiple values for next_page_token",
1651                                ));
1652                            }
1653                            result.next_page_token = map
1654                                .next_value::<std::option::Option<std::string::String>>()?
1655                                .unwrap_or_default();
1656                        }
1657                        __FieldTag::Unknown(key) => {
1658                            let value = map.next_value::<serde_json::Value>()?;
1659                            result._unknown_fields.insert(key, value);
1660                        }
1661                    }
1662                }
1663                std::result::Result::Ok(result)
1664            }
1665        }
1666        deserializer.deserialize_any(Visitor)
1667    }
1668}
1669
1670#[doc(hidden)]
1671impl serde::ser::Serialize for FetchStaticIpsResponse {
1672    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1673    where
1674        S: serde::ser::Serializer,
1675    {
1676        use serde::ser::SerializeMap;
1677        #[allow(unused_imports)]
1678        use std::option::Option::Some;
1679        let mut state = serializer.serialize_map(std::option::Option::None)?;
1680        if !self.static_ips.is_empty() {
1681            state.serialize_entry("staticIps", &self.static_ips)?;
1682        }
1683        if !self.next_page_token.is_empty() {
1684            state.serialize_entry("nextPageToken", &self.next_page_token)?;
1685        }
1686        if !self._unknown_fields.is_empty() {
1687            for (key, value) in self._unknown_fields.iter() {
1688                state.serialize_entry(key, &value)?;
1689            }
1690        }
1691        state.end()
1692    }
1693}
1694
1695impl std::fmt::Debug for FetchStaticIpsResponse {
1696    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1697        let mut debug_struct = f.debug_struct("FetchStaticIpsResponse");
1698        debug_struct.field("static_ips", &self.static_ips);
1699        debug_struct.field("next_page_token", &self.next_page_token);
1700        if !self._unknown_fields.is_empty() {
1701            debug_struct.field("_unknown_fields", &self._unknown_fields);
1702        }
1703        debug_struct.finish()
1704    }
1705}
1706
1707/// Request message for listing connection profiles.
1708#[derive(Clone, Default, PartialEq)]
1709#[non_exhaustive]
1710pub struct ListConnectionProfilesRequest {
1711    /// Required. The parent that owns the collection of connection profiles.
1712    pub parent: std::string::String,
1713
1714    /// Maximum number of connection profiles to return.
1715    /// If unspecified, at most 50 connection profiles will be returned.
1716    /// The maximum value is 1000; values above 1000 will be coerced to 1000.
1717    pub page_size: i32,
1718
1719    /// Page token received from a previous `ListConnectionProfiles` call.
1720    /// Provide this to retrieve the subsequent page.
1721    ///
1722    /// When paginating, all other parameters provided to `ListConnectionProfiles`
1723    /// must match the call that provided the page token.
1724    pub page_token: std::string::String,
1725
1726    /// Filter request.
1727    pub filter: std::string::String,
1728
1729    /// Order by fields for the result.
1730    pub order_by: std::string::String,
1731
1732    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1733}
1734
1735impl ListConnectionProfilesRequest {
1736    pub fn new() -> Self {
1737        std::default::Default::default()
1738    }
1739
1740    /// Sets the value of [parent][crate::model::ListConnectionProfilesRequest::parent].
1741    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1742        self.parent = v.into();
1743        self
1744    }
1745
1746    /// Sets the value of [page_size][crate::model::ListConnectionProfilesRequest::page_size].
1747    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1748        self.page_size = v.into();
1749        self
1750    }
1751
1752    /// Sets the value of [page_token][crate::model::ListConnectionProfilesRequest::page_token].
1753    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1754        self.page_token = v.into();
1755        self
1756    }
1757
1758    /// Sets the value of [filter][crate::model::ListConnectionProfilesRequest::filter].
1759    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1760        self.filter = v.into();
1761        self
1762    }
1763
1764    /// Sets the value of [order_by][crate::model::ListConnectionProfilesRequest::order_by].
1765    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1766        self.order_by = v.into();
1767        self
1768    }
1769}
1770
1771impl wkt::message::Message for ListConnectionProfilesRequest {
1772    fn typename() -> &'static str {
1773        "type.googleapis.com/google.cloud.datastream.v1.ListConnectionProfilesRequest"
1774    }
1775}
1776
1777#[doc(hidden)]
1778impl<'de> serde::de::Deserialize<'de> for ListConnectionProfilesRequest {
1779    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1780    where
1781        D: serde::Deserializer<'de>,
1782    {
1783        #[allow(non_camel_case_types)]
1784        #[doc(hidden)]
1785        #[derive(PartialEq, Eq, Hash)]
1786        enum __FieldTag {
1787            __parent,
1788            __page_size,
1789            __page_token,
1790            __filter,
1791            __order_by,
1792            Unknown(std::string::String),
1793        }
1794        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1795            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1796            where
1797                D: serde::Deserializer<'de>,
1798            {
1799                struct Visitor;
1800                impl<'de> serde::de::Visitor<'de> for Visitor {
1801                    type Value = __FieldTag;
1802                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1803                        formatter.write_str("a field name for ListConnectionProfilesRequest")
1804                    }
1805                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1806                    where
1807                        E: serde::de::Error,
1808                    {
1809                        use std::result::Result::Ok;
1810                        use std::string::ToString;
1811                        match value {
1812                            "parent" => Ok(__FieldTag::__parent),
1813                            "pageSize" => Ok(__FieldTag::__page_size),
1814                            "page_size" => Ok(__FieldTag::__page_size),
1815                            "pageToken" => Ok(__FieldTag::__page_token),
1816                            "page_token" => Ok(__FieldTag::__page_token),
1817                            "filter" => Ok(__FieldTag::__filter),
1818                            "orderBy" => Ok(__FieldTag::__order_by),
1819                            "order_by" => Ok(__FieldTag::__order_by),
1820                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1821                        }
1822                    }
1823                }
1824                deserializer.deserialize_identifier(Visitor)
1825            }
1826        }
1827        struct Visitor;
1828        impl<'de> serde::de::Visitor<'de> for Visitor {
1829            type Value = ListConnectionProfilesRequest;
1830            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1831                formatter.write_str("struct ListConnectionProfilesRequest")
1832            }
1833            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1834            where
1835                A: serde::de::MapAccess<'de>,
1836            {
1837                #[allow(unused_imports)]
1838                use serde::de::Error;
1839                use std::option::Option::Some;
1840                let mut fields = std::collections::HashSet::new();
1841                let mut result = Self::Value::new();
1842                while let Some(tag) = map.next_key::<__FieldTag>()? {
1843                    #[allow(clippy::match_single_binding)]
1844                    match tag {
1845                        __FieldTag::__parent => {
1846                            if !fields.insert(__FieldTag::__parent) {
1847                                return std::result::Result::Err(A::Error::duplicate_field(
1848                                    "multiple values for parent",
1849                                ));
1850                            }
1851                            result.parent = map
1852                                .next_value::<std::option::Option<std::string::String>>()?
1853                                .unwrap_or_default();
1854                        }
1855                        __FieldTag::__page_size => {
1856                            if !fields.insert(__FieldTag::__page_size) {
1857                                return std::result::Result::Err(A::Error::duplicate_field(
1858                                    "multiple values for page_size",
1859                                ));
1860                            }
1861                            struct __With(std::option::Option<i32>);
1862                            impl<'de> serde::de::Deserialize<'de> for __With {
1863                                fn deserialize<D>(
1864                                    deserializer: D,
1865                                ) -> std::result::Result<Self, D::Error>
1866                                where
1867                                    D: serde::de::Deserializer<'de>,
1868                                {
1869                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
1870                                }
1871                            }
1872                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
1873                        }
1874                        __FieldTag::__page_token => {
1875                            if !fields.insert(__FieldTag::__page_token) {
1876                                return std::result::Result::Err(A::Error::duplicate_field(
1877                                    "multiple values for page_token",
1878                                ));
1879                            }
1880                            result.page_token = map
1881                                .next_value::<std::option::Option<std::string::String>>()?
1882                                .unwrap_or_default();
1883                        }
1884                        __FieldTag::__filter => {
1885                            if !fields.insert(__FieldTag::__filter) {
1886                                return std::result::Result::Err(A::Error::duplicate_field(
1887                                    "multiple values for filter",
1888                                ));
1889                            }
1890                            result.filter = map
1891                                .next_value::<std::option::Option<std::string::String>>()?
1892                                .unwrap_or_default();
1893                        }
1894                        __FieldTag::__order_by => {
1895                            if !fields.insert(__FieldTag::__order_by) {
1896                                return std::result::Result::Err(A::Error::duplicate_field(
1897                                    "multiple values for order_by",
1898                                ));
1899                            }
1900                            result.order_by = map
1901                                .next_value::<std::option::Option<std::string::String>>()?
1902                                .unwrap_or_default();
1903                        }
1904                        __FieldTag::Unknown(key) => {
1905                            let value = map.next_value::<serde_json::Value>()?;
1906                            result._unknown_fields.insert(key, value);
1907                        }
1908                    }
1909                }
1910                std::result::Result::Ok(result)
1911            }
1912        }
1913        deserializer.deserialize_any(Visitor)
1914    }
1915}
1916
1917#[doc(hidden)]
1918impl serde::ser::Serialize for ListConnectionProfilesRequest {
1919    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1920    where
1921        S: serde::ser::Serializer,
1922    {
1923        use serde::ser::SerializeMap;
1924        #[allow(unused_imports)]
1925        use std::option::Option::Some;
1926        let mut state = serializer.serialize_map(std::option::Option::None)?;
1927        if !self.parent.is_empty() {
1928            state.serialize_entry("parent", &self.parent)?;
1929        }
1930        if !wkt::internal::is_default(&self.page_size) {
1931            struct __With<'a>(&'a i32);
1932            impl<'a> serde::ser::Serialize for __With<'a> {
1933                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1934                where
1935                    S: serde::ser::Serializer,
1936                {
1937                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
1938                }
1939            }
1940            state.serialize_entry("pageSize", &__With(&self.page_size))?;
1941        }
1942        if !self.page_token.is_empty() {
1943            state.serialize_entry("pageToken", &self.page_token)?;
1944        }
1945        if !self.filter.is_empty() {
1946            state.serialize_entry("filter", &self.filter)?;
1947        }
1948        if !self.order_by.is_empty() {
1949            state.serialize_entry("orderBy", &self.order_by)?;
1950        }
1951        if !self._unknown_fields.is_empty() {
1952            for (key, value) in self._unknown_fields.iter() {
1953                state.serialize_entry(key, &value)?;
1954            }
1955        }
1956        state.end()
1957    }
1958}
1959
1960impl std::fmt::Debug for ListConnectionProfilesRequest {
1961    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1962        let mut debug_struct = f.debug_struct("ListConnectionProfilesRequest");
1963        debug_struct.field("parent", &self.parent);
1964        debug_struct.field("page_size", &self.page_size);
1965        debug_struct.field("page_token", &self.page_token);
1966        debug_struct.field("filter", &self.filter);
1967        debug_struct.field("order_by", &self.order_by);
1968        if !self._unknown_fields.is_empty() {
1969            debug_struct.field("_unknown_fields", &self._unknown_fields);
1970        }
1971        debug_struct.finish()
1972    }
1973}
1974
1975/// Response message for listing connection profiles.
1976#[derive(Clone, Default, PartialEq)]
1977#[non_exhaustive]
1978pub struct ListConnectionProfilesResponse {
1979    /// List of connection profiles.
1980    pub connection_profiles: std::vec::Vec<crate::model::ConnectionProfile>,
1981
1982    /// A token, which can be sent as `page_token` to retrieve the next page.
1983    /// If this field is omitted, there are no subsequent pages.
1984    pub next_page_token: std::string::String,
1985
1986    /// Locations that could not be reached.
1987    pub unreachable: std::vec::Vec<std::string::String>,
1988
1989    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1990}
1991
1992impl ListConnectionProfilesResponse {
1993    pub fn new() -> Self {
1994        std::default::Default::default()
1995    }
1996
1997    /// Sets the value of [connection_profiles][crate::model::ListConnectionProfilesResponse::connection_profiles].
1998    pub fn set_connection_profiles<T, V>(mut self, v: T) -> Self
1999    where
2000        T: std::iter::IntoIterator<Item = V>,
2001        V: std::convert::Into<crate::model::ConnectionProfile>,
2002    {
2003        use std::iter::Iterator;
2004        self.connection_profiles = v.into_iter().map(|i| i.into()).collect();
2005        self
2006    }
2007
2008    /// Sets the value of [next_page_token][crate::model::ListConnectionProfilesResponse::next_page_token].
2009    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2010        self.next_page_token = v.into();
2011        self
2012    }
2013
2014    /// Sets the value of [unreachable][crate::model::ListConnectionProfilesResponse::unreachable].
2015    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2016    where
2017        T: std::iter::IntoIterator<Item = V>,
2018        V: std::convert::Into<std::string::String>,
2019    {
2020        use std::iter::Iterator;
2021        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2022        self
2023    }
2024}
2025
2026impl wkt::message::Message for ListConnectionProfilesResponse {
2027    fn typename() -> &'static str {
2028        "type.googleapis.com/google.cloud.datastream.v1.ListConnectionProfilesResponse"
2029    }
2030}
2031
2032#[doc(hidden)]
2033impl gax::paginator::internal::PageableResponse for ListConnectionProfilesResponse {
2034    type PageItem = crate::model::ConnectionProfile;
2035
2036    fn items(self) -> std::vec::Vec<Self::PageItem> {
2037        self.connection_profiles
2038    }
2039
2040    fn next_page_token(&self) -> std::string::String {
2041        use std::clone::Clone;
2042        self.next_page_token.clone()
2043    }
2044}
2045
2046#[doc(hidden)]
2047impl<'de> serde::de::Deserialize<'de> for ListConnectionProfilesResponse {
2048    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2049    where
2050        D: serde::Deserializer<'de>,
2051    {
2052        #[allow(non_camel_case_types)]
2053        #[doc(hidden)]
2054        #[derive(PartialEq, Eq, Hash)]
2055        enum __FieldTag {
2056            __connection_profiles,
2057            __next_page_token,
2058            __unreachable,
2059            Unknown(std::string::String),
2060        }
2061        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2062            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2063            where
2064                D: serde::Deserializer<'de>,
2065            {
2066                struct Visitor;
2067                impl<'de> serde::de::Visitor<'de> for Visitor {
2068                    type Value = __FieldTag;
2069                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2070                        formatter.write_str("a field name for ListConnectionProfilesResponse")
2071                    }
2072                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2073                    where
2074                        E: serde::de::Error,
2075                    {
2076                        use std::result::Result::Ok;
2077                        use std::string::ToString;
2078                        match value {
2079                            "connectionProfiles" => Ok(__FieldTag::__connection_profiles),
2080                            "connection_profiles" => Ok(__FieldTag::__connection_profiles),
2081                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
2082                            "next_page_token" => Ok(__FieldTag::__next_page_token),
2083                            "unreachable" => Ok(__FieldTag::__unreachable),
2084                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2085                        }
2086                    }
2087                }
2088                deserializer.deserialize_identifier(Visitor)
2089            }
2090        }
2091        struct Visitor;
2092        impl<'de> serde::de::Visitor<'de> for Visitor {
2093            type Value = ListConnectionProfilesResponse;
2094            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2095                formatter.write_str("struct ListConnectionProfilesResponse")
2096            }
2097            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2098            where
2099                A: serde::de::MapAccess<'de>,
2100            {
2101                #[allow(unused_imports)]
2102                use serde::de::Error;
2103                use std::option::Option::Some;
2104                let mut fields = std::collections::HashSet::new();
2105                let mut result = Self::Value::new();
2106                while let Some(tag) = map.next_key::<__FieldTag>()? {
2107                    #[allow(clippy::match_single_binding)]
2108                    match tag {
2109                        __FieldTag::__connection_profiles => {
2110                            if !fields.insert(__FieldTag::__connection_profiles) {
2111                                return std::result::Result::Err(A::Error::duplicate_field(
2112                                    "multiple values for connection_profiles",
2113                                ));
2114                            }
2115                            result.connection_profiles =
2116                                map.next_value::<std::option::Option<
2117                                    std::vec::Vec<crate::model::ConnectionProfile>,
2118                                >>()?
2119                                .unwrap_or_default();
2120                        }
2121                        __FieldTag::__next_page_token => {
2122                            if !fields.insert(__FieldTag::__next_page_token) {
2123                                return std::result::Result::Err(A::Error::duplicate_field(
2124                                    "multiple values for next_page_token",
2125                                ));
2126                            }
2127                            result.next_page_token = map
2128                                .next_value::<std::option::Option<std::string::String>>()?
2129                                .unwrap_or_default();
2130                        }
2131                        __FieldTag::__unreachable => {
2132                            if !fields.insert(__FieldTag::__unreachable) {
2133                                return std::result::Result::Err(A::Error::duplicate_field(
2134                                    "multiple values for unreachable",
2135                                ));
2136                            }
2137                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
2138                        }
2139                        __FieldTag::Unknown(key) => {
2140                            let value = map.next_value::<serde_json::Value>()?;
2141                            result._unknown_fields.insert(key, value);
2142                        }
2143                    }
2144                }
2145                std::result::Result::Ok(result)
2146            }
2147        }
2148        deserializer.deserialize_any(Visitor)
2149    }
2150}
2151
2152#[doc(hidden)]
2153impl serde::ser::Serialize for ListConnectionProfilesResponse {
2154    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2155    where
2156        S: serde::ser::Serializer,
2157    {
2158        use serde::ser::SerializeMap;
2159        #[allow(unused_imports)]
2160        use std::option::Option::Some;
2161        let mut state = serializer.serialize_map(std::option::Option::None)?;
2162        if !self.connection_profiles.is_empty() {
2163            state.serialize_entry("connectionProfiles", &self.connection_profiles)?;
2164        }
2165        if !self.next_page_token.is_empty() {
2166            state.serialize_entry("nextPageToken", &self.next_page_token)?;
2167        }
2168        if !self.unreachable.is_empty() {
2169            state.serialize_entry("unreachable", &self.unreachable)?;
2170        }
2171        if !self._unknown_fields.is_empty() {
2172            for (key, value) in self._unknown_fields.iter() {
2173                state.serialize_entry(key, &value)?;
2174            }
2175        }
2176        state.end()
2177    }
2178}
2179
2180impl std::fmt::Debug for ListConnectionProfilesResponse {
2181    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2182        let mut debug_struct = f.debug_struct("ListConnectionProfilesResponse");
2183        debug_struct.field("connection_profiles", &self.connection_profiles);
2184        debug_struct.field("next_page_token", &self.next_page_token);
2185        debug_struct.field("unreachable", &self.unreachable);
2186        if !self._unknown_fields.is_empty() {
2187            debug_struct.field("_unknown_fields", &self._unknown_fields);
2188        }
2189        debug_struct.finish()
2190    }
2191}
2192
2193/// Request message for getting a connection profile.
2194#[derive(Clone, Default, PartialEq)]
2195#[non_exhaustive]
2196pub struct GetConnectionProfileRequest {
2197    /// Required. The name of the connection profile resource to get.
2198    pub name: std::string::String,
2199
2200    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2201}
2202
2203impl GetConnectionProfileRequest {
2204    pub fn new() -> Self {
2205        std::default::Default::default()
2206    }
2207
2208    /// Sets the value of [name][crate::model::GetConnectionProfileRequest::name].
2209    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2210        self.name = v.into();
2211        self
2212    }
2213}
2214
2215impl wkt::message::Message for GetConnectionProfileRequest {
2216    fn typename() -> &'static str {
2217        "type.googleapis.com/google.cloud.datastream.v1.GetConnectionProfileRequest"
2218    }
2219}
2220
2221#[doc(hidden)]
2222impl<'de> serde::de::Deserialize<'de> for GetConnectionProfileRequest {
2223    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2224    where
2225        D: serde::Deserializer<'de>,
2226    {
2227        #[allow(non_camel_case_types)]
2228        #[doc(hidden)]
2229        #[derive(PartialEq, Eq, Hash)]
2230        enum __FieldTag {
2231            __name,
2232            Unknown(std::string::String),
2233        }
2234        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2235            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2236            where
2237                D: serde::Deserializer<'de>,
2238            {
2239                struct Visitor;
2240                impl<'de> serde::de::Visitor<'de> for Visitor {
2241                    type Value = __FieldTag;
2242                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2243                        formatter.write_str("a field name for GetConnectionProfileRequest")
2244                    }
2245                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2246                    where
2247                        E: serde::de::Error,
2248                    {
2249                        use std::result::Result::Ok;
2250                        use std::string::ToString;
2251                        match value {
2252                            "name" => Ok(__FieldTag::__name),
2253                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2254                        }
2255                    }
2256                }
2257                deserializer.deserialize_identifier(Visitor)
2258            }
2259        }
2260        struct Visitor;
2261        impl<'de> serde::de::Visitor<'de> for Visitor {
2262            type Value = GetConnectionProfileRequest;
2263            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2264                formatter.write_str("struct GetConnectionProfileRequest")
2265            }
2266            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2267            where
2268                A: serde::de::MapAccess<'de>,
2269            {
2270                #[allow(unused_imports)]
2271                use serde::de::Error;
2272                use std::option::Option::Some;
2273                let mut fields = std::collections::HashSet::new();
2274                let mut result = Self::Value::new();
2275                while let Some(tag) = map.next_key::<__FieldTag>()? {
2276                    #[allow(clippy::match_single_binding)]
2277                    match tag {
2278                        __FieldTag::__name => {
2279                            if !fields.insert(__FieldTag::__name) {
2280                                return std::result::Result::Err(A::Error::duplicate_field(
2281                                    "multiple values for name",
2282                                ));
2283                            }
2284                            result.name = map
2285                                .next_value::<std::option::Option<std::string::String>>()?
2286                                .unwrap_or_default();
2287                        }
2288                        __FieldTag::Unknown(key) => {
2289                            let value = map.next_value::<serde_json::Value>()?;
2290                            result._unknown_fields.insert(key, value);
2291                        }
2292                    }
2293                }
2294                std::result::Result::Ok(result)
2295            }
2296        }
2297        deserializer.deserialize_any(Visitor)
2298    }
2299}
2300
2301#[doc(hidden)]
2302impl serde::ser::Serialize for GetConnectionProfileRequest {
2303    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2304    where
2305        S: serde::ser::Serializer,
2306    {
2307        use serde::ser::SerializeMap;
2308        #[allow(unused_imports)]
2309        use std::option::Option::Some;
2310        let mut state = serializer.serialize_map(std::option::Option::None)?;
2311        if !self.name.is_empty() {
2312            state.serialize_entry("name", &self.name)?;
2313        }
2314        if !self._unknown_fields.is_empty() {
2315            for (key, value) in self._unknown_fields.iter() {
2316                state.serialize_entry(key, &value)?;
2317            }
2318        }
2319        state.end()
2320    }
2321}
2322
2323impl std::fmt::Debug for GetConnectionProfileRequest {
2324    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2325        let mut debug_struct = f.debug_struct("GetConnectionProfileRequest");
2326        debug_struct.field("name", &self.name);
2327        if !self._unknown_fields.is_empty() {
2328            debug_struct.field("_unknown_fields", &self._unknown_fields);
2329        }
2330        debug_struct.finish()
2331    }
2332}
2333
2334/// Request message for creating a connection profile.
2335#[derive(Clone, Default, PartialEq)]
2336#[non_exhaustive]
2337pub struct CreateConnectionProfileRequest {
2338    /// Required. The parent that owns the collection of ConnectionProfiles.
2339    pub parent: std::string::String,
2340
2341    /// Required. The connection profile identifier.
2342    pub connection_profile_id: std::string::String,
2343
2344    /// Required. The connection profile resource to create.
2345    pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
2346
2347    /// Optional. A request ID to identify requests. Specify a unique request ID
2348    /// so that if you must retry your request, the server will know to ignore
2349    /// the request if it has already been completed. The server will guarantee
2350    /// that for at least 60 minutes since the first request.
2351    ///
2352    /// For example, consider a situation where you make an initial request and the
2353    /// request times out. If you make the request again with the same request ID,
2354    /// the server can check if original operation with the same request ID was
2355    /// received, and if so, will ignore the second request. This prevents clients
2356    /// from accidentally creating duplicate commitments.
2357    ///
2358    /// The request ID must be a valid UUID with the exception that zero UUID is
2359    /// not supported (00000000-0000-0000-0000-000000000000).
2360    pub request_id: std::string::String,
2361
2362    /// Optional. Only validate the connection profile, but don't create any
2363    /// resources. The default is false.
2364    pub validate_only: bool,
2365
2366    /// Optional. Create the connection profile without validating it.
2367    pub force: bool,
2368
2369    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2370}
2371
2372impl CreateConnectionProfileRequest {
2373    pub fn new() -> Self {
2374        std::default::Default::default()
2375    }
2376
2377    /// Sets the value of [parent][crate::model::CreateConnectionProfileRequest::parent].
2378    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2379        self.parent = v.into();
2380        self
2381    }
2382
2383    /// Sets the value of [connection_profile_id][crate::model::CreateConnectionProfileRequest::connection_profile_id].
2384    pub fn set_connection_profile_id<T: std::convert::Into<std::string::String>>(
2385        mut self,
2386        v: T,
2387    ) -> Self {
2388        self.connection_profile_id = v.into();
2389        self
2390    }
2391
2392    /// Sets the value of [connection_profile][crate::model::CreateConnectionProfileRequest::connection_profile].
2393    pub fn set_connection_profile<T>(mut self, v: T) -> Self
2394    where
2395        T: std::convert::Into<crate::model::ConnectionProfile>,
2396    {
2397        self.connection_profile = std::option::Option::Some(v.into());
2398        self
2399    }
2400
2401    /// Sets or clears the value of [connection_profile][crate::model::CreateConnectionProfileRequest::connection_profile].
2402    pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
2403    where
2404        T: std::convert::Into<crate::model::ConnectionProfile>,
2405    {
2406        self.connection_profile = v.map(|x| x.into());
2407        self
2408    }
2409
2410    /// Sets the value of [request_id][crate::model::CreateConnectionProfileRequest::request_id].
2411    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2412        self.request_id = v.into();
2413        self
2414    }
2415
2416    /// Sets the value of [validate_only][crate::model::CreateConnectionProfileRequest::validate_only].
2417    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2418        self.validate_only = v.into();
2419        self
2420    }
2421
2422    /// Sets the value of [force][crate::model::CreateConnectionProfileRequest::force].
2423    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2424        self.force = v.into();
2425        self
2426    }
2427}
2428
2429impl wkt::message::Message for CreateConnectionProfileRequest {
2430    fn typename() -> &'static str {
2431        "type.googleapis.com/google.cloud.datastream.v1.CreateConnectionProfileRequest"
2432    }
2433}
2434
2435#[doc(hidden)]
2436impl<'de> serde::de::Deserialize<'de> for CreateConnectionProfileRequest {
2437    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2438    where
2439        D: serde::Deserializer<'de>,
2440    {
2441        #[allow(non_camel_case_types)]
2442        #[doc(hidden)]
2443        #[derive(PartialEq, Eq, Hash)]
2444        enum __FieldTag {
2445            __parent,
2446            __connection_profile_id,
2447            __connection_profile,
2448            __request_id,
2449            __validate_only,
2450            __force,
2451            Unknown(std::string::String),
2452        }
2453        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2454            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2455            where
2456                D: serde::Deserializer<'de>,
2457            {
2458                struct Visitor;
2459                impl<'de> serde::de::Visitor<'de> for Visitor {
2460                    type Value = __FieldTag;
2461                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2462                        formatter.write_str("a field name for CreateConnectionProfileRequest")
2463                    }
2464                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2465                    where
2466                        E: serde::de::Error,
2467                    {
2468                        use std::result::Result::Ok;
2469                        use std::string::ToString;
2470                        match value {
2471                            "parent" => Ok(__FieldTag::__parent),
2472                            "connectionProfileId" => Ok(__FieldTag::__connection_profile_id),
2473                            "connection_profile_id" => Ok(__FieldTag::__connection_profile_id),
2474                            "connectionProfile" => Ok(__FieldTag::__connection_profile),
2475                            "connection_profile" => Ok(__FieldTag::__connection_profile),
2476                            "requestId" => Ok(__FieldTag::__request_id),
2477                            "request_id" => Ok(__FieldTag::__request_id),
2478                            "validateOnly" => Ok(__FieldTag::__validate_only),
2479                            "validate_only" => Ok(__FieldTag::__validate_only),
2480                            "force" => Ok(__FieldTag::__force),
2481                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2482                        }
2483                    }
2484                }
2485                deserializer.deserialize_identifier(Visitor)
2486            }
2487        }
2488        struct Visitor;
2489        impl<'de> serde::de::Visitor<'de> for Visitor {
2490            type Value = CreateConnectionProfileRequest;
2491            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2492                formatter.write_str("struct CreateConnectionProfileRequest")
2493            }
2494            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2495            where
2496                A: serde::de::MapAccess<'de>,
2497            {
2498                #[allow(unused_imports)]
2499                use serde::de::Error;
2500                use std::option::Option::Some;
2501                let mut fields = std::collections::HashSet::new();
2502                let mut result = Self::Value::new();
2503                while let Some(tag) = map.next_key::<__FieldTag>()? {
2504                    #[allow(clippy::match_single_binding)]
2505                    match tag {
2506                        __FieldTag::__parent => {
2507                            if !fields.insert(__FieldTag::__parent) {
2508                                return std::result::Result::Err(A::Error::duplicate_field(
2509                                    "multiple values for parent",
2510                                ));
2511                            }
2512                            result.parent = map
2513                                .next_value::<std::option::Option<std::string::String>>()?
2514                                .unwrap_or_default();
2515                        }
2516                        __FieldTag::__connection_profile_id => {
2517                            if !fields.insert(__FieldTag::__connection_profile_id) {
2518                                return std::result::Result::Err(A::Error::duplicate_field(
2519                                    "multiple values for connection_profile_id",
2520                                ));
2521                            }
2522                            result.connection_profile_id = map
2523                                .next_value::<std::option::Option<std::string::String>>()?
2524                                .unwrap_or_default();
2525                        }
2526                        __FieldTag::__connection_profile => {
2527                            if !fields.insert(__FieldTag::__connection_profile) {
2528                                return std::result::Result::Err(A::Error::duplicate_field(
2529                                    "multiple values for connection_profile",
2530                                ));
2531                            }
2532                            result.connection_profile = map
2533                                .next_value::<std::option::Option<crate::model::ConnectionProfile>>(
2534                                )?;
2535                        }
2536                        __FieldTag::__request_id => {
2537                            if !fields.insert(__FieldTag::__request_id) {
2538                                return std::result::Result::Err(A::Error::duplicate_field(
2539                                    "multiple values for request_id",
2540                                ));
2541                            }
2542                            result.request_id = map
2543                                .next_value::<std::option::Option<std::string::String>>()?
2544                                .unwrap_or_default();
2545                        }
2546                        __FieldTag::__validate_only => {
2547                            if !fields.insert(__FieldTag::__validate_only) {
2548                                return std::result::Result::Err(A::Error::duplicate_field(
2549                                    "multiple values for validate_only",
2550                                ));
2551                            }
2552                            result.validate_only = map
2553                                .next_value::<std::option::Option<bool>>()?
2554                                .unwrap_or_default();
2555                        }
2556                        __FieldTag::__force => {
2557                            if !fields.insert(__FieldTag::__force) {
2558                                return std::result::Result::Err(A::Error::duplicate_field(
2559                                    "multiple values for force",
2560                                ));
2561                            }
2562                            result.force = map
2563                                .next_value::<std::option::Option<bool>>()?
2564                                .unwrap_or_default();
2565                        }
2566                        __FieldTag::Unknown(key) => {
2567                            let value = map.next_value::<serde_json::Value>()?;
2568                            result._unknown_fields.insert(key, value);
2569                        }
2570                    }
2571                }
2572                std::result::Result::Ok(result)
2573            }
2574        }
2575        deserializer.deserialize_any(Visitor)
2576    }
2577}
2578
2579#[doc(hidden)]
2580impl serde::ser::Serialize for CreateConnectionProfileRequest {
2581    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2582    where
2583        S: serde::ser::Serializer,
2584    {
2585        use serde::ser::SerializeMap;
2586        #[allow(unused_imports)]
2587        use std::option::Option::Some;
2588        let mut state = serializer.serialize_map(std::option::Option::None)?;
2589        if !self.parent.is_empty() {
2590            state.serialize_entry("parent", &self.parent)?;
2591        }
2592        if !self.connection_profile_id.is_empty() {
2593            state.serialize_entry("connectionProfileId", &self.connection_profile_id)?;
2594        }
2595        if self.connection_profile.is_some() {
2596            state.serialize_entry("connectionProfile", &self.connection_profile)?;
2597        }
2598        if !self.request_id.is_empty() {
2599            state.serialize_entry("requestId", &self.request_id)?;
2600        }
2601        if !wkt::internal::is_default(&self.validate_only) {
2602            state.serialize_entry("validateOnly", &self.validate_only)?;
2603        }
2604        if !wkt::internal::is_default(&self.force) {
2605            state.serialize_entry("force", &self.force)?;
2606        }
2607        if !self._unknown_fields.is_empty() {
2608            for (key, value) in self._unknown_fields.iter() {
2609                state.serialize_entry(key, &value)?;
2610            }
2611        }
2612        state.end()
2613    }
2614}
2615
2616impl std::fmt::Debug for CreateConnectionProfileRequest {
2617    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2618        let mut debug_struct = f.debug_struct("CreateConnectionProfileRequest");
2619        debug_struct.field("parent", &self.parent);
2620        debug_struct.field("connection_profile_id", &self.connection_profile_id);
2621        debug_struct.field("connection_profile", &self.connection_profile);
2622        debug_struct.field("request_id", &self.request_id);
2623        debug_struct.field("validate_only", &self.validate_only);
2624        debug_struct.field("force", &self.force);
2625        if !self._unknown_fields.is_empty() {
2626            debug_struct.field("_unknown_fields", &self._unknown_fields);
2627        }
2628        debug_struct.finish()
2629    }
2630}
2631
2632/// Connection profile update message.
2633#[derive(Clone, Default, PartialEq)]
2634#[non_exhaustive]
2635pub struct UpdateConnectionProfileRequest {
2636    /// Optional. Field mask is used to specify the fields to be overwritten in the
2637    /// ConnectionProfile resource by the update.
2638    /// The fields specified in the update_mask are relative to the resource, not
2639    /// the full request. A field will be overwritten if it is in the mask. If the
2640    /// user does not provide a mask then all fields will be overwritten.
2641    pub update_mask: std::option::Option<wkt::FieldMask>,
2642
2643    /// Required. The connection profile to update.
2644    pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
2645
2646    /// Optional. A request ID to identify requests. Specify a unique request ID
2647    /// so that if you must retry your request, the server will know to ignore
2648    /// the request if it has already been completed. The server will guarantee
2649    /// that for at least 60 minutes since the first request.
2650    ///
2651    /// For example, consider a situation where you make an initial request and the
2652    /// request times out. If you make the request again with the same request ID,
2653    /// the server can check if original operation with the same request ID was
2654    /// received, and if so, will ignore the second request. This prevents clients
2655    /// from accidentally creating duplicate commitments.
2656    ///
2657    /// The request ID must be a valid UUID with the exception that zero UUID is
2658    /// not supported (00000000-0000-0000-0000-000000000000).
2659    pub request_id: std::string::String,
2660
2661    /// Optional. Only validate the connection profile, but don't update any
2662    /// resources. The default is false.
2663    pub validate_only: bool,
2664
2665    /// Optional. Update the connection profile without validating it.
2666    pub force: bool,
2667
2668    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2669}
2670
2671impl UpdateConnectionProfileRequest {
2672    pub fn new() -> Self {
2673        std::default::Default::default()
2674    }
2675
2676    /// Sets the value of [update_mask][crate::model::UpdateConnectionProfileRequest::update_mask].
2677    pub fn set_update_mask<T>(mut self, v: T) -> Self
2678    where
2679        T: std::convert::Into<wkt::FieldMask>,
2680    {
2681        self.update_mask = std::option::Option::Some(v.into());
2682        self
2683    }
2684
2685    /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionProfileRequest::update_mask].
2686    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2687    where
2688        T: std::convert::Into<wkt::FieldMask>,
2689    {
2690        self.update_mask = v.map(|x| x.into());
2691        self
2692    }
2693
2694    /// Sets the value of [connection_profile][crate::model::UpdateConnectionProfileRequest::connection_profile].
2695    pub fn set_connection_profile<T>(mut self, v: T) -> Self
2696    where
2697        T: std::convert::Into<crate::model::ConnectionProfile>,
2698    {
2699        self.connection_profile = std::option::Option::Some(v.into());
2700        self
2701    }
2702
2703    /// Sets or clears the value of [connection_profile][crate::model::UpdateConnectionProfileRequest::connection_profile].
2704    pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
2705    where
2706        T: std::convert::Into<crate::model::ConnectionProfile>,
2707    {
2708        self.connection_profile = v.map(|x| x.into());
2709        self
2710    }
2711
2712    /// Sets the value of [request_id][crate::model::UpdateConnectionProfileRequest::request_id].
2713    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2714        self.request_id = v.into();
2715        self
2716    }
2717
2718    /// Sets the value of [validate_only][crate::model::UpdateConnectionProfileRequest::validate_only].
2719    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2720        self.validate_only = v.into();
2721        self
2722    }
2723
2724    /// Sets the value of [force][crate::model::UpdateConnectionProfileRequest::force].
2725    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2726        self.force = v.into();
2727        self
2728    }
2729}
2730
2731impl wkt::message::Message for UpdateConnectionProfileRequest {
2732    fn typename() -> &'static str {
2733        "type.googleapis.com/google.cloud.datastream.v1.UpdateConnectionProfileRequest"
2734    }
2735}
2736
2737#[doc(hidden)]
2738impl<'de> serde::de::Deserialize<'de> for UpdateConnectionProfileRequest {
2739    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2740    where
2741        D: serde::Deserializer<'de>,
2742    {
2743        #[allow(non_camel_case_types)]
2744        #[doc(hidden)]
2745        #[derive(PartialEq, Eq, Hash)]
2746        enum __FieldTag {
2747            __update_mask,
2748            __connection_profile,
2749            __request_id,
2750            __validate_only,
2751            __force,
2752            Unknown(std::string::String),
2753        }
2754        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2755            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2756            where
2757                D: serde::Deserializer<'de>,
2758            {
2759                struct Visitor;
2760                impl<'de> serde::de::Visitor<'de> for Visitor {
2761                    type Value = __FieldTag;
2762                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2763                        formatter.write_str("a field name for UpdateConnectionProfileRequest")
2764                    }
2765                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2766                    where
2767                        E: serde::de::Error,
2768                    {
2769                        use std::result::Result::Ok;
2770                        use std::string::ToString;
2771                        match value {
2772                            "updateMask" => Ok(__FieldTag::__update_mask),
2773                            "update_mask" => Ok(__FieldTag::__update_mask),
2774                            "connectionProfile" => Ok(__FieldTag::__connection_profile),
2775                            "connection_profile" => Ok(__FieldTag::__connection_profile),
2776                            "requestId" => Ok(__FieldTag::__request_id),
2777                            "request_id" => Ok(__FieldTag::__request_id),
2778                            "validateOnly" => Ok(__FieldTag::__validate_only),
2779                            "validate_only" => Ok(__FieldTag::__validate_only),
2780                            "force" => Ok(__FieldTag::__force),
2781                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2782                        }
2783                    }
2784                }
2785                deserializer.deserialize_identifier(Visitor)
2786            }
2787        }
2788        struct Visitor;
2789        impl<'de> serde::de::Visitor<'de> for Visitor {
2790            type Value = UpdateConnectionProfileRequest;
2791            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2792                formatter.write_str("struct UpdateConnectionProfileRequest")
2793            }
2794            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2795            where
2796                A: serde::de::MapAccess<'de>,
2797            {
2798                #[allow(unused_imports)]
2799                use serde::de::Error;
2800                use std::option::Option::Some;
2801                let mut fields = std::collections::HashSet::new();
2802                let mut result = Self::Value::new();
2803                while let Some(tag) = map.next_key::<__FieldTag>()? {
2804                    #[allow(clippy::match_single_binding)]
2805                    match tag {
2806                        __FieldTag::__update_mask => {
2807                            if !fields.insert(__FieldTag::__update_mask) {
2808                                return std::result::Result::Err(A::Error::duplicate_field(
2809                                    "multiple values for update_mask",
2810                                ));
2811                            }
2812                            result.update_mask =
2813                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
2814                        }
2815                        __FieldTag::__connection_profile => {
2816                            if !fields.insert(__FieldTag::__connection_profile) {
2817                                return std::result::Result::Err(A::Error::duplicate_field(
2818                                    "multiple values for connection_profile",
2819                                ));
2820                            }
2821                            result.connection_profile = map
2822                                .next_value::<std::option::Option<crate::model::ConnectionProfile>>(
2823                                )?;
2824                        }
2825                        __FieldTag::__request_id => {
2826                            if !fields.insert(__FieldTag::__request_id) {
2827                                return std::result::Result::Err(A::Error::duplicate_field(
2828                                    "multiple values for request_id",
2829                                ));
2830                            }
2831                            result.request_id = map
2832                                .next_value::<std::option::Option<std::string::String>>()?
2833                                .unwrap_or_default();
2834                        }
2835                        __FieldTag::__validate_only => {
2836                            if !fields.insert(__FieldTag::__validate_only) {
2837                                return std::result::Result::Err(A::Error::duplicate_field(
2838                                    "multiple values for validate_only",
2839                                ));
2840                            }
2841                            result.validate_only = map
2842                                .next_value::<std::option::Option<bool>>()?
2843                                .unwrap_or_default();
2844                        }
2845                        __FieldTag::__force => {
2846                            if !fields.insert(__FieldTag::__force) {
2847                                return std::result::Result::Err(A::Error::duplicate_field(
2848                                    "multiple values for force",
2849                                ));
2850                            }
2851                            result.force = map
2852                                .next_value::<std::option::Option<bool>>()?
2853                                .unwrap_or_default();
2854                        }
2855                        __FieldTag::Unknown(key) => {
2856                            let value = map.next_value::<serde_json::Value>()?;
2857                            result._unknown_fields.insert(key, value);
2858                        }
2859                    }
2860                }
2861                std::result::Result::Ok(result)
2862            }
2863        }
2864        deserializer.deserialize_any(Visitor)
2865    }
2866}
2867
2868#[doc(hidden)]
2869impl serde::ser::Serialize for UpdateConnectionProfileRequest {
2870    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2871    where
2872        S: serde::ser::Serializer,
2873    {
2874        use serde::ser::SerializeMap;
2875        #[allow(unused_imports)]
2876        use std::option::Option::Some;
2877        let mut state = serializer.serialize_map(std::option::Option::None)?;
2878        if self.update_mask.is_some() {
2879            state.serialize_entry("updateMask", &self.update_mask)?;
2880        }
2881        if self.connection_profile.is_some() {
2882            state.serialize_entry("connectionProfile", &self.connection_profile)?;
2883        }
2884        if !self.request_id.is_empty() {
2885            state.serialize_entry("requestId", &self.request_id)?;
2886        }
2887        if !wkt::internal::is_default(&self.validate_only) {
2888            state.serialize_entry("validateOnly", &self.validate_only)?;
2889        }
2890        if !wkt::internal::is_default(&self.force) {
2891            state.serialize_entry("force", &self.force)?;
2892        }
2893        if !self._unknown_fields.is_empty() {
2894            for (key, value) in self._unknown_fields.iter() {
2895                state.serialize_entry(key, &value)?;
2896            }
2897        }
2898        state.end()
2899    }
2900}
2901
2902impl std::fmt::Debug for UpdateConnectionProfileRequest {
2903    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2904        let mut debug_struct = f.debug_struct("UpdateConnectionProfileRequest");
2905        debug_struct.field("update_mask", &self.update_mask);
2906        debug_struct.field("connection_profile", &self.connection_profile);
2907        debug_struct.field("request_id", &self.request_id);
2908        debug_struct.field("validate_only", &self.validate_only);
2909        debug_struct.field("force", &self.force);
2910        if !self._unknown_fields.is_empty() {
2911            debug_struct.field("_unknown_fields", &self._unknown_fields);
2912        }
2913        debug_struct.finish()
2914    }
2915}
2916
2917/// Request message for deleting a connection profile.
2918#[derive(Clone, Default, PartialEq)]
2919#[non_exhaustive]
2920pub struct DeleteConnectionProfileRequest {
2921    /// Required. The name of the connection profile resource to delete.
2922    pub name: std::string::String,
2923
2924    /// Optional. A request ID to identify requests. Specify a unique request ID
2925    /// so that if you must retry your request, the server will know to ignore
2926    /// the request if it has already been completed. The server will guarantee
2927    /// that for at least 60 minutes after the first request.
2928    ///
2929    /// For example, consider a situation where you make an initial request and the
2930    /// request times out. If you make the request again with the same request ID,
2931    /// the server can check if original operation with the same request ID was
2932    /// received, and if so, will ignore the second request. This prevents clients
2933    /// from accidentally creating duplicate commitments.
2934    ///
2935    /// The request ID must be a valid UUID with the exception that zero UUID is
2936    /// not supported (00000000-0000-0000-0000-000000000000).
2937    pub request_id: std::string::String,
2938
2939    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2940}
2941
2942impl DeleteConnectionProfileRequest {
2943    pub fn new() -> Self {
2944        std::default::Default::default()
2945    }
2946
2947    /// Sets the value of [name][crate::model::DeleteConnectionProfileRequest::name].
2948    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2949        self.name = v.into();
2950        self
2951    }
2952
2953    /// Sets the value of [request_id][crate::model::DeleteConnectionProfileRequest::request_id].
2954    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2955        self.request_id = v.into();
2956        self
2957    }
2958}
2959
2960impl wkt::message::Message for DeleteConnectionProfileRequest {
2961    fn typename() -> &'static str {
2962        "type.googleapis.com/google.cloud.datastream.v1.DeleteConnectionProfileRequest"
2963    }
2964}
2965
2966#[doc(hidden)]
2967impl<'de> serde::de::Deserialize<'de> for DeleteConnectionProfileRequest {
2968    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2969    where
2970        D: serde::Deserializer<'de>,
2971    {
2972        #[allow(non_camel_case_types)]
2973        #[doc(hidden)]
2974        #[derive(PartialEq, Eq, Hash)]
2975        enum __FieldTag {
2976            __name,
2977            __request_id,
2978            Unknown(std::string::String),
2979        }
2980        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2981            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2982            where
2983                D: serde::Deserializer<'de>,
2984            {
2985                struct Visitor;
2986                impl<'de> serde::de::Visitor<'de> for Visitor {
2987                    type Value = __FieldTag;
2988                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2989                        formatter.write_str("a field name for DeleteConnectionProfileRequest")
2990                    }
2991                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2992                    where
2993                        E: serde::de::Error,
2994                    {
2995                        use std::result::Result::Ok;
2996                        use std::string::ToString;
2997                        match value {
2998                            "name" => Ok(__FieldTag::__name),
2999                            "requestId" => Ok(__FieldTag::__request_id),
3000                            "request_id" => Ok(__FieldTag::__request_id),
3001                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3002                        }
3003                    }
3004                }
3005                deserializer.deserialize_identifier(Visitor)
3006            }
3007        }
3008        struct Visitor;
3009        impl<'de> serde::de::Visitor<'de> for Visitor {
3010            type Value = DeleteConnectionProfileRequest;
3011            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3012                formatter.write_str("struct DeleteConnectionProfileRequest")
3013            }
3014            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3015            where
3016                A: serde::de::MapAccess<'de>,
3017            {
3018                #[allow(unused_imports)]
3019                use serde::de::Error;
3020                use std::option::Option::Some;
3021                let mut fields = std::collections::HashSet::new();
3022                let mut result = Self::Value::new();
3023                while let Some(tag) = map.next_key::<__FieldTag>()? {
3024                    #[allow(clippy::match_single_binding)]
3025                    match tag {
3026                        __FieldTag::__name => {
3027                            if !fields.insert(__FieldTag::__name) {
3028                                return std::result::Result::Err(A::Error::duplicate_field(
3029                                    "multiple values for name",
3030                                ));
3031                            }
3032                            result.name = map
3033                                .next_value::<std::option::Option<std::string::String>>()?
3034                                .unwrap_or_default();
3035                        }
3036                        __FieldTag::__request_id => {
3037                            if !fields.insert(__FieldTag::__request_id) {
3038                                return std::result::Result::Err(A::Error::duplicate_field(
3039                                    "multiple values for request_id",
3040                                ));
3041                            }
3042                            result.request_id = map
3043                                .next_value::<std::option::Option<std::string::String>>()?
3044                                .unwrap_or_default();
3045                        }
3046                        __FieldTag::Unknown(key) => {
3047                            let value = map.next_value::<serde_json::Value>()?;
3048                            result._unknown_fields.insert(key, value);
3049                        }
3050                    }
3051                }
3052                std::result::Result::Ok(result)
3053            }
3054        }
3055        deserializer.deserialize_any(Visitor)
3056    }
3057}
3058
3059#[doc(hidden)]
3060impl serde::ser::Serialize for DeleteConnectionProfileRequest {
3061    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3062    where
3063        S: serde::ser::Serializer,
3064    {
3065        use serde::ser::SerializeMap;
3066        #[allow(unused_imports)]
3067        use std::option::Option::Some;
3068        let mut state = serializer.serialize_map(std::option::Option::None)?;
3069        if !self.name.is_empty() {
3070            state.serialize_entry("name", &self.name)?;
3071        }
3072        if !self.request_id.is_empty() {
3073            state.serialize_entry("requestId", &self.request_id)?;
3074        }
3075        if !self._unknown_fields.is_empty() {
3076            for (key, value) in self._unknown_fields.iter() {
3077                state.serialize_entry(key, &value)?;
3078            }
3079        }
3080        state.end()
3081    }
3082}
3083
3084impl std::fmt::Debug for DeleteConnectionProfileRequest {
3085    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3086        let mut debug_struct = f.debug_struct("DeleteConnectionProfileRequest");
3087        debug_struct.field("name", &self.name);
3088        debug_struct.field("request_id", &self.request_id);
3089        if !self._unknown_fields.is_empty() {
3090            debug_struct.field("_unknown_fields", &self._unknown_fields);
3091        }
3092        debug_struct.finish()
3093    }
3094}
3095
3096/// Request message for listing streams.
3097#[derive(Clone, Default, PartialEq)]
3098#[non_exhaustive]
3099pub struct ListStreamsRequest {
3100    /// Required. The parent that owns the collection of streams.
3101    pub parent: std::string::String,
3102
3103    /// Maximum number of streams to return.
3104    /// If unspecified, at most 50 streams will  be returned. The maximum
3105    /// value is 1000; values above 1000 will be coerced to 1000.
3106    pub page_size: i32,
3107
3108    /// Page token received from a previous `ListStreams` call.
3109    /// Provide this to retrieve the subsequent page.
3110    ///
3111    /// When paginating, all other parameters provided to `ListStreams`
3112    /// must match the call that provided the page token.
3113    pub page_token: std::string::String,
3114
3115    /// Filter request.
3116    pub filter: std::string::String,
3117
3118    /// Order by fields for the result.
3119    pub order_by: std::string::String,
3120
3121    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3122}
3123
3124impl ListStreamsRequest {
3125    pub fn new() -> Self {
3126        std::default::Default::default()
3127    }
3128
3129    /// Sets the value of [parent][crate::model::ListStreamsRequest::parent].
3130    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3131        self.parent = v.into();
3132        self
3133    }
3134
3135    /// Sets the value of [page_size][crate::model::ListStreamsRequest::page_size].
3136    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3137        self.page_size = v.into();
3138        self
3139    }
3140
3141    /// Sets the value of [page_token][crate::model::ListStreamsRequest::page_token].
3142    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3143        self.page_token = v.into();
3144        self
3145    }
3146
3147    /// Sets the value of [filter][crate::model::ListStreamsRequest::filter].
3148    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3149        self.filter = v.into();
3150        self
3151    }
3152
3153    /// Sets the value of [order_by][crate::model::ListStreamsRequest::order_by].
3154    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3155        self.order_by = v.into();
3156        self
3157    }
3158}
3159
3160impl wkt::message::Message for ListStreamsRequest {
3161    fn typename() -> &'static str {
3162        "type.googleapis.com/google.cloud.datastream.v1.ListStreamsRequest"
3163    }
3164}
3165
3166#[doc(hidden)]
3167impl<'de> serde::de::Deserialize<'de> for ListStreamsRequest {
3168    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3169    where
3170        D: serde::Deserializer<'de>,
3171    {
3172        #[allow(non_camel_case_types)]
3173        #[doc(hidden)]
3174        #[derive(PartialEq, Eq, Hash)]
3175        enum __FieldTag {
3176            __parent,
3177            __page_size,
3178            __page_token,
3179            __filter,
3180            __order_by,
3181            Unknown(std::string::String),
3182        }
3183        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3184            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3185            where
3186                D: serde::Deserializer<'de>,
3187            {
3188                struct Visitor;
3189                impl<'de> serde::de::Visitor<'de> for Visitor {
3190                    type Value = __FieldTag;
3191                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3192                        formatter.write_str("a field name for ListStreamsRequest")
3193                    }
3194                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3195                    where
3196                        E: serde::de::Error,
3197                    {
3198                        use std::result::Result::Ok;
3199                        use std::string::ToString;
3200                        match value {
3201                            "parent" => Ok(__FieldTag::__parent),
3202                            "pageSize" => Ok(__FieldTag::__page_size),
3203                            "page_size" => Ok(__FieldTag::__page_size),
3204                            "pageToken" => Ok(__FieldTag::__page_token),
3205                            "page_token" => Ok(__FieldTag::__page_token),
3206                            "filter" => Ok(__FieldTag::__filter),
3207                            "orderBy" => Ok(__FieldTag::__order_by),
3208                            "order_by" => Ok(__FieldTag::__order_by),
3209                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3210                        }
3211                    }
3212                }
3213                deserializer.deserialize_identifier(Visitor)
3214            }
3215        }
3216        struct Visitor;
3217        impl<'de> serde::de::Visitor<'de> for Visitor {
3218            type Value = ListStreamsRequest;
3219            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3220                formatter.write_str("struct ListStreamsRequest")
3221            }
3222            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3223            where
3224                A: serde::de::MapAccess<'de>,
3225            {
3226                #[allow(unused_imports)]
3227                use serde::de::Error;
3228                use std::option::Option::Some;
3229                let mut fields = std::collections::HashSet::new();
3230                let mut result = Self::Value::new();
3231                while let Some(tag) = map.next_key::<__FieldTag>()? {
3232                    #[allow(clippy::match_single_binding)]
3233                    match tag {
3234                        __FieldTag::__parent => {
3235                            if !fields.insert(__FieldTag::__parent) {
3236                                return std::result::Result::Err(A::Error::duplicate_field(
3237                                    "multiple values for parent",
3238                                ));
3239                            }
3240                            result.parent = map
3241                                .next_value::<std::option::Option<std::string::String>>()?
3242                                .unwrap_or_default();
3243                        }
3244                        __FieldTag::__page_size => {
3245                            if !fields.insert(__FieldTag::__page_size) {
3246                                return std::result::Result::Err(A::Error::duplicate_field(
3247                                    "multiple values for page_size",
3248                                ));
3249                            }
3250                            struct __With(std::option::Option<i32>);
3251                            impl<'de> serde::de::Deserialize<'de> for __With {
3252                                fn deserialize<D>(
3253                                    deserializer: D,
3254                                ) -> std::result::Result<Self, D::Error>
3255                                where
3256                                    D: serde::de::Deserializer<'de>,
3257                                {
3258                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
3259                                }
3260                            }
3261                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
3262                        }
3263                        __FieldTag::__page_token => {
3264                            if !fields.insert(__FieldTag::__page_token) {
3265                                return std::result::Result::Err(A::Error::duplicate_field(
3266                                    "multiple values for page_token",
3267                                ));
3268                            }
3269                            result.page_token = map
3270                                .next_value::<std::option::Option<std::string::String>>()?
3271                                .unwrap_or_default();
3272                        }
3273                        __FieldTag::__filter => {
3274                            if !fields.insert(__FieldTag::__filter) {
3275                                return std::result::Result::Err(A::Error::duplicate_field(
3276                                    "multiple values for filter",
3277                                ));
3278                            }
3279                            result.filter = map
3280                                .next_value::<std::option::Option<std::string::String>>()?
3281                                .unwrap_or_default();
3282                        }
3283                        __FieldTag::__order_by => {
3284                            if !fields.insert(__FieldTag::__order_by) {
3285                                return std::result::Result::Err(A::Error::duplicate_field(
3286                                    "multiple values for order_by",
3287                                ));
3288                            }
3289                            result.order_by = map
3290                                .next_value::<std::option::Option<std::string::String>>()?
3291                                .unwrap_or_default();
3292                        }
3293                        __FieldTag::Unknown(key) => {
3294                            let value = map.next_value::<serde_json::Value>()?;
3295                            result._unknown_fields.insert(key, value);
3296                        }
3297                    }
3298                }
3299                std::result::Result::Ok(result)
3300            }
3301        }
3302        deserializer.deserialize_any(Visitor)
3303    }
3304}
3305
3306#[doc(hidden)]
3307impl serde::ser::Serialize for ListStreamsRequest {
3308    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3309    where
3310        S: serde::ser::Serializer,
3311    {
3312        use serde::ser::SerializeMap;
3313        #[allow(unused_imports)]
3314        use std::option::Option::Some;
3315        let mut state = serializer.serialize_map(std::option::Option::None)?;
3316        if !self.parent.is_empty() {
3317            state.serialize_entry("parent", &self.parent)?;
3318        }
3319        if !wkt::internal::is_default(&self.page_size) {
3320            struct __With<'a>(&'a i32);
3321            impl<'a> serde::ser::Serialize for __With<'a> {
3322                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3323                where
3324                    S: serde::ser::Serializer,
3325                {
3326                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
3327                }
3328            }
3329            state.serialize_entry("pageSize", &__With(&self.page_size))?;
3330        }
3331        if !self.page_token.is_empty() {
3332            state.serialize_entry("pageToken", &self.page_token)?;
3333        }
3334        if !self.filter.is_empty() {
3335            state.serialize_entry("filter", &self.filter)?;
3336        }
3337        if !self.order_by.is_empty() {
3338            state.serialize_entry("orderBy", &self.order_by)?;
3339        }
3340        if !self._unknown_fields.is_empty() {
3341            for (key, value) in self._unknown_fields.iter() {
3342                state.serialize_entry(key, &value)?;
3343            }
3344        }
3345        state.end()
3346    }
3347}
3348
3349impl std::fmt::Debug for ListStreamsRequest {
3350    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3351        let mut debug_struct = f.debug_struct("ListStreamsRequest");
3352        debug_struct.field("parent", &self.parent);
3353        debug_struct.field("page_size", &self.page_size);
3354        debug_struct.field("page_token", &self.page_token);
3355        debug_struct.field("filter", &self.filter);
3356        debug_struct.field("order_by", &self.order_by);
3357        if !self._unknown_fields.is_empty() {
3358            debug_struct.field("_unknown_fields", &self._unknown_fields);
3359        }
3360        debug_struct.finish()
3361    }
3362}
3363
3364/// Response message for listing streams.
3365#[derive(Clone, Default, PartialEq)]
3366#[non_exhaustive]
3367pub struct ListStreamsResponse {
3368    /// List of streams
3369    pub streams: std::vec::Vec<crate::model::Stream>,
3370
3371    /// A token, which can be sent as `page_token` to retrieve the next page.
3372    /// If this field is omitted, there are no subsequent pages.
3373    pub next_page_token: std::string::String,
3374
3375    /// Locations that could not be reached.
3376    pub unreachable: std::vec::Vec<std::string::String>,
3377
3378    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3379}
3380
3381impl ListStreamsResponse {
3382    pub fn new() -> Self {
3383        std::default::Default::default()
3384    }
3385
3386    /// Sets the value of [streams][crate::model::ListStreamsResponse::streams].
3387    pub fn set_streams<T, V>(mut self, v: T) -> Self
3388    where
3389        T: std::iter::IntoIterator<Item = V>,
3390        V: std::convert::Into<crate::model::Stream>,
3391    {
3392        use std::iter::Iterator;
3393        self.streams = v.into_iter().map(|i| i.into()).collect();
3394        self
3395    }
3396
3397    /// Sets the value of [next_page_token][crate::model::ListStreamsResponse::next_page_token].
3398    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3399        self.next_page_token = v.into();
3400        self
3401    }
3402
3403    /// Sets the value of [unreachable][crate::model::ListStreamsResponse::unreachable].
3404    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3405    where
3406        T: std::iter::IntoIterator<Item = V>,
3407        V: std::convert::Into<std::string::String>,
3408    {
3409        use std::iter::Iterator;
3410        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3411        self
3412    }
3413}
3414
3415impl wkt::message::Message for ListStreamsResponse {
3416    fn typename() -> &'static str {
3417        "type.googleapis.com/google.cloud.datastream.v1.ListStreamsResponse"
3418    }
3419}
3420
3421#[doc(hidden)]
3422impl gax::paginator::internal::PageableResponse for ListStreamsResponse {
3423    type PageItem = crate::model::Stream;
3424
3425    fn items(self) -> std::vec::Vec<Self::PageItem> {
3426        self.streams
3427    }
3428
3429    fn next_page_token(&self) -> std::string::String {
3430        use std::clone::Clone;
3431        self.next_page_token.clone()
3432    }
3433}
3434
3435#[doc(hidden)]
3436impl<'de> serde::de::Deserialize<'de> for ListStreamsResponse {
3437    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3438    where
3439        D: serde::Deserializer<'de>,
3440    {
3441        #[allow(non_camel_case_types)]
3442        #[doc(hidden)]
3443        #[derive(PartialEq, Eq, Hash)]
3444        enum __FieldTag {
3445            __streams,
3446            __next_page_token,
3447            __unreachable,
3448            Unknown(std::string::String),
3449        }
3450        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3451            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3452            where
3453                D: serde::Deserializer<'de>,
3454            {
3455                struct Visitor;
3456                impl<'de> serde::de::Visitor<'de> for Visitor {
3457                    type Value = __FieldTag;
3458                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3459                        formatter.write_str("a field name for ListStreamsResponse")
3460                    }
3461                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3462                    where
3463                        E: serde::de::Error,
3464                    {
3465                        use std::result::Result::Ok;
3466                        use std::string::ToString;
3467                        match value {
3468                            "streams" => Ok(__FieldTag::__streams),
3469                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
3470                            "next_page_token" => Ok(__FieldTag::__next_page_token),
3471                            "unreachable" => Ok(__FieldTag::__unreachable),
3472                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3473                        }
3474                    }
3475                }
3476                deserializer.deserialize_identifier(Visitor)
3477            }
3478        }
3479        struct Visitor;
3480        impl<'de> serde::de::Visitor<'de> for Visitor {
3481            type Value = ListStreamsResponse;
3482            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3483                formatter.write_str("struct ListStreamsResponse")
3484            }
3485            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3486            where
3487                A: serde::de::MapAccess<'de>,
3488            {
3489                #[allow(unused_imports)]
3490                use serde::de::Error;
3491                use std::option::Option::Some;
3492                let mut fields = std::collections::HashSet::new();
3493                let mut result = Self::Value::new();
3494                while let Some(tag) = map.next_key::<__FieldTag>()? {
3495                    #[allow(clippy::match_single_binding)]
3496                    match tag {
3497                        __FieldTag::__streams => {
3498                            if !fields.insert(__FieldTag::__streams) {
3499                                return std::result::Result::Err(A::Error::duplicate_field(
3500                                    "multiple values for streams",
3501                                ));
3502                            }
3503                            result.streams = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Stream>>>()?.unwrap_or_default();
3504                        }
3505                        __FieldTag::__next_page_token => {
3506                            if !fields.insert(__FieldTag::__next_page_token) {
3507                                return std::result::Result::Err(A::Error::duplicate_field(
3508                                    "multiple values for next_page_token",
3509                                ));
3510                            }
3511                            result.next_page_token = map
3512                                .next_value::<std::option::Option<std::string::String>>()?
3513                                .unwrap_or_default();
3514                        }
3515                        __FieldTag::__unreachable => {
3516                            if !fields.insert(__FieldTag::__unreachable) {
3517                                return std::result::Result::Err(A::Error::duplicate_field(
3518                                    "multiple values for unreachable",
3519                                ));
3520                            }
3521                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
3522                        }
3523                        __FieldTag::Unknown(key) => {
3524                            let value = map.next_value::<serde_json::Value>()?;
3525                            result._unknown_fields.insert(key, value);
3526                        }
3527                    }
3528                }
3529                std::result::Result::Ok(result)
3530            }
3531        }
3532        deserializer.deserialize_any(Visitor)
3533    }
3534}
3535
3536#[doc(hidden)]
3537impl serde::ser::Serialize for ListStreamsResponse {
3538    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3539    where
3540        S: serde::ser::Serializer,
3541    {
3542        use serde::ser::SerializeMap;
3543        #[allow(unused_imports)]
3544        use std::option::Option::Some;
3545        let mut state = serializer.serialize_map(std::option::Option::None)?;
3546        if !self.streams.is_empty() {
3547            state.serialize_entry("streams", &self.streams)?;
3548        }
3549        if !self.next_page_token.is_empty() {
3550            state.serialize_entry("nextPageToken", &self.next_page_token)?;
3551        }
3552        if !self.unreachable.is_empty() {
3553            state.serialize_entry("unreachable", &self.unreachable)?;
3554        }
3555        if !self._unknown_fields.is_empty() {
3556            for (key, value) in self._unknown_fields.iter() {
3557                state.serialize_entry(key, &value)?;
3558            }
3559        }
3560        state.end()
3561    }
3562}
3563
3564impl std::fmt::Debug for ListStreamsResponse {
3565    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3566        let mut debug_struct = f.debug_struct("ListStreamsResponse");
3567        debug_struct.field("streams", &self.streams);
3568        debug_struct.field("next_page_token", &self.next_page_token);
3569        debug_struct.field("unreachable", &self.unreachable);
3570        if !self._unknown_fields.is_empty() {
3571            debug_struct.field("_unknown_fields", &self._unknown_fields);
3572        }
3573        debug_struct.finish()
3574    }
3575}
3576
3577/// Request message for getting a stream.
3578#[derive(Clone, Default, PartialEq)]
3579#[non_exhaustive]
3580pub struct GetStreamRequest {
3581    /// Required. The name of the stream resource to get.
3582    pub name: std::string::String,
3583
3584    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3585}
3586
3587impl GetStreamRequest {
3588    pub fn new() -> Self {
3589        std::default::Default::default()
3590    }
3591
3592    /// Sets the value of [name][crate::model::GetStreamRequest::name].
3593    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3594        self.name = v.into();
3595        self
3596    }
3597}
3598
3599impl wkt::message::Message for GetStreamRequest {
3600    fn typename() -> &'static str {
3601        "type.googleapis.com/google.cloud.datastream.v1.GetStreamRequest"
3602    }
3603}
3604
3605#[doc(hidden)]
3606impl<'de> serde::de::Deserialize<'de> for GetStreamRequest {
3607    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3608    where
3609        D: serde::Deserializer<'de>,
3610    {
3611        #[allow(non_camel_case_types)]
3612        #[doc(hidden)]
3613        #[derive(PartialEq, Eq, Hash)]
3614        enum __FieldTag {
3615            __name,
3616            Unknown(std::string::String),
3617        }
3618        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3619            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3620            where
3621                D: serde::Deserializer<'de>,
3622            {
3623                struct Visitor;
3624                impl<'de> serde::de::Visitor<'de> for Visitor {
3625                    type Value = __FieldTag;
3626                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3627                        formatter.write_str("a field name for GetStreamRequest")
3628                    }
3629                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3630                    where
3631                        E: serde::de::Error,
3632                    {
3633                        use std::result::Result::Ok;
3634                        use std::string::ToString;
3635                        match value {
3636                            "name" => Ok(__FieldTag::__name),
3637                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3638                        }
3639                    }
3640                }
3641                deserializer.deserialize_identifier(Visitor)
3642            }
3643        }
3644        struct Visitor;
3645        impl<'de> serde::de::Visitor<'de> for Visitor {
3646            type Value = GetStreamRequest;
3647            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3648                formatter.write_str("struct GetStreamRequest")
3649            }
3650            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3651            where
3652                A: serde::de::MapAccess<'de>,
3653            {
3654                #[allow(unused_imports)]
3655                use serde::de::Error;
3656                use std::option::Option::Some;
3657                let mut fields = std::collections::HashSet::new();
3658                let mut result = Self::Value::new();
3659                while let Some(tag) = map.next_key::<__FieldTag>()? {
3660                    #[allow(clippy::match_single_binding)]
3661                    match tag {
3662                        __FieldTag::__name => {
3663                            if !fields.insert(__FieldTag::__name) {
3664                                return std::result::Result::Err(A::Error::duplicate_field(
3665                                    "multiple values for name",
3666                                ));
3667                            }
3668                            result.name = map
3669                                .next_value::<std::option::Option<std::string::String>>()?
3670                                .unwrap_or_default();
3671                        }
3672                        __FieldTag::Unknown(key) => {
3673                            let value = map.next_value::<serde_json::Value>()?;
3674                            result._unknown_fields.insert(key, value);
3675                        }
3676                    }
3677                }
3678                std::result::Result::Ok(result)
3679            }
3680        }
3681        deserializer.deserialize_any(Visitor)
3682    }
3683}
3684
3685#[doc(hidden)]
3686impl serde::ser::Serialize for GetStreamRequest {
3687    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3688    where
3689        S: serde::ser::Serializer,
3690    {
3691        use serde::ser::SerializeMap;
3692        #[allow(unused_imports)]
3693        use std::option::Option::Some;
3694        let mut state = serializer.serialize_map(std::option::Option::None)?;
3695        if !self.name.is_empty() {
3696            state.serialize_entry("name", &self.name)?;
3697        }
3698        if !self._unknown_fields.is_empty() {
3699            for (key, value) in self._unknown_fields.iter() {
3700                state.serialize_entry(key, &value)?;
3701            }
3702        }
3703        state.end()
3704    }
3705}
3706
3707impl std::fmt::Debug for GetStreamRequest {
3708    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3709        let mut debug_struct = f.debug_struct("GetStreamRequest");
3710        debug_struct.field("name", &self.name);
3711        if !self._unknown_fields.is_empty() {
3712            debug_struct.field("_unknown_fields", &self._unknown_fields);
3713        }
3714        debug_struct.finish()
3715    }
3716}
3717
3718/// Request message for creating a stream.
3719#[derive(Clone, Default, PartialEq)]
3720#[non_exhaustive]
3721pub struct CreateStreamRequest {
3722    /// Required. The parent that owns the collection of streams.
3723    pub parent: std::string::String,
3724
3725    /// Required. The stream identifier.
3726    pub stream_id: std::string::String,
3727
3728    /// Required. The stream resource to create.
3729    pub stream: std::option::Option<crate::model::Stream>,
3730
3731    /// Optional. A request ID to identify requests. Specify a unique request ID
3732    /// so that if you must retry your request, the server will know to ignore
3733    /// the request if it has already been completed. The server will guarantee
3734    /// that for at least 60 minutes since the first request.
3735    ///
3736    /// For example, consider a situation where you make an initial request and the
3737    /// request times out. If you make the request again with the same request ID,
3738    /// the server can check if original operation with the same request ID was
3739    /// received, and if so, will ignore the second request. This prevents clients
3740    /// from accidentally creating duplicate commitments.
3741    ///
3742    /// The request ID must be a valid UUID with the exception that zero UUID is
3743    /// not supported (00000000-0000-0000-0000-000000000000).
3744    pub request_id: std::string::String,
3745
3746    /// Optional. Only validate the stream, but don't create any resources.
3747    /// The default is false.
3748    pub validate_only: bool,
3749
3750    /// Optional. Create the stream without validating it.
3751    pub force: bool,
3752
3753    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3754}
3755
3756impl CreateStreamRequest {
3757    pub fn new() -> Self {
3758        std::default::Default::default()
3759    }
3760
3761    /// Sets the value of [parent][crate::model::CreateStreamRequest::parent].
3762    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3763        self.parent = v.into();
3764        self
3765    }
3766
3767    /// Sets the value of [stream_id][crate::model::CreateStreamRequest::stream_id].
3768    pub fn set_stream_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3769        self.stream_id = v.into();
3770        self
3771    }
3772
3773    /// Sets the value of [stream][crate::model::CreateStreamRequest::stream].
3774    pub fn set_stream<T>(mut self, v: T) -> Self
3775    where
3776        T: std::convert::Into<crate::model::Stream>,
3777    {
3778        self.stream = std::option::Option::Some(v.into());
3779        self
3780    }
3781
3782    /// Sets or clears the value of [stream][crate::model::CreateStreamRequest::stream].
3783    pub fn set_or_clear_stream<T>(mut self, v: std::option::Option<T>) -> Self
3784    where
3785        T: std::convert::Into<crate::model::Stream>,
3786    {
3787        self.stream = v.map(|x| x.into());
3788        self
3789    }
3790
3791    /// Sets the value of [request_id][crate::model::CreateStreamRequest::request_id].
3792    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3793        self.request_id = v.into();
3794        self
3795    }
3796
3797    /// Sets the value of [validate_only][crate::model::CreateStreamRequest::validate_only].
3798    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3799        self.validate_only = v.into();
3800        self
3801    }
3802
3803    /// Sets the value of [force][crate::model::CreateStreamRequest::force].
3804    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3805        self.force = v.into();
3806        self
3807    }
3808}
3809
3810impl wkt::message::Message for CreateStreamRequest {
3811    fn typename() -> &'static str {
3812        "type.googleapis.com/google.cloud.datastream.v1.CreateStreamRequest"
3813    }
3814}
3815
3816#[doc(hidden)]
3817impl<'de> serde::de::Deserialize<'de> for CreateStreamRequest {
3818    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3819    where
3820        D: serde::Deserializer<'de>,
3821    {
3822        #[allow(non_camel_case_types)]
3823        #[doc(hidden)]
3824        #[derive(PartialEq, Eq, Hash)]
3825        enum __FieldTag {
3826            __parent,
3827            __stream_id,
3828            __stream,
3829            __request_id,
3830            __validate_only,
3831            __force,
3832            Unknown(std::string::String),
3833        }
3834        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3835            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3836            where
3837                D: serde::Deserializer<'de>,
3838            {
3839                struct Visitor;
3840                impl<'de> serde::de::Visitor<'de> for Visitor {
3841                    type Value = __FieldTag;
3842                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3843                        formatter.write_str("a field name for CreateStreamRequest")
3844                    }
3845                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3846                    where
3847                        E: serde::de::Error,
3848                    {
3849                        use std::result::Result::Ok;
3850                        use std::string::ToString;
3851                        match value {
3852                            "parent" => Ok(__FieldTag::__parent),
3853                            "streamId" => Ok(__FieldTag::__stream_id),
3854                            "stream_id" => Ok(__FieldTag::__stream_id),
3855                            "stream" => Ok(__FieldTag::__stream),
3856                            "requestId" => Ok(__FieldTag::__request_id),
3857                            "request_id" => Ok(__FieldTag::__request_id),
3858                            "validateOnly" => Ok(__FieldTag::__validate_only),
3859                            "validate_only" => Ok(__FieldTag::__validate_only),
3860                            "force" => Ok(__FieldTag::__force),
3861                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3862                        }
3863                    }
3864                }
3865                deserializer.deserialize_identifier(Visitor)
3866            }
3867        }
3868        struct Visitor;
3869        impl<'de> serde::de::Visitor<'de> for Visitor {
3870            type Value = CreateStreamRequest;
3871            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3872                formatter.write_str("struct CreateStreamRequest")
3873            }
3874            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3875            where
3876                A: serde::de::MapAccess<'de>,
3877            {
3878                #[allow(unused_imports)]
3879                use serde::de::Error;
3880                use std::option::Option::Some;
3881                let mut fields = std::collections::HashSet::new();
3882                let mut result = Self::Value::new();
3883                while let Some(tag) = map.next_key::<__FieldTag>()? {
3884                    #[allow(clippy::match_single_binding)]
3885                    match tag {
3886                        __FieldTag::__parent => {
3887                            if !fields.insert(__FieldTag::__parent) {
3888                                return std::result::Result::Err(A::Error::duplicate_field(
3889                                    "multiple values for parent",
3890                                ));
3891                            }
3892                            result.parent = map
3893                                .next_value::<std::option::Option<std::string::String>>()?
3894                                .unwrap_or_default();
3895                        }
3896                        __FieldTag::__stream_id => {
3897                            if !fields.insert(__FieldTag::__stream_id) {
3898                                return std::result::Result::Err(A::Error::duplicate_field(
3899                                    "multiple values for stream_id",
3900                                ));
3901                            }
3902                            result.stream_id = map
3903                                .next_value::<std::option::Option<std::string::String>>()?
3904                                .unwrap_or_default();
3905                        }
3906                        __FieldTag::__stream => {
3907                            if !fields.insert(__FieldTag::__stream) {
3908                                return std::result::Result::Err(A::Error::duplicate_field(
3909                                    "multiple values for stream",
3910                                ));
3911                            }
3912                            result.stream =
3913                                map.next_value::<std::option::Option<crate::model::Stream>>()?;
3914                        }
3915                        __FieldTag::__request_id => {
3916                            if !fields.insert(__FieldTag::__request_id) {
3917                                return std::result::Result::Err(A::Error::duplicate_field(
3918                                    "multiple values for request_id",
3919                                ));
3920                            }
3921                            result.request_id = map
3922                                .next_value::<std::option::Option<std::string::String>>()?
3923                                .unwrap_or_default();
3924                        }
3925                        __FieldTag::__validate_only => {
3926                            if !fields.insert(__FieldTag::__validate_only) {
3927                                return std::result::Result::Err(A::Error::duplicate_field(
3928                                    "multiple values for validate_only",
3929                                ));
3930                            }
3931                            result.validate_only = map
3932                                .next_value::<std::option::Option<bool>>()?
3933                                .unwrap_or_default();
3934                        }
3935                        __FieldTag::__force => {
3936                            if !fields.insert(__FieldTag::__force) {
3937                                return std::result::Result::Err(A::Error::duplicate_field(
3938                                    "multiple values for force",
3939                                ));
3940                            }
3941                            result.force = map
3942                                .next_value::<std::option::Option<bool>>()?
3943                                .unwrap_or_default();
3944                        }
3945                        __FieldTag::Unknown(key) => {
3946                            let value = map.next_value::<serde_json::Value>()?;
3947                            result._unknown_fields.insert(key, value);
3948                        }
3949                    }
3950                }
3951                std::result::Result::Ok(result)
3952            }
3953        }
3954        deserializer.deserialize_any(Visitor)
3955    }
3956}
3957
3958#[doc(hidden)]
3959impl serde::ser::Serialize for CreateStreamRequest {
3960    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3961    where
3962        S: serde::ser::Serializer,
3963    {
3964        use serde::ser::SerializeMap;
3965        #[allow(unused_imports)]
3966        use std::option::Option::Some;
3967        let mut state = serializer.serialize_map(std::option::Option::None)?;
3968        if !self.parent.is_empty() {
3969            state.serialize_entry("parent", &self.parent)?;
3970        }
3971        if !self.stream_id.is_empty() {
3972            state.serialize_entry("streamId", &self.stream_id)?;
3973        }
3974        if self.stream.is_some() {
3975            state.serialize_entry("stream", &self.stream)?;
3976        }
3977        if !self.request_id.is_empty() {
3978            state.serialize_entry("requestId", &self.request_id)?;
3979        }
3980        if !wkt::internal::is_default(&self.validate_only) {
3981            state.serialize_entry("validateOnly", &self.validate_only)?;
3982        }
3983        if !wkt::internal::is_default(&self.force) {
3984            state.serialize_entry("force", &self.force)?;
3985        }
3986        if !self._unknown_fields.is_empty() {
3987            for (key, value) in self._unknown_fields.iter() {
3988                state.serialize_entry(key, &value)?;
3989            }
3990        }
3991        state.end()
3992    }
3993}
3994
3995impl std::fmt::Debug for CreateStreamRequest {
3996    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3997        let mut debug_struct = f.debug_struct("CreateStreamRequest");
3998        debug_struct.field("parent", &self.parent);
3999        debug_struct.field("stream_id", &self.stream_id);
4000        debug_struct.field("stream", &self.stream);
4001        debug_struct.field("request_id", &self.request_id);
4002        debug_struct.field("validate_only", &self.validate_only);
4003        debug_struct.field("force", &self.force);
4004        if !self._unknown_fields.is_empty() {
4005            debug_struct.field("_unknown_fields", &self._unknown_fields);
4006        }
4007        debug_struct.finish()
4008    }
4009}
4010
4011/// Request message for updating a stream.
4012#[derive(Clone, Default, PartialEq)]
4013#[non_exhaustive]
4014pub struct UpdateStreamRequest {
4015    /// Optional. Field mask is used to specify the fields to be overwritten in the
4016    /// stream resource by the update.
4017    /// The fields specified in the update_mask are relative to the resource, not
4018    /// the full request. A field will be overwritten if it is in the mask. If the
4019    /// user does not provide a mask then all fields will be overwritten.
4020    pub update_mask: std::option::Option<wkt::FieldMask>,
4021
4022    /// Required. The stream resource to update.
4023    pub stream: std::option::Option<crate::model::Stream>,
4024
4025    /// Optional. A request ID to identify requests. Specify a unique request ID
4026    /// so that if you must retry your request, the server will know to ignore
4027    /// the request if it has already been completed. The server will guarantee
4028    /// that for at least 60 minutes since the first request.
4029    ///
4030    /// For example, consider a situation where you make an initial request and the
4031    /// request times out. If you make the request again with the same request ID,
4032    /// the server can check if original operation with the same request ID was
4033    /// received, and if so, will ignore the second request. This prevents clients
4034    /// from accidentally creating duplicate commitments.
4035    ///
4036    /// The request ID must be a valid UUID with the exception that zero UUID is
4037    /// not supported (00000000-0000-0000-0000-000000000000).
4038    pub request_id: std::string::String,
4039
4040    /// Optional. Only validate the stream with the changes, without actually
4041    /// updating it. The default is false.
4042    pub validate_only: bool,
4043
4044    /// Optional. Update the stream without validating it.
4045    pub force: bool,
4046
4047    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4048}
4049
4050impl UpdateStreamRequest {
4051    pub fn new() -> Self {
4052        std::default::Default::default()
4053    }
4054
4055    /// Sets the value of [update_mask][crate::model::UpdateStreamRequest::update_mask].
4056    pub fn set_update_mask<T>(mut self, v: T) -> Self
4057    where
4058        T: std::convert::Into<wkt::FieldMask>,
4059    {
4060        self.update_mask = std::option::Option::Some(v.into());
4061        self
4062    }
4063
4064    /// Sets or clears the value of [update_mask][crate::model::UpdateStreamRequest::update_mask].
4065    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4066    where
4067        T: std::convert::Into<wkt::FieldMask>,
4068    {
4069        self.update_mask = v.map(|x| x.into());
4070        self
4071    }
4072
4073    /// Sets the value of [stream][crate::model::UpdateStreamRequest::stream].
4074    pub fn set_stream<T>(mut self, v: T) -> Self
4075    where
4076        T: std::convert::Into<crate::model::Stream>,
4077    {
4078        self.stream = std::option::Option::Some(v.into());
4079        self
4080    }
4081
4082    /// Sets or clears the value of [stream][crate::model::UpdateStreamRequest::stream].
4083    pub fn set_or_clear_stream<T>(mut self, v: std::option::Option<T>) -> Self
4084    where
4085        T: std::convert::Into<crate::model::Stream>,
4086    {
4087        self.stream = v.map(|x| x.into());
4088        self
4089    }
4090
4091    /// Sets the value of [request_id][crate::model::UpdateStreamRequest::request_id].
4092    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4093        self.request_id = v.into();
4094        self
4095    }
4096
4097    /// Sets the value of [validate_only][crate::model::UpdateStreamRequest::validate_only].
4098    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4099        self.validate_only = v.into();
4100        self
4101    }
4102
4103    /// Sets the value of [force][crate::model::UpdateStreamRequest::force].
4104    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4105        self.force = v.into();
4106        self
4107    }
4108}
4109
4110impl wkt::message::Message for UpdateStreamRequest {
4111    fn typename() -> &'static str {
4112        "type.googleapis.com/google.cloud.datastream.v1.UpdateStreamRequest"
4113    }
4114}
4115
4116#[doc(hidden)]
4117impl<'de> serde::de::Deserialize<'de> for UpdateStreamRequest {
4118    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4119    where
4120        D: serde::Deserializer<'de>,
4121    {
4122        #[allow(non_camel_case_types)]
4123        #[doc(hidden)]
4124        #[derive(PartialEq, Eq, Hash)]
4125        enum __FieldTag {
4126            __update_mask,
4127            __stream,
4128            __request_id,
4129            __validate_only,
4130            __force,
4131            Unknown(std::string::String),
4132        }
4133        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4134            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4135            where
4136                D: serde::Deserializer<'de>,
4137            {
4138                struct Visitor;
4139                impl<'de> serde::de::Visitor<'de> for Visitor {
4140                    type Value = __FieldTag;
4141                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4142                        formatter.write_str("a field name for UpdateStreamRequest")
4143                    }
4144                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4145                    where
4146                        E: serde::de::Error,
4147                    {
4148                        use std::result::Result::Ok;
4149                        use std::string::ToString;
4150                        match value {
4151                            "updateMask" => Ok(__FieldTag::__update_mask),
4152                            "update_mask" => Ok(__FieldTag::__update_mask),
4153                            "stream" => Ok(__FieldTag::__stream),
4154                            "requestId" => Ok(__FieldTag::__request_id),
4155                            "request_id" => Ok(__FieldTag::__request_id),
4156                            "validateOnly" => Ok(__FieldTag::__validate_only),
4157                            "validate_only" => Ok(__FieldTag::__validate_only),
4158                            "force" => Ok(__FieldTag::__force),
4159                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4160                        }
4161                    }
4162                }
4163                deserializer.deserialize_identifier(Visitor)
4164            }
4165        }
4166        struct Visitor;
4167        impl<'de> serde::de::Visitor<'de> for Visitor {
4168            type Value = UpdateStreamRequest;
4169            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4170                formatter.write_str("struct UpdateStreamRequest")
4171            }
4172            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4173            where
4174                A: serde::de::MapAccess<'de>,
4175            {
4176                #[allow(unused_imports)]
4177                use serde::de::Error;
4178                use std::option::Option::Some;
4179                let mut fields = std::collections::HashSet::new();
4180                let mut result = Self::Value::new();
4181                while let Some(tag) = map.next_key::<__FieldTag>()? {
4182                    #[allow(clippy::match_single_binding)]
4183                    match tag {
4184                        __FieldTag::__update_mask => {
4185                            if !fields.insert(__FieldTag::__update_mask) {
4186                                return std::result::Result::Err(A::Error::duplicate_field(
4187                                    "multiple values for update_mask",
4188                                ));
4189                            }
4190                            result.update_mask =
4191                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
4192                        }
4193                        __FieldTag::__stream => {
4194                            if !fields.insert(__FieldTag::__stream) {
4195                                return std::result::Result::Err(A::Error::duplicate_field(
4196                                    "multiple values for stream",
4197                                ));
4198                            }
4199                            result.stream =
4200                                map.next_value::<std::option::Option<crate::model::Stream>>()?;
4201                        }
4202                        __FieldTag::__request_id => {
4203                            if !fields.insert(__FieldTag::__request_id) {
4204                                return std::result::Result::Err(A::Error::duplicate_field(
4205                                    "multiple values for request_id",
4206                                ));
4207                            }
4208                            result.request_id = map
4209                                .next_value::<std::option::Option<std::string::String>>()?
4210                                .unwrap_or_default();
4211                        }
4212                        __FieldTag::__validate_only => {
4213                            if !fields.insert(__FieldTag::__validate_only) {
4214                                return std::result::Result::Err(A::Error::duplicate_field(
4215                                    "multiple values for validate_only",
4216                                ));
4217                            }
4218                            result.validate_only = map
4219                                .next_value::<std::option::Option<bool>>()?
4220                                .unwrap_or_default();
4221                        }
4222                        __FieldTag::__force => {
4223                            if !fields.insert(__FieldTag::__force) {
4224                                return std::result::Result::Err(A::Error::duplicate_field(
4225                                    "multiple values for force",
4226                                ));
4227                            }
4228                            result.force = map
4229                                .next_value::<std::option::Option<bool>>()?
4230                                .unwrap_or_default();
4231                        }
4232                        __FieldTag::Unknown(key) => {
4233                            let value = map.next_value::<serde_json::Value>()?;
4234                            result._unknown_fields.insert(key, value);
4235                        }
4236                    }
4237                }
4238                std::result::Result::Ok(result)
4239            }
4240        }
4241        deserializer.deserialize_any(Visitor)
4242    }
4243}
4244
4245#[doc(hidden)]
4246impl serde::ser::Serialize for UpdateStreamRequest {
4247    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4248    where
4249        S: serde::ser::Serializer,
4250    {
4251        use serde::ser::SerializeMap;
4252        #[allow(unused_imports)]
4253        use std::option::Option::Some;
4254        let mut state = serializer.serialize_map(std::option::Option::None)?;
4255        if self.update_mask.is_some() {
4256            state.serialize_entry("updateMask", &self.update_mask)?;
4257        }
4258        if self.stream.is_some() {
4259            state.serialize_entry("stream", &self.stream)?;
4260        }
4261        if !self.request_id.is_empty() {
4262            state.serialize_entry("requestId", &self.request_id)?;
4263        }
4264        if !wkt::internal::is_default(&self.validate_only) {
4265            state.serialize_entry("validateOnly", &self.validate_only)?;
4266        }
4267        if !wkt::internal::is_default(&self.force) {
4268            state.serialize_entry("force", &self.force)?;
4269        }
4270        if !self._unknown_fields.is_empty() {
4271            for (key, value) in self._unknown_fields.iter() {
4272                state.serialize_entry(key, &value)?;
4273            }
4274        }
4275        state.end()
4276    }
4277}
4278
4279impl std::fmt::Debug for UpdateStreamRequest {
4280    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4281        let mut debug_struct = f.debug_struct("UpdateStreamRequest");
4282        debug_struct.field("update_mask", &self.update_mask);
4283        debug_struct.field("stream", &self.stream);
4284        debug_struct.field("request_id", &self.request_id);
4285        debug_struct.field("validate_only", &self.validate_only);
4286        debug_struct.field("force", &self.force);
4287        if !self._unknown_fields.is_empty() {
4288            debug_struct.field("_unknown_fields", &self._unknown_fields);
4289        }
4290        debug_struct.finish()
4291    }
4292}
4293
4294/// Request message for deleting a stream.
4295#[derive(Clone, Default, PartialEq)]
4296#[non_exhaustive]
4297pub struct DeleteStreamRequest {
4298    /// Required. The name of the stream resource to delete.
4299    pub name: std::string::String,
4300
4301    /// Optional. A request ID to identify requests. Specify a unique request ID
4302    /// so that if you must retry your request, the server will know to ignore
4303    /// the request if it has already been completed. The server will guarantee
4304    /// that for at least 60 minutes after the first request.
4305    ///
4306    /// For example, consider a situation where you make an initial request and the
4307    /// request times out. If you make the request again with the same request ID,
4308    /// the server can check if original operation with the same request ID was
4309    /// received, and if so, will ignore the second request. This prevents clients
4310    /// from accidentally creating duplicate commitments.
4311    ///
4312    /// The request ID must be a valid UUID with the exception that zero UUID is
4313    /// not supported (00000000-0000-0000-0000-000000000000).
4314    pub request_id: std::string::String,
4315
4316    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4317}
4318
4319impl DeleteStreamRequest {
4320    pub fn new() -> Self {
4321        std::default::Default::default()
4322    }
4323
4324    /// Sets the value of [name][crate::model::DeleteStreamRequest::name].
4325    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4326        self.name = v.into();
4327        self
4328    }
4329
4330    /// Sets the value of [request_id][crate::model::DeleteStreamRequest::request_id].
4331    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4332        self.request_id = v.into();
4333        self
4334    }
4335}
4336
4337impl wkt::message::Message for DeleteStreamRequest {
4338    fn typename() -> &'static str {
4339        "type.googleapis.com/google.cloud.datastream.v1.DeleteStreamRequest"
4340    }
4341}
4342
4343#[doc(hidden)]
4344impl<'de> serde::de::Deserialize<'de> for DeleteStreamRequest {
4345    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4346    where
4347        D: serde::Deserializer<'de>,
4348    {
4349        #[allow(non_camel_case_types)]
4350        #[doc(hidden)]
4351        #[derive(PartialEq, Eq, Hash)]
4352        enum __FieldTag {
4353            __name,
4354            __request_id,
4355            Unknown(std::string::String),
4356        }
4357        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4358            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4359            where
4360                D: serde::Deserializer<'de>,
4361            {
4362                struct Visitor;
4363                impl<'de> serde::de::Visitor<'de> for Visitor {
4364                    type Value = __FieldTag;
4365                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4366                        formatter.write_str("a field name for DeleteStreamRequest")
4367                    }
4368                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4369                    where
4370                        E: serde::de::Error,
4371                    {
4372                        use std::result::Result::Ok;
4373                        use std::string::ToString;
4374                        match value {
4375                            "name" => Ok(__FieldTag::__name),
4376                            "requestId" => Ok(__FieldTag::__request_id),
4377                            "request_id" => Ok(__FieldTag::__request_id),
4378                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4379                        }
4380                    }
4381                }
4382                deserializer.deserialize_identifier(Visitor)
4383            }
4384        }
4385        struct Visitor;
4386        impl<'de> serde::de::Visitor<'de> for Visitor {
4387            type Value = DeleteStreamRequest;
4388            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4389                formatter.write_str("struct DeleteStreamRequest")
4390            }
4391            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4392            where
4393                A: serde::de::MapAccess<'de>,
4394            {
4395                #[allow(unused_imports)]
4396                use serde::de::Error;
4397                use std::option::Option::Some;
4398                let mut fields = std::collections::HashSet::new();
4399                let mut result = Self::Value::new();
4400                while let Some(tag) = map.next_key::<__FieldTag>()? {
4401                    #[allow(clippy::match_single_binding)]
4402                    match tag {
4403                        __FieldTag::__name => {
4404                            if !fields.insert(__FieldTag::__name) {
4405                                return std::result::Result::Err(A::Error::duplicate_field(
4406                                    "multiple values for name",
4407                                ));
4408                            }
4409                            result.name = map
4410                                .next_value::<std::option::Option<std::string::String>>()?
4411                                .unwrap_or_default();
4412                        }
4413                        __FieldTag::__request_id => {
4414                            if !fields.insert(__FieldTag::__request_id) {
4415                                return std::result::Result::Err(A::Error::duplicate_field(
4416                                    "multiple values for request_id",
4417                                ));
4418                            }
4419                            result.request_id = map
4420                                .next_value::<std::option::Option<std::string::String>>()?
4421                                .unwrap_or_default();
4422                        }
4423                        __FieldTag::Unknown(key) => {
4424                            let value = map.next_value::<serde_json::Value>()?;
4425                            result._unknown_fields.insert(key, value);
4426                        }
4427                    }
4428                }
4429                std::result::Result::Ok(result)
4430            }
4431        }
4432        deserializer.deserialize_any(Visitor)
4433    }
4434}
4435
4436#[doc(hidden)]
4437impl serde::ser::Serialize for DeleteStreamRequest {
4438    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4439    where
4440        S: serde::ser::Serializer,
4441    {
4442        use serde::ser::SerializeMap;
4443        #[allow(unused_imports)]
4444        use std::option::Option::Some;
4445        let mut state = serializer.serialize_map(std::option::Option::None)?;
4446        if !self.name.is_empty() {
4447            state.serialize_entry("name", &self.name)?;
4448        }
4449        if !self.request_id.is_empty() {
4450            state.serialize_entry("requestId", &self.request_id)?;
4451        }
4452        if !self._unknown_fields.is_empty() {
4453            for (key, value) in self._unknown_fields.iter() {
4454                state.serialize_entry(key, &value)?;
4455            }
4456        }
4457        state.end()
4458    }
4459}
4460
4461impl std::fmt::Debug for DeleteStreamRequest {
4462    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4463        let mut debug_struct = f.debug_struct("DeleteStreamRequest");
4464        debug_struct.field("name", &self.name);
4465        debug_struct.field("request_id", &self.request_id);
4466        if !self._unknown_fields.is_empty() {
4467            debug_struct.field("_unknown_fields", &self._unknown_fields);
4468        }
4469        debug_struct.finish()
4470    }
4471}
4472
4473/// Request message for running a stream.
4474#[derive(Clone, Default, PartialEq)]
4475#[non_exhaustive]
4476pub struct RunStreamRequest {
4477    /// Required. Name of the stream resource to start, in the format:
4478    /// projects/{project_id}/locations/{location}/streams/{stream_name}
4479    pub name: std::string::String,
4480
4481    /// Optional. The CDC strategy of the stream. If not set, the system's default
4482    /// value will be used.
4483    pub cdc_strategy: std::option::Option<crate::model::CdcStrategy>,
4484
4485    /// Optional. Update the stream without validating it.
4486    pub force: bool,
4487
4488    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4489}
4490
4491impl RunStreamRequest {
4492    pub fn new() -> Self {
4493        std::default::Default::default()
4494    }
4495
4496    /// Sets the value of [name][crate::model::RunStreamRequest::name].
4497    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4498        self.name = v.into();
4499        self
4500    }
4501
4502    /// Sets the value of [cdc_strategy][crate::model::RunStreamRequest::cdc_strategy].
4503    pub fn set_cdc_strategy<T>(mut self, v: T) -> Self
4504    where
4505        T: std::convert::Into<crate::model::CdcStrategy>,
4506    {
4507        self.cdc_strategy = std::option::Option::Some(v.into());
4508        self
4509    }
4510
4511    /// Sets or clears the value of [cdc_strategy][crate::model::RunStreamRequest::cdc_strategy].
4512    pub fn set_or_clear_cdc_strategy<T>(mut self, v: std::option::Option<T>) -> Self
4513    where
4514        T: std::convert::Into<crate::model::CdcStrategy>,
4515    {
4516        self.cdc_strategy = v.map(|x| x.into());
4517        self
4518    }
4519
4520    /// Sets the value of [force][crate::model::RunStreamRequest::force].
4521    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4522        self.force = v.into();
4523        self
4524    }
4525}
4526
4527impl wkt::message::Message for RunStreamRequest {
4528    fn typename() -> &'static str {
4529        "type.googleapis.com/google.cloud.datastream.v1.RunStreamRequest"
4530    }
4531}
4532
4533#[doc(hidden)]
4534impl<'de> serde::de::Deserialize<'de> for RunStreamRequest {
4535    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4536    where
4537        D: serde::Deserializer<'de>,
4538    {
4539        #[allow(non_camel_case_types)]
4540        #[doc(hidden)]
4541        #[derive(PartialEq, Eq, Hash)]
4542        enum __FieldTag {
4543            __name,
4544            __cdc_strategy,
4545            __force,
4546            Unknown(std::string::String),
4547        }
4548        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4549            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4550            where
4551                D: serde::Deserializer<'de>,
4552            {
4553                struct Visitor;
4554                impl<'de> serde::de::Visitor<'de> for Visitor {
4555                    type Value = __FieldTag;
4556                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4557                        formatter.write_str("a field name for RunStreamRequest")
4558                    }
4559                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4560                    where
4561                        E: serde::de::Error,
4562                    {
4563                        use std::result::Result::Ok;
4564                        use std::string::ToString;
4565                        match value {
4566                            "name" => Ok(__FieldTag::__name),
4567                            "cdcStrategy" => Ok(__FieldTag::__cdc_strategy),
4568                            "cdc_strategy" => Ok(__FieldTag::__cdc_strategy),
4569                            "force" => Ok(__FieldTag::__force),
4570                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4571                        }
4572                    }
4573                }
4574                deserializer.deserialize_identifier(Visitor)
4575            }
4576        }
4577        struct Visitor;
4578        impl<'de> serde::de::Visitor<'de> for Visitor {
4579            type Value = RunStreamRequest;
4580            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4581                formatter.write_str("struct RunStreamRequest")
4582            }
4583            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4584            where
4585                A: serde::de::MapAccess<'de>,
4586            {
4587                #[allow(unused_imports)]
4588                use serde::de::Error;
4589                use std::option::Option::Some;
4590                let mut fields = std::collections::HashSet::new();
4591                let mut result = Self::Value::new();
4592                while let Some(tag) = map.next_key::<__FieldTag>()? {
4593                    #[allow(clippy::match_single_binding)]
4594                    match tag {
4595                        __FieldTag::__name => {
4596                            if !fields.insert(__FieldTag::__name) {
4597                                return std::result::Result::Err(A::Error::duplicate_field(
4598                                    "multiple values for name",
4599                                ));
4600                            }
4601                            result.name = map
4602                                .next_value::<std::option::Option<std::string::String>>()?
4603                                .unwrap_or_default();
4604                        }
4605                        __FieldTag::__cdc_strategy => {
4606                            if !fields.insert(__FieldTag::__cdc_strategy) {
4607                                return std::result::Result::Err(A::Error::duplicate_field(
4608                                    "multiple values for cdc_strategy",
4609                                ));
4610                            }
4611                            result.cdc_strategy =
4612                                map.next_value::<std::option::Option<crate::model::CdcStrategy>>()?;
4613                        }
4614                        __FieldTag::__force => {
4615                            if !fields.insert(__FieldTag::__force) {
4616                                return std::result::Result::Err(A::Error::duplicate_field(
4617                                    "multiple values for force",
4618                                ));
4619                            }
4620                            result.force = map
4621                                .next_value::<std::option::Option<bool>>()?
4622                                .unwrap_or_default();
4623                        }
4624                        __FieldTag::Unknown(key) => {
4625                            let value = map.next_value::<serde_json::Value>()?;
4626                            result._unknown_fields.insert(key, value);
4627                        }
4628                    }
4629                }
4630                std::result::Result::Ok(result)
4631            }
4632        }
4633        deserializer.deserialize_any(Visitor)
4634    }
4635}
4636
4637#[doc(hidden)]
4638impl serde::ser::Serialize for RunStreamRequest {
4639    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4640    where
4641        S: serde::ser::Serializer,
4642    {
4643        use serde::ser::SerializeMap;
4644        #[allow(unused_imports)]
4645        use std::option::Option::Some;
4646        let mut state = serializer.serialize_map(std::option::Option::None)?;
4647        if !self.name.is_empty() {
4648            state.serialize_entry("name", &self.name)?;
4649        }
4650        if self.cdc_strategy.is_some() {
4651            state.serialize_entry("cdcStrategy", &self.cdc_strategy)?;
4652        }
4653        if !wkt::internal::is_default(&self.force) {
4654            state.serialize_entry("force", &self.force)?;
4655        }
4656        if !self._unknown_fields.is_empty() {
4657            for (key, value) in self._unknown_fields.iter() {
4658                state.serialize_entry(key, &value)?;
4659            }
4660        }
4661        state.end()
4662    }
4663}
4664
4665impl std::fmt::Debug for RunStreamRequest {
4666    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4667        let mut debug_struct = f.debug_struct("RunStreamRequest");
4668        debug_struct.field("name", &self.name);
4669        debug_struct.field("cdc_strategy", &self.cdc_strategy);
4670        debug_struct.field("force", &self.force);
4671        if !self._unknown_fields.is_empty() {
4672            debug_struct.field("_unknown_fields", &self._unknown_fields);
4673        }
4674        debug_struct.finish()
4675    }
4676}
4677
4678/// Request for fetching a specific stream object.
4679#[derive(Clone, Default, PartialEq)]
4680#[non_exhaustive]
4681pub struct GetStreamObjectRequest {
4682    /// Required. The name of the stream object resource to get.
4683    pub name: std::string::String,
4684
4685    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4686}
4687
4688impl GetStreamObjectRequest {
4689    pub fn new() -> Self {
4690        std::default::Default::default()
4691    }
4692
4693    /// Sets the value of [name][crate::model::GetStreamObjectRequest::name].
4694    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4695        self.name = v.into();
4696        self
4697    }
4698}
4699
4700impl wkt::message::Message for GetStreamObjectRequest {
4701    fn typename() -> &'static str {
4702        "type.googleapis.com/google.cloud.datastream.v1.GetStreamObjectRequest"
4703    }
4704}
4705
4706#[doc(hidden)]
4707impl<'de> serde::de::Deserialize<'de> for GetStreamObjectRequest {
4708    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4709    where
4710        D: serde::Deserializer<'de>,
4711    {
4712        #[allow(non_camel_case_types)]
4713        #[doc(hidden)]
4714        #[derive(PartialEq, Eq, Hash)]
4715        enum __FieldTag {
4716            __name,
4717            Unknown(std::string::String),
4718        }
4719        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4720            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4721            where
4722                D: serde::Deserializer<'de>,
4723            {
4724                struct Visitor;
4725                impl<'de> serde::de::Visitor<'de> for Visitor {
4726                    type Value = __FieldTag;
4727                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4728                        formatter.write_str("a field name for GetStreamObjectRequest")
4729                    }
4730                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4731                    where
4732                        E: serde::de::Error,
4733                    {
4734                        use std::result::Result::Ok;
4735                        use std::string::ToString;
4736                        match value {
4737                            "name" => Ok(__FieldTag::__name),
4738                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4739                        }
4740                    }
4741                }
4742                deserializer.deserialize_identifier(Visitor)
4743            }
4744        }
4745        struct Visitor;
4746        impl<'de> serde::de::Visitor<'de> for Visitor {
4747            type Value = GetStreamObjectRequest;
4748            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4749                formatter.write_str("struct GetStreamObjectRequest")
4750            }
4751            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4752            where
4753                A: serde::de::MapAccess<'de>,
4754            {
4755                #[allow(unused_imports)]
4756                use serde::de::Error;
4757                use std::option::Option::Some;
4758                let mut fields = std::collections::HashSet::new();
4759                let mut result = Self::Value::new();
4760                while let Some(tag) = map.next_key::<__FieldTag>()? {
4761                    #[allow(clippy::match_single_binding)]
4762                    match tag {
4763                        __FieldTag::__name => {
4764                            if !fields.insert(__FieldTag::__name) {
4765                                return std::result::Result::Err(A::Error::duplicate_field(
4766                                    "multiple values for name",
4767                                ));
4768                            }
4769                            result.name = map
4770                                .next_value::<std::option::Option<std::string::String>>()?
4771                                .unwrap_or_default();
4772                        }
4773                        __FieldTag::Unknown(key) => {
4774                            let value = map.next_value::<serde_json::Value>()?;
4775                            result._unknown_fields.insert(key, value);
4776                        }
4777                    }
4778                }
4779                std::result::Result::Ok(result)
4780            }
4781        }
4782        deserializer.deserialize_any(Visitor)
4783    }
4784}
4785
4786#[doc(hidden)]
4787impl serde::ser::Serialize for GetStreamObjectRequest {
4788    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4789    where
4790        S: serde::ser::Serializer,
4791    {
4792        use serde::ser::SerializeMap;
4793        #[allow(unused_imports)]
4794        use std::option::Option::Some;
4795        let mut state = serializer.serialize_map(std::option::Option::None)?;
4796        if !self.name.is_empty() {
4797            state.serialize_entry("name", &self.name)?;
4798        }
4799        if !self._unknown_fields.is_empty() {
4800            for (key, value) in self._unknown_fields.iter() {
4801                state.serialize_entry(key, &value)?;
4802            }
4803        }
4804        state.end()
4805    }
4806}
4807
4808impl std::fmt::Debug for GetStreamObjectRequest {
4809    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4810        let mut debug_struct = f.debug_struct("GetStreamObjectRequest");
4811        debug_struct.field("name", &self.name);
4812        if !self._unknown_fields.is_empty() {
4813            debug_struct.field("_unknown_fields", &self._unknown_fields);
4814        }
4815        debug_struct.finish()
4816    }
4817}
4818
4819/// Request for looking up a specific stream object by its source object
4820/// identifier.
4821#[derive(Clone, Default, PartialEq)]
4822#[non_exhaustive]
4823pub struct LookupStreamObjectRequest {
4824    /// Required. The parent stream that owns the collection of objects.
4825    pub parent: std::string::String,
4826
4827    /// Required. The source object identifier which maps to the stream object.
4828    pub source_object_identifier: std::option::Option<crate::model::SourceObjectIdentifier>,
4829
4830    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4831}
4832
4833impl LookupStreamObjectRequest {
4834    pub fn new() -> Self {
4835        std::default::Default::default()
4836    }
4837
4838    /// Sets the value of [parent][crate::model::LookupStreamObjectRequest::parent].
4839    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4840        self.parent = v.into();
4841        self
4842    }
4843
4844    /// Sets the value of [source_object_identifier][crate::model::LookupStreamObjectRequest::source_object_identifier].
4845    pub fn set_source_object_identifier<T>(mut self, v: T) -> Self
4846    where
4847        T: std::convert::Into<crate::model::SourceObjectIdentifier>,
4848    {
4849        self.source_object_identifier = std::option::Option::Some(v.into());
4850        self
4851    }
4852
4853    /// Sets or clears the value of [source_object_identifier][crate::model::LookupStreamObjectRequest::source_object_identifier].
4854    pub fn set_or_clear_source_object_identifier<T>(mut self, v: std::option::Option<T>) -> Self
4855    where
4856        T: std::convert::Into<crate::model::SourceObjectIdentifier>,
4857    {
4858        self.source_object_identifier = v.map(|x| x.into());
4859        self
4860    }
4861}
4862
4863impl wkt::message::Message for LookupStreamObjectRequest {
4864    fn typename() -> &'static str {
4865        "type.googleapis.com/google.cloud.datastream.v1.LookupStreamObjectRequest"
4866    }
4867}
4868
4869#[doc(hidden)]
4870impl<'de> serde::de::Deserialize<'de> for LookupStreamObjectRequest {
4871    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4872    where
4873        D: serde::Deserializer<'de>,
4874    {
4875        #[allow(non_camel_case_types)]
4876        #[doc(hidden)]
4877        #[derive(PartialEq, Eq, Hash)]
4878        enum __FieldTag {
4879            __parent,
4880            __source_object_identifier,
4881            Unknown(std::string::String),
4882        }
4883        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4884            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4885            where
4886                D: serde::Deserializer<'de>,
4887            {
4888                struct Visitor;
4889                impl<'de> serde::de::Visitor<'de> for Visitor {
4890                    type Value = __FieldTag;
4891                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4892                        formatter.write_str("a field name for LookupStreamObjectRequest")
4893                    }
4894                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4895                    where
4896                        E: serde::de::Error,
4897                    {
4898                        use std::result::Result::Ok;
4899                        use std::string::ToString;
4900                        match value {
4901                            "parent" => Ok(__FieldTag::__parent),
4902                            "sourceObjectIdentifier" => Ok(__FieldTag::__source_object_identifier),
4903                            "source_object_identifier" => {
4904                                Ok(__FieldTag::__source_object_identifier)
4905                            }
4906                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4907                        }
4908                    }
4909                }
4910                deserializer.deserialize_identifier(Visitor)
4911            }
4912        }
4913        struct Visitor;
4914        impl<'de> serde::de::Visitor<'de> for Visitor {
4915            type Value = LookupStreamObjectRequest;
4916            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4917                formatter.write_str("struct LookupStreamObjectRequest")
4918            }
4919            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4920            where
4921                A: serde::de::MapAccess<'de>,
4922            {
4923                #[allow(unused_imports)]
4924                use serde::de::Error;
4925                use std::option::Option::Some;
4926                let mut fields = std::collections::HashSet::new();
4927                let mut result = Self::Value::new();
4928                while let Some(tag) = map.next_key::<__FieldTag>()? {
4929                    #[allow(clippy::match_single_binding)]
4930                    match tag {
4931                        __FieldTag::__parent => {
4932                            if !fields.insert(__FieldTag::__parent) {
4933                                return std::result::Result::Err(A::Error::duplicate_field(
4934                                    "multiple values for parent",
4935                                ));
4936                            }
4937                            result.parent = map
4938                                .next_value::<std::option::Option<std::string::String>>()?
4939                                .unwrap_or_default();
4940                        }
4941                        __FieldTag::__source_object_identifier => {
4942                            if !fields.insert(__FieldTag::__source_object_identifier) {
4943                                return std::result::Result::Err(A::Error::duplicate_field(
4944                                    "multiple values for source_object_identifier",
4945                                ));
4946                            }
4947                            result.source_object_identifier = map.next_value::<std::option::Option<crate::model::SourceObjectIdentifier>>()?
4948                                ;
4949                        }
4950                        __FieldTag::Unknown(key) => {
4951                            let value = map.next_value::<serde_json::Value>()?;
4952                            result._unknown_fields.insert(key, value);
4953                        }
4954                    }
4955                }
4956                std::result::Result::Ok(result)
4957            }
4958        }
4959        deserializer.deserialize_any(Visitor)
4960    }
4961}
4962
4963#[doc(hidden)]
4964impl serde::ser::Serialize for LookupStreamObjectRequest {
4965    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4966    where
4967        S: serde::ser::Serializer,
4968    {
4969        use serde::ser::SerializeMap;
4970        #[allow(unused_imports)]
4971        use std::option::Option::Some;
4972        let mut state = serializer.serialize_map(std::option::Option::None)?;
4973        if !self.parent.is_empty() {
4974            state.serialize_entry("parent", &self.parent)?;
4975        }
4976        if self.source_object_identifier.is_some() {
4977            state.serialize_entry("sourceObjectIdentifier", &self.source_object_identifier)?;
4978        }
4979        if !self._unknown_fields.is_empty() {
4980            for (key, value) in self._unknown_fields.iter() {
4981                state.serialize_entry(key, &value)?;
4982            }
4983        }
4984        state.end()
4985    }
4986}
4987
4988impl std::fmt::Debug for LookupStreamObjectRequest {
4989    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4990        let mut debug_struct = f.debug_struct("LookupStreamObjectRequest");
4991        debug_struct.field("parent", &self.parent);
4992        debug_struct.field("source_object_identifier", &self.source_object_identifier);
4993        if !self._unknown_fields.is_empty() {
4994            debug_struct.field("_unknown_fields", &self._unknown_fields);
4995        }
4996        debug_struct.finish()
4997    }
4998}
4999
5000/// Request for manually initiating a backfill job for a specific stream object.
5001#[derive(Clone, Default, PartialEq)]
5002#[non_exhaustive]
5003pub struct StartBackfillJobRequest {
5004    /// Required. The name of the stream object resource to start a backfill job
5005    /// for.
5006    pub object: std::string::String,
5007
5008    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5009}
5010
5011impl StartBackfillJobRequest {
5012    pub fn new() -> Self {
5013        std::default::Default::default()
5014    }
5015
5016    /// Sets the value of [object][crate::model::StartBackfillJobRequest::object].
5017    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5018        self.object = v.into();
5019        self
5020    }
5021}
5022
5023impl wkt::message::Message for StartBackfillJobRequest {
5024    fn typename() -> &'static str {
5025        "type.googleapis.com/google.cloud.datastream.v1.StartBackfillJobRequest"
5026    }
5027}
5028
5029#[doc(hidden)]
5030impl<'de> serde::de::Deserialize<'de> for StartBackfillJobRequest {
5031    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5032    where
5033        D: serde::Deserializer<'de>,
5034    {
5035        #[allow(non_camel_case_types)]
5036        #[doc(hidden)]
5037        #[derive(PartialEq, Eq, Hash)]
5038        enum __FieldTag {
5039            __object,
5040            Unknown(std::string::String),
5041        }
5042        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5043            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5044            where
5045                D: serde::Deserializer<'de>,
5046            {
5047                struct Visitor;
5048                impl<'de> serde::de::Visitor<'de> for Visitor {
5049                    type Value = __FieldTag;
5050                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5051                        formatter.write_str("a field name for StartBackfillJobRequest")
5052                    }
5053                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5054                    where
5055                        E: serde::de::Error,
5056                    {
5057                        use std::result::Result::Ok;
5058                        use std::string::ToString;
5059                        match value {
5060                            "object" => Ok(__FieldTag::__object),
5061                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5062                        }
5063                    }
5064                }
5065                deserializer.deserialize_identifier(Visitor)
5066            }
5067        }
5068        struct Visitor;
5069        impl<'de> serde::de::Visitor<'de> for Visitor {
5070            type Value = StartBackfillJobRequest;
5071            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5072                formatter.write_str("struct StartBackfillJobRequest")
5073            }
5074            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5075            where
5076                A: serde::de::MapAccess<'de>,
5077            {
5078                #[allow(unused_imports)]
5079                use serde::de::Error;
5080                use std::option::Option::Some;
5081                let mut fields = std::collections::HashSet::new();
5082                let mut result = Self::Value::new();
5083                while let Some(tag) = map.next_key::<__FieldTag>()? {
5084                    #[allow(clippy::match_single_binding)]
5085                    match tag {
5086                        __FieldTag::__object => {
5087                            if !fields.insert(__FieldTag::__object) {
5088                                return std::result::Result::Err(A::Error::duplicate_field(
5089                                    "multiple values for object",
5090                                ));
5091                            }
5092                            result.object = map
5093                                .next_value::<std::option::Option<std::string::String>>()?
5094                                .unwrap_or_default();
5095                        }
5096                        __FieldTag::Unknown(key) => {
5097                            let value = map.next_value::<serde_json::Value>()?;
5098                            result._unknown_fields.insert(key, value);
5099                        }
5100                    }
5101                }
5102                std::result::Result::Ok(result)
5103            }
5104        }
5105        deserializer.deserialize_any(Visitor)
5106    }
5107}
5108
5109#[doc(hidden)]
5110impl serde::ser::Serialize for StartBackfillJobRequest {
5111    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5112    where
5113        S: serde::ser::Serializer,
5114    {
5115        use serde::ser::SerializeMap;
5116        #[allow(unused_imports)]
5117        use std::option::Option::Some;
5118        let mut state = serializer.serialize_map(std::option::Option::None)?;
5119        if !self.object.is_empty() {
5120            state.serialize_entry("object", &self.object)?;
5121        }
5122        if !self._unknown_fields.is_empty() {
5123            for (key, value) in self._unknown_fields.iter() {
5124                state.serialize_entry(key, &value)?;
5125            }
5126        }
5127        state.end()
5128    }
5129}
5130
5131impl std::fmt::Debug for StartBackfillJobRequest {
5132    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5133        let mut debug_struct = f.debug_struct("StartBackfillJobRequest");
5134        debug_struct.field("object", &self.object);
5135        if !self._unknown_fields.is_empty() {
5136            debug_struct.field("_unknown_fields", &self._unknown_fields);
5137        }
5138        debug_struct.finish()
5139    }
5140}
5141
5142/// Response for manually initiating a backfill job for a specific stream object.
5143#[derive(Clone, Default, PartialEq)]
5144#[non_exhaustive]
5145pub struct StartBackfillJobResponse {
5146    /// The stream object resource a backfill job was started for.
5147    pub object: std::option::Option<crate::model::StreamObject>,
5148
5149    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5150}
5151
5152impl StartBackfillJobResponse {
5153    pub fn new() -> Self {
5154        std::default::Default::default()
5155    }
5156
5157    /// Sets the value of [object][crate::model::StartBackfillJobResponse::object].
5158    pub fn set_object<T>(mut self, v: T) -> Self
5159    where
5160        T: std::convert::Into<crate::model::StreamObject>,
5161    {
5162        self.object = std::option::Option::Some(v.into());
5163        self
5164    }
5165
5166    /// Sets or clears the value of [object][crate::model::StartBackfillJobResponse::object].
5167    pub fn set_or_clear_object<T>(mut self, v: std::option::Option<T>) -> Self
5168    where
5169        T: std::convert::Into<crate::model::StreamObject>,
5170    {
5171        self.object = v.map(|x| x.into());
5172        self
5173    }
5174}
5175
5176impl wkt::message::Message for StartBackfillJobResponse {
5177    fn typename() -> &'static str {
5178        "type.googleapis.com/google.cloud.datastream.v1.StartBackfillJobResponse"
5179    }
5180}
5181
5182#[doc(hidden)]
5183impl<'de> serde::de::Deserialize<'de> for StartBackfillJobResponse {
5184    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5185    where
5186        D: serde::Deserializer<'de>,
5187    {
5188        #[allow(non_camel_case_types)]
5189        #[doc(hidden)]
5190        #[derive(PartialEq, Eq, Hash)]
5191        enum __FieldTag {
5192            __object,
5193            Unknown(std::string::String),
5194        }
5195        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5196            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5197            where
5198                D: serde::Deserializer<'de>,
5199            {
5200                struct Visitor;
5201                impl<'de> serde::de::Visitor<'de> for Visitor {
5202                    type Value = __FieldTag;
5203                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5204                        formatter.write_str("a field name for StartBackfillJobResponse")
5205                    }
5206                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5207                    where
5208                        E: serde::de::Error,
5209                    {
5210                        use std::result::Result::Ok;
5211                        use std::string::ToString;
5212                        match value {
5213                            "object" => Ok(__FieldTag::__object),
5214                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5215                        }
5216                    }
5217                }
5218                deserializer.deserialize_identifier(Visitor)
5219            }
5220        }
5221        struct Visitor;
5222        impl<'de> serde::de::Visitor<'de> for Visitor {
5223            type Value = StartBackfillJobResponse;
5224            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5225                formatter.write_str("struct StartBackfillJobResponse")
5226            }
5227            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5228            where
5229                A: serde::de::MapAccess<'de>,
5230            {
5231                #[allow(unused_imports)]
5232                use serde::de::Error;
5233                use std::option::Option::Some;
5234                let mut fields = std::collections::HashSet::new();
5235                let mut result = Self::Value::new();
5236                while let Some(tag) = map.next_key::<__FieldTag>()? {
5237                    #[allow(clippy::match_single_binding)]
5238                    match tag {
5239                        __FieldTag::__object => {
5240                            if !fields.insert(__FieldTag::__object) {
5241                                return std::result::Result::Err(A::Error::duplicate_field(
5242                                    "multiple values for object",
5243                                ));
5244                            }
5245                            result.object = map
5246                                .next_value::<std::option::Option<crate::model::StreamObject>>()?;
5247                        }
5248                        __FieldTag::Unknown(key) => {
5249                            let value = map.next_value::<serde_json::Value>()?;
5250                            result._unknown_fields.insert(key, value);
5251                        }
5252                    }
5253                }
5254                std::result::Result::Ok(result)
5255            }
5256        }
5257        deserializer.deserialize_any(Visitor)
5258    }
5259}
5260
5261#[doc(hidden)]
5262impl serde::ser::Serialize for StartBackfillJobResponse {
5263    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5264    where
5265        S: serde::ser::Serializer,
5266    {
5267        use serde::ser::SerializeMap;
5268        #[allow(unused_imports)]
5269        use std::option::Option::Some;
5270        let mut state = serializer.serialize_map(std::option::Option::None)?;
5271        if self.object.is_some() {
5272            state.serialize_entry("object", &self.object)?;
5273        }
5274        if !self._unknown_fields.is_empty() {
5275            for (key, value) in self._unknown_fields.iter() {
5276                state.serialize_entry(key, &value)?;
5277            }
5278        }
5279        state.end()
5280    }
5281}
5282
5283impl std::fmt::Debug for StartBackfillJobResponse {
5284    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5285        let mut debug_struct = f.debug_struct("StartBackfillJobResponse");
5286        debug_struct.field("object", &self.object);
5287        if !self._unknown_fields.is_empty() {
5288            debug_struct.field("_unknown_fields", &self._unknown_fields);
5289        }
5290        debug_struct.finish()
5291    }
5292}
5293
5294/// Request for manually stopping a running backfill job for a specific stream
5295/// object.
5296#[derive(Clone, Default, PartialEq)]
5297#[non_exhaustive]
5298pub struct StopBackfillJobRequest {
5299    /// Required. The name of the stream object resource to stop the backfill job
5300    /// for.
5301    pub object: std::string::String,
5302
5303    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5304}
5305
5306impl StopBackfillJobRequest {
5307    pub fn new() -> Self {
5308        std::default::Default::default()
5309    }
5310
5311    /// Sets the value of [object][crate::model::StopBackfillJobRequest::object].
5312    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5313        self.object = v.into();
5314        self
5315    }
5316}
5317
5318impl wkt::message::Message for StopBackfillJobRequest {
5319    fn typename() -> &'static str {
5320        "type.googleapis.com/google.cloud.datastream.v1.StopBackfillJobRequest"
5321    }
5322}
5323
5324#[doc(hidden)]
5325impl<'de> serde::de::Deserialize<'de> for StopBackfillJobRequest {
5326    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5327    where
5328        D: serde::Deserializer<'de>,
5329    {
5330        #[allow(non_camel_case_types)]
5331        #[doc(hidden)]
5332        #[derive(PartialEq, Eq, Hash)]
5333        enum __FieldTag {
5334            __object,
5335            Unknown(std::string::String),
5336        }
5337        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5338            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5339            where
5340                D: serde::Deserializer<'de>,
5341            {
5342                struct Visitor;
5343                impl<'de> serde::de::Visitor<'de> for Visitor {
5344                    type Value = __FieldTag;
5345                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5346                        formatter.write_str("a field name for StopBackfillJobRequest")
5347                    }
5348                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5349                    where
5350                        E: serde::de::Error,
5351                    {
5352                        use std::result::Result::Ok;
5353                        use std::string::ToString;
5354                        match value {
5355                            "object" => Ok(__FieldTag::__object),
5356                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5357                        }
5358                    }
5359                }
5360                deserializer.deserialize_identifier(Visitor)
5361            }
5362        }
5363        struct Visitor;
5364        impl<'de> serde::de::Visitor<'de> for Visitor {
5365            type Value = StopBackfillJobRequest;
5366            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5367                formatter.write_str("struct StopBackfillJobRequest")
5368            }
5369            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5370            where
5371                A: serde::de::MapAccess<'de>,
5372            {
5373                #[allow(unused_imports)]
5374                use serde::de::Error;
5375                use std::option::Option::Some;
5376                let mut fields = std::collections::HashSet::new();
5377                let mut result = Self::Value::new();
5378                while let Some(tag) = map.next_key::<__FieldTag>()? {
5379                    #[allow(clippy::match_single_binding)]
5380                    match tag {
5381                        __FieldTag::__object => {
5382                            if !fields.insert(__FieldTag::__object) {
5383                                return std::result::Result::Err(A::Error::duplicate_field(
5384                                    "multiple values for object",
5385                                ));
5386                            }
5387                            result.object = map
5388                                .next_value::<std::option::Option<std::string::String>>()?
5389                                .unwrap_or_default();
5390                        }
5391                        __FieldTag::Unknown(key) => {
5392                            let value = map.next_value::<serde_json::Value>()?;
5393                            result._unknown_fields.insert(key, value);
5394                        }
5395                    }
5396                }
5397                std::result::Result::Ok(result)
5398            }
5399        }
5400        deserializer.deserialize_any(Visitor)
5401    }
5402}
5403
5404#[doc(hidden)]
5405impl serde::ser::Serialize for StopBackfillJobRequest {
5406    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5407    where
5408        S: serde::ser::Serializer,
5409    {
5410        use serde::ser::SerializeMap;
5411        #[allow(unused_imports)]
5412        use std::option::Option::Some;
5413        let mut state = serializer.serialize_map(std::option::Option::None)?;
5414        if !self.object.is_empty() {
5415            state.serialize_entry("object", &self.object)?;
5416        }
5417        if !self._unknown_fields.is_empty() {
5418            for (key, value) in self._unknown_fields.iter() {
5419                state.serialize_entry(key, &value)?;
5420            }
5421        }
5422        state.end()
5423    }
5424}
5425
5426impl std::fmt::Debug for StopBackfillJobRequest {
5427    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5428        let mut debug_struct = f.debug_struct("StopBackfillJobRequest");
5429        debug_struct.field("object", &self.object);
5430        if !self._unknown_fields.is_empty() {
5431            debug_struct.field("_unknown_fields", &self._unknown_fields);
5432        }
5433        debug_struct.finish()
5434    }
5435}
5436
5437/// Response for manually stop a backfill job for a specific stream object.
5438#[derive(Clone, Default, PartialEq)]
5439#[non_exhaustive]
5440pub struct StopBackfillJobResponse {
5441    /// The stream object resource the backfill job was stopped for.
5442    pub object: std::option::Option<crate::model::StreamObject>,
5443
5444    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5445}
5446
5447impl StopBackfillJobResponse {
5448    pub fn new() -> Self {
5449        std::default::Default::default()
5450    }
5451
5452    /// Sets the value of [object][crate::model::StopBackfillJobResponse::object].
5453    pub fn set_object<T>(mut self, v: T) -> Self
5454    where
5455        T: std::convert::Into<crate::model::StreamObject>,
5456    {
5457        self.object = std::option::Option::Some(v.into());
5458        self
5459    }
5460
5461    /// Sets or clears the value of [object][crate::model::StopBackfillJobResponse::object].
5462    pub fn set_or_clear_object<T>(mut self, v: std::option::Option<T>) -> Self
5463    where
5464        T: std::convert::Into<crate::model::StreamObject>,
5465    {
5466        self.object = v.map(|x| x.into());
5467        self
5468    }
5469}
5470
5471impl wkt::message::Message for StopBackfillJobResponse {
5472    fn typename() -> &'static str {
5473        "type.googleapis.com/google.cloud.datastream.v1.StopBackfillJobResponse"
5474    }
5475}
5476
5477#[doc(hidden)]
5478impl<'de> serde::de::Deserialize<'de> for StopBackfillJobResponse {
5479    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5480    where
5481        D: serde::Deserializer<'de>,
5482    {
5483        #[allow(non_camel_case_types)]
5484        #[doc(hidden)]
5485        #[derive(PartialEq, Eq, Hash)]
5486        enum __FieldTag {
5487            __object,
5488            Unknown(std::string::String),
5489        }
5490        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5491            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5492            where
5493                D: serde::Deserializer<'de>,
5494            {
5495                struct Visitor;
5496                impl<'de> serde::de::Visitor<'de> for Visitor {
5497                    type Value = __FieldTag;
5498                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5499                        formatter.write_str("a field name for StopBackfillJobResponse")
5500                    }
5501                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5502                    where
5503                        E: serde::de::Error,
5504                    {
5505                        use std::result::Result::Ok;
5506                        use std::string::ToString;
5507                        match value {
5508                            "object" => Ok(__FieldTag::__object),
5509                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5510                        }
5511                    }
5512                }
5513                deserializer.deserialize_identifier(Visitor)
5514            }
5515        }
5516        struct Visitor;
5517        impl<'de> serde::de::Visitor<'de> for Visitor {
5518            type Value = StopBackfillJobResponse;
5519            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5520                formatter.write_str("struct StopBackfillJobResponse")
5521            }
5522            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5523            where
5524                A: serde::de::MapAccess<'de>,
5525            {
5526                #[allow(unused_imports)]
5527                use serde::de::Error;
5528                use std::option::Option::Some;
5529                let mut fields = std::collections::HashSet::new();
5530                let mut result = Self::Value::new();
5531                while let Some(tag) = map.next_key::<__FieldTag>()? {
5532                    #[allow(clippy::match_single_binding)]
5533                    match tag {
5534                        __FieldTag::__object => {
5535                            if !fields.insert(__FieldTag::__object) {
5536                                return std::result::Result::Err(A::Error::duplicate_field(
5537                                    "multiple values for object",
5538                                ));
5539                            }
5540                            result.object = map
5541                                .next_value::<std::option::Option<crate::model::StreamObject>>()?;
5542                        }
5543                        __FieldTag::Unknown(key) => {
5544                            let value = map.next_value::<serde_json::Value>()?;
5545                            result._unknown_fields.insert(key, value);
5546                        }
5547                    }
5548                }
5549                std::result::Result::Ok(result)
5550            }
5551        }
5552        deserializer.deserialize_any(Visitor)
5553    }
5554}
5555
5556#[doc(hidden)]
5557impl serde::ser::Serialize for StopBackfillJobResponse {
5558    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5559    where
5560        S: serde::ser::Serializer,
5561    {
5562        use serde::ser::SerializeMap;
5563        #[allow(unused_imports)]
5564        use std::option::Option::Some;
5565        let mut state = serializer.serialize_map(std::option::Option::None)?;
5566        if self.object.is_some() {
5567            state.serialize_entry("object", &self.object)?;
5568        }
5569        if !self._unknown_fields.is_empty() {
5570            for (key, value) in self._unknown_fields.iter() {
5571                state.serialize_entry(key, &value)?;
5572            }
5573        }
5574        state.end()
5575    }
5576}
5577
5578impl std::fmt::Debug for StopBackfillJobResponse {
5579    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5580        let mut debug_struct = f.debug_struct("StopBackfillJobResponse");
5581        debug_struct.field("object", &self.object);
5582        if !self._unknown_fields.is_empty() {
5583            debug_struct.field("_unknown_fields", &self._unknown_fields);
5584        }
5585        debug_struct.finish()
5586    }
5587}
5588
5589/// Request for listing all objects for a specific stream.
5590#[derive(Clone, Default, PartialEq)]
5591#[non_exhaustive]
5592pub struct ListStreamObjectsRequest {
5593    /// Required. The parent stream that owns the collection of objects.
5594    pub parent: std::string::String,
5595
5596    /// Maximum number of objects to return. Default is 50.
5597    /// The maximum value is 1000; values above 1000 will be coerced to 1000.
5598    pub page_size: i32,
5599
5600    /// Page token received from a previous `ListStreamObjectsRequest` call.
5601    /// Provide this to retrieve the subsequent page.
5602    ///
5603    /// When paginating, all other parameters provided to
5604    /// `ListStreamObjectsRequest` must match the call that provided the page
5605    /// token.
5606    pub page_token: std::string::String,
5607
5608    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5609}
5610
5611impl ListStreamObjectsRequest {
5612    pub fn new() -> Self {
5613        std::default::Default::default()
5614    }
5615
5616    /// Sets the value of [parent][crate::model::ListStreamObjectsRequest::parent].
5617    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5618        self.parent = v.into();
5619        self
5620    }
5621
5622    /// Sets the value of [page_size][crate::model::ListStreamObjectsRequest::page_size].
5623    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5624        self.page_size = v.into();
5625        self
5626    }
5627
5628    /// Sets the value of [page_token][crate::model::ListStreamObjectsRequest::page_token].
5629    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5630        self.page_token = v.into();
5631        self
5632    }
5633}
5634
5635impl wkt::message::Message for ListStreamObjectsRequest {
5636    fn typename() -> &'static str {
5637        "type.googleapis.com/google.cloud.datastream.v1.ListStreamObjectsRequest"
5638    }
5639}
5640
5641#[doc(hidden)]
5642impl<'de> serde::de::Deserialize<'de> for ListStreamObjectsRequest {
5643    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5644    where
5645        D: serde::Deserializer<'de>,
5646    {
5647        #[allow(non_camel_case_types)]
5648        #[doc(hidden)]
5649        #[derive(PartialEq, Eq, Hash)]
5650        enum __FieldTag {
5651            __parent,
5652            __page_size,
5653            __page_token,
5654            Unknown(std::string::String),
5655        }
5656        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5657            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5658            where
5659                D: serde::Deserializer<'de>,
5660            {
5661                struct Visitor;
5662                impl<'de> serde::de::Visitor<'de> for Visitor {
5663                    type Value = __FieldTag;
5664                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5665                        formatter.write_str("a field name for ListStreamObjectsRequest")
5666                    }
5667                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5668                    where
5669                        E: serde::de::Error,
5670                    {
5671                        use std::result::Result::Ok;
5672                        use std::string::ToString;
5673                        match value {
5674                            "parent" => Ok(__FieldTag::__parent),
5675                            "pageSize" => Ok(__FieldTag::__page_size),
5676                            "page_size" => Ok(__FieldTag::__page_size),
5677                            "pageToken" => Ok(__FieldTag::__page_token),
5678                            "page_token" => Ok(__FieldTag::__page_token),
5679                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5680                        }
5681                    }
5682                }
5683                deserializer.deserialize_identifier(Visitor)
5684            }
5685        }
5686        struct Visitor;
5687        impl<'de> serde::de::Visitor<'de> for Visitor {
5688            type Value = ListStreamObjectsRequest;
5689            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5690                formatter.write_str("struct ListStreamObjectsRequest")
5691            }
5692            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5693            where
5694                A: serde::de::MapAccess<'de>,
5695            {
5696                #[allow(unused_imports)]
5697                use serde::de::Error;
5698                use std::option::Option::Some;
5699                let mut fields = std::collections::HashSet::new();
5700                let mut result = Self::Value::new();
5701                while let Some(tag) = map.next_key::<__FieldTag>()? {
5702                    #[allow(clippy::match_single_binding)]
5703                    match tag {
5704                        __FieldTag::__parent => {
5705                            if !fields.insert(__FieldTag::__parent) {
5706                                return std::result::Result::Err(A::Error::duplicate_field(
5707                                    "multiple values for parent",
5708                                ));
5709                            }
5710                            result.parent = map
5711                                .next_value::<std::option::Option<std::string::String>>()?
5712                                .unwrap_or_default();
5713                        }
5714                        __FieldTag::__page_size => {
5715                            if !fields.insert(__FieldTag::__page_size) {
5716                                return std::result::Result::Err(A::Error::duplicate_field(
5717                                    "multiple values for page_size",
5718                                ));
5719                            }
5720                            struct __With(std::option::Option<i32>);
5721                            impl<'de> serde::de::Deserialize<'de> for __With {
5722                                fn deserialize<D>(
5723                                    deserializer: D,
5724                                ) -> std::result::Result<Self, D::Error>
5725                                where
5726                                    D: serde::de::Deserializer<'de>,
5727                                {
5728                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
5729                                }
5730                            }
5731                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
5732                        }
5733                        __FieldTag::__page_token => {
5734                            if !fields.insert(__FieldTag::__page_token) {
5735                                return std::result::Result::Err(A::Error::duplicate_field(
5736                                    "multiple values for page_token",
5737                                ));
5738                            }
5739                            result.page_token = map
5740                                .next_value::<std::option::Option<std::string::String>>()?
5741                                .unwrap_or_default();
5742                        }
5743                        __FieldTag::Unknown(key) => {
5744                            let value = map.next_value::<serde_json::Value>()?;
5745                            result._unknown_fields.insert(key, value);
5746                        }
5747                    }
5748                }
5749                std::result::Result::Ok(result)
5750            }
5751        }
5752        deserializer.deserialize_any(Visitor)
5753    }
5754}
5755
5756#[doc(hidden)]
5757impl serde::ser::Serialize for ListStreamObjectsRequest {
5758    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5759    where
5760        S: serde::ser::Serializer,
5761    {
5762        use serde::ser::SerializeMap;
5763        #[allow(unused_imports)]
5764        use std::option::Option::Some;
5765        let mut state = serializer.serialize_map(std::option::Option::None)?;
5766        if !self.parent.is_empty() {
5767            state.serialize_entry("parent", &self.parent)?;
5768        }
5769        if !wkt::internal::is_default(&self.page_size) {
5770            struct __With<'a>(&'a i32);
5771            impl<'a> serde::ser::Serialize for __With<'a> {
5772                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5773                where
5774                    S: serde::ser::Serializer,
5775                {
5776                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
5777                }
5778            }
5779            state.serialize_entry("pageSize", &__With(&self.page_size))?;
5780        }
5781        if !self.page_token.is_empty() {
5782            state.serialize_entry("pageToken", &self.page_token)?;
5783        }
5784        if !self._unknown_fields.is_empty() {
5785            for (key, value) in self._unknown_fields.iter() {
5786                state.serialize_entry(key, &value)?;
5787            }
5788        }
5789        state.end()
5790    }
5791}
5792
5793impl std::fmt::Debug for ListStreamObjectsRequest {
5794    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5795        let mut debug_struct = f.debug_struct("ListStreamObjectsRequest");
5796        debug_struct.field("parent", &self.parent);
5797        debug_struct.field("page_size", &self.page_size);
5798        debug_struct.field("page_token", &self.page_token);
5799        if !self._unknown_fields.is_empty() {
5800            debug_struct.field("_unknown_fields", &self._unknown_fields);
5801        }
5802        debug_struct.finish()
5803    }
5804}
5805
5806/// Response containing the objects for a stream.
5807#[derive(Clone, Default, PartialEq)]
5808#[non_exhaustive]
5809pub struct ListStreamObjectsResponse {
5810    /// List of stream objects.
5811    pub stream_objects: std::vec::Vec<crate::model::StreamObject>,
5812
5813    /// A token, which can be sent as `page_token` to retrieve the next page.
5814    pub next_page_token: std::string::String,
5815
5816    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5817}
5818
5819impl ListStreamObjectsResponse {
5820    pub fn new() -> Self {
5821        std::default::Default::default()
5822    }
5823
5824    /// Sets the value of [stream_objects][crate::model::ListStreamObjectsResponse::stream_objects].
5825    pub fn set_stream_objects<T, V>(mut self, v: T) -> Self
5826    where
5827        T: std::iter::IntoIterator<Item = V>,
5828        V: std::convert::Into<crate::model::StreamObject>,
5829    {
5830        use std::iter::Iterator;
5831        self.stream_objects = v.into_iter().map(|i| i.into()).collect();
5832        self
5833    }
5834
5835    /// Sets the value of [next_page_token][crate::model::ListStreamObjectsResponse::next_page_token].
5836    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5837        self.next_page_token = v.into();
5838        self
5839    }
5840}
5841
5842impl wkt::message::Message for ListStreamObjectsResponse {
5843    fn typename() -> &'static str {
5844        "type.googleapis.com/google.cloud.datastream.v1.ListStreamObjectsResponse"
5845    }
5846}
5847
5848#[doc(hidden)]
5849impl gax::paginator::internal::PageableResponse for ListStreamObjectsResponse {
5850    type PageItem = crate::model::StreamObject;
5851
5852    fn items(self) -> std::vec::Vec<Self::PageItem> {
5853        self.stream_objects
5854    }
5855
5856    fn next_page_token(&self) -> std::string::String {
5857        use std::clone::Clone;
5858        self.next_page_token.clone()
5859    }
5860}
5861
5862#[doc(hidden)]
5863impl<'de> serde::de::Deserialize<'de> for ListStreamObjectsResponse {
5864    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5865    where
5866        D: serde::Deserializer<'de>,
5867    {
5868        #[allow(non_camel_case_types)]
5869        #[doc(hidden)]
5870        #[derive(PartialEq, Eq, Hash)]
5871        enum __FieldTag {
5872            __stream_objects,
5873            __next_page_token,
5874            Unknown(std::string::String),
5875        }
5876        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5877            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5878            where
5879                D: serde::Deserializer<'de>,
5880            {
5881                struct Visitor;
5882                impl<'de> serde::de::Visitor<'de> for Visitor {
5883                    type Value = __FieldTag;
5884                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5885                        formatter.write_str("a field name for ListStreamObjectsResponse")
5886                    }
5887                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5888                    where
5889                        E: serde::de::Error,
5890                    {
5891                        use std::result::Result::Ok;
5892                        use std::string::ToString;
5893                        match value {
5894                            "streamObjects" => Ok(__FieldTag::__stream_objects),
5895                            "stream_objects" => Ok(__FieldTag::__stream_objects),
5896                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
5897                            "next_page_token" => Ok(__FieldTag::__next_page_token),
5898                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5899                        }
5900                    }
5901                }
5902                deserializer.deserialize_identifier(Visitor)
5903            }
5904        }
5905        struct Visitor;
5906        impl<'de> serde::de::Visitor<'de> for Visitor {
5907            type Value = ListStreamObjectsResponse;
5908            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5909                formatter.write_str("struct ListStreamObjectsResponse")
5910            }
5911            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5912            where
5913                A: serde::de::MapAccess<'de>,
5914            {
5915                #[allow(unused_imports)]
5916                use serde::de::Error;
5917                use std::option::Option::Some;
5918                let mut fields = std::collections::HashSet::new();
5919                let mut result = Self::Value::new();
5920                while let Some(tag) = map.next_key::<__FieldTag>()? {
5921                    #[allow(clippy::match_single_binding)]
5922                    match tag {
5923                        __FieldTag::__stream_objects => {
5924                            if !fields.insert(__FieldTag::__stream_objects) {
5925                                return std::result::Result::Err(A::Error::duplicate_field(
5926                                    "multiple values for stream_objects",
5927                                ));
5928                            }
5929                            result.stream_objects = map.next_value::<std::option::Option<std::vec::Vec<crate::model::StreamObject>>>()?.unwrap_or_default();
5930                        }
5931                        __FieldTag::__next_page_token => {
5932                            if !fields.insert(__FieldTag::__next_page_token) {
5933                                return std::result::Result::Err(A::Error::duplicate_field(
5934                                    "multiple values for next_page_token",
5935                                ));
5936                            }
5937                            result.next_page_token = map
5938                                .next_value::<std::option::Option<std::string::String>>()?
5939                                .unwrap_or_default();
5940                        }
5941                        __FieldTag::Unknown(key) => {
5942                            let value = map.next_value::<serde_json::Value>()?;
5943                            result._unknown_fields.insert(key, value);
5944                        }
5945                    }
5946                }
5947                std::result::Result::Ok(result)
5948            }
5949        }
5950        deserializer.deserialize_any(Visitor)
5951    }
5952}
5953
5954#[doc(hidden)]
5955impl serde::ser::Serialize for ListStreamObjectsResponse {
5956    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5957    where
5958        S: serde::ser::Serializer,
5959    {
5960        use serde::ser::SerializeMap;
5961        #[allow(unused_imports)]
5962        use std::option::Option::Some;
5963        let mut state = serializer.serialize_map(std::option::Option::None)?;
5964        if !self.stream_objects.is_empty() {
5965            state.serialize_entry("streamObjects", &self.stream_objects)?;
5966        }
5967        if !self.next_page_token.is_empty() {
5968            state.serialize_entry("nextPageToken", &self.next_page_token)?;
5969        }
5970        if !self._unknown_fields.is_empty() {
5971            for (key, value) in self._unknown_fields.iter() {
5972                state.serialize_entry(key, &value)?;
5973            }
5974        }
5975        state.end()
5976    }
5977}
5978
5979impl std::fmt::Debug for ListStreamObjectsResponse {
5980    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5981        let mut debug_struct = f.debug_struct("ListStreamObjectsResponse");
5982        debug_struct.field("stream_objects", &self.stream_objects);
5983        debug_struct.field("next_page_token", &self.next_page_token);
5984        if !self._unknown_fields.is_empty() {
5985            debug_struct.field("_unknown_fields", &self._unknown_fields);
5986        }
5987        debug_struct.finish()
5988    }
5989}
5990
5991/// Represents the metadata of the long-running operation.
5992#[derive(Clone, Default, PartialEq)]
5993#[non_exhaustive]
5994pub struct OperationMetadata {
5995    /// Output only. The time the operation was created.
5996    pub create_time: std::option::Option<wkt::Timestamp>,
5997
5998    /// Output only. The time the operation finished running.
5999    pub end_time: std::option::Option<wkt::Timestamp>,
6000
6001    /// Output only. Server-defined resource path for the target of the operation.
6002    pub target: std::string::String,
6003
6004    /// Output only. Name of the verb executed by the operation.
6005    pub verb: std::string::String,
6006
6007    /// Output only. Human-readable status of the operation, if any.
6008    pub status_message: std::string::String,
6009
6010    /// Output only. Identifies whether the user has requested cancellation
6011    /// of the operation. Operations that have successfully been cancelled
6012    /// have
6013    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
6014    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
6015    /// corresponding to `Code.CANCELLED`.
6016    ///
6017    /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
6018    /// [google.rpc.Status.code]: rpc::model::Status::code
6019    pub requested_cancellation: bool,
6020
6021    /// Output only. API version used to start the operation.
6022    pub api_version: std::string::String,
6023
6024    /// Output only. Results of executed validations if there are any.
6025    pub validation_result: std::option::Option<crate::model::ValidationResult>,
6026
6027    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6028}
6029
6030impl OperationMetadata {
6031    pub fn new() -> Self {
6032        std::default::Default::default()
6033    }
6034
6035    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
6036    pub fn set_create_time<T>(mut self, v: T) -> Self
6037    where
6038        T: std::convert::Into<wkt::Timestamp>,
6039    {
6040        self.create_time = std::option::Option::Some(v.into());
6041        self
6042    }
6043
6044    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
6045    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6046    where
6047        T: std::convert::Into<wkt::Timestamp>,
6048    {
6049        self.create_time = v.map(|x| x.into());
6050        self
6051    }
6052
6053    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
6054    pub fn set_end_time<T>(mut self, v: T) -> Self
6055    where
6056        T: std::convert::Into<wkt::Timestamp>,
6057    {
6058        self.end_time = std::option::Option::Some(v.into());
6059        self
6060    }
6061
6062    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
6063    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
6064    where
6065        T: std::convert::Into<wkt::Timestamp>,
6066    {
6067        self.end_time = v.map(|x| x.into());
6068        self
6069    }
6070
6071    /// Sets the value of [target][crate::model::OperationMetadata::target].
6072    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6073        self.target = v.into();
6074        self
6075    }
6076
6077    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
6078    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6079        self.verb = v.into();
6080        self
6081    }
6082
6083    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
6084    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6085        self.status_message = v.into();
6086        self
6087    }
6088
6089    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
6090    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6091        self.requested_cancellation = v.into();
6092        self
6093    }
6094
6095    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
6096    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6097        self.api_version = v.into();
6098        self
6099    }
6100
6101    /// Sets the value of [validation_result][crate::model::OperationMetadata::validation_result].
6102    pub fn set_validation_result<T>(mut self, v: T) -> Self
6103    where
6104        T: std::convert::Into<crate::model::ValidationResult>,
6105    {
6106        self.validation_result = std::option::Option::Some(v.into());
6107        self
6108    }
6109
6110    /// Sets or clears the value of [validation_result][crate::model::OperationMetadata::validation_result].
6111    pub fn set_or_clear_validation_result<T>(mut self, v: std::option::Option<T>) -> Self
6112    where
6113        T: std::convert::Into<crate::model::ValidationResult>,
6114    {
6115        self.validation_result = v.map(|x| x.into());
6116        self
6117    }
6118}
6119
6120impl wkt::message::Message for OperationMetadata {
6121    fn typename() -> &'static str {
6122        "type.googleapis.com/google.cloud.datastream.v1.OperationMetadata"
6123    }
6124}
6125
6126#[doc(hidden)]
6127impl<'de> serde::de::Deserialize<'de> for OperationMetadata {
6128    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6129    where
6130        D: serde::Deserializer<'de>,
6131    {
6132        #[allow(non_camel_case_types)]
6133        #[doc(hidden)]
6134        #[derive(PartialEq, Eq, Hash)]
6135        enum __FieldTag {
6136            __create_time,
6137            __end_time,
6138            __target,
6139            __verb,
6140            __status_message,
6141            __requested_cancellation,
6142            __api_version,
6143            __validation_result,
6144            Unknown(std::string::String),
6145        }
6146        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6147            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6148            where
6149                D: serde::Deserializer<'de>,
6150            {
6151                struct Visitor;
6152                impl<'de> serde::de::Visitor<'de> for Visitor {
6153                    type Value = __FieldTag;
6154                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6155                        formatter.write_str("a field name for OperationMetadata")
6156                    }
6157                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6158                    where
6159                        E: serde::de::Error,
6160                    {
6161                        use std::result::Result::Ok;
6162                        use std::string::ToString;
6163                        match value {
6164                            "createTime" => Ok(__FieldTag::__create_time),
6165                            "create_time" => Ok(__FieldTag::__create_time),
6166                            "endTime" => Ok(__FieldTag::__end_time),
6167                            "end_time" => Ok(__FieldTag::__end_time),
6168                            "target" => Ok(__FieldTag::__target),
6169                            "verb" => Ok(__FieldTag::__verb),
6170                            "statusMessage" => Ok(__FieldTag::__status_message),
6171                            "status_message" => Ok(__FieldTag::__status_message),
6172                            "requestedCancellation" => Ok(__FieldTag::__requested_cancellation),
6173                            "requested_cancellation" => Ok(__FieldTag::__requested_cancellation),
6174                            "apiVersion" => Ok(__FieldTag::__api_version),
6175                            "api_version" => Ok(__FieldTag::__api_version),
6176                            "validationResult" => Ok(__FieldTag::__validation_result),
6177                            "validation_result" => Ok(__FieldTag::__validation_result),
6178                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6179                        }
6180                    }
6181                }
6182                deserializer.deserialize_identifier(Visitor)
6183            }
6184        }
6185        struct Visitor;
6186        impl<'de> serde::de::Visitor<'de> for Visitor {
6187            type Value = OperationMetadata;
6188            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6189                formatter.write_str("struct OperationMetadata")
6190            }
6191            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6192            where
6193                A: serde::de::MapAccess<'de>,
6194            {
6195                #[allow(unused_imports)]
6196                use serde::de::Error;
6197                use std::option::Option::Some;
6198                let mut fields = std::collections::HashSet::new();
6199                let mut result = Self::Value::new();
6200                while let Some(tag) = map.next_key::<__FieldTag>()? {
6201                    #[allow(clippy::match_single_binding)]
6202                    match tag {
6203                        __FieldTag::__create_time => {
6204                            if !fields.insert(__FieldTag::__create_time) {
6205                                return std::result::Result::Err(A::Error::duplicate_field(
6206                                    "multiple values for create_time",
6207                                ));
6208                            }
6209                            result.create_time =
6210                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
6211                        }
6212                        __FieldTag::__end_time => {
6213                            if !fields.insert(__FieldTag::__end_time) {
6214                                return std::result::Result::Err(A::Error::duplicate_field(
6215                                    "multiple values for end_time",
6216                                ));
6217                            }
6218                            result.end_time =
6219                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
6220                        }
6221                        __FieldTag::__target => {
6222                            if !fields.insert(__FieldTag::__target) {
6223                                return std::result::Result::Err(A::Error::duplicate_field(
6224                                    "multiple values for target",
6225                                ));
6226                            }
6227                            result.target = map
6228                                .next_value::<std::option::Option<std::string::String>>()?
6229                                .unwrap_or_default();
6230                        }
6231                        __FieldTag::__verb => {
6232                            if !fields.insert(__FieldTag::__verb) {
6233                                return std::result::Result::Err(A::Error::duplicate_field(
6234                                    "multiple values for verb",
6235                                ));
6236                            }
6237                            result.verb = map
6238                                .next_value::<std::option::Option<std::string::String>>()?
6239                                .unwrap_or_default();
6240                        }
6241                        __FieldTag::__status_message => {
6242                            if !fields.insert(__FieldTag::__status_message) {
6243                                return std::result::Result::Err(A::Error::duplicate_field(
6244                                    "multiple values for status_message",
6245                                ));
6246                            }
6247                            result.status_message = map
6248                                .next_value::<std::option::Option<std::string::String>>()?
6249                                .unwrap_or_default();
6250                        }
6251                        __FieldTag::__requested_cancellation => {
6252                            if !fields.insert(__FieldTag::__requested_cancellation) {
6253                                return std::result::Result::Err(A::Error::duplicate_field(
6254                                    "multiple values for requested_cancellation",
6255                                ));
6256                            }
6257                            result.requested_cancellation = map
6258                                .next_value::<std::option::Option<bool>>()?
6259                                .unwrap_or_default();
6260                        }
6261                        __FieldTag::__api_version => {
6262                            if !fields.insert(__FieldTag::__api_version) {
6263                                return std::result::Result::Err(A::Error::duplicate_field(
6264                                    "multiple values for api_version",
6265                                ));
6266                            }
6267                            result.api_version = map
6268                                .next_value::<std::option::Option<std::string::String>>()?
6269                                .unwrap_or_default();
6270                        }
6271                        __FieldTag::__validation_result => {
6272                            if !fields.insert(__FieldTag::__validation_result) {
6273                                return std::result::Result::Err(A::Error::duplicate_field(
6274                                    "multiple values for validation_result",
6275                                ));
6276                            }
6277                            result.validation_result = map
6278                                .next_value::<std::option::Option<crate::model::ValidationResult>>(
6279                                )?;
6280                        }
6281                        __FieldTag::Unknown(key) => {
6282                            let value = map.next_value::<serde_json::Value>()?;
6283                            result._unknown_fields.insert(key, value);
6284                        }
6285                    }
6286                }
6287                std::result::Result::Ok(result)
6288            }
6289        }
6290        deserializer.deserialize_any(Visitor)
6291    }
6292}
6293
6294#[doc(hidden)]
6295impl serde::ser::Serialize for OperationMetadata {
6296    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6297    where
6298        S: serde::ser::Serializer,
6299    {
6300        use serde::ser::SerializeMap;
6301        #[allow(unused_imports)]
6302        use std::option::Option::Some;
6303        let mut state = serializer.serialize_map(std::option::Option::None)?;
6304        if self.create_time.is_some() {
6305            state.serialize_entry("createTime", &self.create_time)?;
6306        }
6307        if self.end_time.is_some() {
6308            state.serialize_entry("endTime", &self.end_time)?;
6309        }
6310        if !self.target.is_empty() {
6311            state.serialize_entry("target", &self.target)?;
6312        }
6313        if !self.verb.is_empty() {
6314            state.serialize_entry("verb", &self.verb)?;
6315        }
6316        if !self.status_message.is_empty() {
6317            state.serialize_entry("statusMessage", &self.status_message)?;
6318        }
6319        if !wkt::internal::is_default(&self.requested_cancellation) {
6320            state.serialize_entry("requestedCancellation", &self.requested_cancellation)?;
6321        }
6322        if !self.api_version.is_empty() {
6323            state.serialize_entry("apiVersion", &self.api_version)?;
6324        }
6325        if self.validation_result.is_some() {
6326            state.serialize_entry("validationResult", &self.validation_result)?;
6327        }
6328        if !self._unknown_fields.is_empty() {
6329            for (key, value) in self._unknown_fields.iter() {
6330                state.serialize_entry(key, &value)?;
6331            }
6332        }
6333        state.end()
6334    }
6335}
6336
6337impl std::fmt::Debug for OperationMetadata {
6338    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6339        let mut debug_struct = f.debug_struct("OperationMetadata");
6340        debug_struct.field("create_time", &self.create_time);
6341        debug_struct.field("end_time", &self.end_time);
6342        debug_struct.field("target", &self.target);
6343        debug_struct.field("verb", &self.verb);
6344        debug_struct.field("status_message", &self.status_message);
6345        debug_struct.field("requested_cancellation", &self.requested_cancellation);
6346        debug_struct.field("api_version", &self.api_version);
6347        debug_struct.field("validation_result", &self.validation_result);
6348        if !self._unknown_fields.is_empty() {
6349            debug_struct.field("_unknown_fields", &self._unknown_fields);
6350        }
6351        debug_struct.finish()
6352    }
6353}
6354
6355/// Request for creating a private connection.
6356#[derive(Clone, Default, PartialEq)]
6357#[non_exhaustive]
6358pub struct CreatePrivateConnectionRequest {
6359    /// Required. The parent that owns the collection of PrivateConnections.
6360    pub parent: std::string::String,
6361
6362    /// Required. The private connectivity identifier.
6363    pub private_connection_id: std::string::String,
6364
6365    /// Required. The Private Connectivity resource to create.
6366    pub private_connection: std::option::Option<crate::model::PrivateConnection>,
6367
6368    /// Optional. A request ID to identify requests. Specify a unique request ID
6369    /// so that if you must retry your request, the server will know to ignore
6370    /// the request if it has already been completed. The server will guarantee
6371    /// that for at least 60 minutes since the first request.
6372    ///
6373    /// For example, consider a situation where you make an initial request and the
6374    /// request times out. If you make the request again with the same request ID,
6375    /// the server can check if original operation with the same request ID was
6376    /// received, and if so, will ignore the second request. This prevents clients
6377    /// from accidentally creating duplicate commitments.
6378    ///
6379    /// The request ID must be a valid UUID with the exception that zero UUID is
6380    /// not supported (00000000-0000-0000-0000-000000000000).
6381    pub request_id: std::string::String,
6382
6383    /// Optional. If set to true, will skip validations.
6384    pub force: bool,
6385
6386    /// Optional. When supplied with PSC Interface config, will get/create the
6387    /// tenant project required for the customer to allow list and won't actually
6388    /// create the private connection.
6389    pub validate_only: bool,
6390
6391    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6392}
6393
6394impl CreatePrivateConnectionRequest {
6395    pub fn new() -> Self {
6396        std::default::Default::default()
6397    }
6398
6399    /// Sets the value of [parent][crate::model::CreatePrivateConnectionRequest::parent].
6400    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6401        self.parent = v.into();
6402        self
6403    }
6404
6405    /// Sets the value of [private_connection_id][crate::model::CreatePrivateConnectionRequest::private_connection_id].
6406    pub fn set_private_connection_id<T: std::convert::Into<std::string::String>>(
6407        mut self,
6408        v: T,
6409    ) -> Self {
6410        self.private_connection_id = v.into();
6411        self
6412    }
6413
6414    /// Sets the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
6415    pub fn set_private_connection<T>(mut self, v: T) -> Self
6416    where
6417        T: std::convert::Into<crate::model::PrivateConnection>,
6418    {
6419        self.private_connection = std::option::Option::Some(v.into());
6420        self
6421    }
6422
6423    /// Sets or clears the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
6424    pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
6425    where
6426        T: std::convert::Into<crate::model::PrivateConnection>,
6427    {
6428        self.private_connection = v.map(|x| x.into());
6429        self
6430    }
6431
6432    /// Sets the value of [request_id][crate::model::CreatePrivateConnectionRequest::request_id].
6433    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6434        self.request_id = v.into();
6435        self
6436    }
6437
6438    /// Sets the value of [force][crate::model::CreatePrivateConnectionRequest::force].
6439    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6440        self.force = v.into();
6441        self
6442    }
6443
6444    /// Sets the value of [validate_only][crate::model::CreatePrivateConnectionRequest::validate_only].
6445    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6446        self.validate_only = v.into();
6447        self
6448    }
6449}
6450
6451impl wkt::message::Message for CreatePrivateConnectionRequest {
6452    fn typename() -> &'static str {
6453        "type.googleapis.com/google.cloud.datastream.v1.CreatePrivateConnectionRequest"
6454    }
6455}
6456
6457#[doc(hidden)]
6458impl<'de> serde::de::Deserialize<'de> for CreatePrivateConnectionRequest {
6459    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6460    where
6461        D: serde::Deserializer<'de>,
6462    {
6463        #[allow(non_camel_case_types)]
6464        #[doc(hidden)]
6465        #[derive(PartialEq, Eq, Hash)]
6466        enum __FieldTag {
6467            __parent,
6468            __private_connection_id,
6469            __private_connection,
6470            __request_id,
6471            __force,
6472            __validate_only,
6473            Unknown(std::string::String),
6474        }
6475        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6476            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6477            where
6478                D: serde::Deserializer<'de>,
6479            {
6480                struct Visitor;
6481                impl<'de> serde::de::Visitor<'de> for Visitor {
6482                    type Value = __FieldTag;
6483                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6484                        formatter.write_str("a field name for CreatePrivateConnectionRequest")
6485                    }
6486                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6487                    where
6488                        E: serde::de::Error,
6489                    {
6490                        use std::result::Result::Ok;
6491                        use std::string::ToString;
6492                        match value {
6493                            "parent" => Ok(__FieldTag::__parent),
6494                            "privateConnectionId" => Ok(__FieldTag::__private_connection_id),
6495                            "private_connection_id" => Ok(__FieldTag::__private_connection_id),
6496                            "privateConnection" => Ok(__FieldTag::__private_connection),
6497                            "private_connection" => Ok(__FieldTag::__private_connection),
6498                            "requestId" => Ok(__FieldTag::__request_id),
6499                            "request_id" => Ok(__FieldTag::__request_id),
6500                            "force" => Ok(__FieldTag::__force),
6501                            "validateOnly" => Ok(__FieldTag::__validate_only),
6502                            "validate_only" => Ok(__FieldTag::__validate_only),
6503                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6504                        }
6505                    }
6506                }
6507                deserializer.deserialize_identifier(Visitor)
6508            }
6509        }
6510        struct Visitor;
6511        impl<'de> serde::de::Visitor<'de> for Visitor {
6512            type Value = CreatePrivateConnectionRequest;
6513            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6514                formatter.write_str("struct CreatePrivateConnectionRequest")
6515            }
6516            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6517            where
6518                A: serde::de::MapAccess<'de>,
6519            {
6520                #[allow(unused_imports)]
6521                use serde::de::Error;
6522                use std::option::Option::Some;
6523                let mut fields = std::collections::HashSet::new();
6524                let mut result = Self::Value::new();
6525                while let Some(tag) = map.next_key::<__FieldTag>()? {
6526                    #[allow(clippy::match_single_binding)]
6527                    match tag {
6528                        __FieldTag::__parent => {
6529                            if !fields.insert(__FieldTag::__parent) {
6530                                return std::result::Result::Err(A::Error::duplicate_field(
6531                                    "multiple values for parent",
6532                                ));
6533                            }
6534                            result.parent = map
6535                                .next_value::<std::option::Option<std::string::String>>()?
6536                                .unwrap_or_default();
6537                        }
6538                        __FieldTag::__private_connection_id => {
6539                            if !fields.insert(__FieldTag::__private_connection_id) {
6540                                return std::result::Result::Err(A::Error::duplicate_field(
6541                                    "multiple values for private_connection_id",
6542                                ));
6543                            }
6544                            result.private_connection_id = map
6545                                .next_value::<std::option::Option<std::string::String>>()?
6546                                .unwrap_or_default();
6547                        }
6548                        __FieldTag::__private_connection => {
6549                            if !fields.insert(__FieldTag::__private_connection) {
6550                                return std::result::Result::Err(A::Error::duplicate_field(
6551                                    "multiple values for private_connection",
6552                                ));
6553                            }
6554                            result.private_connection = map
6555                                .next_value::<std::option::Option<crate::model::PrivateConnection>>(
6556                                )?;
6557                        }
6558                        __FieldTag::__request_id => {
6559                            if !fields.insert(__FieldTag::__request_id) {
6560                                return std::result::Result::Err(A::Error::duplicate_field(
6561                                    "multiple values for request_id",
6562                                ));
6563                            }
6564                            result.request_id = map
6565                                .next_value::<std::option::Option<std::string::String>>()?
6566                                .unwrap_or_default();
6567                        }
6568                        __FieldTag::__force => {
6569                            if !fields.insert(__FieldTag::__force) {
6570                                return std::result::Result::Err(A::Error::duplicate_field(
6571                                    "multiple values for force",
6572                                ));
6573                            }
6574                            result.force = map
6575                                .next_value::<std::option::Option<bool>>()?
6576                                .unwrap_or_default();
6577                        }
6578                        __FieldTag::__validate_only => {
6579                            if !fields.insert(__FieldTag::__validate_only) {
6580                                return std::result::Result::Err(A::Error::duplicate_field(
6581                                    "multiple values for validate_only",
6582                                ));
6583                            }
6584                            result.validate_only = map
6585                                .next_value::<std::option::Option<bool>>()?
6586                                .unwrap_or_default();
6587                        }
6588                        __FieldTag::Unknown(key) => {
6589                            let value = map.next_value::<serde_json::Value>()?;
6590                            result._unknown_fields.insert(key, value);
6591                        }
6592                    }
6593                }
6594                std::result::Result::Ok(result)
6595            }
6596        }
6597        deserializer.deserialize_any(Visitor)
6598    }
6599}
6600
6601#[doc(hidden)]
6602impl serde::ser::Serialize for CreatePrivateConnectionRequest {
6603    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6604    where
6605        S: serde::ser::Serializer,
6606    {
6607        use serde::ser::SerializeMap;
6608        #[allow(unused_imports)]
6609        use std::option::Option::Some;
6610        let mut state = serializer.serialize_map(std::option::Option::None)?;
6611        if !self.parent.is_empty() {
6612            state.serialize_entry("parent", &self.parent)?;
6613        }
6614        if !self.private_connection_id.is_empty() {
6615            state.serialize_entry("privateConnectionId", &self.private_connection_id)?;
6616        }
6617        if self.private_connection.is_some() {
6618            state.serialize_entry("privateConnection", &self.private_connection)?;
6619        }
6620        if !self.request_id.is_empty() {
6621            state.serialize_entry("requestId", &self.request_id)?;
6622        }
6623        if !wkt::internal::is_default(&self.force) {
6624            state.serialize_entry("force", &self.force)?;
6625        }
6626        if !wkt::internal::is_default(&self.validate_only) {
6627            state.serialize_entry("validateOnly", &self.validate_only)?;
6628        }
6629        if !self._unknown_fields.is_empty() {
6630            for (key, value) in self._unknown_fields.iter() {
6631                state.serialize_entry(key, &value)?;
6632            }
6633        }
6634        state.end()
6635    }
6636}
6637
6638impl std::fmt::Debug for CreatePrivateConnectionRequest {
6639    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6640        let mut debug_struct = f.debug_struct("CreatePrivateConnectionRequest");
6641        debug_struct.field("parent", &self.parent);
6642        debug_struct.field("private_connection_id", &self.private_connection_id);
6643        debug_struct.field("private_connection", &self.private_connection);
6644        debug_struct.field("request_id", &self.request_id);
6645        debug_struct.field("force", &self.force);
6646        debug_struct.field("validate_only", &self.validate_only);
6647        if !self._unknown_fields.is_empty() {
6648            debug_struct.field("_unknown_fields", &self._unknown_fields);
6649        }
6650        debug_struct.finish()
6651    }
6652}
6653
6654/// Request for listing private connections.
6655#[derive(Clone, Default, PartialEq)]
6656#[non_exhaustive]
6657pub struct ListPrivateConnectionsRequest {
6658    /// Required. The parent that owns the collection of private connectivity
6659    /// configurations.
6660    pub parent: std::string::String,
6661
6662    /// Maximum number of private connectivity configurations to return.
6663    /// If unspecified, at most 50 private connectivity configurations that will be
6664    /// returned. The maximum value is 1000; values above 1000 will be coerced to
6665    /// 1000.
6666    pub page_size: i32,
6667
6668    /// Page token received from a previous `ListPrivateConnections` call.
6669    /// Provide this to retrieve the subsequent page.
6670    ///
6671    /// When paginating, all other parameters provided to
6672    /// `ListPrivateConnections` must match the call that provided the page
6673    /// token.
6674    pub page_token: std::string::String,
6675
6676    /// Filter request.
6677    pub filter: std::string::String,
6678
6679    /// Order by fields for the result.
6680    pub order_by: std::string::String,
6681
6682    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6683}
6684
6685impl ListPrivateConnectionsRequest {
6686    pub fn new() -> Self {
6687        std::default::Default::default()
6688    }
6689
6690    /// Sets the value of [parent][crate::model::ListPrivateConnectionsRequest::parent].
6691    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6692        self.parent = v.into();
6693        self
6694    }
6695
6696    /// Sets the value of [page_size][crate::model::ListPrivateConnectionsRequest::page_size].
6697    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6698        self.page_size = v.into();
6699        self
6700    }
6701
6702    /// Sets the value of [page_token][crate::model::ListPrivateConnectionsRequest::page_token].
6703    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6704        self.page_token = v.into();
6705        self
6706    }
6707
6708    /// Sets the value of [filter][crate::model::ListPrivateConnectionsRequest::filter].
6709    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6710        self.filter = v.into();
6711        self
6712    }
6713
6714    /// Sets the value of [order_by][crate::model::ListPrivateConnectionsRequest::order_by].
6715    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6716        self.order_by = v.into();
6717        self
6718    }
6719}
6720
6721impl wkt::message::Message for ListPrivateConnectionsRequest {
6722    fn typename() -> &'static str {
6723        "type.googleapis.com/google.cloud.datastream.v1.ListPrivateConnectionsRequest"
6724    }
6725}
6726
6727#[doc(hidden)]
6728impl<'de> serde::de::Deserialize<'de> for ListPrivateConnectionsRequest {
6729    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6730    where
6731        D: serde::Deserializer<'de>,
6732    {
6733        #[allow(non_camel_case_types)]
6734        #[doc(hidden)]
6735        #[derive(PartialEq, Eq, Hash)]
6736        enum __FieldTag {
6737            __parent,
6738            __page_size,
6739            __page_token,
6740            __filter,
6741            __order_by,
6742            Unknown(std::string::String),
6743        }
6744        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6745            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6746            where
6747                D: serde::Deserializer<'de>,
6748            {
6749                struct Visitor;
6750                impl<'de> serde::de::Visitor<'de> for Visitor {
6751                    type Value = __FieldTag;
6752                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6753                        formatter.write_str("a field name for ListPrivateConnectionsRequest")
6754                    }
6755                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6756                    where
6757                        E: serde::de::Error,
6758                    {
6759                        use std::result::Result::Ok;
6760                        use std::string::ToString;
6761                        match value {
6762                            "parent" => Ok(__FieldTag::__parent),
6763                            "pageSize" => Ok(__FieldTag::__page_size),
6764                            "page_size" => Ok(__FieldTag::__page_size),
6765                            "pageToken" => Ok(__FieldTag::__page_token),
6766                            "page_token" => Ok(__FieldTag::__page_token),
6767                            "filter" => Ok(__FieldTag::__filter),
6768                            "orderBy" => Ok(__FieldTag::__order_by),
6769                            "order_by" => Ok(__FieldTag::__order_by),
6770                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6771                        }
6772                    }
6773                }
6774                deserializer.deserialize_identifier(Visitor)
6775            }
6776        }
6777        struct Visitor;
6778        impl<'de> serde::de::Visitor<'de> for Visitor {
6779            type Value = ListPrivateConnectionsRequest;
6780            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6781                formatter.write_str("struct ListPrivateConnectionsRequest")
6782            }
6783            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6784            where
6785                A: serde::de::MapAccess<'de>,
6786            {
6787                #[allow(unused_imports)]
6788                use serde::de::Error;
6789                use std::option::Option::Some;
6790                let mut fields = std::collections::HashSet::new();
6791                let mut result = Self::Value::new();
6792                while let Some(tag) = map.next_key::<__FieldTag>()? {
6793                    #[allow(clippy::match_single_binding)]
6794                    match tag {
6795                        __FieldTag::__parent => {
6796                            if !fields.insert(__FieldTag::__parent) {
6797                                return std::result::Result::Err(A::Error::duplicate_field(
6798                                    "multiple values for parent",
6799                                ));
6800                            }
6801                            result.parent = map
6802                                .next_value::<std::option::Option<std::string::String>>()?
6803                                .unwrap_or_default();
6804                        }
6805                        __FieldTag::__page_size => {
6806                            if !fields.insert(__FieldTag::__page_size) {
6807                                return std::result::Result::Err(A::Error::duplicate_field(
6808                                    "multiple values for page_size",
6809                                ));
6810                            }
6811                            struct __With(std::option::Option<i32>);
6812                            impl<'de> serde::de::Deserialize<'de> for __With {
6813                                fn deserialize<D>(
6814                                    deserializer: D,
6815                                ) -> std::result::Result<Self, D::Error>
6816                                where
6817                                    D: serde::de::Deserializer<'de>,
6818                                {
6819                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
6820                                }
6821                            }
6822                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
6823                        }
6824                        __FieldTag::__page_token => {
6825                            if !fields.insert(__FieldTag::__page_token) {
6826                                return std::result::Result::Err(A::Error::duplicate_field(
6827                                    "multiple values for page_token",
6828                                ));
6829                            }
6830                            result.page_token = map
6831                                .next_value::<std::option::Option<std::string::String>>()?
6832                                .unwrap_or_default();
6833                        }
6834                        __FieldTag::__filter => {
6835                            if !fields.insert(__FieldTag::__filter) {
6836                                return std::result::Result::Err(A::Error::duplicate_field(
6837                                    "multiple values for filter",
6838                                ));
6839                            }
6840                            result.filter = map
6841                                .next_value::<std::option::Option<std::string::String>>()?
6842                                .unwrap_or_default();
6843                        }
6844                        __FieldTag::__order_by => {
6845                            if !fields.insert(__FieldTag::__order_by) {
6846                                return std::result::Result::Err(A::Error::duplicate_field(
6847                                    "multiple values for order_by",
6848                                ));
6849                            }
6850                            result.order_by = map
6851                                .next_value::<std::option::Option<std::string::String>>()?
6852                                .unwrap_or_default();
6853                        }
6854                        __FieldTag::Unknown(key) => {
6855                            let value = map.next_value::<serde_json::Value>()?;
6856                            result._unknown_fields.insert(key, value);
6857                        }
6858                    }
6859                }
6860                std::result::Result::Ok(result)
6861            }
6862        }
6863        deserializer.deserialize_any(Visitor)
6864    }
6865}
6866
6867#[doc(hidden)]
6868impl serde::ser::Serialize for ListPrivateConnectionsRequest {
6869    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6870    where
6871        S: serde::ser::Serializer,
6872    {
6873        use serde::ser::SerializeMap;
6874        #[allow(unused_imports)]
6875        use std::option::Option::Some;
6876        let mut state = serializer.serialize_map(std::option::Option::None)?;
6877        if !self.parent.is_empty() {
6878            state.serialize_entry("parent", &self.parent)?;
6879        }
6880        if !wkt::internal::is_default(&self.page_size) {
6881            struct __With<'a>(&'a i32);
6882            impl<'a> serde::ser::Serialize for __With<'a> {
6883                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6884                where
6885                    S: serde::ser::Serializer,
6886                {
6887                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
6888                }
6889            }
6890            state.serialize_entry("pageSize", &__With(&self.page_size))?;
6891        }
6892        if !self.page_token.is_empty() {
6893            state.serialize_entry("pageToken", &self.page_token)?;
6894        }
6895        if !self.filter.is_empty() {
6896            state.serialize_entry("filter", &self.filter)?;
6897        }
6898        if !self.order_by.is_empty() {
6899            state.serialize_entry("orderBy", &self.order_by)?;
6900        }
6901        if !self._unknown_fields.is_empty() {
6902            for (key, value) in self._unknown_fields.iter() {
6903                state.serialize_entry(key, &value)?;
6904            }
6905        }
6906        state.end()
6907    }
6908}
6909
6910impl std::fmt::Debug for ListPrivateConnectionsRequest {
6911    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6912        let mut debug_struct = f.debug_struct("ListPrivateConnectionsRequest");
6913        debug_struct.field("parent", &self.parent);
6914        debug_struct.field("page_size", &self.page_size);
6915        debug_struct.field("page_token", &self.page_token);
6916        debug_struct.field("filter", &self.filter);
6917        debug_struct.field("order_by", &self.order_by);
6918        if !self._unknown_fields.is_empty() {
6919            debug_struct.field("_unknown_fields", &self._unknown_fields);
6920        }
6921        debug_struct.finish()
6922    }
6923}
6924
6925/// Response containing a list of private connection configurations.
6926#[derive(Clone, Default, PartialEq)]
6927#[non_exhaustive]
6928pub struct ListPrivateConnectionsResponse {
6929    /// List of private connectivity configurations.
6930    pub private_connections: std::vec::Vec<crate::model::PrivateConnection>,
6931
6932    /// A token, which can be sent as `page_token` to retrieve the next page.
6933    /// If this field is omitted, there are no subsequent pages.
6934    pub next_page_token: std::string::String,
6935
6936    /// Locations that could not be reached.
6937    pub unreachable: std::vec::Vec<std::string::String>,
6938
6939    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6940}
6941
6942impl ListPrivateConnectionsResponse {
6943    pub fn new() -> Self {
6944        std::default::Default::default()
6945    }
6946
6947    /// Sets the value of [private_connections][crate::model::ListPrivateConnectionsResponse::private_connections].
6948    pub fn set_private_connections<T, V>(mut self, v: T) -> Self
6949    where
6950        T: std::iter::IntoIterator<Item = V>,
6951        V: std::convert::Into<crate::model::PrivateConnection>,
6952    {
6953        use std::iter::Iterator;
6954        self.private_connections = v.into_iter().map(|i| i.into()).collect();
6955        self
6956    }
6957
6958    /// Sets the value of [next_page_token][crate::model::ListPrivateConnectionsResponse::next_page_token].
6959    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6960        self.next_page_token = v.into();
6961        self
6962    }
6963
6964    /// Sets the value of [unreachable][crate::model::ListPrivateConnectionsResponse::unreachable].
6965    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6966    where
6967        T: std::iter::IntoIterator<Item = V>,
6968        V: std::convert::Into<std::string::String>,
6969    {
6970        use std::iter::Iterator;
6971        self.unreachable = v.into_iter().map(|i| i.into()).collect();
6972        self
6973    }
6974}
6975
6976impl wkt::message::Message for ListPrivateConnectionsResponse {
6977    fn typename() -> &'static str {
6978        "type.googleapis.com/google.cloud.datastream.v1.ListPrivateConnectionsResponse"
6979    }
6980}
6981
6982#[doc(hidden)]
6983impl gax::paginator::internal::PageableResponse for ListPrivateConnectionsResponse {
6984    type PageItem = crate::model::PrivateConnection;
6985
6986    fn items(self) -> std::vec::Vec<Self::PageItem> {
6987        self.private_connections
6988    }
6989
6990    fn next_page_token(&self) -> std::string::String {
6991        use std::clone::Clone;
6992        self.next_page_token.clone()
6993    }
6994}
6995
6996#[doc(hidden)]
6997impl<'de> serde::de::Deserialize<'de> for ListPrivateConnectionsResponse {
6998    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6999    where
7000        D: serde::Deserializer<'de>,
7001    {
7002        #[allow(non_camel_case_types)]
7003        #[doc(hidden)]
7004        #[derive(PartialEq, Eq, Hash)]
7005        enum __FieldTag {
7006            __private_connections,
7007            __next_page_token,
7008            __unreachable,
7009            Unknown(std::string::String),
7010        }
7011        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7012            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7013            where
7014                D: serde::Deserializer<'de>,
7015            {
7016                struct Visitor;
7017                impl<'de> serde::de::Visitor<'de> for Visitor {
7018                    type Value = __FieldTag;
7019                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7020                        formatter.write_str("a field name for ListPrivateConnectionsResponse")
7021                    }
7022                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7023                    where
7024                        E: serde::de::Error,
7025                    {
7026                        use std::result::Result::Ok;
7027                        use std::string::ToString;
7028                        match value {
7029                            "privateConnections" => Ok(__FieldTag::__private_connections),
7030                            "private_connections" => Ok(__FieldTag::__private_connections),
7031                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
7032                            "next_page_token" => Ok(__FieldTag::__next_page_token),
7033                            "unreachable" => Ok(__FieldTag::__unreachable),
7034                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7035                        }
7036                    }
7037                }
7038                deserializer.deserialize_identifier(Visitor)
7039            }
7040        }
7041        struct Visitor;
7042        impl<'de> serde::de::Visitor<'de> for Visitor {
7043            type Value = ListPrivateConnectionsResponse;
7044            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7045                formatter.write_str("struct ListPrivateConnectionsResponse")
7046            }
7047            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7048            where
7049                A: serde::de::MapAccess<'de>,
7050            {
7051                #[allow(unused_imports)]
7052                use serde::de::Error;
7053                use std::option::Option::Some;
7054                let mut fields = std::collections::HashSet::new();
7055                let mut result = Self::Value::new();
7056                while let Some(tag) = map.next_key::<__FieldTag>()? {
7057                    #[allow(clippy::match_single_binding)]
7058                    match tag {
7059                        __FieldTag::__private_connections => {
7060                            if !fields.insert(__FieldTag::__private_connections) {
7061                                return std::result::Result::Err(A::Error::duplicate_field(
7062                                    "multiple values for private_connections",
7063                                ));
7064                            }
7065                            result.private_connections =
7066                                map.next_value::<std::option::Option<
7067                                    std::vec::Vec<crate::model::PrivateConnection>,
7068                                >>()?
7069                                .unwrap_or_default();
7070                        }
7071                        __FieldTag::__next_page_token => {
7072                            if !fields.insert(__FieldTag::__next_page_token) {
7073                                return std::result::Result::Err(A::Error::duplicate_field(
7074                                    "multiple values for next_page_token",
7075                                ));
7076                            }
7077                            result.next_page_token = map
7078                                .next_value::<std::option::Option<std::string::String>>()?
7079                                .unwrap_or_default();
7080                        }
7081                        __FieldTag::__unreachable => {
7082                            if !fields.insert(__FieldTag::__unreachable) {
7083                                return std::result::Result::Err(A::Error::duplicate_field(
7084                                    "multiple values for unreachable",
7085                                ));
7086                            }
7087                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
7088                        }
7089                        __FieldTag::Unknown(key) => {
7090                            let value = map.next_value::<serde_json::Value>()?;
7091                            result._unknown_fields.insert(key, value);
7092                        }
7093                    }
7094                }
7095                std::result::Result::Ok(result)
7096            }
7097        }
7098        deserializer.deserialize_any(Visitor)
7099    }
7100}
7101
7102#[doc(hidden)]
7103impl serde::ser::Serialize for ListPrivateConnectionsResponse {
7104    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7105    where
7106        S: serde::ser::Serializer,
7107    {
7108        use serde::ser::SerializeMap;
7109        #[allow(unused_imports)]
7110        use std::option::Option::Some;
7111        let mut state = serializer.serialize_map(std::option::Option::None)?;
7112        if !self.private_connections.is_empty() {
7113            state.serialize_entry("privateConnections", &self.private_connections)?;
7114        }
7115        if !self.next_page_token.is_empty() {
7116            state.serialize_entry("nextPageToken", &self.next_page_token)?;
7117        }
7118        if !self.unreachable.is_empty() {
7119            state.serialize_entry("unreachable", &self.unreachable)?;
7120        }
7121        if !self._unknown_fields.is_empty() {
7122            for (key, value) in self._unknown_fields.iter() {
7123                state.serialize_entry(key, &value)?;
7124            }
7125        }
7126        state.end()
7127    }
7128}
7129
7130impl std::fmt::Debug for ListPrivateConnectionsResponse {
7131    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7132        let mut debug_struct = f.debug_struct("ListPrivateConnectionsResponse");
7133        debug_struct.field("private_connections", &self.private_connections);
7134        debug_struct.field("next_page_token", &self.next_page_token);
7135        debug_struct.field("unreachable", &self.unreachable);
7136        if !self._unknown_fields.is_empty() {
7137            debug_struct.field("_unknown_fields", &self._unknown_fields);
7138        }
7139        debug_struct.finish()
7140    }
7141}
7142
7143/// Request to delete a private connection.
7144#[derive(Clone, Default, PartialEq)]
7145#[non_exhaustive]
7146pub struct DeletePrivateConnectionRequest {
7147    /// Required. The name of the private connectivity configuration to delete.
7148    pub name: std::string::String,
7149
7150    /// Optional. A request ID to identify requests. Specify a unique request ID
7151    /// so that if you must retry your request, the server will know to ignore
7152    /// the request if it has already been completed. The server will guarantee
7153    /// that for at least 60 minutes after the first request.
7154    ///
7155    /// For example, consider a situation where you make an initial request and the
7156    /// request times out. If you make the request again with the same request ID,
7157    /// the server can check if original operation with the same request ID was
7158    /// received, and if so, will ignore the second request. This prevents clients
7159    /// from accidentally creating duplicate commitments.
7160    ///
7161    /// The request ID must be a valid UUID with the exception that zero UUID is
7162    /// not supported (00000000-0000-0000-0000-000000000000).
7163    pub request_id: std::string::String,
7164
7165    /// Optional. If set to true, any child routes that belong to this
7166    /// PrivateConnection will also be deleted.
7167    pub force: bool,
7168
7169    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7170}
7171
7172impl DeletePrivateConnectionRequest {
7173    pub fn new() -> Self {
7174        std::default::Default::default()
7175    }
7176
7177    /// Sets the value of [name][crate::model::DeletePrivateConnectionRequest::name].
7178    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7179        self.name = v.into();
7180        self
7181    }
7182
7183    /// Sets the value of [request_id][crate::model::DeletePrivateConnectionRequest::request_id].
7184    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7185        self.request_id = v.into();
7186        self
7187    }
7188
7189    /// Sets the value of [force][crate::model::DeletePrivateConnectionRequest::force].
7190    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7191        self.force = v.into();
7192        self
7193    }
7194}
7195
7196impl wkt::message::Message for DeletePrivateConnectionRequest {
7197    fn typename() -> &'static str {
7198        "type.googleapis.com/google.cloud.datastream.v1.DeletePrivateConnectionRequest"
7199    }
7200}
7201
7202#[doc(hidden)]
7203impl<'de> serde::de::Deserialize<'de> for DeletePrivateConnectionRequest {
7204    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7205    where
7206        D: serde::Deserializer<'de>,
7207    {
7208        #[allow(non_camel_case_types)]
7209        #[doc(hidden)]
7210        #[derive(PartialEq, Eq, Hash)]
7211        enum __FieldTag {
7212            __name,
7213            __request_id,
7214            __force,
7215            Unknown(std::string::String),
7216        }
7217        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7218            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7219            where
7220                D: serde::Deserializer<'de>,
7221            {
7222                struct Visitor;
7223                impl<'de> serde::de::Visitor<'de> for Visitor {
7224                    type Value = __FieldTag;
7225                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7226                        formatter.write_str("a field name for DeletePrivateConnectionRequest")
7227                    }
7228                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7229                    where
7230                        E: serde::de::Error,
7231                    {
7232                        use std::result::Result::Ok;
7233                        use std::string::ToString;
7234                        match value {
7235                            "name" => Ok(__FieldTag::__name),
7236                            "requestId" => Ok(__FieldTag::__request_id),
7237                            "request_id" => Ok(__FieldTag::__request_id),
7238                            "force" => Ok(__FieldTag::__force),
7239                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7240                        }
7241                    }
7242                }
7243                deserializer.deserialize_identifier(Visitor)
7244            }
7245        }
7246        struct Visitor;
7247        impl<'de> serde::de::Visitor<'de> for Visitor {
7248            type Value = DeletePrivateConnectionRequest;
7249            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7250                formatter.write_str("struct DeletePrivateConnectionRequest")
7251            }
7252            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7253            where
7254                A: serde::de::MapAccess<'de>,
7255            {
7256                #[allow(unused_imports)]
7257                use serde::de::Error;
7258                use std::option::Option::Some;
7259                let mut fields = std::collections::HashSet::new();
7260                let mut result = Self::Value::new();
7261                while let Some(tag) = map.next_key::<__FieldTag>()? {
7262                    #[allow(clippy::match_single_binding)]
7263                    match tag {
7264                        __FieldTag::__name => {
7265                            if !fields.insert(__FieldTag::__name) {
7266                                return std::result::Result::Err(A::Error::duplicate_field(
7267                                    "multiple values for name",
7268                                ));
7269                            }
7270                            result.name = map
7271                                .next_value::<std::option::Option<std::string::String>>()?
7272                                .unwrap_or_default();
7273                        }
7274                        __FieldTag::__request_id => {
7275                            if !fields.insert(__FieldTag::__request_id) {
7276                                return std::result::Result::Err(A::Error::duplicate_field(
7277                                    "multiple values for request_id",
7278                                ));
7279                            }
7280                            result.request_id = map
7281                                .next_value::<std::option::Option<std::string::String>>()?
7282                                .unwrap_or_default();
7283                        }
7284                        __FieldTag::__force => {
7285                            if !fields.insert(__FieldTag::__force) {
7286                                return std::result::Result::Err(A::Error::duplicate_field(
7287                                    "multiple values for force",
7288                                ));
7289                            }
7290                            result.force = map
7291                                .next_value::<std::option::Option<bool>>()?
7292                                .unwrap_or_default();
7293                        }
7294                        __FieldTag::Unknown(key) => {
7295                            let value = map.next_value::<serde_json::Value>()?;
7296                            result._unknown_fields.insert(key, value);
7297                        }
7298                    }
7299                }
7300                std::result::Result::Ok(result)
7301            }
7302        }
7303        deserializer.deserialize_any(Visitor)
7304    }
7305}
7306
7307#[doc(hidden)]
7308impl serde::ser::Serialize for DeletePrivateConnectionRequest {
7309    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7310    where
7311        S: serde::ser::Serializer,
7312    {
7313        use serde::ser::SerializeMap;
7314        #[allow(unused_imports)]
7315        use std::option::Option::Some;
7316        let mut state = serializer.serialize_map(std::option::Option::None)?;
7317        if !self.name.is_empty() {
7318            state.serialize_entry("name", &self.name)?;
7319        }
7320        if !self.request_id.is_empty() {
7321            state.serialize_entry("requestId", &self.request_id)?;
7322        }
7323        if !wkt::internal::is_default(&self.force) {
7324            state.serialize_entry("force", &self.force)?;
7325        }
7326        if !self._unknown_fields.is_empty() {
7327            for (key, value) in self._unknown_fields.iter() {
7328                state.serialize_entry(key, &value)?;
7329            }
7330        }
7331        state.end()
7332    }
7333}
7334
7335impl std::fmt::Debug for DeletePrivateConnectionRequest {
7336    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7337        let mut debug_struct = f.debug_struct("DeletePrivateConnectionRequest");
7338        debug_struct.field("name", &self.name);
7339        debug_struct.field("request_id", &self.request_id);
7340        debug_struct.field("force", &self.force);
7341        if !self._unknown_fields.is_empty() {
7342            debug_struct.field("_unknown_fields", &self._unknown_fields);
7343        }
7344        debug_struct.finish()
7345    }
7346}
7347
7348/// Request to get a private connection configuration.
7349#[derive(Clone, Default, PartialEq)]
7350#[non_exhaustive]
7351pub struct GetPrivateConnectionRequest {
7352    /// Required. The name of the  private connectivity configuration to get.
7353    pub name: std::string::String,
7354
7355    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7356}
7357
7358impl GetPrivateConnectionRequest {
7359    pub fn new() -> Self {
7360        std::default::Default::default()
7361    }
7362
7363    /// Sets the value of [name][crate::model::GetPrivateConnectionRequest::name].
7364    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7365        self.name = v.into();
7366        self
7367    }
7368}
7369
7370impl wkt::message::Message for GetPrivateConnectionRequest {
7371    fn typename() -> &'static str {
7372        "type.googleapis.com/google.cloud.datastream.v1.GetPrivateConnectionRequest"
7373    }
7374}
7375
7376#[doc(hidden)]
7377impl<'de> serde::de::Deserialize<'de> for GetPrivateConnectionRequest {
7378    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7379    where
7380        D: serde::Deserializer<'de>,
7381    {
7382        #[allow(non_camel_case_types)]
7383        #[doc(hidden)]
7384        #[derive(PartialEq, Eq, Hash)]
7385        enum __FieldTag {
7386            __name,
7387            Unknown(std::string::String),
7388        }
7389        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7390            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7391            where
7392                D: serde::Deserializer<'de>,
7393            {
7394                struct Visitor;
7395                impl<'de> serde::de::Visitor<'de> for Visitor {
7396                    type Value = __FieldTag;
7397                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7398                        formatter.write_str("a field name for GetPrivateConnectionRequest")
7399                    }
7400                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7401                    where
7402                        E: serde::de::Error,
7403                    {
7404                        use std::result::Result::Ok;
7405                        use std::string::ToString;
7406                        match value {
7407                            "name" => Ok(__FieldTag::__name),
7408                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7409                        }
7410                    }
7411                }
7412                deserializer.deserialize_identifier(Visitor)
7413            }
7414        }
7415        struct Visitor;
7416        impl<'de> serde::de::Visitor<'de> for Visitor {
7417            type Value = GetPrivateConnectionRequest;
7418            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7419                formatter.write_str("struct GetPrivateConnectionRequest")
7420            }
7421            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7422            where
7423                A: serde::de::MapAccess<'de>,
7424            {
7425                #[allow(unused_imports)]
7426                use serde::de::Error;
7427                use std::option::Option::Some;
7428                let mut fields = std::collections::HashSet::new();
7429                let mut result = Self::Value::new();
7430                while let Some(tag) = map.next_key::<__FieldTag>()? {
7431                    #[allow(clippy::match_single_binding)]
7432                    match tag {
7433                        __FieldTag::__name => {
7434                            if !fields.insert(__FieldTag::__name) {
7435                                return std::result::Result::Err(A::Error::duplicate_field(
7436                                    "multiple values for name",
7437                                ));
7438                            }
7439                            result.name = map
7440                                .next_value::<std::option::Option<std::string::String>>()?
7441                                .unwrap_or_default();
7442                        }
7443                        __FieldTag::Unknown(key) => {
7444                            let value = map.next_value::<serde_json::Value>()?;
7445                            result._unknown_fields.insert(key, value);
7446                        }
7447                    }
7448                }
7449                std::result::Result::Ok(result)
7450            }
7451        }
7452        deserializer.deserialize_any(Visitor)
7453    }
7454}
7455
7456#[doc(hidden)]
7457impl serde::ser::Serialize for GetPrivateConnectionRequest {
7458    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7459    where
7460        S: serde::ser::Serializer,
7461    {
7462        use serde::ser::SerializeMap;
7463        #[allow(unused_imports)]
7464        use std::option::Option::Some;
7465        let mut state = serializer.serialize_map(std::option::Option::None)?;
7466        if !self.name.is_empty() {
7467            state.serialize_entry("name", &self.name)?;
7468        }
7469        if !self._unknown_fields.is_empty() {
7470            for (key, value) in self._unknown_fields.iter() {
7471                state.serialize_entry(key, &value)?;
7472            }
7473        }
7474        state.end()
7475    }
7476}
7477
7478impl std::fmt::Debug for GetPrivateConnectionRequest {
7479    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7480        let mut debug_struct = f.debug_struct("GetPrivateConnectionRequest");
7481        debug_struct.field("name", &self.name);
7482        if !self._unknown_fields.is_empty() {
7483            debug_struct.field("_unknown_fields", &self._unknown_fields);
7484        }
7485        debug_struct.finish()
7486    }
7487}
7488
7489/// Route creation request.
7490#[derive(Clone, Default, PartialEq)]
7491#[non_exhaustive]
7492pub struct CreateRouteRequest {
7493    /// Required. The parent that owns the collection of Routes.
7494    pub parent: std::string::String,
7495
7496    /// Required. The Route identifier.
7497    pub route_id: std::string::String,
7498
7499    /// Required. The Route resource to create.
7500    pub route: std::option::Option<crate::model::Route>,
7501
7502    /// Optional. A request ID to identify requests. Specify a unique request ID
7503    /// so that if you must retry your request, the server will know to ignore
7504    /// the request if it has already been completed. The server will guarantee
7505    /// that for at least 60 minutes since the first request.
7506    ///
7507    /// For example, consider a situation where you make an initial request and the
7508    /// request times out. If you make the request again with the same request ID,
7509    /// the server can check if original operation with the same request ID was
7510    /// received, and if so, will ignore the second request. This prevents clients
7511    /// from accidentally creating duplicate commitments.
7512    ///
7513    /// The request ID must be a valid UUID with the exception that zero UUID is
7514    /// not supported (00000000-0000-0000-0000-000000000000).
7515    pub request_id: std::string::String,
7516
7517    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7518}
7519
7520impl CreateRouteRequest {
7521    pub fn new() -> Self {
7522        std::default::Default::default()
7523    }
7524
7525    /// Sets the value of [parent][crate::model::CreateRouteRequest::parent].
7526    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7527        self.parent = v.into();
7528        self
7529    }
7530
7531    /// Sets the value of [route_id][crate::model::CreateRouteRequest::route_id].
7532    pub fn set_route_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7533        self.route_id = v.into();
7534        self
7535    }
7536
7537    /// Sets the value of [route][crate::model::CreateRouteRequest::route].
7538    pub fn set_route<T>(mut self, v: T) -> Self
7539    where
7540        T: std::convert::Into<crate::model::Route>,
7541    {
7542        self.route = std::option::Option::Some(v.into());
7543        self
7544    }
7545
7546    /// Sets or clears the value of [route][crate::model::CreateRouteRequest::route].
7547    pub fn set_or_clear_route<T>(mut self, v: std::option::Option<T>) -> Self
7548    where
7549        T: std::convert::Into<crate::model::Route>,
7550    {
7551        self.route = v.map(|x| x.into());
7552        self
7553    }
7554
7555    /// Sets the value of [request_id][crate::model::CreateRouteRequest::request_id].
7556    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7557        self.request_id = v.into();
7558        self
7559    }
7560}
7561
7562impl wkt::message::Message for CreateRouteRequest {
7563    fn typename() -> &'static str {
7564        "type.googleapis.com/google.cloud.datastream.v1.CreateRouteRequest"
7565    }
7566}
7567
7568#[doc(hidden)]
7569impl<'de> serde::de::Deserialize<'de> for CreateRouteRequest {
7570    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7571    where
7572        D: serde::Deserializer<'de>,
7573    {
7574        #[allow(non_camel_case_types)]
7575        #[doc(hidden)]
7576        #[derive(PartialEq, Eq, Hash)]
7577        enum __FieldTag {
7578            __parent,
7579            __route_id,
7580            __route,
7581            __request_id,
7582            Unknown(std::string::String),
7583        }
7584        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7585            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7586            where
7587                D: serde::Deserializer<'de>,
7588            {
7589                struct Visitor;
7590                impl<'de> serde::de::Visitor<'de> for Visitor {
7591                    type Value = __FieldTag;
7592                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7593                        formatter.write_str("a field name for CreateRouteRequest")
7594                    }
7595                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7596                    where
7597                        E: serde::de::Error,
7598                    {
7599                        use std::result::Result::Ok;
7600                        use std::string::ToString;
7601                        match value {
7602                            "parent" => Ok(__FieldTag::__parent),
7603                            "routeId" => Ok(__FieldTag::__route_id),
7604                            "route_id" => Ok(__FieldTag::__route_id),
7605                            "route" => Ok(__FieldTag::__route),
7606                            "requestId" => Ok(__FieldTag::__request_id),
7607                            "request_id" => Ok(__FieldTag::__request_id),
7608                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7609                        }
7610                    }
7611                }
7612                deserializer.deserialize_identifier(Visitor)
7613            }
7614        }
7615        struct Visitor;
7616        impl<'de> serde::de::Visitor<'de> for Visitor {
7617            type Value = CreateRouteRequest;
7618            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7619                formatter.write_str("struct CreateRouteRequest")
7620            }
7621            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7622            where
7623                A: serde::de::MapAccess<'de>,
7624            {
7625                #[allow(unused_imports)]
7626                use serde::de::Error;
7627                use std::option::Option::Some;
7628                let mut fields = std::collections::HashSet::new();
7629                let mut result = Self::Value::new();
7630                while let Some(tag) = map.next_key::<__FieldTag>()? {
7631                    #[allow(clippy::match_single_binding)]
7632                    match tag {
7633                        __FieldTag::__parent => {
7634                            if !fields.insert(__FieldTag::__parent) {
7635                                return std::result::Result::Err(A::Error::duplicate_field(
7636                                    "multiple values for parent",
7637                                ));
7638                            }
7639                            result.parent = map
7640                                .next_value::<std::option::Option<std::string::String>>()?
7641                                .unwrap_or_default();
7642                        }
7643                        __FieldTag::__route_id => {
7644                            if !fields.insert(__FieldTag::__route_id) {
7645                                return std::result::Result::Err(A::Error::duplicate_field(
7646                                    "multiple values for route_id",
7647                                ));
7648                            }
7649                            result.route_id = map
7650                                .next_value::<std::option::Option<std::string::String>>()?
7651                                .unwrap_or_default();
7652                        }
7653                        __FieldTag::__route => {
7654                            if !fields.insert(__FieldTag::__route) {
7655                                return std::result::Result::Err(A::Error::duplicate_field(
7656                                    "multiple values for route",
7657                                ));
7658                            }
7659                            result.route =
7660                                map.next_value::<std::option::Option<crate::model::Route>>()?;
7661                        }
7662                        __FieldTag::__request_id => {
7663                            if !fields.insert(__FieldTag::__request_id) {
7664                                return std::result::Result::Err(A::Error::duplicate_field(
7665                                    "multiple values for request_id",
7666                                ));
7667                            }
7668                            result.request_id = map
7669                                .next_value::<std::option::Option<std::string::String>>()?
7670                                .unwrap_or_default();
7671                        }
7672                        __FieldTag::Unknown(key) => {
7673                            let value = map.next_value::<serde_json::Value>()?;
7674                            result._unknown_fields.insert(key, value);
7675                        }
7676                    }
7677                }
7678                std::result::Result::Ok(result)
7679            }
7680        }
7681        deserializer.deserialize_any(Visitor)
7682    }
7683}
7684
7685#[doc(hidden)]
7686impl serde::ser::Serialize for CreateRouteRequest {
7687    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7688    where
7689        S: serde::ser::Serializer,
7690    {
7691        use serde::ser::SerializeMap;
7692        #[allow(unused_imports)]
7693        use std::option::Option::Some;
7694        let mut state = serializer.serialize_map(std::option::Option::None)?;
7695        if !self.parent.is_empty() {
7696            state.serialize_entry("parent", &self.parent)?;
7697        }
7698        if !self.route_id.is_empty() {
7699            state.serialize_entry("routeId", &self.route_id)?;
7700        }
7701        if self.route.is_some() {
7702            state.serialize_entry("route", &self.route)?;
7703        }
7704        if !self.request_id.is_empty() {
7705            state.serialize_entry("requestId", &self.request_id)?;
7706        }
7707        if !self._unknown_fields.is_empty() {
7708            for (key, value) in self._unknown_fields.iter() {
7709                state.serialize_entry(key, &value)?;
7710            }
7711        }
7712        state.end()
7713    }
7714}
7715
7716impl std::fmt::Debug for CreateRouteRequest {
7717    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7718        let mut debug_struct = f.debug_struct("CreateRouteRequest");
7719        debug_struct.field("parent", &self.parent);
7720        debug_struct.field("route_id", &self.route_id);
7721        debug_struct.field("route", &self.route);
7722        debug_struct.field("request_id", &self.request_id);
7723        if !self._unknown_fields.is_empty() {
7724            debug_struct.field("_unknown_fields", &self._unknown_fields);
7725        }
7726        debug_struct.finish()
7727    }
7728}
7729
7730/// Route list request.
7731#[derive(Clone, Default, PartialEq)]
7732#[non_exhaustive]
7733pub struct ListRoutesRequest {
7734    /// Required. The parent that owns the collection of Routess.
7735    pub parent: std::string::String,
7736
7737    /// Maximum number of Routes to return. The service may return
7738    /// fewer than this value. If unspecified, at most 50 Routes
7739    /// will be returned. The maximum value is 1000; values above 1000 will be
7740    /// coerced to 1000.
7741    pub page_size: i32,
7742
7743    /// Page token received from a previous `ListRoutes` call.
7744    /// Provide this to retrieve the subsequent page.
7745    ///
7746    /// When paginating, all other parameters provided to
7747    /// `ListRoutes` must match the call that provided the page
7748    /// token.
7749    pub page_token: std::string::String,
7750
7751    /// Filter request.
7752    pub filter: std::string::String,
7753
7754    /// Order by fields for the result.
7755    pub order_by: std::string::String,
7756
7757    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7758}
7759
7760impl ListRoutesRequest {
7761    pub fn new() -> Self {
7762        std::default::Default::default()
7763    }
7764
7765    /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
7766    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7767        self.parent = v.into();
7768        self
7769    }
7770
7771    /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
7772    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7773        self.page_size = v.into();
7774        self
7775    }
7776
7777    /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
7778    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7779        self.page_token = v.into();
7780        self
7781    }
7782
7783    /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
7784    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7785        self.filter = v.into();
7786        self
7787    }
7788
7789    /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
7790    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7791        self.order_by = v.into();
7792        self
7793    }
7794}
7795
7796impl wkt::message::Message for ListRoutesRequest {
7797    fn typename() -> &'static str {
7798        "type.googleapis.com/google.cloud.datastream.v1.ListRoutesRequest"
7799    }
7800}
7801
7802#[doc(hidden)]
7803impl<'de> serde::de::Deserialize<'de> for ListRoutesRequest {
7804    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7805    where
7806        D: serde::Deserializer<'de>,
7807    {
7808        #[allow(non_camel_case_types)]
7809        #[doc(hidden)]
7810        #[derive(PartialEq, Eq, Hash)]
7811        enum __FieldTag {
7812            __parent,
7813            __page_size,
7814            __page_token,
7815            __filter,
7816            __order_by,
7817            Unknown(std::string::String),
7818        }
7819        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7820            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7821            where
7822                D: serde::Deserializer<'de>,
7823            {
7824                struct Visitor;
7825                impl<'de> serde::de::Visitor<'de> for Visitor {
7826                    type Value = __FieldTag;
7827                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7828                        formatter.write_str("a field name for ListRoutesRequest")
7829                    }
7830                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7831                    where
7832                        E: serde::de::Error,
7833                    {
7834                        use std::result::Result::Ok;
7835                        use std::string::ToString;
7836                        match value {
7837                            "parent" => Ok(__FieldTag::__parent),
7838                            "pageSize" => Ok(__FieldTag::__page_size),
7839                            "page_size" => Ok(__FieldTag::__page_size),
7840                            "pageToken" => Ok(__FieldTag::__page_token),
7841                            "page_token" => Ok(__FieldTag::__page_token),
7842                            "filter" => Ok(__FieldTag::__filter),
7843                            "orderBy" => Ok(__FieldTag::__order_by),
7844                            "order_by" => Ok(__FieldTag::__order_by),
7845                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7846                        }
7847                    }
7848                }
7849                deserializer.deserialize_identifier(Visitor)
7850            }
7851        }
7852        struct Visitor;
7853        impl<'de> serde::de::Visitor<'de> for Visitor {
7854            type Value = ListRoutesRequest;
7855            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7856                formatter.write_str("struct ListRoutesRequest")
7857            }
7858            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7859            where
7860                A: serde::de::MapAccess<'de>,
7861            {
7862                #[allow(unused_imports)]
7863                use serde::de::Error;
7864                use std::option::Option::Some;
7865                let mut fields = std::collections::HashSet::new();
7866                let mut result = Self::Value::new();
7867                while let Some(tag) = map.next_key::<__FieldTag>()? {
7868                    #[allow(clippy::match_single_binding)]
7869                    match tag {
7870                        __FieldTag::__parent => {
7871                            if !fields.insert(__FieldTag::__parent) {
7872                                return std::result::Result::Err(A::Error::duplicate_field(
7873                                    "multiple values for parent",
7874                                ));
7875                            }
7876                            result.parent = map
7877                                .next_value::<std::option::Option<std::string::String>>()?
7878                                .unwrap_or_default();
7879                        }
7880                        __FieldTag::__page_size => {
7881                            if !fields.insert(__FieldTag::__page_size) {
7882                                return std::result::Result::Err(A::Error::duplicate_field(
7883                                    "multiple values for page_size",
7884                                ));
7885                            }
7886                            struct __With(std::option::Option<i32>);
7887                            impl<'de> serde::de::Deserialize<'de> for __With {
7888                                fn deserialize<D>(
7889                                    deserializer: D,
7890                                ) -> std::result::Result<Self, D::Error>
7891                                where
7892                                    D: serde::de::Deserializer<'de>,
7893                                {
7894                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
7895                                }
7896                            }
7897                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
7898                        }
7899                        __FieldTag::__page_token => {
7900                            if !fields.insert(__FieldTag::__page_token) {
7901                                return std::result::Result::Err(A::Error::duplicate_field(
7902                                    "multiple values for page_token",
7903                                ));
7904                            }
7905                            result.page_token = map
7906                                .next_value::<std::option::Option<std::string::String>>()?
7907                                .unwrap_or_default();
7908                        }
7909                        __FieldTag::__filter => {
7910                            if !fields.insert(__FieldTag::__filter) {
7911                                return std::result::Result::Err(A::Error::duplicate_field(
7912                                    "multiple values for filter",
7913                                ));
7914                            }
7915                            result.filter = map
7916                                .next_value::<std::option::Option<std::string::String>>()?
7917                                .unwrap_or_default();
7918                        }
7919                        __FieldTag::__order_by => {
7920                            if !fields.insert(__FieldTag::__order_by) {
7921                                return std::result::Result::Err(A::Error::duplicate_field(
7922                                    "multiple values for order_by",
7923                                ));
7924                            }
7925                            result.order_by = map
7926                                .next_value::<std::option::Option<std::string::String>>()?
7927                                .unwrap_or_default();
7928                        }
7929                        __FieldTag::Unknown(key) => {
7930                            let value = map.next_value::<serde_json::Value>()?;
7931                            result._unknown_fields.insert(key, value);
7932                        }
7933                    }
7934                }
7935                std::result::Result::Ok(result)
7936            }
7937        }
7938        deserializer.deserialize_any(Visitor)
7939    }
7940}
7941
7942#[doc(hidden)]
7943impl serde::ser::Serialize for ListRoutesRequest {
7944    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7945    where
7946        S: serde::ser::Serializer,
7947    {
7948        use serde::ser::SerializeMap;
7949        #[allow(unused_imports)]
7950        use std::option::Option::Some;
7951        let mut state = serializer.serialize_map(std::option::Option::None)?;
7952        if !self.parent.is_empty() {
7953            state.serialize_entry("parent", &self.parent)?;
7954        }
7955        if !wkt::internal::is_default(&self.page_size) {
7956            struct __With<'a>(&'a i32);
7957            impl<'a> serde::ser::Serialize for __With<'a> {
7958                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7959                where
7960                    S: serde::ser::Serializer,
7961                {
7962                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
7963                }
7964            }
7965            state.serialize_entry("pageSize", &__With(&self.page_size))?;
7966        }
7967        if !self.page_token.is_empty() {
7968            state.serialize_entry("pageToken", &self.page_token)?;
7969        }
7970        if !self.filter.is_empty() {
7971            state.serialize_entry("filter", &self.filter)?;
7972        }
7973        if !self.order_by.is_empty() {
7974            state.serialize_entry("orderBy", &self.order_by)?;
7975        }
7976        if !self._unknown_fields.is_empty() {
7977            for (key, value) in self._unknown_fields.iter() {
7978                state.serialize_entry(key, &value)?;
7979            }
7980        }
7981        state.end()
7982    }
7983}
7984
7985impl std::fmt::Debug for ListRoutesRequest {
7986    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7987        let mut debug_struct = f.debug_struct("ListRoutesRequest");
7988        debug_struct.field("parent", &self.parent);
7989        debug_struct.field("page_size", &self.page_size);
7990        debug_struct.field("page_token", &self.page_token);
7991        debug_struct.field("filter", &self.filter);
7992        debug_struct.field("order_by", &self.order_by);
7993        if !self._unknown_fields.is_empty() {
7994            debug_struct.field("_unknown_fields", &self._unknown_fields);
7995        }
7996        debug_struct.finish()
7997    }
7998}
7999
8000/// Route list response.
8001#[derive(Clone, Default, PartialEq)]
8002#[non_exhaustive]
8003pub struct ListRoutesResponse {
8004    /// List of Routes.
8005    pub routes: std::vec::Vec<crate::model::Route>,
8006
8007    /// A token, which can be sent as `page_token` to retrieve the next page.
8008    /// If this field is omitted, there are no subsequent pages.
8009    pub next_page_token: std::string::String,
8010
8011    /// Locations that could not be reached.
8012    pub unreachable: std::vec::Vec<std::string::String>,
8013
8014    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8015}
8016
8017impl ListRoutesResponse {
8018    pub fn new() -> Self {
8019        std::default::Default::default()
8020    }
8021
8022    /// Sets the value of [routes][crate::model::ListRoutesResponse::routes].
8023    pub fn set_routes<T, V>(mut self, v: T) -> Self
8024    where
8025        T: std::iter::IntoIterator<Item = V>,
8026        V: std::convert::Into<crate::model::Route>,
8027    {
8028        use std::iter::Iterator;
8029        self.routes = v.into_iter().map(|i| i.into()).collect();
8030        self
8031    }
8032
8033    /// Sets the value of [next_page_token][crate::model::ListRoutesResponse::next_page_token].
8034    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8035        self.next_page_token = v.into();
8036        self
8037    }
8038
8039    /// Sets the value of [unreachable][crate::model::ListRoutesResponse::unreachable].
8040    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8041    where
8042        T: std::iter::IntoIterator<Item = V>,
8043        V: std::convert::Into<std::string::String>,
8044    {
8045        use std::iter::Iterator;
8046        self.unreachable = v.into_iter().map(|i| i.into()).collect();
8047        self
8048    }
8049}
8050
8051impl wkt::message::Message for ListRoutesResponse {
8052    fn typename() -> &'static str {
8053        "type.googleapis.com/google.cloud.datastream.v1.ListRoutesResponse"
8054    }
8055}
8056
8057#[doc(hidden)]
8058impl gax::paginator::internal::PageableResponse for ListRoutesResponse {
8059    type PageItem = crate::model::Route;
8060
8061    fn items(self) -> std::vec::Vec<Self::PageItem> {
8062        self.routes
8063    }
8064
8065    fn next_page_token(&self) -> std::string::String {
8066        use std::clone::Clone;
8067        self.next_page_token.clone()
8068    }
8069}
8070
8071#[doc(hidden)]
8072impl<'de> serde::de::Deserialize<'de> for ListRoutesResponse {
8073    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8074    where
8075        D: serde::Deserializer<'de>,
8076    {
8077        #[allow(non_camel_case_types)]
8078        #[doc(hidden)]
8079        #[derive(PartialEq, Eq, Hash)]
8080        enum __FieldTag {
8081            __routes,
8082            __next_page_token,
8083            __unreachable,
8084            Unknown(std::string::String),
8085        }
8086        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8087            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8088            where
8089                D: serde::Deserializer<'de>,
8090            {
8091                struct Visitor;
8092                impl<'de> serde::de::Visitor<'de> for Visitor {
8093                    type Value = __FieldTag;
8094                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8095                        formatter.write_str("a field name for ListRoutesResponse")
8096                    }
8097                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8098                    where
8099                        E: serde::de::Error,
8100                    {
8101                        use std::result::Result::Ok;
8102                        use std::string::ToString;
8103                        match value {
8104                            "routes" => Ok(__FieldTag::__routes),
8105                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
8106                            "next_page_token" => Ok(__FieldTag::__next_page_token),
8107                            "unreachable" => Ok(__FieldTag::__unreachable),
8108                            _ => Ok(__FieldTag::Unknown(value.to_string())),
8109                        }
8110                    }
8111                }
8112                deserializer.deserialize_identifier(Visitor)
8113            }
8114        }
8115        struct Visitor;
8116        impl<'de> serde::de::Visitor<'de> for Visitor {
8117            type Value = ListRoutesResponse;
8118            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8119                formatter.write_str("struct ListRoutesResponse")
8120            }
8121            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8122            where
8123                A: serde::de::MapAccess<'de>,
8124            {
8125                #[allow(unused_imports)]
8126                use serde::de::Error;
8127                use std::option::Option::Some;
8128                let mut fields = std::collections::HashSet::new();
8129                let mut result = Self::Value::new();
8130                while let Some(tag) = map.next_key::<__FieldTag>()? {
8131                    #[allow(clippy::match_single_binding)]
8132                    match tag {
8133                        __FieldTag::__routes => {
8134                            if !fields.insert(__FieldTag::__routes) {
8135                                return std::result::Result::Err(A::Error::duplicate_field(
8136                                    "multiple values for routes",
8137                                ));
8138                            }
8139                            result.routes = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Route>>>()?.unwrap_or_default();
8140                        }
8141                        __FieldTag::__next_page_token => {
8142                            if !fields.insert(__FieldTag::__next_page_token) {
8143                                return std::result::Result::Err(A::Error::duplicate_field(
8144                                    "multiple values for next_page_token",
8145                                ));
8146                            }
8147                            result.next_page_token = map
8148                                .next_value::<std::option::Option<std::string::String>>()?
8149                                .unwrap_or_default();
8150                        }
8151                        __FieldTag::__unreachable => {
8152                            if !fields.insert(__FieldTag::__unreachable) {
8153                                return std::result::Result::Err(A::Error::duplicate_field(
8154                                    "multiple values for unreachable",
8155                                ));
8156                            }
8157                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
8158                        }
8159                        __FieldTag::Unknown(key) => {
8160                            let value = map.next_value::<serde_json::Value>()?;
8161                            result._unknown_fields.insert(key, value);
8162                        }
8163                    }
8164                }
8165                std::result::Result::Ok(result)
8166            }
8167        }
8168        deserializer.deserialize_any(Visitor)
8169    }
8170}
8171
8172#[doc(hidden)]
8173impl serde::ser::Serialize for ListRoutesResponse {
8174    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8175    where
8176        S: serde::ser::Serializer,
8177    {
8178        use serde::ser::SerializeMap;
8179        #[allow(unused_imports)]
8180        use std::option::Option::Some;
8181        let mut state = serializer.serialize_map(std::option::Option::None)?;
8182        if !self.routes.is_empty() {
8183            state.serialize_entry("routes", &self.routes)?;
8184        }
8185        if !self.next_page_token.is_empty() {
8186            state.serialize_entry("nextPageToken", &self.next_page_token)?;
8187        }
8188        if !self.unreachable.is_empty() {
8189            state.serialize_entry("unreachable", &self.unreachable)?;
8190        }
8191        if !self._unknown_fields.is_empty() {
8192            for (key, value) in self._unknown_fields.iter() {
8193                state.serialize_entry(key, &value)?;
8194            }
8195        }
8196        state.end()
8197    }
8198}
8199
8200impl std::fmt::Debug for ListRoutesResponse {
8201    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8202        let mut debug_struct = f.debug_struct("ListRoutesResponse");
8203        debug_struct.field("routes", &self.routes);
8204        debug_struct.field("next_page_token", &self.next_page_token);
8205        debug_struct.field("unreachable", &self.unreachable);
8206        if !self._unknown_fields.is_empty() {
8207            debug_struct.field("_unknown_fields", &self._unknown_fields);
8208        }
8209        debug_struct.finish()
8210    }
8211}
8212
8213/// Route deletion request.
8214#[derive(Clone, Default, PartialEq)]
8215#[non_exhaustive]
8216pub struct DeleteRouteRequest {
8217    /// Required. The name of the Route resource to delete.
8218    pub name: std::string::String,
8219
8220    /// Optional. A request ID to identify requests. Specify a unique request ID
8221    /// so that if you must retry your request, the server will know to ignore
8222    /// the request if it has already been completed. The server will guarantee
8223    /// that for at least 60 minutes after the first request.
8224    ///
8225    /// For example, consider a situation where you make an initial request and the
8226    /// request times out. If you make the request again with the same request ID,
8227    /// the server can check if original operation with the same request ID was
8228    /// received, and if so, will ignore the second request. This prevents clients
8229    /// from accidentally creating duplicate commitments.
8230    ///
8231    /// The request ID must be a valid UUID with the exception that zero UUID is
8232    /// not supported (00000000-0000-0000-0000-000000000000).
8233    pub request_id: std::string::String,
8234
8235    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8236}
8237
8238impl DeleteRouteRequest {
8239    pub fn new() -> Self {
8240        std::default::Default::default()
8241    }
8242
8243    /// Sets the value of [name][crate::model::DeleteRouteRequest::name].
8244    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8245        self.name = v.into();
8246        self
8247    }
8248
8249    /// Sets the value of [request_id][crate::model::DeleteRouteRequest::request_id].
8250    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8251        self.request_id = v.into();
8252        self
8253    }
8254}
8255
8256impl wkt::message::Message for DeleteRouteRequest {
8257    fn typename() -> &'static str {
8258        "type.googleapis.com/google.cloud.datastream.v1.DeleteRouteRequest"
8259    }
8260}
8261
8262#[doc(hidden)]
8263impl<'de> serde::de::Deserialize<'de> for DeleteRouteRequest {
8264    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8265    where
8266        D: serde::Deserializer<'de>,
8267    {
8268        #[allow(non_camel_case_types)]
8269        #[doc(hidden)]
8270        #[derive(PartialEq, Eq, Hash)]
8271        enum __FieldTag {
8272            __name,
8273            __request_id,
8274            Unknown(std::string::String),
8275        }
8276        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8277            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8278            where
8279                D: serde::Deserializer<'de>,
8280            {
8281                struct Visitor;
8282                impl<'de> serde::de::Visitor<'de> for Visitor {
8283                    type Value = __FieldTag;
8284                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8285                        formatter.write_str("a field name for DeleteRouteRequest")
8286                    }
8287                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8288                    where
8289                        E: serde::de::Error,
8290                    {
8291                        use std::result::Result::Ok;
8292                        use std::string::ToString;
8293                        match value {
8294                            "name" => Ok(__FieldTag::__name),
8295                            "requestId" => Ok(__FieldTag::__request_id),
8296                            "request_id" => Ok(__FieldTag::__request_id),
8297                            _ => Ok(__FieldTag::Unknown(value.to_string())),
8298                        }
8299                    }
8300                }
8301                deserializer.deserialize_identifier(Visitor)
8302            }
8303        }
8304        struct Visitor;
8305        impl<'de> serde::de::Visitor<'de> for Visitor {
8306            type Value = DeleteRouteRequest;
8307            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8308                formatter.write_str("struct DeleteRouteRequest")
8309            }
8310            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8311            where
8312                A: serde::de::MapAccess<'de>,
8313            {
8314                #[allow(unused_imports)]
8315                use serde::de::Error;
8316                use std::option::Option::Some;
8317                let mut fields = std::collections::HashSet::new();
8318                let mut result = Self::Value::new();
8319                while let Some(tag) = map.next_key::<__FieldTag>()? {
8320                    #[allow(clippy::match_single_binding)]
8321                    match tag {
8322                        __FieldTag::__name => {
8323                            if !fields.insert(__FieldTag::__name) {
8324                                return std::result::Result::Err(A::Error::duplicate_field(
8325                                    "multiple values for name",
8326                                ));
8327                            }
8328                            result.name = map
8329                                .next_value::<std::option::Option<std::string::String>>()?
8330                                .unwrap_or_default();
8331                        }
8332                        __FieldTag::__request_id => {
8333                            if !fields.insert(__FieldTag::__request_id) {
8334                                return std::result::Result::Err(A::Error::duplicate_field(
8335                                    "multiple values for request_id",
8336                                ));
8337                            }
8338                            result.request_id = map
8339                                .next_value::<std::option::Option<std::string::String>>()?
8340                                .unwrap_or_default();
8341                        }
8342                        __FieldTag::Unknown(key) => {
8343                            let value = map.next_value::<serde_json::Value>()?;
8344                            result._unknown_fields.insert(key, value);
8345                        }
8346                    }
8347                }
8348                std::result::Result::Ok(result)
8349            }
8350        }
8351        deserializer.deserialize_any(Visitor)
8352    }
8353}
8354
8355#[doc(hidden)]
8356impl serde::ser::Serialize for DeleteRouteRequest {
8357    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8358    where
8359        S: serde::ser::Serializer,
8360    {
8361        use serde::ser::SerializeMap;
8362        #[allow(unused_imports)]
8363        use std::option::Option::Some;
8364        let mut state = serializer.serialize_map(std::option::Option::None)?;
8365        if !self.name.is_empty() {
8366            state.serialize_entry("name", &self.name)?;
8367        }
8368        if !self.request_id.is_empty() {
8369            state.serialize_entry("requestId", &self.request_id)?;
8370        }
8371        if !self._unknown_fields.is_empty() {
8372            for (key, value) in self._unknown_fields.iter() {
8373                state.serialize_entry(key, &value)?;
8374            }
8375        }
8376        state.end()
8377    }
8378}
8379
8380impl std::fmt::Debug for DeleteRouteRequest {
8381    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8382        let mut debug_struct = f.debug_struct("DeleteRouteRequest");
8383        debug_struct.field("name", &self.name);
8384        debug_struct.field("request_id", &self.request_id);
8385        if !self._unknown_fields.is_empty() {
8386            debug_struct.field("_unknown_fields", &self._unknown_fields);
8387        }
8388        debug_struct.finish()
8389    }
8390}
8391
8392/// Route get request.
8393#[derive(Clone, Default, PartialEq)]
8394#[non_exhaustive]
8395pub struct GetRouteRequest {
8396    /// Required. The name of the Route resource to get.
8397    pub name: std::string::String,
8398
8399    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8400}
8401
8402impl GetRouteRequest {
8403    pub fn new() -> Self {
8404        std::default::Default::default()
8405    }
8406
8407    /// Sets the value of [name][crate::model::GetRouteRequest::name].
8408    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8409        self.name = v.into();
8410        self
8411    }
8412}
8413
8414impl wkt::message::Message for GetRouteRequest {
8415    fn typename() -> &'static str {
8416        "type.googleapis.com/google.cloud.datastream.v1.GetRouteRequest"
8417    }
8418}
8419
8420#[doc(hidden)]
8421impl<'de> serde::de::Deserialize<'de> for GetRouteRequest {
8422    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8423    where
8424        D: serde::Deserializer<'de>,
8425    {
8426        #[allow(non_camel_case_types)]
8427        #[doc(hidden)]
8428        #[derive(PartialEq, Eq, Hash)]
8429        enum __FieldTag {
8430            __name,
8431            Unknown(std::string::String),
8432        }
8433        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8434            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8435            where
8436                D: serde::Deserializer<'de>,
8437            {
8438                struct Visitor;
8439                impl<'de> serde::de::Visitor<'de> for Visitor {
8440                    type Value = __FieldTag;
8441                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8442                        formatter.write_str("a field name for GetRouteRequest")
8443                    }
8444                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8445                    where
8446                        E: serde::de::Error,
8447                    {
8448                        use std::result::Result::Ok;
8449                        use std::string::ToString;
8450                        match value {
8451                            "name" => Ok(__FieldTag::__name),
8452                            _ => Ok(__FieldTag::Unknown(value.to_string())),
8453                        }
8454                    }
8455                }
8456                deserializer.deserialize_identifier(Visitor)
8457            }
8458        }
8459        struct Visitor;
8460        impl<'de> serde::de::Visitor<'de> for Visitor {
8461            type Value = GetRouteRequest;
8462            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8463                formatter.write_str("struct GetRouteRequest")
8464            }
8465            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8466            where
8467                A: serde::de::MapAccess<'de>,
8468            {
8469                #[allow(unused_imports)]
8470                use serde::de::Error;
8471                use std::option::Option::Some;
8472                let mut fields = std::collections::HashSet::new();
8473                let mut result = Self::Value::new();
8474                while let Some(tag) = map.next_key::<__FieldTag>()? {
8475                    #[allow(clippy::match_single_binding)]
8476                    match tag {
8477                        __FieldTag::__name => {
8478                            if !fields.insert(__FieldTag::__name) {
8479                                return std::result::Result::Err(A::Error::duplicate_field(
8480                                    "multiple values for name",
8481                                ));
8482                            }
8483                            result.name = map
8484                                .next_value::<std::option::Option<std::string::String>>()?
8485                                .unwrap_or_default();
8486                        }
8487                        __FieldTag::Unknown(key) => {
8488                            let value = map.next_value::<serde_json::Value>()?;
8489                            result._unknown_fields.insert(key, value);
8490                        }
8491                    }
8492                }
8493                std::result::Result::Ok(result)
8494            }
8495        }
8496        deserializer.deserialize_any(Visitor)
8497    }
8498}
8499
8500#[doc(hidden)]
8501impl serde::ser::Serialize for GetRouteRequest {
8502    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8503    where
8504        S: serde::ser::Serializer,
8505    {
8506        use serde::ser::SerializeMap;
8507        #[allow(unused_imports)]
8508        use std::option::Option::Some;
8509        let mut state = serializer.serialize_map(std::option::Option::None)?;
8510        if !self.name.is_empty() {
8511            state.serialize_entry("name", &self.name)?;
8512        }
8513        if !self._unknown_fields.is_empty() {
8514            for (key, value) in self._unknown_fields.iter() {
8515                state.serialize_entry(key, &value)?;
8516            }
8517        }
8518        state.end()
8519    }
8520}
8521
8522impl std::fmt::Debug for GetRouteRequest {
8523    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8524        let mut debug_struct = f.debug_struct("GetRouteRequest");
8525        debug_struct.field("name", &self.name);
8526        if !self._unknown_fields.is_empty() {
8527            debug_struct.field("_unknown_fields", &self._unknown_fields);
8528        }
8529        debug_struct.finish()
8530    }
8531}
8532
8533/// Oracle database profile.
8534#[derive(Clone, Default, PartialEq)]
8535#[non_exhaustive]
8536pub struct OracleProfile {
8537    /// Required. Hostname for the Oracle connection.
8538    pub hostname: std::string::String,
8539
8540    /// Port for the Oracle connection, default value is 1521.
8541    pub port: i32,
8542
8543    /// Required. Username for the Oracle connection.
8544    pub username: std::string::String,
8545
8546    /// Optional. Password for the Oracle connection. Mutually exclusive with the
8547    /// `secret_manager_stored_password` field.
8548    pub password: std::string::String,
8549
8550    /// Required. Database for the Oracle connection.
8551    pub database_service: std::string::String,
8552
8553    /// Connection string attributes
8554    pub connection_attributes: std::collections::HashMap<std::string::String, std::string::String>,
8555
8556    /// Optional. SSL configuration for the Oracle connection.
8557    pub oracle_ssl_config: std::option::Option<crate::model::OracleSslConfig>,
8558
8559    /// Optional. Configuration for Oracle ASM connection.
8560    pub oracle_asm_config: std::option::Option<crate::model::OracleAsmConfig>,
8561
8562    /// Optional. A reference to a Secret Manager resource name storing the Oracle
8563    /// connection password. Mutually exclusive with the `password` field.
8564    pub secret_manager_stored_password: std::string::String,
8565
8566    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8567}
8568
8569impl OracleProfile {
8570    pub fn new() -> Self {
8571        std::default::Default::default()
8572    }
8573
8574    /// Sets the value of [hostname][crate::model::OracleProfile::hostname].
8575    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8576        self.hostname = v.into();
8577        self
8578    }
8579
8580    /// Sets the value of [port][crate::model::OracleProfile::port].
8581    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8582        self.port = v.into();
8583        self
8584    }
8585
8586    /// Sets the value of [username][crate::model::OracleProfile::username].
8587    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8588        self.username = v.into();
8589        self
8590    }
8591
8592    /// Sets the value of [password][crate::model::OracleProfile::password].
8593    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8594        self.password = v.into();
8595        self
8596    }
8597
8598    /// Sets the value of [database_service][crate::model::OracleProfile::database_service].
8599    pub fn set_database_service<T: std::convert::Into<std::string::String>>(
8600        mut self,
8601        v: T,
8602    ) -> Self {
8603        self.database_service = v.into();
8604        self
8605    }
8606
8607    /// Sets the value of [connection_attributes][crate::model::OracleProfile::connection_attributes].
8608    pub fn set_connection_attributes<T, K, V>(mut self, v: T) -> Self
8609    where
8610        T: std::iter::IntoIterator<Item = (K, V)>,
8611        K: std::convert::Into<std::string::String>,
8612        V: std::convert::Into<std::string::String>,
8613    {
8614        use std::iter::Iterator;
8615        self.connection_attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8616        self
8617    }
8618
8619    /// Sets the value of [oracle_ssl_config][crate::model::OracleProfile::oracle_ssl_config].
8620    pub fn set_oracle_ssl_config<T>(mut self, v: T) -> Self
8621    where
8622        T: std::convert::Into<crate::model::OracleSslConfig>,
8623    {
8624        self.oracle_ssl_config = std::option::Option::Some(v.into());
8625        self
8626    }
8627
8628    /// Sets or clears the value of [oracle_ssl_config][crate::model::OracleProfile::oracle_ssl_config].
8629    pub fn set_or_clear_oracle_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
8630    where
8631        T: std::convert::Into<crate::model::OracleSslConfig>,
8632    {
8633        self.oracle_ssl_config = v.map(|x| x.into());
8634        self
8635    }
8636
8637    /// Sets the value of [oracle_asm_config][crate::model::OracleProfile::oracle_asm_config].
8638    pub fn set_oracle_asm_config<T>(mut self, v: T) -> Self
8639    where
8640        T: std::convert::Into<crate::model::OracleAsmConfig>,
8641    {
8642        self.oracle_asm_config = std::option::Option::Some(v.into());
8643        self
8644    }
8645
8646    /// Sets or clears the value of [oracle_asm_config][crate::model::OracleProfile::oracle_asm_config].
8647    pub fn set_or_clear_oracle_asm_config<T>(mut self, v: std::option::Option<T>) -> Self
8648    where
8649        T: std::convert::Into<crate::model::OracleAsmConfig>,
8650    {
8651        self.oracle_asm_config = v.map(|x| x.into());
8652        self
8653    }
8654
8655    /// Sets the value of [secret_manager_stored_password][crate::model::OracleProfile::secret_manager_stored_password].
8656    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
8657        mut self,
8658        v: T,
8659    ) -> Self {
8660        self.secret_manager_stored_password = v.into();
8661        self
8662    }
8663}
8664
8665impl wkt::message::Message for OracleProfile {
8666    fn typename() -> &'static str {
8667        "type.googleapis.com/google.cloud.datastream.v1.OracleProfile"
8668    }
8669}
8670
8671#[doc(hidden)]
8672impl<'de> serde::de::Deserialize<'de> for OracleProfile {
8673    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8674    where
8675        D: serde::Deserializer<'de>,
8676    {
8677        #[allow(non_camel_case_types)]
8678        #[doc(hidden)]
8679        #[derive(PartialEq, Eq, Hash)]
8680        enum __FieldTag {
8681            __hostname,
8682            __port,
8683            __username,
8684            __password,
8685            __database_service,
8686            __connection_attributes,
8687            __oracle_ssl_config,
8688            __oracle_asm_config,
8689            __secret_manager_stored_password,
8690            Unknown(std::string::String),
8691        }
8692        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8693            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8694            where
8695                D: serde::Deserializer<'de>,
8696            {
8697                struct Visitor;
8698                impl<'de> serde::de::Visitor<'de> for Visitor {
8699                    type Value = __FieldTag;
8700                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8701                        formatter.write_str("a field name for OracleProfile")
8702                    }
8703                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8704                    where
8705                        E: serde::de::Error,
8706                    {
8707                        use std::result::Result::Ok;
8708                        use std::string::ToString;
8709                        match value {
8710                            "hostname" => Ok(__FieldTag::__hostname),
8711                            "port" => Ok(__FieldTag::__port),
8712                            "username" => Ok(__FieldTag::__username),
8713                            "password" => Ok(__FieldTag::__password),
8714                            "databaseService" => Ok(__FieldTag::__database_service),
8715                            "database_service" => Ok(__FieldTag::__database_service),
8716                            "connectionAttributes" => Ok(__FieldTag::__connection_attributes),
8717                            "connection_attributes" => Ok(__FieldTag::__connection_attributes),
8718                            "oracleSslConfig" => Ok(__FieldTag::__oracle_ssl_config),
8719                            "oracle_ssl_config" => Ok(__FieldTag::__oracle_ssl_config),
8720                            "oracleAsmConfig" => Ok(__FieldTag::__oracle_asm_config),
8721                            "oracle_asm_config" => Ok(__FieldTag::__oracle_asm_config),
8722                            "secretManagerStoredPassword" => {
8723                                Ok(__FieldTag::__secret_manager_stored_password)
8724                            }
8725                            "secret_manager_stored_password" => {
8726                                Ok(__FieldTag::__secret_manager_stored_password)
8727                            }
8728                            _ => Ok(__FieldTag::Unknown(value.to_string())),
8729                        }
8730                    }
8731                }
8732                deserializer.deserialize_identifier(Visitor)
8733            }
8734        }
8735        struct Visitor;
8736        impl<'de> serde::de::Visitor<'de> for Visitor {
8737            type Value = OracleProfile;
8738            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8739                formatter.write_str("struct OracleProfile")
8740            }
8741            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8742            where
8743                A: serde::de::MapAccess<'de>,
8744            {
8745                #[allow(unused_imports)]
8746                use serde::de::Error;
8747                use std::option::Option::Some;
8748                let mut fields = std::collections::HashSet::new();
8749                let mut result = Self::Value::new();
8750                while let Some(tag) = map.next_key::<__FieldTag>()? {
8751                    #[allow(clippy::match_single_binding)]
8752                    match tag {
8753                        __FieldTag::__hostname => {
8754                            if !fields.insert(__FieldTag::__hostname) {
8755                                return std::result::Result::Err(A::Error::duplicate_field(
8756                                    "multiple values for hostname",
8757                                ));
8758                            }
8759                            result.hostname = map
8760                                .next_value::<std::option::Option<std::string::String>>()?
8761                                .unwrap_or_default();
8762                        }
8763                        __FieldTag::__port => {
8764                            if !fields.insert(__FieldTag::__port) {
8765                                return std::result::Result::Err(A::Error::duplicate_field(
8766                                    "multiple values for port",
8767                                ));
8768                            }
8769                            struct __With(std::option::Option<i32>);
8770                            impl<'de> serde::de::Deserialize<'de> for __With {
8771                                fn deserialize<D>(
8772                                    deserializer: D,
8773                                ) -> std::result::Result<Self, D::Error>
8774                                where
8775                                    D: serde::de::Deserializer<'de>,
8776                                {
8777                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
8778                                }
8779                            }
8780                            result.port = map.next_value::<__With>()?.0.unwrap_or_default();
8781                        }
8782                        __FieldTag::__username => {
8783                            if !fields.insert(__FieldTag::__username) {
8784                                return std::result::Result::Err(A::Error::duplicate_field(
8785                                    "multiple values for username",
8786                                ));
8787                            }
8788                            result.username = map
8789                                .next_value::<std::option::Option<std::string::String>>()?
8790                                .unwrap_or_default();
8791                        }
8792                        __FieldTag::__password => {
8793                            if !fields.insert(__FieldTag::__password) {
8794                                return std::result::Result::Err(A::Error::duplicate_field(
8795                                    "multiple values for password",
8796                                ));
8797                            }
8798                            result.password = map
8799                                .next_value::<std::option::Option<std::string::String>>()?
8800                                .unwrap_or_default();
8801                        }
8802                        __FieldTag::__database_service => {
8803                            if !fields.insert(__FieldTag::__database_service) {
8804                                return std::result::Result::Err(A::Error::duplicate_field(
8805                                    "multiple values for database_service",
8806                                ));
8807                            }
8808                            result.database_service = map
8809                                .next_value::<std::option::Option<std::string::String>>()?
8810                                .unwrap_or_default();
8811                        }
8812                        __FieldTag::__connection_attributes => {
8813                            if !fields.insert(__FieldTag::__connection_attributes) {
8814                                return std::result::Result::Err(A::Error::duplicate_field(
8815                                    "multiple values for connection_attributes",
8816                                ));
8817                            }
8818                            result.connection_attributes = map
8819                                .next_value::<std::option::Option<
8820                                    std::collections::HashMap<
8821                                        std::string::String,
8822                                        std::string::String,
8823                                    >,
8824                                >>()?
8825                                .unwrap_or_default();
8826                        }
8827                        __FieldTag::__oracle_ssl_config => {
8828                            if !fields.insert(__FieldTag::__oracle_ssl_config) {
8829                                return std::result::Result::Err(A::Error::duplicate_field(
8830                                    "multiple values for oracle_ssl_config",
8831                                ));
8832                            }
8833                            result.oracle_ssl_config = map
8834                                .next_value::<std::option::Option<crate::model::OracleSslConfig>>(
8835                                )?;
8836                        }
8837                        __FieldTag::__oracle_asm_config => {
8838                            if !fields.insert(__FieldTag::__oracle_asm_config) {
8839                                return std::result::Result::Err(A::Error::duplicate_field(
8840                                    "multiple values for oracle_asm_config",
8841                                ));
8842                            }
8843                            result.oracle_asm_config = map
8844                                .next_value::<std::option::Option<crate::model::OracleAsmConfig>>(
8845                                )?;
8846                        }
8847                        __FieldTag::__secret_manager_stored_password => {
8848                            if !fields.insert(__FieldTag::__secret_manager_stored_password) {
8849                                return std::result::Result::Err(A::Error::duplicate_field(
8850                                    "multiple values for secret_manager_stored_password",
8851                                ));
8852                            }
8853                            result.secret_manager_stored_password = map
8854                                .next_value::<std::option::Option<std::string::String>>()?
8855                                .unwrap_or_default();
8856                        }
8857                        __FieldTag::Unknown(key) => {
8858                            let value = map.next_value::<serde_json::Value>()?;
8859                            result._unknown_fields.insert(key, value);
8860                        }
8861                    }
8862                }
8863                std::result::Result::Ok(result)
8864            }
8865        }
8866        deserializer.deserialize_any(Visitor)
8867    }
8868}
8869
8870#[doc(hidden)]
8871impl serde::ser::Serialize for OracleProfile {
8872    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8873    where
8874        S: serde::ser::Serializer,
8875    {
8876        use serde::ser::SerializeMap;
8877        #[allow(unused_imports)]
8878        use std::option::Option::Some;
8879        let mut state = serializer.serialize_map(std::option::Option::None)?;
8880        if !self.hostname.is_empty() {
8881            state.serialize_entry("hostname", &self.hostname)?;
8882        }
8883        if !wkt::internal::is_default(&self.port) {
8884            struct __With<'a>(&'a i32);
8885            impl<'a> serde::ser::Serialize for __With<'a> {
8886                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8887                where
8888                    S: serde::ser::Serializer,
8889                {
8890                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
8891                }
8892            }
8893            state.serialize_entry("port", &__With(&self.port))?;
8894        }
8895        if !self.username.is_empty() {
8896            state.serialize_entry("username", &self.username)?;
8897        }
8898        if !self.password.is_empty() {
8899            state.serialize_entry("password", &self.password)?;
8900        }
8901        if !self.database_service.is_empty() {
8902            state.serialize_entry("databaseService", &self.database_service)?;
8903        }
8904        if !self.connection_attributes.is_empty() {
8905            state.serialize_entry("connectionAttributes", &self.connection_attributes)?;
8906        }
8907        if self.oracle_ssl_config.is_some() {
8908            state.serialize_entry("oracleSslConfig", &self.oracle_ssl_config)?;
8909        }
8910        if self.oracle_asm_config.is_some() {
8911            state.serialize_entry("oracleAsmConfig", &self.oracle_asm_config)?;
8912        }
8913        if !self.secret_manager_stored_password.is_empty() {
8914            state.serialize_entry(
8915                "secretManagerStoredPassword",
8916                &self.secret_manager_stored_password,
8917            )?;
8918        }
8919        if !self._unknown_fields.is_empty() {
8920            for (key, value) in self._unknown_fields.iter() {
8921                state.serialize_entry(key, &value)?;
8922            }
8923        }
8924        state.end()
8925    }
8926}
8927
8928impl std::fmt::Debug for OracleProfile {
8929    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8930        let mut debug_struct = f.debug_struct("OracleProfile");
8931        debug_struct.field("hostname", &self.hostname);
8932        debug_struct.field("port", &self.port);
8933        debug_struct.field("username", &self.username);
8934        debug_struct.field("password", &self.password);
8935        debug_struct.field("database_service", &self.database_service);
8936        debug_struct.field("connection_attributes", &self.connection_attributes);
8937        debug_struct.field("oracle_ssl_config", &self.oracle_ssl_config);
8938        debug_struct.field("oracle_asm_config", &self.oracle_asm_config);
8939        debug_struct.field(
8940            "secret_manager_stored_password",
8941            &self.secret_manager_stored_password,
8942        );
8943        if !self._unknown_fields.is_empty() {
8944            debug_struct.field("_unknown_fields", &self._unknown_fields);
8945        }
8946        debug_struct.finish()
8947    }
8948}
8949
8950/// Configuration for Oracle Automatic Storage Management (ASM) connection.
8951#[derive(Clone, Default, PartialEq)]
8952#[non_exhaustive]
8953pub struct OracleAsmConfig {
8954    /// Required. Hostname for the Oracle ASM connection.
8955    pub hostname: std::string::String,
8956
8957    /// Required. Port for the Oracle ASM connection.
8958    pub port: i32,
8959
8960    /// Required. Username for the Oracle ASM connection.
8961    pub username: std::string::String,
8962
8963    /// Optional. Password for the Oracle ASM connection. Mutually exclusive with
8964    /// the `secret_manager_stored_password` field.
8965    pub password: std::string::String,
8966
8967    /// Required. ASM service name for the Oracle ASM connection.
8968    pub asm_service: std::string::String,
8969
8970    /// Optional. Connection string attributes
8971    pub connection_attributes: std::collections::HashMap<std::string::String, std::string::String>,
8972
8973    /// Optional. SSL configuration for the Oracle connection.
8974    pub oracle_ssl_config: std::option::Option<crate::model::OracleSslConfig>,
8975
8976    /// Optional. A reference to a Secret Manager resource name storing the Oracle
8977    /// ASM connection password. Mutually exclusive with the `password` field.
8978    pub secret_manager_stored_password: std::string::String,
8979
8980    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8981}
8982
8983impl OracleAsmConfig {
8984    pub fn new() -> Self {
8985        std::default::Default::default()
8986    }
8987
8988    /// Sets the value of [hostname][crate::model::OracleAsmConfig::hostname].
8989    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8990        self.hostname = v.into();
8991        self
8992    }
8993
8994    /// Sets the value of [port][crate::model::OracleAsmConfig::port].
8995    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8996        self.port = v.into();
8997        self
8998    }
8999
9000    /// Sets the value of [username][crate::model::OracleAsmConfig::username].
9001    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9002        self.username = v.into();
9003        self
9004    }
9005
9006    /// Sets the value of [password][crate::model::OracleAsmConfig::password].
9007    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9008        self.password = v.into();
9009        self
9010    }
9011
9012    /// Sets the value of [asm_service][crate::model::OracleAsmConfig::asm_service].
9013    pub fn set_asm_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9014        self.asm_service = v.into();
9015        self
9016    }
9017
9018    /// Sets the value of [connection_attributes][crate::model::OracleAsmConfig::connection_attributes].
9019    pub fn set_connection_attributes<T, K, V>(mut self, v: T) -> Self
9020    where
9021        T: std::iter::IntoIterator<Item = (K, V)>,
9022        K: std::convert::Into<std::string::String>,
9023        V: std::convert::Into<std::string::String>,
9024    {
9025        use std::iter::Iterator;
9026        self.connection_attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9027        self
9028    }
9029
9030    /// Sets the value of [oracle_ssl_config][crate::model::OracleAsmConfig::oracle_ssl_config].
9031    pub fn set_oracle_ssl_config<T>(mut self, v: T) -> Self
9032    where
9033        T: std::convert::Into<crate::model::OracleSslConfig>,
9034    {
9035        self.oracle_ssl_config = std::option::Option::Some(v.into());
9036        self
9037    }
9038
9039    /// Sets or clears the value of [oracle_ssl_config][crate::model::OracleAsmConfig::oracle_ssl_config].
9040    pub fn set_or_clear_oracle_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
9041    where
9042        T: std::convert::Into<crate::model::OracleSslConfig>,
9043    {
9044        self.oracle_ssl_config = v.map(|x| x.into());
9045        self
9046    }
9047
9048    /// Sets the value of [secret_manager_stored_password][crate::model::OracleAsmConfig::secret_manager_stored_password].
9049    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
9050        mut self,
9051        v: T,
9052    ) -> Self {
9053        self.secret_manager_stored_password = v.into();
9054        self
9055    }
9056}
9057
9058impl wkt::message::Message for OracleAsmConfig {
9059    fn typename() -> &'static str {
9060        "type.googleapis.com/google.cloud.datastream.v1.OracleAsmConfig"
9061    }
9062}
9063
9064#[doc(hidden)]
9065impl<'de> serde::de::Deserialize<'de> for OracleAsmConfig {
9066    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9067    where
9068        D: serde::Deserializer<'de>,
9069    {
9070        #[allow(non_camel_case_types)]
9071        #[doc(hidden)]
9072        #[derive(PartialEq, Eq, Hash)]
9073        enum __FieldTag {
9074            __hostname,
9075            __port,
9076            __username,
9077            __password,
9078            __asm_service,
9079            __connection_attributes,
9080            __oracle_ssl_config,
9081            __secret_manager_stored_password,
9082            Unknown(std::string::String),
9083        }
9084        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9085            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9086            where
9087                D: serde::Deserializer<'de>,
9088            {
9089                struct Visitor;
9090                impl<'de> serde::de::Visitor<'de> for Visitor {
9091                    type Value = __FieldTag;
9092                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9093                        formatter.write_str("a field name for OracleAsmConfig")
9094                    }
9095                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9096                    where
9097                        E: serde::de::Error,
9098                    {
9099                        use std::result::Result::Ok;
9100                        use std::string::ToString;
9101                        match value {
9102                            "hostname" => Ok(__FieldTag::__hostname),
9103                            "port" => Ok(__FieldTag::__port),
9104                            "username" => Ok(__FieldTag::__username),
9105                            "password" => Ok(__FieldTag::__password),
9106                            "asmService" => Ok(__FieldTag::__asm_service),
9107                            "asm_service" => Ok(__FieldTag::__asm_service),
9108                            "connectionAttributes" => Ok(__FieldTag::__connection_attributes),
9109                            "connection_attributes" => Ok(__FieldTag::__connection_attributes),
9110                            "oracleSslConfig" => Ok(__FieldTag::__oracle_ssl_config),
9111                            "oracle_ssl_config" => Ok(__FieldTag::__oracle_ssl_config),
9112                            "secretManagerStoredPassword" => {
9113                                Ok(__FieldTag::__secret_manager_stored_password)
9114                            }
9115                            "secret_manager_stored_password" => {
9116                                Ok(__FieldTag::__secret_manager_stored_password)
9117                            }
9118                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9119                        }
9120                    }
9121                }
9122                deserializer.deserialize_identifier(Visitor)
9123            }
9124        }
9125        struct Visitor;
9126        impl<'de> serde::de::Visitor<'de> for Visitor {
9127            type Value = OracleAsmConfig;
9128            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9129                formatter.write_str("struct OracleAsmConfig")
9130            }
9131            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9132            where
9133                A: serde::de::MapAccess<'de>,
9134            {
9135                #[allow(unused_imports)]
9136                use serde::de::Error;
9137                use std::option::Option::Some;
9138                let mut fields = std::collections::HashSet::new();
9139                let mut result = Self::Value::new();
9140                while let Some(tag) = map.next_key::<__FieldTag>()? {
9141                    #[allow(clippy::match_single_binding)]
9142                    match tag {
9143                        __FieldTag::__hostname => {
9144                            if !fields.insert(__FieldTag::__hostname) {
9145                                return std::result::Result::Err(A::Error::duplicate_field(
9146                                    "multiple values for hostname",
9147                                ));
9148                            }
9149                            result.hostname = map
9150                                .next_value::<std::option::Option<std::string::String>>()?
9151                                .unwrap_or_default();
9152                        }
9153                        __FieldTag::__port => {
9154                            if !fields.insert(__FieldTag::__port) {
9155                                return std::result::Result::Err(A::Error::duplicate_field(
9156                                    "multiple values for port",
9157                                ));
9158                            }
9159                            struct __With(std::option::Option<i32>);
9160                            impl<'de> serde::de::Deserialize<'de> for __With {
9161                                fn deserialize<D>(
9162                                    deserializer: D,
9163                                ) -> std::result::Result<Self, D::Error>
9164                                where
9165                                    D: serde::de::Deserializer<'de>,
9166                                {
9167                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
9168                                }
9169                            }
9170                            result.port = map.next_value::<__With>()?.0.unwrap_or_default();
9171                        }
9172                        __FieldTag::__username => {
9173                            if !fields.insert(__FieldTag::__username) {
9174                                return std::result::Result::Err(A::Error::duplicate_field(
9175                                    "multiple values for username",
9176                                ));
9177                            }
9178                            result.username = map
9179                                .next_value::<std::option::Option<std::string::String>>()?
9180                                .unwrap_or_default();
9181                        }
9182                        __FieldTag::__password => {
9183                            if !fields.insert(__FieldTag::__password) {
9184                                return std::result::Result::Err(A::Error::duplicate_field(
9185                                    "multiple values for password",
9186                                ));
9187                            }
9188                            result.password = map
9189                                .next_value::<std::option::Option<std::string::String>>()?
9190                                .unwrap_or_default();
9191                        }
9192                        __FieldTag::__asm_service => {
9193                            if !fields.insert(__FieldTag::__asm_service) {
9194                                return std::result::Result::Err(A::Error::duplicate_field(
9195                                    "multiple values for asm_service",
9196                                ));
9197                            }
9198                            result.asm_service = map
9199                                .next_value::<std::option::Option<std::string::String>>()?
9200                                .unwrap_or_default();
9201                        }
9202                        __FieldTag::__connection_attributes => {
9203                            if !fields.insert(__FieldTag::__connection_attributes) {
9204                                return std::result::Result::Err(A::Error::duplicate_field(
9205                                    "multiple values for connection_attributes",
9206                                ));
9207                            }
9208                            result.connection_attributes = map
9209                                .next_value::<std::option::Option<
9210                                    std::collections::HashMap<
9211                                        std::string::String,
9212                                        std::string::String,
9213                                    >,
9214                                >>()?
9215                                .unwrap_or_default();
9216                        }
9217                        __FieldTag::__oracle_ssl_config => {
9218                            if !fields.insert(__FieldTag::__oracle_ssl_config) {
9219                                return std::result::Result::Err(A::Error::duplicate_field(
9220                                    "multiple values for oracle_ssl_config",
9221                                ));
9222                            }
9223                            result.oracle_ssl_config = map
9224                                .next_value::<std::option::Option<crate::model::OracleSslConfig>>(
9225                                )?;
9226                        }
9227                        __FieldTag::__secret_manager_stored_password => {
9228                            if !fields.insert(__FieldTag::__secret_manager_stored_password) {
9229                                return std::result::Result::Err(A::Error::duplicate_field(
9230                                    "multiple values for secret_manager_stored_password",
9231                                ));
9232                            }
9233                            result.secret_manager_stored_password = map
9234                                .next_value::<std::option::Option<std::string::String>>()?
9235                                .unwrap_or_default();
9236                        }
9237                        __FieldTag::Unknown(key) => {
9238                            let value = map.next_value::<serde_json::Value>()?;
9239                            result._unknown_fields.insert(key, value);
9240                        }
9241                    }
9242                }
9243                std::result::Result::Ok(result)
9244            }
9245        }
9246        deserializer.deserialize_any(Visitor)
9247    }
9248}
9249
9250#[doc(hidden)]
9251impl serde::ser::Serialize for OracleAsmConfig {
9252    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9253    where
9254        S: serde::ser::Serializer,
9255    {
9256        use serde::ser::SerializeMap;
9257        #[allow(unused_imports)]
9258        use std::option::Option::Some;
9259        let mut state = serializer.serialize_map(std::option::Option::None)?;
9260        if !self.hostname.is_empty() {
9261            state.serialize_entry("hostname", &self.hostname)?;
9262        }
9263        if !wkt::internal::is_default(&self.port) {
9264            struct __With<'a>(&'a i32);
9265            impl<'a> serde::ser::Serialize for __With<'a> {
9266                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9267                where
9268                    S: serde::ser::Serializer,
9269                {
9270                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
9271                }
9272            }
9273            state.serialize_entry("port", &__With(&self.port))?;
9274        }
9275        if !self.username.is_empty() {
9276            state.serialize_entry("username", &self.username)?;
9277        }
9278        if !self.password.is_empty() {
9279            state.serialize_entry("password", &self.password)?;
9280        }
9281        if !self.asm_service.is_empty() {
9282            state.serialize_entry("asmService", &self.asm_service)?;
9283        }
9284        if !self.connection_attributes.is_empty() {
9285            state.serialize_entry("connectionAttributes", &self.connection_attributes)?;
9286        }
9287        if self.oracle_ssl_config.is_some() {
9288            state.serialize_entry("oracleSslConfig", &self.oracle_ssl_config)?;
9289        }
9290        if !self.secret_manager_stored_password.is_empty() {
9291            state.serialize_entry(
9292                "secretManagerStoredPassword",
9293                &self.secret_manager_stored_password,
9294            )?;
9295        }
9296        if !self._unknown_fields.is_empty() {
9297            for (key, value) in self._unknown_fields.iter() {
9298                state.serialize_entry(key, &value)?;
9299            }
9300        }
9301        state.end()
9302    }
9303}
9304
9305impl std::fmt::Debug for OracleAsmConfig {
9306    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9307        let mut debug_struct = f.debug_struct("OracleAsmConfig");
9308        debug_struct.field("hostname", &self.hostname);
9309        debug_struct.field("port", &self.port);
9310        debug_struct.field("username", &self.username);
9311        debug_struct.field("password", &self.password);
9312        debug_struct.field("asm_service", &self.asm_service);
9313        debug_struct.field("connection_attributes", &self.connection_attributes);
9314        debug_struct.field("oracle_ssl_config", &self.oracle_ssl_config);
9315        debug_struct.field(
9316            "secret_manager_stored_password",
9317            &self.secret_manager_stored_password,
9318        );
9319        if !self._unknown_fields.is_empty() {
9320            debug_struct.field("_unknown_fields", &self._unknown_fields);
9321        }
9322        debug_struct.finish()
9323    }
9324}
9325
9326/// MySQL database profile.
9327#[derive(Clone, Default, PartialEq)]
9328#[non_exhaustive]
9329pub struct MysqlProfile {
9330    /// Required. Hostname for the MySQL connection.
9331    pub hostname: std::string::String,
9332
9333    /// Port for the MySQL connection, default value is 3306.
9334    pub port: i32,
9335
9336    /// Required. Username for the MySQL connection.
9337    pub username: std::string::String,
9338
9339    /// Optional. Input only. Password for the MySQL connection. Mutually exclusive
9340    /// with the `secret_manager_stored_password` field.
9341    pub password: std::string::String,
9342
9343    /// SSL configuration for the MySQL connection.
9344    pub ssl_config: std::option::Option<crate::model::MysqlSslConfig>,
9345
9346    /// Optional. A reference to a Secret Manager resource name storing the MySQL
9347    /// connection password. Mutually exclusive with the `password` field.
9348    pub secret_manager_stored_password: std::string::String,
9349
9350    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9351}
9352
9353impl MysqlProfile {
9354    pub fn new() -> Self {
9355        std::default::Default::default()
9356    }
9357
9358    /// Sets the value of [hostname][crate::model::MysqlProfile::hostname].
9359    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9360        self.hostname = v.into();
9361        self
9362    }
9363
9364    /// Sets the value of [port][crate::model::MysqlProfile::port].
9365    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9366        self.port = v.into();
9367        self
9368    }
9369
9370    /// Sets the value of [username][crate::model::MysqlProfile::username].
9371    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9372        self.username = v.into();
9373        self
9374    }
9375
9376    /// Sets the value of [password][crate::model::MysqlProfile::password].
9377    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9378        self.password = v.into();
9379        self
9380    }
9381
9382    /// Sets the value of [ssl_config][crate::model::MysqlProfile::ssl_config].
9383    pub fn set_ssl_config<T>(mut self, v: T) -> Self
9384    where
9385        T: std::convert::Into<crate::model::MysqlSslConfig>,
9386    {
9387        self.ssl_config = std::option::Option::Some(v.into());
9388        self
9389    }
9390
9391    /// Sets or clears the value of [ssl_config][crate::model::MysqlProfile::ssl_config].
9392    pub fn set_or_clear_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
9393    where
9394        T: std::convert::Into<crate::model::MysqlSslConfig>,
9395    {
9396        self.ssl_config = v.map(|x| x.into());
9397        self
9398    }
9399
9400    /// Sets the value of [secret_manager_stored_password][crate::model::MysqlProfile::secret_manager_stored_password].
9401    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
9402        mut self,
9403        v: T,
9404    ) -> Self {
9405        self.secret_manager_stored_password = v.into();
9406        self
9407    }
9408}
9409
9410impl wkt::message::Message for MysqlProfile {
9411    fn typename() -> &'static str {
9412        "type.googleapis.com/google.cloud.datastream.v1.MysqlProfile"
9413    }
9414}
9415
9416#[doc(hidden)]
9417impl<'de> serde::de::Deserialize<'de> for MysqlProfile {
9418    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9419    where
9420        D: serde::Deserializer<'de>,
9421    {
9422        #[allow(non_camel_case_types)]
9423        #[doc(hidden)]
9424        #[derive(PartialEq, Eq, Hash)]
9425        enum __FieldTag {
9426            __hostname,
9427            __port,
9428            __username,
9429            __password,
9430            __ssl_config,
9431            __secret_manager_stored_password,
9432            Unknown(std::string::String),
9433        }
9434        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9435            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9436            where
9437                D: serde::Deserializer<'de>,
9438            {
9439                struct Visitor;
9440                impl<'de> serde::de::Visitor<'de> for Visitor {
9441                    type Value = __FieldTag;
9442                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9443                        formatter.write_str("a field name for MysqlProfile")
9444                    }
9445                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9446                    where
9447                        E: serde::de::Error,
9448                    {
9449                        use std::result::Result::Ok;
9450                        use std::string::ToString;
9451                        match value {
9452                            "hostname" => Ok(__FieldTag::__hostname),
9453                            "port" => Ok(__FieldTag::__port),
9454                            "username" => Ok(__FieldTag::__username),
9455                            "password" => Ok(__FieldTag::__password),
9456                            "sslConfig" => Ok(__FieldTag::__ssl_config),
9457                            "ssl_config" => Ok(__FieldTag::__ssl_config),
9458                            "secretManagerStoredPassword" => {
9459                                Ok(__FieldTag::__secret_manager_stored_password)
9460                            }
9461                            "secret_manager_stored_password" => {
9462                                Ok(__FieldTag::__secret_manager_stored_password)
9463                            }
9464                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9465                        }
9466                    }
9467                }
9468                deserializer.deserialize_identifier(Visitor)
9469            }
9470        }
9471        struct Visitor;
9472        impl<'de> serde::de::Visitor<'de> for Visitor {
9473            type Value = MysqlProfile;
9474            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9475                formatter.write_str("struct MysqlProfile")
9476            }
9477            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9478            where
9479                A: serde::de::MapAccess<'de>,
9480            {
9481                #[allow(unused_imports)]
9482                use serde::de::Error;
9483                use std::option::Option::Some;
9484                let mut fields = std::collections::HashSet::new();
9485                let mut result = Self::Value::new();
9486                while let Some(tag) = map.next_key::<__FieldTag>()? {
9487                    #[allow(clippy::match_single_binding)]
9488                    match tag {
9489                        __FieldTag::__hostname => {
9490                            if !fields.insert(__FieldTag::__hostname) {
9491                                return std::result::Result::Err(A::Error::duplicate_field(
9492                                    "multiple values for hostname",
9493                                ));
9494                            }
9495                            result.hostname = map
9496                                .next_value::<std::option::Option<std::string::String>>()?
9497                                .unwrap_or_default();
9498                        }
9499                        __FieldTag::__port => {
9500                            if !fields.insert(__FieldTag::__port) {
9501                                return std::result::Result::Err(A::Error::duplicate_field(
9502                                    "multiple values for port",
9503                                ));
9504                            }
9505                            struct __With(std::option::Option<i32>);
9506                            impl<'de> serde::de::Deserialize<'de> for __With {
9507                                fn deserialize<D>(
9508                                    deserializer: D,
9509                                ) -> std::result::Result<Self, D::Error>
9510                                where
9511                                    D: serde::de::Deserializer<'de>,
9512                                {
9513                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
9514                                }
9515                            }
9516                            result.port = map.next_value::<__With>()?.0.unwrap_or_default();
9517                        }
9518                        __FieldTag::__username => {
9519                            if !fields.insert(__FieldTag::__username) {
9520                                return std::result::Result::Err(A::Error::duplicate_field(
9521                                    "multiple values for username",
9522                                ));
9523                            }
9524                            result.username = map
9525                                .next_value::<std::option::Option<std::string::String>>()?
9526                                .unwrap_or_default();
9527                        }
9528                        __FieldTag::__password => {
9529                            if !fields.insert(__FieldTag::__password) {
9530                                return std::result::Result::Err(A::Error::duplicate_field(
9531                                    "multiple values for password",
9532                                ));
9533                            }
9534                            result.password = map
9535                                .next_value::<std::option::Option<std::string::String>>()?
9536                                .unwrap_or_default();
9537                        }
9538                        __FieldTag::__ssl_config => {
9539                            if !fields.insert(__FieldTag::__ssl_config) {
9540                                return std::result::Result::Err(A::Error::duplicate_field(
9541                                    "multiple values for ssl_config",
9542                                ));
9543                            }
9544                            result.ssl_config = map
9545                                .next_value::<std::option::Option<crate::model::MysqlSslConfig>>(
9546                                )?;
9547                        }
9548                        __FieldTag::__secret_manager_stored_password => {
9549                            if !fields.insert(__FieldTag::__secret_manager_stored_password) {
9550                                return std::result::Result::Err(A::Error::duplicate_field(
9551                                    "multiple values for secret_manager_stored_password",
9552                                ));
9553                            }
9554                            result.secret_manager_stored_password = map
9555                                .next_value::<std::option::Option<std::string::String>>()?
9556                                .unwrap_or_default();
9557                        }
9558                        __FieldTag::Unknown(key) => {
9559                            let value = map.next_value::<serde_json::Value>()?;
9560                            result._unknown_fields.insert(key, value);
9561                        }
9562                    }
9563                }
9564                std::result::Result::Ok(result)
9565            }
9566        }
9567        deserializer.deserialize_any(Visitor)
9568    }
9569}
9570
9571#[doc(hidden)]
9572impl serde::ser::Serialize for MysqlProfile {
9573    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9574    where
9575        S: serde::ser::Serializer,
9576    {
9577        use serde::ser::SerializeMap;
9578        #[allow(unused_imports)]
9579        use std::option::Option::Some;
9580        let mut state = serializer.serialize_map(std::option::Option::None)?;
9581        if !self.hostname.is_empty() {
9582            state.serialize_entry("hostname", &self.hostname)?;
9583        }
9584        if !wkt::internal::is_default(&self.port) {
9585            struct __With<'a>(&'a i32);
9586            impl<'a> serde::ser::Serialize for __With<'a> {
9587                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9588                where
9589                    S: serde::ser::Serializer,
9590                {
9591                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
9592                }
9593            }
9594            state.serialize_entry("port", &__With(&self.port))?;
9595        }
9596        if !self.username.is_empty() {
9597            state.serialize_entry("username", &self.username)?;
9598        }
9599        if !self.password.is_empty() {
9600            state.serialize_entry("password", &self.password)?;
9601        }
9602        if self.ssl_config.is_some() {
9603            state.serialize_entry("sslConfig", &self.ssl_config)?;
9604        }
9605        if !self.secret_manager_stored_password.is_empty() {
9606            state.serialize_entry(
9607                "secretManagerStoredPassword",
9608                &self.secret_manager_stored_password,
9609            )?;
9610        }
9611        if !self._unknown_fields.is_empty() {
9612            for (key, value) in self._unknown_fields.iter() {
9613                state.serialize_entry(key, &value)?;
9614            }
9615        }
9616        state.end()
9617    }
9618}
9619
9620impl std::fmt::Debug for MysqlProfile {
9621    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9622        let mut debug_struct = f.debug_struct("MysqlProfile");
9623        debug_struct.field("hostname", &self.hostname);
9624        debug_struct.field("port", &self.port);
9625        debug_struct.field("username", &self.username);
9626        debug_struct.field("password", &self.password);
9627        debug_struct.field("ssl_config", &self.ssl_config);
9628        debug_struct.field(
9629            "secret_manager_stored_password",
9630            &self.secret_manager_stored_password,
9631        );
9632        if !self._unknown_fields.is_empty() {
9633            debug_struct.field("_unknown_fields", &self._unknown_fields);
9634        }
9635        debug_struct.finish()
9636    }
9637}
9638
9639/// PostgreSQL database profile.
9640#[derive(Clone, Default, PartialEq)]
9641#[non_exhaustive]
9642pub struct PostgresqlProfile {
9643    /// Required. Hostname for the PostgreSQL connection.
9644    pub hostname: std::string::String,
9645
9646    /// Port for the PostgreSQL connection, default value is 5432.
9647    pub port: i32,
9648
9649    /// Required. Username for the PostgreSQL connection.
9650    pub username: std::string::String,
9651
9652    /// Optional. Password for the PostgreSQL connection. Mutually exclusive with
9653    /// the `secret_manager_stored_password` field.
9654    pub password: std::string::String,
9655
9656    /// Required. Database for the PostgreSQL connection.
9657    pub database: std::string::String,
9658
9659    /// Optional. A reference to a Secret Manager resource name storing the
9660    /// PostgreSQL connection password. Mutually exclusive with the `password`
9661    /// field.
9662    pub secret_manager_stored_password: std::string::String,
9663
9664    /// Optional. SSL configuration for the PostgreSQL connection.
9665    /// In case PostgresqlSslConfig is not set, the connection will use the default
9666    /// SSL mode, which is `prefer` (i.e. this mode will only use encryption if
9667    /// enabled from database side, otherwise will use unencrypted communication)
9668    pub ssl_config: std::option::Option<crate::model::PostgresqlSslConfig>,
9669
9670    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9671}
9672
9673impl PostgresqlProfile {
9674    pub fn new() -> Self {
9675        std::default::Default::default()
9676    }
9677
9678    /// Sets the value of [hostname][crate::model::PostgresqlProfile::hostname].
9679    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9680        self.hostname = v.into();
9681        self
9682    }
9683
9684    /// Sets the value of [port][crate::model::PostgresqlProfile::port].
9685    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9686        self.port = v.into();
9687        self
9688    }
9689
9690    /// Sets the value of [username][crate::model::PostgresqlProfile::username].
9691    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9692        self.username = v.into();
9693        self
9694    }
9695
9696    /// Sets the value of [password][crate::model::PostgresqlProfile::password].
9697    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9698        self.password = v.into();
9699        self
9700    }
9701
9702    /// Sets the value of [database][crate::model::PostgresqlProfile::database].
9703    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9704        self.database = v.into();
9705        self
9706    }
9707
9708    /// Sets the value of [secret_manager_stored_password][crate::model::PostgresqlProfile::secret_manager_stored_password].
9709    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
9710        mut self,
9711        v: T,
9712    ) -> Self {
9713        self.secret_manager_stored_password = v.into();
9714        self
9715    }
9716
9717    /// Sets the value of [ssl_config][crate::model::PostgresqlProfile::ssl_config].
9718    pub fn set_ssl_config<T>(mut self, v: T) -> Self
9719    where
9720        T: std::convert::Into<crate::model::PostgresqlSslConfig>,
9721    {
9722        self.ssl_config = std::option::Option::Some(v.into());
9723        self
9724    }
9725
9726    /// Sets or clears the value of [ssl_config][crate::model::PostgresqlProfile::ssl_config].
9727    pub fn set_or_clear_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
9728    where
9729        T: std::convert::Into<crate::model::PostgresqlSslConfig>,
9730    {
9731        self.ssl_config = v.map(|x| x.into());
9732        self
9733    }
9734}
9735
9736impl wkt::message::Message for PostgresqlProfile {
9737    fn typename() -> &'static str {
9738        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlProfile"
9739    }
9740}
9741
9742#[doc(hidden)]
9743impl<'de> serde::de::Deserialize<'de> for PostgresqlProfile {
9744    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9745    where
9746        D: serde::Deserializer<'de>,
9747    {
9748        #[allow(non_camel_case_types)]
9749        #[doc(hidden)]
9750        #[derive(PartialEq, Eq, Hash)]
9751        enum __FieldTag {
9752            __hostname,
9753            __port,
9754            __username,
9755            __password,
9756            __database,
9757            __secret_manager_stored_password,
9758            __ssl_config,
9759            Unknown(std::string::String),
9760        }
9761        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9762            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9763            where
9764                D: serde::Deserializer<'de>,
9765            {
9766                struct Visitor;
9767                impl<'de> serde::de::Visitor<'de> for Visitor {
9768                    type Value = __FieldTag;
9769                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9770                        formatter.write_str("a field name for PostgresqlProfile")
9771                    }
9772                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9773                    where
9774                        E: serde::de::Error,
9775                    {
9776                        use std::result::Result::Ok;
9777                        use std::string::ToString;
9778                        match value {
9779                            "hostname" => Ok(__FieldTag::__hostname),
9780                            "port" => Ok(__FieldTag::__port),
9781                            "username" => Ok(__FieldTag::__username),
9782                            "password" => Ok(__FieldTag::__password),
9783                            "database" => Ok(__FieldTag::__database),
9784                            "secretManagerStoredPassword" => {
9785                                Ok(__FieldTag::__secret_manager_stored_password)
9786                            }
9787                            "secret_manager_stored_password" => {
9788                                Ok(__FieldTag::__secret_manager_stored_password)
9789                            }
9790                            "sslConfig" => Ok(__FieldTag::__ssl_config),
9791                            "ssl_config" => Ok(__FieldTag::__ssl_config),
9792                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9793                        }
9794                    }
9795                }
9796                deserializer.deserialize_identifier(Visitor)
9797            }
9798        }
9799        struct Visitor;
9800        impl<'de> serde::de::Visitor<'de> for Visitor {
9801            type Value = PostgresqlProfile;
9802            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9803                formatter.write_str("struct PostgresqlProfile")
9804            }
9805            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9806            where
9807                A: serde::de::MapAccess<'de>,
9808            {
9809                #[allow(unused_imports)]
9810                use serde::de::Error;
9811                use std::option::Option::Some;
9812                let mut fields = std::collections::HashSet::new();
9813                let mut result = Self::Value::new();
9814                while let Some(tag) = map.next_key::<__FieldTag>()? {
9815                    #[allow(clippy::match_single_binding)]
9816                    match tag {
9817                        __FieldTag::__hostname => {
9818                            if !fields.insert(__FieldTag::__hostname) {
9819                                return std::result::Result::Err(A::Error::duplicate_field(
9820                                    "multiple values for hostname",
9821                                ));
9822                            }
9823                            result.hostname = map
9824                                .next_value::<std::option::Option<std::string::String>>()?
9825                                .unwrap_or_default();
9826                        }
9827                        __FieldTag::__port => {
9828                            if !fields.insert(__FieldTag::__port) {
9829                                return std::result::Result::Err(A::Error::duplicate_field(
9830                                    "multiple values for port",
9831                                ));
9832                            }
9833                            struct __With(std::option::Option<i32>);
9834                            impl<'de> serde::de::Deserialize<'de> for __With {
9835                                fn deserialize<D>(
9836                                    deserializer: D,
9837                                ) -> std::result::Result<Self, D::Error>
9838                                where
9839                                    D: serde::de::Deserializer<'de>,
9840                                {
9841                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
9842                                }
9843                            }
9844                            result.port = map.next_value::<__With>()?.0.unwrap_or_default();
9845                        }
9846                        __FieldTag::__username => {
9847                            if !fields.insert(__FieldTag::__username) {
9848                                return std::result::Result::Err(A::Error::duplicate_field(
9849                                    "multiple values for username",
9850                                ));
9851                            }
9852                            result.username = map
9853                                .next_value::<std::option::Option<std::string::String>>()?
9854                                .unwrap_or_default();
9855                        }
9856                        __FieldTag::__password => {
9857                            if !fields.insert(__FieldTag::__password) {
9858                                return std::result::Result::Err(A::Error::duplicate_field(
9859                                    "multiple values for password",
9860                                ));
9861                            }
9862                            result.password = map
9863                                .next_value::<std::option::Option<std::string::String>>()?
9864                                .unwrap_or_default();
9865                        }
9866                        __FieldTag::__database => {
9867                            if !fields.insert(__FieldTag::__database) {
9868                                return std::result::Result::Err(A::Error::duplicate_field(
9869                                    "multiple values for database",
9870                                ));
9871                            }
9872                            result.database = map
9873                                .next_value::<std::option::Option<std::string::String>>()?
9874                                .unwrap_or_default();
9875                        }
9876                        __FieldTag::__secret_manager_stored_password => {
9877                            if !fields.insert(__FieldTag::__secret_manager_stored_password) {
9878                                return std::result::Result::Err(A::Error::duplicate_field(
9879                                    "multiple values for secret_manager_stored_password",
9880                                ));
9881                            }
9882                            result.secret_manager_stored_password = map
9883                                .next_value::<std::option::Option<std::string::String>>()?
9884                                .unwrap_or_default();
9885                        }
9886                        __FieldTag::__ssl_config => {
9887                            if !fields.insert(__FieldTag::__ssl_config) {
9888                                return std::result::Result::Err(A::Error::duplicate_field(
9889                                    "multiple values for ssl_config",
9890                                ));
9891                            }
9892                            result.ssl_config = map.next_value::<std::option::Option<crate::model::PostgresqlSslConfig>>()?
9893                                ;
9894                        }
9895                        __FieldTag::Unknown(key) => {
9896                            let value = map.next_value::<serde_json::Value>()?;
9897                            result._unknown_fields.insert(key, value);
9898                        }
9899                    }
9900                }
9901                std::result::Result::Ok(result)
9902            }
9903        }
9904        deserializer.deserialize_any(Visitor)
9905    }
9906}
9907
9908#[doc(hidden)]
9909impl serde::ser::Serialize for PostgresqlProfile {
9910    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9911    where
9912        S: serde::ser::Serializer,
9913    {
9914        use serde::ser::SerializeMap;
9915        #[allow(unused_imports)]
9916        use std::option::Option::Some;
9917        let mut state = serializer.serialize_map(std::option::Option::None)?;
9918        if !self.hostname.is_empty() {
9919            state.serialize_entry("hostname", &self.hostname)?;
9920        }
9921        if !wkt::internal::is_default(&self.port) {
9922            struct __With<'a>(&'a i32);
9923            impl<'a> serde::ser::Serialize for __With<'a> {
9924                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9925                where
9926                    S: serde::ser::Serializer,
9927                {
9928                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
9929                }
9930            }
9931            state.serialize_entry("port", &__With(&self.port))?;
9932        }
9933        if !self.username.is_empty() {
9934            state.serialize_entry("username", &self.username)?;
9935        }
9936        if !self.password.is_empty() {
9937            state.serialize_entry("password", &self.password)?;
9938        }
9939        if !self.database.is_empty() {
9940            state.serialize_entry("database", &self.database)?;
9941        }
9942        if !self.secret_manager_stored_password.is_empty() {
9943            state.serialize_entry(
9944                "secretManagerStoredPassword",
9945                &self.secret_manager_stored_password,
9946            )?;
9947        }
9948        if self.ssl_config.is_some() {
9949            state.serialize_entry("sslConfig", &self.ssl_config)?;
9950        }
9951        if !self._unknown_fields.is_empty() {
9952            for (key, value) in self._unknown_fields.iter() {
9953                state.serialize_entry(key, &value)?;
9954            }
9955        }
9956        state.end()
9957    }
9958}
9959
9960impl std::fmt::Debug for PostgresqlProfile {
9961    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9962        let mut debug_struct = f.debug_struct("PostgresqlProfile");
9963        debug_struct.field("hostname", &self.hostname);
9964        debug_struct.field("port", &self.port);
9965        debug_struct.field("username", &self.username);
9966        debug_struct.field("password", &self.password);
9967        debug_struct.field("database", &self.database);
9968        debug_struct.field(
9969            "secret_manager_stored_password",
9970            &self.secret_manager_stored_password,
9971        );
9972        debug_struct.field("ssl_config", &self.ssl_config);
9973        if !self._unknown_fields.is_empty() {
9974            debug_struct.field("_unknown_fields", &self._unknown_fields);
9975        }
9976        debug_struct.finish()
9977    }
9978}
9979
9980/// SQLServer database profile.
9981#[derive(Clone, Default, PartialEq)]
9982#[non_exhaustive]
9983pub struct SqlServerProfile {
9984    /// Required. Hostname for the SQLServer connection.
9985    pub hostname: std::string::String,
9986
9987    /// Port for the SQLServer connection, default value is 1433.
9988    pub port: i32,
9989
9990    /// Required. Username for the SQLServer connection.
9991    pub username: std::string::String,
9992
9993    /// Optional. Password for the SQLServer connection. Mutually exclusive with
9994    /// the `secret_manager_stored_password` field.
9995    pub password: std::string::String,
9996
9997    /// Required. Database for the SQLServer connection.
9998    pub database: std::string::String,
9999
10000    /// Optional. A reference to a Secret Manager resource name storing the
10001    /// SQLServer connection password. Mutually exclusive with the `password`
10002    /// field.
10003    pub secret_manager_stored_password: std::string::String,
10004
10005    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10006}
10007
10008impl SqlServerProfile {
10009    pub fn new() -> Self {
10010        std::default::Default::default()
10011    }
10012
10013    /// Sets the value of [hostname][crate::model::SqlServerProfile::hostname].
10014    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10015        self.hostname = v.into();
10016        self
10017    }
10018
10019    /// Sets the value of [port][crate::model::SqlServerProfile::port].
10020    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10021        self.port = v.into();
10022        self
10023    }
10024
10025    /// Sets the value of [username][crate::model::SqlServerProfile::username].
10026    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10027        self.username = v.into();
10028        self
10029    }
10030
10031    /// Sets the value of [password][crate::model::SqlServerProfile::password].
10032    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10033        self.password = v.into();
10034        self
10035    }
10036
10037    /// Sets the value of [database][crate::model::SqlServerProfile::database].
10038    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10039        self.database = v.into();
10040        self
10041    }
10042
10043    /// Sets the value of [secret_manager_stored_password][crate::model::SqlServerProfile::secret_manager_stored_password].
10044    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
10045        mut self,
10046        v: T,
10047    ) -> Self {
10048        self.secret_manager_stored_password = v.into();
10049        self
10050    }
10051}
10052
10053impl wkt::message::Message for SqlServerProfile {
10054    fn typename() -> &'static str {
10055        "type.googleapis.com/google.cloud.datastream.v1.SqlServerProfile"
10056    }
10057}
10058
10059#[doc(hidden)]
10060impl<'de> serde::de::Deserialize<'de> for SqlServerProfile {
10061    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10062    where
10063        D: serde::Deserializer<'de>,
10064    {
10065        #[allow(non_camel_case_types)]
10066        #[doc(hidden)]
10067        #[derive(PartialEq, Eq, Hash)]
10068        enum __FieldTag {
10069            __hostname,
10070            __port,
10071            __username,
10072            __password,
10073            __database,
10074            __secret_manager_stored_password,
10075            Unknown(std::string::String),
10076        }
10077        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10078            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10079            where
10080                D: serde::Deserializer<'de>,
10081            {
10082                struct Visitor;
10083                impl<'de> serde::de::Visitor<'de> for Visitor {
10084                    type Value = __FieldTag;
10085                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10086                        formatter.write_str("a field name for SqlServerProfile")
10087                    }
10088                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10089                    where
10090                        E: serde::de::Error,
10091                    {
10092                        use std::result::Result::Ok;
10093                        use std::string::ToString;
10094                        match value {
10095                            "hostname" => Ok(__FieldTag::__hostname),
10096                            "port" => Ok(__FieldTag::__port),
10097                            "username" => Ok(__FieldTag::__username),
10098                            "password" => Ok(__FieldTag::__password),
10099                            "database" => Ok(__FieldTag::__database),
10100                            "secretManagerStoredPassword" => {
10101                                Ok(__FieldTag::__secret_manager_stored_password)
10102                            }
10103                            "secret_manager_stored_password" => {
10104                                Ok(__FieldTag::__secret_manager_stored_password)
10105                            }
10106                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10107                        }
10108                    }
10109                }
10110                deserializer.deserialize_identifier(Visitor)
10111            }
10112        }
10113        struct Visitor;
10114        impl<'de> serde::de::Visitor<'de> for Visitor {
10115            type Value = SqlServerProfile;
10116            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10117                formatter.write_str("struct SqlServerProfile")
10118            }
10119            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10120            where
10121                A: serde::de::MapAccess<'de>,
10122            {
10123                #[allow(unused_imports)]
10124                use serde::de::Error;
10125                use std::option::Option::Some;
10126                let mut fields = std::collections::HashSet::new();
10127                let mut result = Self::Value::new();
10128                while let Some(tag) = map.next_key::<__FieldTag>()? {
10129                    #[allow(clippy::match_single_binding)]
10130                    match tag {
10131                        __FieldTag::__hostname => {
10132                            if !fields.insert(__FieldTag::__hostname) {
10133                                return std::result::Result::Err(A::Error::duplicate_field(
10134                                    "multiple values for hostname",
10135                                ));
10136                            }
10137                            result.hostname = map
10138                                .next_value::<std::option::Option<std::string::String>>()?
10139                                .unwrap_or_default();
10140                        }
10141                        __FieldTag::__port => {
10142                            if !fields.insert(__FieldTag::__port) {
10143                                return std::result::Result::Err(A::Error::duplicate_field(
10144                                    "multiple values for port",
10145                                ));
10146                            }
10147                            struct __With(std::option::Option<i32>);
10148                            impl<'de> serde::de::Deserialize<'de> for __With {
10149                                fn deserialize<D>(
10150                                    deserializer: D,
10151                                ) -> std::result::Result<Self, D::Error>
10152                                where
10153                                    D: serde::de::Deserializer<'de>,
10154                                {
10155                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
10156                                }
10157                            }
10158                            result.port = map.next_value::<__With>()?.0.unwrap_or_default();
10159                        }
10160                        __FieldTag::__username => {
10161                            if !fields.insert(__FieldTag::__username) {
10162                                return std::result::Result::Err(A::Error::duplicate_field(
10163                                    "multiple values for username",
10164                                ));
10165                            }
10166                            result.username = map
10167                                .next_value::<std::option::Option<std::string::String>>()?
10168                                .unwrap_or_default();
10169                        }
10170                        __FieldTag::__password => {
10171                            if !fields.insert(__FieldTag::__password) {
10172                                return std::result::Result::Err(A::Error::duplicate_field(
10173                                    "multiple values for password",
10174                                ));
10175                            }
10176                            result.password = map
10177                                .next_value::<std::option::Option<std::string::String>>()?
10178                                .unwrap_or_default();
10179                        }
10180                        __FieldTag::__database => {
10181                            if !fields.insert(__FieldTag::__database) {
10182                                return std::result::Result::Err(A::Error::duplicate_field(
10183                                    "multiple values for database",
10184                                ));
10185                            }
10186                            result.database = map
10187                                .next_value::<std::option::Option<std::string::String>>()?
10188                                .unwrap_or_default();
10189                        }
10190                        __FieldTag::__secret_manager_stored_password => {
10191                            if !fields.insert(__FieldTag::__secret_manager_stored_password) {
10192                                return std::result::Result::Err(A::Error::duplicate_field(
10193                                    "multiple values for secret_manager_stored_password",
10194                                ));
10195                            }
10196                            result.secret_manager_stored_password = map
10197                                .next_value::<std::option::Option<std::string::String>>()?
10198                                .unwrap_or_default();
10199                        }
10200                        __FieldTag::Unknown(key) => {
10201                            let value = map.next_value::<serde_json::Value>()?;
10202                            result._unknown_fields.insert(key, value);
10203                        }
10204                    }
10205                }
10206                std::result::Result::Ok(result)
10207            }
10208        }
10209        deserializer.deserialize_any(Visitor)
10210    }
10211}
10212
10213#[doc(hidden)]
10214impl serde::ser::Serialize for SqlServerProfile {
10215    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10216    where
10217        S: serde::ser::Serializer,
10218    {
10219        use serde::ser::SerializeMap;
10220        #[allow(unused_imports)]
10221        use std::option::Option::Some;
10222        let mut state = serializer.serialize_map(std::option::Option::None)?;
10223        if !self.hostname.is_empty() {
10224            state.serialize_entry("hostname", &self.hostname)?;
10225        }
10226        if !wkt::internal::is_default(&self.port) {
10227            struct __With<'a>(&'a i32);
10228            impl<'a> serde::ser::Serialize for __With<'a> {
10229                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10230                where
10231                    S: serde::ser::Serializer,
10232                {
10233                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
10234                }
10235            }
10236            state.serialize_entry("port", &__With(&self.port))?;
10237        }
10238        if !self.username.is_empty() {
10239            state.serialize_entry("username", &self.username)?;
10240        }
10241        if !self.password.is_empty() {
10242            state.serialize_entry("password", &self.password)?;
10243        }
10244        if !self.database.is_empty() {
10245            state.serialize_entry("database", &self.database)?;
10246        }
10247        if !self.secret_manager_stored_password.is_empty() {
10248            state.serialize_entry(
10249                "secretManagerStoredPassword",
10250                &self.secret_manager_stored_password,
10251            )?;
10252        }
10253        if !self._unknown_fields.is_empty() {
10254            for (key, value) in self._unknown_fields.iter() {
10255                state.serialize_entry(key, &value)?;
10256            }
10257        }
10258        state.end()
10259    }
10260}
10261
10262impl std::fmt::Debug for SqlServerProfile {
10263    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10264        let mut debug_struct = f.debug_struct("SqlServerProfile");
10265        debug_struct.field("hostname", &self.hostname);
10266        debug_struct.field("port", &self.port);
10267        debug_struct.field("username", &self.username);
10268        debug_struct.field("password", &self.password);
10269        debug_struct.field("database", &self.database);
10270        debug_struct.field(
10271            "secret_manager_stored_password",
10272            &self.secret_manager_stored_password,
10273        );
10274        if !self._unknown_fields.is_empty() {
10275            debug_struct.field("_unknown_fields", &self._unknown_fields);
10276        }
10277        debug_struct.finish()
10278    }
10279}
10280
10281/// Salesforce profile
10282#[derive(Clone, Default, PartialEq)]
10283#[non_exhaustive]
10284pub struct SalesforceProfile {
10285    /// Required. Domain endpoint for the Salesforce connection.
10286    pub domain: std::string::String,
10287
10288    /// Credentials for Salesforce connection.
10289    pub credentials: std::option::Option<crate::model::salesforce_profile::Credentials>,
10290
10291    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10292}
10293
10294impl SalesforceProfile {
10295    pub fn new() -> Self {
10296        std::default::Default::default()
10297    }
10298
10299    /// Sets the value of [domain][crate::model::SalesforceProfile::domain].
10300    pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10301        self.domain = v.into();
10302        self
10303    }
10304
10305    /// Sets the value of [credentials][crate::model::SalesforceProfile::credentials].
10306    ///
10307    /// Note that all the setters affecting `credentials` are mutually
10308    /// exclusive.
10309    pub fn set_credentials<
10310        T: std::convert::Into<std::option::Option<crate::model::salesforce_profile::Credentials>>,
10311    >(
10312        mut self,
10313        v: T,
10314    ) -> Self {
10315        self.credentials = v.into();
10316        self
10317    }
10318
10319    /// The value of [credentials][crate::model::SalesforceProfile::credentials]
10320    /// if it holds a `UserCredentials`, `None` if the field is not set or
10321    /// holds a different branch.
10322    pub fn user_credentials(
10323        &self,
10324    ) -> std::option::Option<&std::boxed::Box<crate::model::salesforce_profile::UserCredentials>>
10325    {
10326        #[allow(unreachable_patterns)]
10327        self.credentials.as_ref().and_then(|v| match v {
10328            crate::model::salesforce_profile::Credentials::UserCredentials(v) => {
10329                std::option::Option::Some(v)
10330            }
10331            _ => std::option::Option::None,
10332        })
10333    }
10334
10335    /// Sets the value of [credentials][crate::model::SalesforceProfile::credentials]
10336    /// to hold a `UserCredentials`.
10337    ///
10338    /// Note that all the setters affecting `credentials` are
10339    /// mutually exclusive.
10340    pub fn set_user_credentials<
10341        T: std::convert::Into<std::boxed::Box<crate::model::salesforce_profile::UserCredentials>>,
10342    >(
10343        mut self,
10344        v: T,
10345    ) -> Self {
10346        self.credentials = std::option::Option::Some(
10347            crate::model::salesforce_profile::Credentials::UserCredentials(v.into()),
10348        );
10349        self
10350    }
10351
10352    /// The value of [credentials][crate::model::SalesforceProfile::credentials]
10353    /// if it holds a `Oauth2ClientCredentials`, `None` if the field is not set or
10354    /// holds a different branch.
10355    pub fn oauth2_client_credentials(
10356        &self,
10357    ) -> std::option::Option<
10358        &std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>,
10359    > {
10360        #[allow(unreachable_patterns)]
10361        self.credentials.as_ref().and_then(|v| match v {
10362            crate::model::salesforce_profile::Credentials::Oauth2ClientCredentials(v) => {
10363                std::option::Option::Some(v)
10364            }
10365            _ => std::option::Option::None,
10366        })
10367    }
10368
10369    /// Sets the value of [credentials][crate::model::SalesforceProfile::credentials]
10370    /// to hold a `Oauth2ClientCredentials`.
10371    ///
10372    /// Note that all the setters affecting `credentials` are
10373    /// mutually exclusive.
10374    pub fn set_oauth2_client_credentials<
10375        T: std::convert::Into<
10376                std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>,
10377            >,
10378    >(
10379        mut self,
10380        v: T,
10381    ) -> Self {
10382        self.credentials = std::option::Option::Some(
10383            crate::model::salesforce_profile::Credentials::Oauth2ClientCredentials(v.into()),
10384        );
10385        self
10386    }
10387}
10388
10389impl wkt::message::Message for SalesforceProfile {
10390    fn typename() -> &'static str {
10391        "type.googleapis.com/google.cloud.datastream.v1.SalesforceProfile"
10392    }
10393}
10394
10395#[doc(hidden)]
10396impl<'de> serde::de::Deserialize<'de> for SalesforceProfile {
10397    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10398    where
10399        D: serde::Deserializer<'de>,
10400    {
10401        #[allow(non_camel_case_types)]
10402        #[doc(hidden)]
10403        #[derive(PartialEq, Eq, Hash)]
10404        enum __FieldTag {
10405            __domain,
10406            __user_credentials,
10407            __oauth2_client_credentials,
10408            Unknown(std::string::String),
10409        }
10410        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10411            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10412            where
10413                D: serde::Deserializer<'de>,
10414            {
10415                struct Visitor;
10416                impl<'de> serde::de::Visitor<'de> for Visitor {
10417                    type Value = __FieldTag;
10418                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10419                        formatter.write_str("a field name for SalesforceProfile")
10420                    }
10421                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10422                    where
10423                        E: serde::de::Error,
10424                    {
10425                        use std::result::Result::Ok;
10426                        use std::string::ToString;
10427                        match value {
10428                            "domain" => Ok(__FieldTag::__domain),
10429                            "userCredentials" => Ok(__FieldTag::__user_credentials),
10430                            "user_credentials" => Ok(__FieldTag::__user_credentials),
10431                            "oauth2ClientCredentials" => {
10432                                Ok(__FieldTag::__oauth2_client_credentials)
10433                            }
10434                            "oauth2_client_credentials" => {
10435                                Ok(__FieldTag::__oauth2_client_credentials)
10436                            }
10437                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10438                        }
10439                    }
10440                }
10441                deserializer.deserialize_identifier(Visitor)
10442            }
10443        }
10444        struct Visitor;
10445        impl<'de> serde::de::Visitor<'de> for Visitor {
10446            type Value = SalesforceProfile;
10447            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10448                formatter.write_str("struct SalesforceProfile")
10449            }
10450            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10451            where
10452                A: serde::de::MapAccess<'de>,
10453            {
10454                #[allow(unused_imports)]
10455                use serde::de::Error;
10456                use std::option::Option::Some;
10457                let mut fields = std::collections::HashSet::new();
10458                let mut result = Self::Value::new();
10459                while let Some(tag) = map.next_key::<__FieldTag>()? {
10460                    #[allow(clippy::match_single_binding)]
10461                    match tag {
10462                        __FieldTag::__domain => {
10463                            if !fields.insert(__FieldTag::__domain) {
10464                                return std::result::Result::Err(A::Error::duplicate_field(
10465                                    "multiple values for domain",
10466                                ));
10467                            }
10468                            result.domain = map
10469                                .next_value::<std::option::Option<std::string::String>>()?
10470                                .unwrap_or_default();
10471                        }
10472                        __FieldTag::__user_credentials => {
10473                            if !fields.insert(__FieldTag::__user_credentials) {
10474                                return std::result::Result::Err(A::Error::duplicate_field(
10475                                    "multiple values for user_credentials",
10476                                ));
10477                            }
10478                            if result.credentials.is_some() {
10479                                return std::result::Result::Err(A::Error::duplicate_field(
10480                                    "multiple values for `credentials`, a oneof with full ID .google.cloud.datastream.v1.SalesforceProfile.user_credentials, latest field was userCredentials",
10481                                ));
10482                            }
10483                            result.credentials = std::option::Option::Some(
10484                                crate::model::salesforce_profile::Credentials::UserCredentials(
10485                                    map.next_value::<std::option::Option<
10486                                        std::boxed::Box<
10487                                            crate::model::salesforce_profile::UserCredentials,
10488                                        >,
10489                                    >>()?
10490                                    .unwrap_or_default(),
10491                                ),
10492                            );
10493                        }
10494                        __FieldTag::__oauth2_client_credentials => {
10495                            if !fields.insert(__FieldTag::__oauth2_client_credentials) {
10496                                return std::result::Result::Err(A::Error::duplicate_field(
10497                                    "multiple values for oauth2_client_credentials",
10498                                ));
10499                            }
10500                            if result.credentials.is_some() {
10501                                return std::result::Result::Err(A::Error::duplicate_field(
10502                                    "multiple values for `credentials`, a oneof with full ID .google.cloud.datastream.v1.SalesforceProfile.oauth2_client_credentials, latest field was oauth2ClientCredentials",
10503                                ));
10504                            }
10505                            result.credentials = std::option::Option::Some(
10506                                crate::model::salesforce_profile::Credentials::Oauth2ClientCredentials(
10507                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>>>()?.unwrap_or_default()
10508                                ),
10509                            );
10510                        }
10511                        __FieldTag::Unknown(key) => {
10512                            let value = map.next_value::<serde_json::Value>()?;
10513                            result._unknown_fields.insert(key, value);
10514                        }
10515                    }
10516                }
10517                std::result::Result::Ok(result)
10518            }
10519        }
10520        deserializer.deserialize_any(Visitor)
10521    }
10522}
10523
10524#[doc(hidden)]
10525impl serde::ser::Serialize for SalesforceProfile {
10526    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10527    where
10528        S: serde::ser::Serializer,
10529    {
10530        use serde::ser::SerializeMap;
10531        #[allow(unused_imports)]
10532        use std::option::Option::Some;
10533        let mut state = serializer.serialize_map(std::option::Option::None)?;
10534        if !self.domain.is_empty() {
10535            state.serialize_entry("domain", &self.domain)?;
10536        }
10537        if let Some(value) = self.user_credentials() {
10538            state.serialize_entry("userCredentials", value)?;
10539        }
10540        if let Some(value) = self.oauth2_client_credentials() {
10541            state.serialize_entry("oauth2ClientCredentials", value)?;
10542        }
10543        if !self._unknown_fields.is_empty() {
10544            for (key, value) in self._unknown_fields.iter() {
10545                state.serialize_entry(key, &value)?;
10546            }
10547        }
10548        state.end()
10549    }
10550}
10551
10552impl std::fmt::Debug for SalesforceProfile {
10553    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10554        let mut debug_struct = f.debug_struct("SalesforceProfile");
10555        debug_struct.field("domain", &self.domain);
10556        debug_struct.field("credentials", &self.credentials);
10557        if !self._unknown_fields.is_empty() {
10558            debug_struct.field("_unknown_fields", &self._unknown_fields);
10559        }
10560        debug_struct.finish()
10561    }
10562}
10563
10564/// Defines additional types related to [SalesforceProfile].
10565pub mod salesforce_profile {
10566    #[allow(unused_imports)]
10567    use super::*;
10568
10569    /// Username-password credentials.
10570    #[derive(Clone, Default, PartialEq)]
10571    #[non_exhaustive]
10572    pub struct UserCredentials {
10573        /// Required. Username for the Salesforce connection.
10574        pub username: std::string::String,
10575
10576        /// Optional. Password for the Salesforce connection.
10577        /// Mutually exclusive with the `secret_manager_stored_password` field.
10578        pub password: std::string::String,
10579
10580        /// Optional. Security token for the Salesforce connection.
10581        /// Mutually exclusive with the `secret_manager_stored_security_token` field.
10582        pub security_token: std::string::String,
10583
10584        /// Optional. A reference to a Secret Manager resource name storing the
10585        /// Salesforce connection's password. Mutually exclusive with the `password`
10586        /// field.
10587        pub secret_manager_stored_password: std::string::String,
10588
10589        /// Optional. A reference to a Secret Manager resource name storing the
10590        /// Salesforce connection's security token. Mutually exclusive with the
10591        /// `security_token` field.
10592        pub secret_manager_stored_security_token: std::string::String,
10593
10594        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10595    }
10596
10597    impl UserCredentials {
10598        pub fn new() -> Self {
10599            std::default::Default::default()
10600        }
10601
10602        /// Sets the value of [username][crate::model::salesforce_profile::UserCredentials::username].
10603        pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10604            self.username = v.into();
10605            self
10606        }
10607
10608        /// Sets the value of [password][crate::model::salesforce_profile::UserCredentials::password].
10609        pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10610            self.password = v.into();
10611            self
10612        }
10613
10614        /// Sets the value of [security_token][crate::model::salesforce_profile::UserCredentials::security_token].
10615        pub fn set_security_token<T: std::convert::Into<std::string::String>>(
10616            mut self,
10617            v: T,
10618        ) -> Self {
10619            self.security_token = v.into();
10620            self
10621        }
10622
10623        /// Sets the value of [secret_manager_stored_password][crate::model::salesforce_profile::UserCredentials::secret_manager_stored_password].
10624        pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
10625            mut self,
10626            v: T,
10627        ) -> Self {
10628            self.secret_manager_stored_password = v.into();
10629            self
10630        }
10631
10632        /// Sets the value of [secret_manager_stored_security_token][crate::model::salesforce_profile::UserCredentials::secret_manager_stored_security_token].
10633        pub fn set_secret_manager_stored_security_token<
10634            T: std::convert::Into<std::string::String>,
10635        >(
10636            mut self,
10637            v: T,
10638        ) -> Self {
10639            self.secret_manager_stored_security_token = v.into();
10640            self
10641        }
10642    }
10643
10644    impl wkt::message::Message for UserCredentials {
10645        fn typename() -> &'static str {
10646            "type.googleapis.com/google.cloud.datastream.v1.SalesforceProfile.UserCredentials"
10647        }
10648    }
10649
10650    #[doc(hidden)]
10651    impl<'de> serde::de::Deserialize<'de> for UserCredentials {
10652        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10653        where
10654            D: serde::Deserializer<'de>,
10655        {
10656            #[allow(non_camel_case_types)]
10657            #[doc(hidden)]
10658            #[derive(PartialEq, Eq, Hash)]
10659            enum __FieldTag {
10660                __username,
10661                __password,
10662                __security_token,
10663                __secret_manager_stored_password,
10664                __secret_manager_stored_security_token,
10665                Unknown(std::string::String),
10666            }
10667            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10668                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10669                where
10670                    D: serde::Deserializer<'de>,
10671                {
10672                    struct Visitor;
10673                    impl<'de> serde::de::Visitor<'de> for Visitor {
10674                        type Value = __FieldTag;
10675                        fn expecting(
10676                            &self,
10677                            formatter: &mut std::fmt::Formatter,
10678                        ) -> std::fmt::Result {
10679                            formatter.write_str("a field name for UserCredentials")
10680                        }
10681                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10682                        where
10683                            E: serde::de::Error,
10684                        {
10685                            use std::result::Result::Ok;
10686                            use std::string::ToString;
10687                            match value {
10688                                "username" => Ok(__FieldTag::__username),
10689                                "password" => Ok(__FieldTag::__password),
10690                                "securityToken" => Ok(__FieldTag::__security_token),
10691                                "security_token" => Ok(__FieldTag::__security_token),
10692                                "secretManagerStoredPassword" => {
10693                                    Ok(__FieldTag::__secret_manager_stored_password)
10694                                }
10695                                "secret_manager_stored_password" => {
10696                                    Ok(__FieldTag::__secret_manager_stored_password)
10697                                }
10698                                "secretManagerStoredSecurityToken" => {
10699                                    Ok(__FieldTag::__secret_manager_stored_security_token)
10700                                }
10701                                "secret_manager_stored_security_token" => {
10702                                    Ok(__FieldTag::__secret_manager_stored_security_token)
10703                                }
10704                                _ => Ok(__FieldTag::Unknown(value.to_string())),
10705                            }
10706                        }
10707                    }
10708                    deserializer.deserialize_identifier(Visitor)
10709                }
10710            }
10711            struct Visitor;
10712            impl<'de> serde::de::Visitor<'de> for Visitor {
10713                type Value = UserCredentials;
10714                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10715                    formatter.write_str("struct UserCredentials")
10716                }
10717                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10718                where
10719                    A: serde::de::MapAccess<'de>,
10720                {
10721                    #[allow(unused_imports)]
10722                    use serde::de::Error;
10723                    use std::option::Option::Some;
10724                    let mut fields = std::collections::HashSet::new();
10725                    let mut result = Self::Value::new();
10726                    while let Some(tag) = map.next_key::<__FieldTag>()? {
10727                        #[allow(clippy::match_single_binding)]
10728                        match tag {
10729                            __FieldTag::__username => {
10730                                if !fields.insert(__FieldTag::__username) {
10731                                    return std::result::Result::Err(A::Error::duplicate_field(
10732                                        "multiple values for username",
10733                                    ));
10734                                }
10735                                result.username = map
10736                                    .next_value::<std::option::Option<std::string::String>>()?
10737                                    .unwrap_or_default();
10738                            }
10739                            __FieldTag::__password => {
10740                                if !fields.insert(__FieldTag::__password) {
10741                                    return std::result::Result::Err(A::Error::duplicate_field(
10742                                        "multiple values for password",
10743                                    ));
10744                                }
10745                                result.password = map
10746                                    .next_value::<std::option::Option<std::string::String>>()?
10747                                    .unwrap_or_default();
10748                            }
10749                            __FieldTag::__security_token => {
10750                                if !fields.insert(__FieldTag::__security_token) {
10751                                    return std::result::Result::Err(A::Error::duplicate_field(
10752                                        "multiple values for security_token",
10753                                    ));
10754                                }
10755                                result.security_token = map
10756                                    .next_value::<std::option::Option<std::string::String>>()?
10757                                    .unwrap_or_default();
10758                            }
10759                            __FieldTag::__secret_manager_stored_password => {
10760                                if !fields.insert(__FieldTag::__secret_manager_stored_password) {
10761                                    return std::result::Result::Err(A::Error::duplicate_field(
10762                                        "multiple values for secret_manager_stored_password",
10763                                    ));
10764                                }
10765                                result.secret_manager_stored_password = map
10766                                    .next_value::<std::option::Option<std::string::String>>()?
10767                                    .unwrap_or_default();
10768                            }
10769                            __FieldTag::__secret_manager_stored_security_token => {
10770                                if !fields
10771                                    .insert(__FieldTag::__secret_manager_stored_security_token)
10772                                {
10773                                    return std::result::Result::Err(A::Error::duplicate_field(
10774                                        "multiple values for secret_manager_stored_security_token",
10775                                    ));
10776                                }
10777                                result.secret_manager_stored_security_token = map
10778                                    .next_value::<std::option::Option<std::string::String>>()?
10779                                    .unwrap_or_default();
10780                            }
10781                            __FieldTag::Unknown(key) => {
10782                                let value = map.next_value::<serde_json::Value>()?;
10783                                result._unknown_fields.insert(key, value);
10784                            }
10785                        }
10786                    }
10787                    std::result::Result::Ok(result)
10788                }
10789            }
10790            deserializer.deserialize_any(Visitor)
10791        }
10792    }
10793
10794    #[doc(hidden)]
10795    impl serde::ser::Serialize for UserCredentials {
10796        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10797        where
10798            S: serde::ser::Serializer,
10799        {
10800            use serde::ser::SerializeMap;
10801            #[allow(unused_imports)]
10802            use std::option::Option::Some;
10803            let mut state = serializer.serialize_map(std::option::Option::None)?;
10804            if !self.username.is_empty() {
10805                state.serialize_entry("username", &self.username)?;
10806            }
10807            if !self.password.is_empty() {
10808                state.serialize_entry("password", &self.password)?;
10809            }
10810            if !self.security_token.is_empty() {
10811                state.serialize_entry("securityToken", &self.security_token)?;
10812            }
10813            if !self.secret_manager_stored_password.is_empty() {
10814                state.serialize_entry(
10815                    "secretManagerStoredPassword",
10816                    &self.secret_manager_stored_password,
10817                )?;
10818            }
10819            if !self.secret_manager_stored_security_token.is_empty() {
10820                state.serialize_entry(
10821                    "secretManagerStoredSecurityToken",
10822                    &self.secret_manager_stored_security_token,
10823                )?;
10824            }
10825            if !self._unknown_fields.is_empty() {
10826                for (key, value) in self._unknown_fields.iter() {
10827                    state.serialize_entry(key, &value)?;
10828                }
10829            }
10830            state.end()
10831        }
10832    }
10833
10834    impl std::fmt::Debug for UserCredentials {
10835        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10836            let mut debug_struct = f.debug_struct("UserCredentials");
10837            debug_struct.field("username", &self.username);
10838            debug_struct.field("password", &self.password);
10839            debug_struct.field("security_token", &self.security_token);
10840            debug_struct.field(
10841                "secret_manager_stored_password",
10842                &self.secret_manager_stored_password,
10843            );
10844            debug_struct.field(
10845                "secret_manager_stored_security_token",
10846                &self.secret_manager_stored_security_token,
10847            );
10848            if !self._unknown_fields.is_empty() {
10849                debug_struct.field("_unknown_fields", &self._unknown_fields);
10850            }
10851            debug_struct.finish()
10852        }
10853    }
10854
10855    /// OAuth2 Client Credentials.
10856    #[derive(Clone, Default, PartialEq)]
10857    #[non_exhaustive]
10858    pub struct Oauth2ClientCredentials {
10859        /// Required. Client ID for Salesforce OAuth2 Client Credentials.
10860        pub client_id: std::string::String,
10861
10862        /// Optional. Client secret for Salesforce OAuth2 Client Credentials.
10863        /// Mutually exclusive with the `secret_manager_stored_client_secret` field.
10864        pub client_secret: std::string::String,
10865
10866        /// Optional. A reference to a Secret Manager resource name storing the
10867        /// Salesforce OAuth2 client_secret. Mutually exclusive with the
10868        /// `client_secret` field.
10869        pub secret_manager_stored_client_secret: std::string::String,
10870
10871        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10872    }
10873
10874    impl Oauth2ClientCredentials {
10875        pub fn new() -> Self {
10876            std::default::Default::default()
10877        }
10878
10879        /// Sets the value of [client_id][crate::model::salesforce_profile::Oauth2ClientCredentials::client_id].
10880        pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10881            self.client_id = v.into();
10882            self
10883        }
10884
10885        /// Sets the value of [client_secret][crate::model::salesforce_profile::Oauth2ClientCredentials::client_secret].
10886        pub fn set_client_secret<T: std::convert::Into<std::string::String>>(
10887            mut self,
10888            v: T,
10889        ) -> Self {
10890            self.client_secret = v.into();
10891            self
10892        }
10893
10894        /// Sets the value of [secret_manager_stored_client_secret][crate::model::salesforce_profile::Oauth2ClientCredentials::secret_manager_stored_client_secret].
10895        pub fn set_secret_manager_stored_client_secret<
10896            T: std::convert::Into<std::string::String>,
10897        >(
10898            mut self,
10899            v: T,
10900        ) -> Self {
10901            self.secret_manager_stored_client_secret = v.into();
10902            self
10903        }
10904    }
10905
10906    impl wkt::message::Message for Oauth2ClientCredentials {
10907        fn typename() -> &'static str {
10908            "type.googleapis.com/google.cloud.datastream.v1.SalesforceProfile.Oauth2ClientCredentials"
10909        }
10910    }
10911
10912    #[doc(hidden)]
10913    impl<'de> serde::de::Deserialize<'de> for Oauth2ClientCredentials {
10914        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10915        where
10916            D: serde::Deserializer<'de>,
10917        {
10918            #[allow(non_camel_case_types)]
10919            #[doc(hidden)]
10920            #[derive(PartialEq, Eq, Hash)]
10921            enum __FieldTag {
10922                __client_id,
10923                __client_secret,
10924                __secret_manager_stored_client_secret,
10925                Unknown(std::string::String),
10926            }
10927            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10928                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10929                where
10930                    D: serde::Deserializer<'de>,
10931                {
10932                    struct Visitor;
10933                    impl<'de> serde::de::Visitor<'de> for Visitor {
10934                        type Value = __FieldTag;
10935                        fn expecting(
10936                            &self,
10937                            formatter: &mut std::fmt::Formatter,
10938                        ) -> std::fmt::Result {
10939                            formatter.write_str("a field name for Oauth2ClientCredentials")
10940                        }
10941                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10942                        where
10943                            E: serde::de::Error,
10944                        {
10945                            use std::result::Result::Ok;
10946                            use std::string::ToString;
10947                            match value {
10948                                "clientId" => Ok(__FieldTag::__client_id),
10949                                "client_id" => Ok(__FieldTag::__client_id),
10950                                "clientSecret" => Ok(__FieldTag::__client_secret),
10951                                "client_secret" => Ok(__FieldTag::__client_secret),
10952                                "secretManagerStoredClientSecret" => {
10953                                    Ok(__FieldTag::__secret_manager_stored_client_secret)
10954                                }
10955                                "secret_manager_stored_client_secret" => {
10956                                    Ok(__FieldTag::__secret_manager_stored_client_secret)
10957                                }
10958                                _ => Ok(__FieldTag::Unknown(value.to_string())),
10959                            }
10960                        }
10961                    }
10962                    deserializer.deserialize_identifier(Visitor)
10963                }
10964            }
10965            struct Visitor;
10966            impl<'de> serde::de::Visitor<'de> for Visitor {
10967                type Value = Oauth2ClientCredentials;
10968                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10969                    formatter.write_str("struct Oauth2ClientCredentials")
10970                }
10971                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10972                where
10973                    A: serde::de::MapAccess<'de>,
10974                {
10975                    #[allow(unused_imports)]
10976                    use serde::de::Error;
10977                    use std::option::Option::Some;
10978                    let mut fields = std::collections::HashSet::new();
10979                    let mut result = Self::Value::new();
10980                    while let Some(tag) = map.next_key::<__FieldTag>()? {
10981                        #[allow(clippy::match_single_binding)]
10982                        match tag {
10983                            __FieldTag::__client_id => {
10984                                if !fields.insert(__FieldTag::__client_id) {
10985                                    return std::result::Result::Err(A::Error::duplicate_field(
10986                                        "multiple values for client_id",
10987                                    ));
10988                                }
10989                                result.client_id = map
10990                                    .next_value::<std::option::Option<std::string::String>>()?
10991                                    .unwrap_or_default();
10992                            }
10993                            __FieldTag::__client_secret => {
10994                                if !fields.insert(__FieldTag::__client_secret) {
10995                                    return std::result::Result::Err(A::Error::duplicate_field(
10996                                        "multiple values for client_secret",
10997                                    ));
10998                                }
10999                                result.client_secret = map
11000                                    .next_value::<std::option::Option<std::string::String>>()?
11001                                    .unwrap_or_default();
11002                            }
11003                            __FieldTag::__secret_manager_stored_client_secret => {
11004                                if !fields.insert(__FieldTag::__secret_manager_stored_client_secret)
11005                                {
11006                                    return std::result::Result::Err(A::Error::duplicate_field(
11007                                        "multiple values for secret_manager_stored_client_secret",
11008                                    ));
11009                                }
11010                                result.secret_manager_stored_client_secret = map
11011                                    .next_value::<std::option::Option<std::string::String>>()?
11012                                    .unwrap_or_default();
11013                            }
11014                            __FieldTag::Unknown(key) => {
11015                                let value = map.next_value::<serde_json::Value>()?;
11016                                result._unknown_fields.insert(key, value);
11017                            }
11018                        }
11019                    }
11020                    std::result::Result::Ok(result)
11021                }
11022            }
11023            deserializer.deserialize_any(Visitor)
11024        }
11025    }
11026
11027    #[doc(hidden)]
11028    impl serde::ser::Serialize for Oauth2ClientCredentials {
11029        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11030        where
11031            S: serde::ser::Serializer,
11032        {
11033            use serde::ser::SerializeMap;
11034            #[allow(unused_imports)]
11035            use std::option::Option::Some;
11036            let mut state = serializer.serialize_map(std::option::Option::None)?;
11037            if !self.client_id.is_empty() {
11038                state.serialize_entry("clientId", &self.client_id)?;
11039            }
11040            if !self.client_secret.is_empty() {
11041                state.serialize_entry("clientSecret", &self.client_secret)?;
11042            }
11043            if !self.secret_manager_stored_client_secret.is_empty() {
11044                state.serialize_entry(
11045                    "secretManagerStoredClientSecret",
11046                    &self.secret_manager_stored_client_secret,
11047                )?;
11048            }
11049            if !self._unknown_fields.is_empty() {
11050                for (key, value) in self._unknown_fields.iter() {
11051                    state.serialize_entry(key, &value)?;
11052                }
11053            }
11054            state.end()
11055        }
11056    }
11057
11058    impl std::fmt::Debug for Oauth2ClientCredentials {
11059        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11060            let mut debug_struct = f.debug_struct("Oauth2ClientCredentials");
11061            debug_struct.field("client_id", &self.client_id);
11062            debug_struct.field("client_secret", &self.client_secret);
11063            debug_struct.field(
11064                "secret_manager_stored_client_secret",
11065                &self.secret_manager_stored_client_secret,
11066            );
11067            if !self._unknown_fields.is_empty() {
11068                debug_struct.field("_unknown_fields", &self._unknown_fields);
11069            }
11070            debug_struct.finish()
11071        }
11072    }
11073
11074    /// Credentials for Salesforce connection.
11075    #[derive(Clone, Debug, PartialEq)]
11076    #[non_exhaustive]
11077    pub enum Credentials {
11078        /// User-password authentication.
11079        UserCredentials(std::boxed::Box<crate::model::salesforce_profile::UserCredentials>),
11080        /// Connected app authentication.
11081        Oauth2ClientCredentials(
11082            std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>,
11083        ),
11084    }
11085}
11086
11087/// MongoDB profile.
11088#[derive(Clone, Default, PartialEq)]
11089#[non_exhaustive]
11090pub struct MongodbProfile {
11091    /// Required. List of host addresses for a MongoDB cluster.
11092    /// For SRV connection format, this list must contain exactly one DNS host
11093    /// without a port. For Standard connection format, this list must contain all
11094    /// the required hosts in the cluster with their respective ports.
11095    pub host_addresses: std::vec::Vec<crate::model::HostAddress>,
11096
11097    /// Optional. Name of the replica set. Only needed for self hosted replica set
11098    /// type MongoDB cluster. For SRV connection format, this field must be empty.
11099    /// For Standard connection format, this field must be specified.
11100    pub replica_set: std::string::String,
11101
11102    /// Required. Username for the MongoDB connection.
11103    pub username: std::string::String,
11104
11105    /// Optional. Password for the MongoDB connection. Mutually exclusive with the
11106    /// `secret_manager_stored_password` field.
11107    pub password: std::string::String,
11108
11109    /// Optional. A reference to a Secret Manager resource name storing the
11110    /// SQLServer connection password. Mutually exclusive with the `password`
11111    /// field.
11112    pub secret_manager_stored_password: std::string::String,
11113
11114    /// Optional. SSL configuration for the MongoDB connection.
11115    pub ssl_config: std::option::Option<crate::model::MongodbSslConfig>,
11116
11117    /// MongoDB connection format.
11118    /// Must specify either srv_connection_format or standard_connection_format.
11119    pub mongodb_connection_format:
11120        std::option::Option<crate::model::mongodb_profile::MongodbConnectionFormat>,
11121
11122    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11123}
11124
11125impl MongodbProfile {
11126    pub fn new() -> Self {
11127        std::default::Default::default()
11128    }
11129
11130    /// Sets the value of [host_addresses][crate::model::MongodbProfile::host_addresses].
11131    pub fn set_host_addresses<T, V>(mut self, v: T) -> Self
11132    where
11133        T: std::iter::IntoIterator<Item = V>,
11134        V: std::convert::Into<crate::model::HostAddress>,
11135    {
11136        use std::iter::Iterator;
11137        self.host_addresses = v.into_iter().map(|i| i.into()).collect();
11138        self
11139    }
11140
11141    /// Sets the value of [replica_set][crate::model::MongodbProfile::replica_set].
11142    pub fn set_replica_set<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11143        self.replica_set = v.into();
11144        self
11145    }
11146
11147    /// Sets the value of [username][crate::model::MongodbProfile::username].
11148    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11149        self.username = v.into();
11150        self
11151    }
11152
11153    /// Sets the value of [password][crate::model::MongodbProfile::password].
11154    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11155        self.password = v.into();
11156        self
11157    }
11158
11159    /// Sets the value of [secret_manager_stored_password][crate::model::MongodbProfile::secret_manager_stored_password].
11160    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
11161        mut self,
11162        v: T,
11163    ) -> Self {
11164        self.secret_manager_stored_password = v.into();
11165        self
11166    }
11167
11168    /// Sets the value of [ssl_config][crate::model::MongodbProfile::ssl_config].
11169    pub fn set_ssl_config<T>(mut self, v: T) -> Self
11170    where
11171        T: std::convert::Into<crate::model::MongodbSslConfig>,
11172    {
11173        self.ssl_config = std::option::Option::Some(v.into());
11174        self
11175    }
11176
11177    /// Sets or clears the value of [ssl_config][crate::model::MongodbProfile::ssl_config].
11178    pub fn set_or_clear_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
11179    where
11180        T: std::convert::Into<crate::model::MongodbSslConfig>,
11181    {
11182        self.ssl_config = v.map(|x| x.into());
11183        self
11184    }
11185
11186    /// Sets the value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format].
11187    ///
11188    /// Note that all the setters affecting `mongodb_connection_format` are mutually
11189    /// exclusive.
11190    pub fn set_mongodb_connection_format<
11191        T: std::convert::Into<
11192                std::option::Option<crate::model::mongodb_profile::MongodbConnectionFormat>,
11193            >,
11194    >(
11195        mut self,
11196        v: T,
11197    ) -> Self {
11198        self.mongodb_connection_format = v.into();
11199        self
11200    }
11201
11202    /// The value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
11203    /// if it holds a `SrvConnectionFormat`, `None` if the field is not set or
11204    /// holds a different branch.
11205    pub fn srv_connection_format(
11206        &self,
11207    ) -> std::option::Option<&std::boxed::Box<crate::model::SrvConnectionFormat>> {
11208        #[allow(unreachable_patterns)]
11209        self.mongodb_connection_format
11210            .as_ref()
11211            .and_then(|v| match v {
11212                crate::model::mongodb_profile::MongodbConnectionFormat::SrvConnectionFormat(v) => {
11213                    std::option::Option::Some(v)
11214                }
11215                _ => std::option::Option::None,
11216            })
11217    }
11218
11219    /// Sets the value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
11220    /// to hold a `SrvConnectionFormat`.
11221    ///
11222    /// Note that all the setters affecting `mongodb_connection_format` are
11223    /// mutually exclusive.
11224    pub fn set_srv_connection_format<
11225        T: std::convert::Into<std::boxed::Box<crate::model::SrvConnectionFormat>>,
11226    >(
11227        mut self,
11228        v: T,
11229    ) -> Self {
11230        self.mongodb_connection_format = std::option::Option::Some(
11231            crate::model::mongodb_profile::MongodbConnectionFormat::SrvConnectionFormat(v.into()),
11232        );
11233        self
11234    }
11235
11236    /// The value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
11237    /// if it holds a `StandardConnectionFormat`, `None` if the field is not set or
11238    /// holds a different branch.
11239    pub fn standard_connection_format(
11240        &self,
11241    ) -> std::option::Option<&std::boxed::Box<crate::model::StandardConnectionFormat>> {
11242        #[allow(unreachable_patterns)]
11243        self.mongodb_connection_format.as_ref().and_then(|v| match v {
11244            crate::model::mongodb_profile::MongodbConnectionFormat::StandardConnectionFormat(v) => std::option::Option::Some(v),
11245            _ => std::option::Option::None,
11246        })
11247    }
11248
11249    /// Sets the value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
11250    /// to hold a `StandardConnectionFormat`.
11251    ///
11252    /// Note that all the setters affecting `mongodb_connection_format` are
11253    /// mutually exclusive.
11254    pub fn set_standard_connection_format<
11255        T: std::convert::Into<std::boxed::Box<crate::model::StandardConnectionFormat>>,
11256    >(
11257        mut self,
11258        v: T,
11259    ) -> Self {
11260        self.mongodb_connection_format = std::option::Option::Some(
11261            crate::model::mongodb_profile::MongodbConnectionFormat::StandardConnectionFormat(
11262                v.into(),
11263            ),
11264        );
11265        self
11266    }
11267}
11268
11269impl wkt::message::Message for MongodbProfile {
11270    fn typename() -> &'static str {
11271        "type.googleapis.com/google.cloud.datastream.v1.MongodbProfile"
11272    }
11273}
11274
11275#[doc(hidden)]
11276impl<'de> serde::de::Deserialize<'de> for MongodbProfile {
11277    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11278    where
11279        D: serde::Deserializer<'de>,
11280    {
11281        #[allow(non_camel_case_types)]
11282        #[doc(hidden)]
11283        #[derive(PartialEq, Eq, Hash)]
11284        enum __FieldTag {
11285            __host_addresses,
11286            __replica_set,
11287            __username,
11288            __password,
11289            __secret_manager_stored_password,
11290            __ssl_config,
11291            __srv_connection_format,
11292            __standard_connection_format,
11293            Unknown(std::string::String),
11294        }
11295        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11296            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11297            where
11298                D: serde::Deserializer<'de>,
11299            {
11300                struct Visitor;
11301                impl<'de> serde::de::Visitor<'de> for Visitor {
11302                    type Value = __FieldTag;
11303                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11304                        formatter.write_str("a field name for MongodbProfile")
11305                    }
11306                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11307                    where
11308                        E: serde::de::Error,
11309                    {
11310                        use std::result::Result::Ok;
11311                        use std::string::ToString;
11312                        match value {
11313                            "hostAddresses" => Ok(__FieldTag::__host_addresses),
11314                            "host_addresses" => Ok(__FieldTag::__host_addresses),
11315                            "replicaSet" => Ok(__FieldTag::__replica_set),
11316                            "replica_set" => Ok(__FieldTag::__replica_set),
11317                            "username" => Ok(__FieldTag::__username),
11318                            "password" => Ok(__FieldTag::__password),
11319                            "secretManagerStoredPassword" => {
11320                                Ok(__FieldTag::__secret_manager_stored_password)
11321                            }
11322                            "secret_manager_stored_password" => {
11323                                Ok(__FieldTag::__secret_manager_stored_password)
11324                            }
11325                            "sslConfig" => Ok(__FieldTag::__ssl_config),
11326                            "ssl_config" => Ok(__FieldTag::__ssl_config),
11327                            "srvConnectionFormat" => Ok(__FieldTag::__srv_connection_format),
11328                            "srv_connection_format" => Ok(__FieldTag::__srv_connection_format),
11329                            "standardConnectionFormat" => {
11330                                Ok(__FieldTag::__standard_connection_format)
11331                            }
11332                            "standard_connection_format" => {
11333                                Ok(__FieldTag::__standard_connection_format)
11334                            }
11335                            _ => Ok(__FieldTag::Unknown(value.to_string())),
11336                        }
11337                    }
11338                }
11339                deserializer.deserialize_identifier(Visitor)
11340            }
11341        }
11342        struct Visitor;
11343        impl<'de> serde::de::Visitor<'de> for Visitor {
11344            type Value = MongodbProfile;
11345            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11346                formatter.write_str("struct MongodbProfile")
11347            }
11348            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11349            where
11350                A: serde::de::MapAccess<'de>,
11351            {
11352                #[allow(unused_imports)]
11353                use serde::de::Error;
11354                use std::option::Option::Some;
11355                let mut fields = std::collections::HashSet::new();
11356                let mut result = Self::Value::new();
11357                while let Some(tag) = map.next_key::<__FieldTag>()? {
11358                    #[allow(clippy::match_single_binding)]
11359                    match tag {
11360                        __FieldTag::__host_addresses => {
11361                            if !fields.insert(__FieldTag::__host_addresses) {
11362                                return std::result::Result::Err(A::Error::duplicate_field(
11363                                    "multiple values for host_addresses",
11364                                ));
11365                            }
11366                            result.host_addresses = map.next_value::<std::option::Option<std::vec::Vec<crate::model::HostAddress>>>()?.unwrap_or_default();
11367                        }
11368                        __FieldTag::__replica_set => {
11369                            if !fields.insert(__FieldTag::__replica_set) {
11370                                return std::result::Result::Err(A::Error::duplicate_field(
11371                                    "multiple values for replica_set",
11372                                ));
11373                            }
11374                            result.replica_set = map
11375                                .next_value::<std::option::Option<std::string::String>>()?
11376                                .unwrap_or_default();
11377                        }
11378                        __FieldTag::__username => {
11379                            if !fields.insert(__FieldTag::__username) {
11380                                return std::result::Result::Err(A::Error::duplicate_field(
11381                                    "multiple values for username",
11382                                ));
11383                            }
11384                            result.username = map
11385                                .next_value::<std::option::Option<std::string::String>>()?
11386                                .unwrap_or_default();
11387                        }
11388                        __FieldTag::__password => {
11389                            if !fields.insert(__FieldTag::__password) {
11390                                return std::result::Result::Err(A::Error::duplicate_field(
11391                                    "multiple values for password",
11392                                ));
11393                            }
11394                            result.password = map
11395                                .next_value::<std::option::Option<std::string::String>>()?
11396                                .unwrap_or_default();
11397                        }
11398                        __FieldTag::__secret_manager_stored_password => {
11399                            if !fields.insert(__FieldTag::__secret_manager_stored_password) {
11400                                return std::result::Result::Err(A::Error::duplicate_field(
11401                                    "multiple values for secret_manager_stored_password",
11402                                ));
11403                            }
11404                            result.secret_manager_stored_password = map
11405                                .next_value::<std::option::Option<std::string::String>>()?
11406                                .unwrap_or_default();
11407                        }
11408                        __FieldTag::__ssl_config => {
11409                            if !fields.insert(__FieldTag::__ssl_config) {
11410                                return std::result::Result::Err(A::Error::duplicate_field(
11411                                    "multiple values for ssl_config",
11412                                ));
11413                            }
11414                            result.ssl_config = map
11415                                .next_value::<std::option::Option<crate::model::MongodbSslConfig>>(
11416                                )?;
11417                        }
11418                        __FieldTag::__srv_connection_format => {
11419                            if !fields.insert(__FieldTag::__srv_connection_format) {
11420                                return std::result::Result::Err(A::Error::duplicate_field(
11421                                    "multiple values for srv_connection_format",
11422                                ));
11423                            }
11424                            if result.mongodb_connection_format.is_some() {
11425                                return std::result::Result::Err(A::Error::duplicate_field(
11426                                    "multiple values for `mongodb_connection_format`, a oneof with full ID .google.cloud.datastream.v1.MongodbProfile.srv_connection_format, latest field was srvConnectionFormat",
11427                                ));
11428                            }
11429                            result.mongodb_connection_format = std::option::Option::Some(
11430                                crate::model::mongodb_profile::MongodbConnectionFormat::SrvConnectionFormat(
11431                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::SrvConnectionFormat>>>()?.unwrap_or_default()
11432                                ),
11433                            );
11434                        }
11435                        __FieldTag::__standard_connection_format => {
11436                            if !fields.insert(__FieldTag::__standard_connection_format) {
11437                                return std::result::Result::Err(A::Error::duplicate_field(
11438                                    "multiple values for standard_connection_format",
11439                                ));
11440                            }
11441                            if result.mongodb_connection_format.is_some() {
11442                                return std::result::Result::Err(A::Error::duplicate_field(
11443                                    "multiple values for `mongodb_connection_format`, a oneof with full ID .google.cloud.datastream.v1.MongodbProfile.standard_connection_format, latest field was standardConnectionFormat",
11444                                ));
11445                            }
11446                            result.mongodb_connection_format = std::option::Option::Some(
11447                                crate::model::mongodb_profile::MongodbConnectionFormat::StandardConnectionFormat(
11448                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::StandardConnectionFormat>>>()?.unwrap_or_default()
11449                                ),
11450                            );
11451                        }
11452                        __FieldTag::Unknown(key) => {
11453                            let value = map.next_value::<serde_json::Value>()?;
11454                            result._unknown_fields.insert(key, value);
11455                        }
11456                    }
11457                }
11458                std::result::Result::Ok(result)
11459            }
11460        }
11461        deserializer.deserialize_any(Visitor)
11462    }
11463}
11464
11465#[doc(hidden)]
11466impl serde::ser::Serialize for MongodbProfile {
11467    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11468    where
11469        S: serde::ser::Serializer,
11470    {
11471        use serde::ser::SerializeMap;
11472        #[allow(unused_imports)]
11473        use std::option::Option::Some;
11474        let mut state = serializer.serialize_map(std::option::Option::None)?;
11475        if !self.host_addresses.is_empty() {
11476            state.serialize_entry("hostAddresses", &self.host_addresses)?;
11477        }
11478        if !self.replica_set.is_empty() {
11479            state.serialize_entry("replicaSet", &self.replica_set)?;
11480        }
11481        if !self.username.is_empty() {
11482            state.serialize_entry("username", &self.username)?;
11483        }
11484        if !self.password.is_empty() {
11485            state.serialize_entry("password", &self.password)?;
11486        }
11487        if !self.secret_manager_stored_password.is_empty() {
11488            state.serialize_entry(
11489                "secretManagerStoredPassword",
11490                &self.secret_manager_stored_password,
11491            )?;
11492        }
11493        if self.ssl_config.is_some() {
11494            state.serialize_entry("sslConfig", &self.ssl_config)?;
11495        }
11496        if let Some(value) = self.srv_connection_format() {
11497            state.serialize_entry("srvConnectionFormat", value)?;
11498        }
11499        if let Some(value) = self.standard_connection_format() {
11500            state.serialize_entry("standardConnectionFormat", value)?;
11501        }
11502        if !self._unknown_fields.is_empty() {
11503            for (key, value) in self._unknown_fields.iter() {
11504                state.serialize_entry(key, &value)?;
11505            }
11506        }
11507        state.end()
11508    }
11509}
11510
11511impl std::fmt::Debug for MongodbProfile {
11512    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11513        let mut debug_struct = f.debug_struct("MongodbProfile");
11514        debug_struct.field("host_addresses", &self.host_addresses);
11515        debug_struct.field("replica_set", &self.replica_set);
11516        debug_struct.field("username", &self.username);
11517        debug_struct.field("password", &self.password);
11518        debug_struct.field(
11519            "secret_manager_stored_password",
11520            &self.secret_manager_stored_password,
11521        );
11522        debug_struct.field("ssl_config", &self.ssl_config);
11523        debug_struct.field("mongodb_connection_format", &self.mongodb_connection_format);
11524        if !self._unknown_fields.is_empty() {
11525            debug_struct.field("_unknown_fields", &self._unknown_fields);
11526        }
11527        debug_struct.finish()
11528    }
11529}
11530
11531/// Defines additional types related to [MongodbProfile].
11532pub mod mongodb_profile {
11533    #[allow(unused_imports)]
11534    use super::*;
11535
11536    /// MongoDB connection format.
11537    /// Must specify either srv_connection_format or standard_connection_format.
11538    #[derive(Clone, Debug, PartialEq)]
11539    #[non_exhaustive]
11540    pub enum MongodbConnectionFormat {
11541        /// Srv connection format.
11542        SrvConnectionFormat(std::boxed::Box<crate::model::SrvConnectionFormat>),
11543        /// Standard connection format.
11544        StandardConnectionFormat(std::boxed::Box<crate::model::StandardConnectionFormat>),
11545    }
11546}
11547
11548/// A HostAddress represents a transport end point, which is the combination
11549/// of an IP address or hostname and a port number.
11550#[derive(Clone, Default, PartialEq)]
11551#[non_exhaustive]
11552pub struct HostAddress {
11553    /// Required. Hostname for the connection.
11554    pub hostname: std::string::String,
11555
11556    /// Optional. Port for the connection.
11557    pub port: i32,
11558
11559    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11560}
11561
11562impl HostAddress {
11563    pub fn new() -> Self {
11564        std::default::Default::default()
11565    }
11566
11567    /// Sets the value of [hostname][crate::model::HostAddress::hostname].
11568    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11569        self.hostname = v.into();
11570        self
11571    }
11572
11573    /// Sets the value of [port][crate::model::HostAddress::port].
11574    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11575        self.port = v.into();
11576        self
11577    }
11578}
11579
11580impl wkt::message::Message for HostAddress {
11581    fn typename() -> &'static str {
11582        "type.googleapis.com/google.cloud.datastream.v1.HostAddress"
11583    }
11584}
11585
11586#[doc(hidden)]
11587impl<'de> serde::de::Deserialize<'de> for HostAddress {
11588    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11589    where
11590        D: serde::Deserializer<'de>,
11591    {
11592        #[allow(non_camel_case_types)]
11593        #[doc(hidden)]
11594        #[derive(PartialEq, Eq, Hash)]
11595        enum __FieldTag {
11596            __hostname,
11597            __port,
11598            Unknown(std::string::String),
11599        }
11600        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11601            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11602            where
11603                D: serde::Deserializer<'de>,
11604            {
11605                struct Visitor;
11606                impl<'de> serde::de::Visitor<'de> for Visitor {
11607                    type Value = __FieldTag;
11608                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11609                        formatter.write_str("a field name for HostAddress")
11610                    }
11611                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11612                    where
11613                        E: serde::de::Error,
11614                    {
11615                        use std::result::Result::Ok;
11616                        use std::string::ToString;
11617                        match value {
11618                            "hostname" => Ok(__FieldTag::__hostname),
11619                            "port" => Ok(__FieldTag::__port),
11620                            _ => Ok(__FieldTag::Unknown(value.to_string())),
11621                        }
11622                    }
11623                }
11624                deserializer.deserialize_identifier(Visitor)
11625            }
11626        }
11627        struct Visitor;
11628        impl<'de> serde::de::Visitor<'de> for Visitor {
11629            type Value = HostAddress;
11630            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11631                formatter.write_str("struct HostAddress")
11632            }
11633            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11634            where
11635                A: serde::de::MapAccess<'de>,
11636            {
11637                #[allow(unused_imports)]
11638                use serde::de::Error;
11639                use std::option::Option::Some;
11640                let mut fields = std::collections::HashSet::new();
11641                let mut result = Self::Value::new();
11642                while let Some(tag) = map.next_key::<__FieldTag>()? {
11643                    #[allow(clippy::match_single_binding)]
11644                    match tag {
11645                        __FieldTag::__hostname => {
11646                            if !fields.insert(__FieldTag::__hostname) {
11647                                return std::result::Result::Err(A::Error::duplicate_field(
11648                                    "multiple values for hostname",
11649                                ));
11650                            }
11651                            result.hostname = map
11652                                .next_value::<std::option::Option<std::string::String>>()?
11653                                .unwrap_or_default();
11654                        }
11655                        __FieldTag::__port => {
11656                            if !fields.insert(__FieldTag::__port) {
11657                                return std::result::Result::Err(A::Error::duplicate_field(
11658                                    "multiple values for port",
11659                                ));
11660                            }
11661                            struct __With(std::option::Option<i32>);
11662                            impl<'de> serde::de::Deserialize<'de> for __With {
11663                                fn deserialize<D>(
11664                                    deserializer: D,
11665                                ) -> std::result::Result<Self, D::Error>
11666                                where
11667                                    D: serde::de::Deserializer<'de>,
11668                                {
11669                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
11670                                }
11671                            }
11672                            result.port = map.next_value::<__With>()?.0.unwrap_or_default();
11673                        }
11674                        __FieldTag::Unknown(key) => {
11675                            let value = map.next_value::<serde_json::Value>()?;
11676                            result._unknown_fields.insert(key, value);
11677                        }
11678                    }
11679                }
11680                std::result::Result::Ok(result)
11681            }
11682        }
11683        deserializer.deserialize_any(Visitor)
11684    }
11685}
11686
11687#[doc(hidden)]
11688impl serde::ser::Serialize for HostAddress {
11689    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11690    where
11691        S: serde::ser::Serializer,
11692    {
11693        use serde::ser::SerializeMap;
11694        #[allow(unused_imports)]
11695        use std::option::Option::Some;
11696        let mut state = serializer.serialize_map(std::option::Option::None)?;
11697        if !self.hostname.is_empty() {
11698            state.serialize_entry("hostname", &self.hostname)?;
11699        }
11700        if !wkt::internal::is_default(&self.port) {
11701            struct __With<'a>(&'a i32);
11702            impl<'a> serde::ser::Serialize for __With<'a> {
11703                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11704                where
11705                    S: serde::ser::Serializer,
11706                {
11707                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
11708                }
11709            }
11710            state.serialize_entry("port", &__With(&self.port))?;
11711        }
11712        if !self._unknown_fields.is_empty() {
11713            for (key, value) in self._unknown_fields.iter() {
11714                state.serialize_entry(key, &value)?;
11715            }
11716        }
11717        state.end()
11718    }
11719}
11720
11721impl std::fmt::Debug for HostAddress {
11722    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11723        let mut debug_struct = f.debug_struct("HostAddress");
11724        debug_struct.field("hostname", &self.hostname);
11725        debug_struct.field("port", &self.port);
11726        if !self._unknown_fields.is_empty() {
11727            debug_struct.field("_unknown_fields", &self._unknown_fields);
11728        }
11729        debug_struct.finish()
11730    }
11731}
11732
11733/// Srv connection format.
11734#[derive(Clone, Default, PartialEq)]
11735#[non_exhaustive]
11736pub struct SrvConnectionFormat {
11737    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11738}
11739
11740impl SrvConnectionFormat {
11741    pub fn new() -> Self {
11742        std::default::Default::default()
11743    }
11744}
11745
11746impl wkt::message::Message for SrvConnectionFormat {
11747    fn typename() -> &'static str {
11748        "type.googleapis.com/google.cloud.datastream.v1.SrvConnectionFormat"
11749    }
11750}
11751
11752#[doc(hidden)]
11753impl<'de> serde::de::Deserialize<'de> for SrvConnectionFormat {
11754    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11755    where
11756        D: serde::Deserializer<'de>,
11757    {
11758        #[allow(non_camel_case_types)]
11759        #[doc(hidden)]
11760        #[derive(PartialEq, Eq, Hash)]
11761        enum __FieldTag {
11762            Unknown(std::string::String),
11763        }
11764        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11765            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11766            where
11767                D: serde::Deserializer<'de>,
11768            {
11769                struct Visitor;
11770                impl<'de> serde::de::Visitor<'de> for Visitor {
11771                    type Value = __FieldTag;
11772                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11773                        formatter.write_str("a field name for SrvConnectionFormat")
11774                    }
11775                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11776                    where
11777                        E: serde::de::Error,
11778                    {
11779                        use std::result::Result::Ok;
11780                        use std::string::ToString;
11781                        Ok(__FieldTag::Unknown(value.to_string()))
11782                    }
11783                }
11784                deserializer.deserialize_identifier(Visitor)
11785            }
11786        }
11787        struct Visitor;
11788        impl<'de> serde::de::Visitor<'de> for Visitor {
11789            type Value = SrvConnectionFormat;
11790            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11791                formatter.write_str("struct SrvConnectionFormat")
11792            }
11793            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11794            where
11795                A: serde::de::MapAccess<'de>,
11796            {
11797                #[allow(unused_imports)]
11798                use serde::de::Error;
11799                use std::option::Option::Some;
11800                let mut result = Self::Value::new();
11801                while let Some(tag) = map.next_key::<__FieldTag>()? {
11802                    #[allow(clippy::match_single_binding)]
11803                    match tag {
11804                        __FieldTag::Unknown(key) => {
11805                            let value = map.next_value::<serde_json::Value>()?;
11806                            result._unknown_fields.insert(key, value);
11807                        }
11808                    }
11809                }
11810                std::result::Result::Ok(result)
11811            }
11812        }
11813        deserializer.deserialize_any(Visitor)
11814    }
11815}
11816
11817#[doc(hidden)]
11818impl serde::ser::Serialize for SrvConnectionFormat {
11819    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11820    where
11821        S: serde::ser::Serializer,
11822    {
11823        use serde::ser::SerializeMap;
11824        #[allow(unused_imports)]
11825        use std::option::Option::Some;
11826        let mut state = serializer.serialize_map(std::option::Option::None)?;
11827        if !self._unknown_fields.is_empty() {
11828            for (key, value) in self._unknown_fields.iter() {
11829                state.serialize_entry(key, &value)?;
11830            }
11831        }
11832        state.end()
11833    }
11834}
11835
11836impl std::fmt::Debug for SrvConnectionFormat {
11837    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11838        let mut debug_struct = f.debug_struct("SrvConnectionFormat");
11839        if !self._unknown_fields.is_empty() {
11840            debug_struct.field("_unknown_fields", &self._unknown_fields);
11841        }
11842        debug_struct.finish()
11843    }
11844}
11845
11846/// Standard connection format.
11847#[derive(Clone, Default, PartialEq)]
11848#[non_exhaustive]
11849pub struct StandardConnectionFormat {
11850    /// Optional. Specifies whether the client connects directly to the host[:port]
11851    /// in the connection URI.
11852    pub direct_connection: bool,
11853
11854    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11855}
11856
11857impl StandardConnectionFormat {
11858    pub fn new() -> Self {
11859        std::default::Default::default()
11860    }
11861
11862    /// Sets the value of [direct_connection][crate::model::StandardConnectionFormat::direct_connection].
11863    pub fn set_direct_connection<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11864        self.direct_connection = v.into();
11865        self
11866    }
11867}
11868
11869impl wkt::message::Message for StandardConnectionFormat {
11870    fn typename() -> &'static str {
11871        "type.googleapis.com/google.cloud.datastream.v1.StandardConnectionFormat"
11872    }
11873}
11874
11875#[doc(hidden)]
11876impl<'de> serde::de::Deserialize<'de> for StandardConnectionFormat {
11877    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11878    where
11879        D: serde::Deserializer<'de>,
11880    {
11881        #[allow(non_camel_case_types)]
11882        #[doc(hidden)]
11883        #[derive(PartialEq, Eq, Hash)]
11884        enum __FieldTag {
11885            __direct_connection,
11886            Unknown(std::string::String),
11887        }
11888        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11889            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11890            where
11891                D: serde::Deserializer<'de>,
11892            {
11893                struct Visitor;
11894                impl<'de> serde::de::Visitor<'de> for Visitor {
11895                    type Value = __FieldTag;
11896                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11897                        formatter.write_str("a field name for StandardConnectionFormat")
11898                    }
11899                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11900                    where
11901                        E: serde::de::Error,
11902                    {
11903                        use std::result::Result::Ok;
11904                        use std::string::ToString;
11905                        match value {
11906                            "directConnection" => Ok(__FieldTag::__direct_connection),
11907                            "direct_connection" => Ok(__FieldTag::__direct_connection),
11908                            _ => Ok(__FieldTag::Unknown(value.to_string())),
11909                        }
11910                    }
11911                }
11912                deserializer.deserialize_identifier(Visitor)
11913            }
11914        }
11915        struct Visitor;
11916        impl<'de> serde::de::Visitor<'de> for Visitor {
11917            type Value = StandardConnectionFormat;
11918            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11919                formatter.write_str("struct StandardConnectionFormat")
11920            }
11921            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11922            where
11923                A: serde::de::MapAccess<'de>,
11924            {
11925                #[allow(unused_imports)]
11926                use serde::de::Error;
11927                use std::option::Option::Some;
11928                let mut fields = std::collections::HashSet::new();
11929                let mut result = Self::Value::new();
11930                while let Some(tag) = map.next_key::<__FieldTag>()? {
11931                    #[allow(clippy::match_single_binding)]
11932                    match tag {
11933                        __FieldTag::__direct_connection => {
11934                            if !fields.insert(__FieldTag::__direct_connection) {
11935                                return std::result::Result::Err(A::Error::duplicate_field(
11936                                    "multiple values for direct_connection",
11937                                ));
11938                            }
11939                            result.direct_connection = map
11940                                .next_value::<std::option::Option<bool>>()?
11941                                .unwrap_or_default();
11942                        }
11943                        __FieldTag::Unknown(key) => {
11944                            let value = map.next_value::<serde_json::Value>()?;
11945                            result._unknown_fields.insert(key, value);
11946                        }
11947                    }
11948                }
11949                std::result::Result::Ok(result)
11950            }
11951        }
11952        deserializer.deserialize_any(Visitor)
11953    }
11954}
11955
11956#[doc(hidden)]
11957impl serde::ser::Serialize for StandardConnectionFormat {
11958    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11959    where
11960        S: serde::ser::Serializer,
11961    {
11962        use serde::ser::SerializeMap;
11963        #[allow(unused_imports)]
11964        use std::option::Option::Some;
11965        let mut state = serializer.serialize_map(std::option::Option::None)?;
11966        if !wkt::internal::is_default(&self.direct_connection) {
11967            state.serialize_entry("directConnection", &self.direct_connection)?;
11968        }
11969        if !self._unknown_fields.is_empty() {
11970            for (key, value) in self._unknown_fields.iter() {
11971                state.serialize_entry(key, &value)?;
11972            }
11973        }
11974        state.end()
11975    }
11976}
11977
11978impl std::fmt::Debug for StandardConnectionFormat {
11979    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11980        let mut debug_struct = f.debug_struct("StandardConnectionFormat");
11981        debug_struct.field("direct_connection", &self.direct_connection);
11982        if !self._unknown_fields.is_empty() {
11983            debug_struct.field("_unknown_fields", &self._unknown_fields);
11984        }
11985        debug_struct.finish()
11986    }
11987}
11988
11989/// Cloud Storage bucket profile.
11990#[derive(Clone, Default, PartialEq)]
11991#[non_exhaustive]
11992pub struct GcsProfile {
11993    /// Required. The Cloud Storage bucket name.
11994    pub bucket: std::string::String,
11995
11996    /// The root path inside the Cloud Storage bucket.
11997    pub root_path: std::string::String,
11998
11999    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12000}
12001
12002impl GcsProfile {
12003    pub fn new() -> Self {
12004        std::default::Default::default()
12005    }
12006
12007    /// Sets the value of [bucket][crate::model::GcsProfile::bucket].
12008    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12009        self.bucket = v.into();
12010        self
12011    }
12012
12013    /// Sets the value of [root_path][crate::model::GcsProfile::root_path].
12014    pub fn set_root_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12015        self.root_path = v.into();
12016        self
12017    }
12018}
12019
12020impl wkt::message::Message for GcsProfile {
12021    fn typename() -> &'static str {
12022        "type.googleapis.com/google.cloud.datastream.v1.GcsProfile"
12023    }
12024}
12025
12026#[doc(hidden)]
12027impl<'de> serde::de::Deserialize<'de> for GcsProfile {
12028    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12029    where
12030        D: serde::Deserializer<'de>,
12031    {
12032        #[allow(non_camel_case_types)]
12033        #[doc(hidden)]
12034        #[derive(PartialEq, Eq, Hash)]
12035        enum __FieldTag {
12036            __bucket,
12037            __root_path,
12038            Unknown(std::string::String),
12039        }
12040        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12041            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12042            where
12043                D: serde::Deserializer<'de>,
12044            {
12045                struct Visitor;
12046                impl<'de> serde::de::Visitor<'de> for Visitor {
12047                    type Value = __FieldTag;
12048                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12049                        formatter.write_str("a field name for GcsProfile")
12050                    }
12051                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12052                    where
12053                        E: serde::de::Error,
12054                    {
12055                        use std::result::Result::Ok;
12056                        use std::string::ToString;
12057                        match value {
12058                            "bucket" => Ok(__FieldTag::__bucket),
12059                            "rootPath" => Ok(__FieldTag::__root_path),
12060                            "root_path" => Ok(__FieldTag::__root_path),
12061                            _ => Ok(__FieldTag::Unknown(value.to_string())),
12062                        }
12063                    }
12064                }
12065                deserializer.deserialize_identifier(Visitor)
12066            }
12067        }
12068        struct Visitor;
12069        impl<'de> serde::de::Visitor<'de> for Visitor {
12070            type Value = GcsProfile;
12071            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12072                formatter.write_str("struct GcsProfile")
12073            }
12074            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12075            where
12076                A: serde::de::MapAccess<'de>,
12077            {
12078                #[allow(unused_imports)]
12079                use serde::de::Error;
12080                use std::option::Option::Some;
12081                let mut fields = std::collections::HashSet::new();
12082                let mut result = Self::Value::new();
12083                while let Some(tag) = map.next_key::<__FieldTag>()? {
12084                    #[allow(clippy::match_single_binding)]
12085                    match tag {
12086                        __FieldTag::__bucket => {
12087                            if !fields.insert(__FieldTag::__bucket) {
12088                                return std::result::Result::Err(A::Error::duplicate_field(
12089                                    "multiple values for bucket",
12090                                ));
12091                            }
12092                            result.bucket = map
12093                                .next_value::<std::option::Option<std::string::String>>()?
12094                                .unwrap_or_default();
12095                        }
12096                        __FieldTag::__root_path => {
12097                            if !fields.insert(__FieldTag::__root_path) {
12098                                return std::result::Result::Err(A::Error::duplicate_field(
12099                                    "multiple values for root_path",
12100                                ));
12101                            }
12102                            result.root_path = map
12103                                .next_value::<std::option::Option<std::string::String>>()?
12104                                .unwrap_or_default();
12105                        }
12106                        __FieldTag::Unknown(key) => {
12107                            let value = map.next_value::<serde_json::Value>()?;
12108                            result._unknown_fields.insert(key, value);
12109                        }
12110                    }
12111                }
12112                std::result::Result::Ok(result)
12113            }
12114        }
12115        deserializer.deserialize_any(Visitor)
12116    }
12117}
12118
12119#[doc(hidden)]
12120impl serde::ser::Serialize for GcsProfile {
12121    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12122    where
12123        S: serde::ser::Serializer,
12124    {
12125        use serde::ser::SerializeMap;
12126        #[allow(unused_imports)]
12127        use std::option::Option::Some;
12128        let mut state = serializer.serialize_map(std::option::Option::None)?;
12129        if !self.bucket.is_empty() {
12130            state.serialize_entry("bucket", &self.bucket)?;
12131        }
12132        if !self.root_path.is_empty() {
12133            state.serialize_entry("rootPath", &self.root_path)?;
12134        }
12135        if !self._unknown_fields.is_empty() {
12136            for (key, value) in self._unknown_fields.iter() {
12137                state.serialize_entry(key, &value)?;
12138            }
12139        }
12140        state.end()
12141    }
12142}
12143
12144impl std::fmt::Debug for GcsProfile {
12145    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12146        let mut debug_struct = f.debug_struct("GcsProfile");
12147        debug_struct.field("bucket", &self.bucket);
12148        debug_struct.field("root_path", &self.root_path);
12149        if !self._unknown_fields.is_empty() {
12150            debug_struct.field("_unknown_fields", &self._unknown_fields);
12151        }
12152        debug_struct.finish()
12153    }
12154}
12155
12156/// BigQuery warehouse profile.
12157#[derive(Clone, Default, PartialEq)]
12158#[non_exhaustive]
12159pub struct BigQueryProfile {
12160    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12161}
12162
12163impl BigQueryProfile {
12164    pub fn new() -> Self {
12165        std::default::Default::default()
12166    }
12167}
12168
12169impl wkt::message::Message for BigQueryProfile {
12170    fn typename() -> &'static str {
12171        "type.googleapis.com/google.cloud.datastream.v1.BigQueryProfile"
12172    }
12173}
12174
12175#[doc(hidden)]
12176impl<'de> serde::de::Deserialize<'de> for BigQueryProfile {
12177    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12178    where
12179        D: serde::Deserializer<'de>,
12180    {
12181        #[allow(non_camel_case_types)]
12182        #[doc(hidden)]
12183        #[derive(PartialEq, Eq, Hash)]
12184        enum __FieldTag {
12185            Unknown(std::string::String),
12186        }
12187        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12188            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12189            where
12190                D: serde::Deserializer<'de>,
12191            {
12192                struct Visitor;
12193                impl<'de> serde::de::Visitor<'de> for Visitor {
12194                    type Value = __FieldTag;
12195                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12196                        formatter.write_str("a field name for BigQueryProfile")
12197                    }
12198                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12199                    where
12200                        E: serde::de::Error,
12201                    {
12202                        use std::result::Result::Ok;
12203                        use std::string::ToString;
12204                        Ok(__FieldTag::Unknown(value.to_string()))
12205                    }
12206                }
12207                deserializer.deserialize_identifier(Visitor)
12208            }
12209        }
12210        struct Visitor;
12211        impl<'de> serde::de::Visitor<'de> for Visitor {
12212            type Value = BigQueryProfile;
12213            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12214                formatter.write_str("struct BigQueryProfile")
12215            }
12216            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12217            where
12218                A: serde::de::MapAccess<'de>,
12219            {
12220                #[allow(unused_imports)]
12221                use serde::de::Error;
12222                use std::option::Option::Some;
12223                let mut result = Self::Value::new();
12224                while let Some(tag) = map.next_key::<__FieldTag>()? {
12225                    #[allow(clippy::match_single_binding)]
12226                    match tag {
12227                        __FieldTag::Unknown(key) => {
12228                            let value = map.next_value::<serde_json::Value>()?;
12229                            result._unknown_fields.insert(key, value);
12230                        }
12231                    }
12232                }
12233                std::result::Result::Ok(result)
12234            }
12235        }
12236        deserializer.deserialize_any(Visitor)
12237    }
12238}
12239
12240#[doc(hidden)]
12241impl serde::ser::Serialize for BigQueryProfile {
12242    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12243    where
12244        S: serde::ser::Serializer,
12245    {
12246        use serde::ser::SerializeMap;
12247        #[allow(unused_imports)]
12248        use std::option::Option::Some;
12249        let mut state = serializer.serialize_map(std::option::Option::None)?;
12250        if !self._unknown_fields.is_empty() {
12251            for (key, value) in self._unknown_fields.iter() {
12252                state.serialize_entry(key, &value)?;
12253            }
12254        }
12255        state.end()
12256    }
12257}
12258
12259impl std::fmt::Debug for BigQueryProfile {
12260    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12261        let mut debug_struct = f.debug_struct("BigQueryProfile");
12262        if !self._unknown_fields.is_empty() {
12263            debug_struct.field("_unknown_fields", &self._unknown_fields);
12264        }
12265        debug_struct.finish()
12266    }
12267}
12268
12269/// Static IP address connectivity. Used when the source database is configured
12270/// to allow incoming connections from the Datastream public IP addresses
12271/// for the region specified in the connection profile.
12272#[derive(Clone, Default, PartialEq)]
12273#[non_exhaustive]
12274pub struct StaticServiceIpConnectivity {
12275    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12276}
12277
12278impl StaticServiceIpConnectivity {
12279    pub fn new() -> Self {
12280        std::default::Default::default()
12281    }
12282}
12283
12284impl wkt::message::Message for StaticServiceIpConnectivity {
12285    fn typename() -> &'static str {
12286        "type.googleapis.com/google.cloud.datastream.v1.StaticServiceIpConnectivity"
12287    }
12288}
12289
12290#[doc(hidden)]
12291impl<'de> serde::de::Deserialize<'de> for StaticServiceIpConnectivity {
12292    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12293    where
12294        D: serde::Deserializer<'de>,
12295    {
12296        #[allow(non_camel_case_types)]
12297        #[doc(hidden)]
12298        #[derive(PartialEq, Eq, Hash)]
12299        enum __FieldTag {
12300            Unknown(std::string::String),
12301        }
12302        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12303            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12304            where
12305                D: serde::Deserializer<'de>,
12306            {
12307                struct Visitor;
12308                impl<'de> serde::de::Visitor<'de> for Visitor {
12309                    type Value = __FieldTag;
12310                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12311                        formatter.write_str("a field name for StaticServiceIpConnectivity")
12312                    }
12313                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12314                    where
12315                        E: serde::de::Error,
12316                    {
12317                        use std::result::Result::Ok;
12318                        use std::string::ToString;
12319                        Ok(__FieldTag::Unknown(value.to_string()))
12320                    }
12321                }
12322                deserializer.deserialize_identifier(Visitor)
12323            }
12324        }
12325        struct Visitor;
12326        impl<'de> serde::de::Visitor<'de> for Visitor {
12327            type Value = StaticServiceIpConnectivity;
12328            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12329                formatter.write_str("struct StaticServiceIpConnectivity")
12330            }
12331            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12332            where
12333                A: serde::de::MapAccess<'de>,
12334            {
12335                #[allow(unused_imports)]
12336                use serde::de::Error;
12337                use std::option::Option::Some;
12338                let mut result = Self::Value::new();
12339                while let Some(tag) = map.next_key::<__FieldTag>()? {
12340                    #[allow(clippy::match_single_binding)]
12341                    match tag {
12342                        __FieldTag::Unknown(key) => {
12343                            let value = map.next_value::<serde_json::Value>()?;
12344                            result._unknown_fields.insert(key, value);
12345                        }
12346                    }
12347                }
12348                std::result::Result::Ok(result)
12349            }
12350        }
12351        deserializer.deserialize_any(Visitor)
12352    }
12353}
12354
12355#[doc(hidden)]
12356impl serde::ser::Serialize for StaticServiceIpConnectivity {
12357    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12358    where
12359        S: serde::ser::Serializer,
12360    {
12361        use serde::ser::SerializeMap;
12362        #[allow(unused_imports)]
12363        use std::option::Option::Some;
12364        let mut state = serializer.serialize_map(std::option::Option::None)?;
12365        if !self._unknown_fields.is_empty() {
12366            for (key, value) in self._unknown_fields.iter() {
12367                state.serialize_entry(key, &value)?;
12368            }
12369        }
12370        state.end()
12371    }
12372}
12373
12374impl std::fmt::Debug for StaticServiceIpConnectivity {
12375    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12376        let mut debug_struct = f.debug_struct("StaticServiceIpConnectivity");
12377        if !self._unknown_fields.is_empty() {
12378            debug_struct.field("_unknown_fields", &self._unknown_fields);
12379        }
12380        debug_struct.finish()
12381    }
12382}
12383
12384/// Forward SSH Tunnel connectivity.
12385#[derive(Clone, Default, PartialEq)]
12386#[non_exhaustive]
12387pub struct ForwardSshTunnelConnectivity {
12388    /// Required. Hostname for the SSH tunnel.
12389    pub hostname: std::string::String,
12390
12391    /// Required. Username for the SSH tunnel.
12392    pub username: std::string::String,
12393
12394    /// Port for the SSH tunnel, default value is 22.
12395    pub port: i32,
12396
12397    pub authentication_method:
12398        std::option::Option<crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod>,
12399
12400    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12401}
12402
12403impl ForwardSshTunnelConnectivity {
12404    pub fn new() -> Self {
12405        std::default::Default::default()
12406    }
12407
12408    /// Sets the value of [hostname][crate::model::ForwardSshTunnelConnectivity::hostname].
12409    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12410        self.hostname = v.into();
12411        self
12412    }
12413
12414    /// Sets the value of [username][crate::model::ForwardSshTunnelConnectivity::username].
12415    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12416        self.username = v.into();
12417        self
12418    }
12419
12420    /// Sets the value of [port][crate::model::ForwardSshTunnelConnectivity::port].
12421    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12422        self.port = v.into();
12423        self
12424    }
12425
12426    /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method].
12427    ///
12428    /// Note that all the setters affecting `authentication_method` are mutually
12429    /// exclusive.
12430    pub fn set_authentication_method<
12431        T: std::convert::Into<
12432                std::option::Option<
12433                    crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod,
12434                >,
12435            >,
12436    >(
12437        mut self,
12438        v: T,
12439    ) -> Self {
12440        self.authentication_method = v.into();
12441        self
12442    }
12443
12444    /// The value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
12445    /// if it holds a `Password`, `None` if the field is not set or
12446    /// holds a different branch.
12447    pub fn password(&self) -> std::option::Option<&std::string::String> {
12448        #[allow(unreachable_patterns)]
12449        self.authentication_method.as_ref().and_then(|v| match v {
12450            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::Password(v) => {
12451                std::option::Option::Some(v)
12452            }
12453            _ => std::option::Option::None,
12454        })
12455    }
12456
12457    /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
12458    /// to hold a `Password`.
12459    ///
12460    /// Note that all the setters affecting `authentication_method` are
12461    /// mutually exclusive.
12462    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12463        self.authentication_method = std::option::Option::Some(
12464            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::Password(v.into()),
12465        );
12466        self
12467    }
12468
12469    /// The value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
12470    /// if it holds a `PrivateKey`, `None` if the field is not set or
12471    /// holds a different branch.
12472    pub fn private_key(&self) -> std::option::Option<&std::string::String> {
12473        #[allow(unreachable_patterns)]
12474        self.authentication_method.as_ref().and_then(|v| match v {
12475            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::PrivateKey(v) => {
12476                std::option::Option::Some(v)
12477            }
12478            _ => std::option::Option::None,
12479        })
12480    }
12481
12482    /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
12483    /// to hold a `PrivateKey`.
12484    ///
12485    /// Note that all the setters affecting `authentication_method` are
12486    /// mutually exclusive.
12487    pub fn set_private_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12488        self.authentication_method = std::option::Option::Some(
12489            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::PrivateKey(
12490                v.into(),
12491            ),
12492        );
12493        self
12494    }
12495}
12496
12497impl wkt::message::Message for ForwardSshTunnelConnectivity {
12498    fn typename() -> &'static str {
12499        "type.googleapis.com/google.cloud.datastream.v1.ForwardSshTunnelConnectivity"
12500    }
12501}
12502
12503#[doc(hidden)]
12504impl<'de> serde::de::Deserialize<'de> for ForwardSshTunnelConnectivity {
12505    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12506    where
12507        D: serde::Deserializer<'de>,
12508    {
12509        #[allow(non_camel_case_types)]
12510        #[doc(hidden)]
12511        #[derive(PartialEq, Eq, Hash)]
12512        enum __FieldTag {
12513            __hostname,
12514            __username,
12515            __port,
12516            __password,
12517            __private_key,
12518            Unknown(std::string::String),
12519        }
12520        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12521            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12522            where
12523                D: serde::Deserializer<'de>,
12524            {
12525                struct Visitor;
12526                impl<'de> serde::de::Visitor<'de> for Visitor {
12527                    type Value = __FieldTag;
12528                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12529                        formatter.write_str("a field name for ForwardSshTunnelConnectivity")
12530                    }
12531                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12532                    where
12533                        E: serde::de::Error,
12534                    {
12535                        use std::result::Result::Ok;
12536                        use std::string::ToString;
12537                        match value {
12538                            "hostname" => Ok(__FieldTag::__hostname),
12539                            "username" => Ok(__FieldTag::__username),
12540                            "port" => Ok(__FieldTag::__port),
12541                            "password" => Ok(__FieldTag::__password),
12542                            "privateKey" => Ok(__FieldTag::__private_key),
12543                            "private_key" => Ok(__FieldTag::__private_key),
12544                            _ => Ok(__FieldTag::Unknown(value.to_string())),
12545                        }
12546                    }
12547                }
12548                deserializer.deserialize_identifier(Visitor)
12549            }
12550        }
12551        struct Visitor;
12552        impl<'de> serde::de::Visitor<'de> for Visitor {
12553            type Value = ForwardSshTunnelConnectivity;
12554            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12555                formatter.write_str("struct ForwardSshTunnelConnectivity")
12556            }
12557            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12558            where
12559                A: serde::de::MapAccess<'de>,
12560            {
12561                #[allow(unused_imports)]
12562                use serde::de::Error;
12563                use std::option::Option::Some;
12564                let mut fields = std::collections::HashSet::new();
12565                let mut result = Self::Value::new();
12566                while let Some(tag) = map.next_key::<__FieldTag>()? {
12567                    #[allow(clippy::match_single_binding)]
12568                    match tag {
12569                        __FieldTag::__hostname => {
12570                            if !fields.insert(__FieldTag::__hostname) {
12571                                return std::result::Result::Err(A::Error::duplicate_field(
12572                                    "multiple values for hostname",
12573                                ));
12574                            }
12575                            result.hostname = map
12576                                .next_value::<std::option::Option<std::string::String>>()?
12577                                .unwrap_or_default();
12578                        }
12579                        __FieldTag::__username => {
12580                            if !fields.insert(__FieldTag::__username) {
12581                                return std::result::Result::Err(A::Error::duplicate_field(
12582                                    "multiple values for username",
12583                                ));
12584                            }
12585                            result.username = map
12586                                .next_value::<std::option::Option<std::string::String>>()?
12587                                .unwrap_or_default();
12588                        }
12589                        __FieldTag::__port => {
12590                            if !fields.insert(__FieldTag::__port) {
12591                                return std::result::Result::Err(A::Error::duplicate_field(
12592                                    "multiple values for port",
12593                                ));
12594                            }
12595                            struct __With(std::option::Option<i32>);
12596                            impl<'de> serde::de::Deserialize<'de> for __With {
12597                                fn deserialize<D>(
12598                                    deserializer: D,
12599                                ) -> std::result::Result<Self, D::Error>
12600                                where
12601                                    D: serde::de::Deserializer<'de>,
12602                                {
12603                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
12604                                }
12605                            }
12606                            result.port = map.next_value::<__With>()?.0.unwrap_or_default();
12607                        }
12608                        __FieldTag::__password => {
12609                            if !fields.insert(__FieldTag::__password) {
12610                                return std::result::Result::Err(A::Error::duplicate_field(
12611                                    "multiple values for password",
12612                                ));
12613                            }
12614                            if result.authentication_method.is_some() {
12615                                return std::result::Result::Err(A::Error::duplicate_field(
12616                                    "multiple values for `authentication_method`, a oneof with full ID .google.cloud.datastream.v1.ForwardSshTunnelConnectivity.password, latest field was password",
12617                                ));
12618                            }
12619                            result.authentication_method = std::option::Option::Some(
12620                                crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::Password(
12621                                    map.next_value::<std::option::Option<std::string::String>>()?.unwrap_or_default()
12622                                ),
12623                            );
12624                        }
12625                        __FieldTag::__private_key => {
12626                            if !fields.insert(__FieldTag::__private_key) {
12627                                return std::result::Result::Err(A::Error::duplicate_field(
12628                                    "multiple values for private_key",
12629                                ));
12630                            }
12631                            if result.authentication_method.is_some() {
12632                                return std::result::Result::Err(A::Error::duplicate_field(
12633                                    "multiple values for `authentication_method`, a oneof with full ID .google.cloud.datastream.v1.ForwardSshTunnelConnectivity.private_key, latest field was privateKey",
12634                                ));
12635                            }
12636                            result.authentication_method = std::option::Option::Some(
12637                                crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::PrivateKey(
12638                                    map.next_value::<std::option::Option<std::string::String>>()?.unwrap_or_default()
12639                                ),
12640                            );
12641                        }
12642                        __FieldTag::Unknown(key) => {
12643                            let value = map.next_value::<serde_json::Value>()?;
12644                            result._unknown_fields.insert(key, value);
12645                        }
12646                    }
12647                }
12648                std::result::Result::Ok(result)
12649            }
12650        }
12651        deserializer.deserialize_any(Visitor)
12652    }
12653}
12654
12655#[doc(hidden)]
12656impl serde::ser::Serialize for ForwardSshTunnelConnectivity {
12657    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12658    where
12659        S: serde::ser::Serializer,
12660    {
12661        use serde::ser::SerializeMap;
12662        #[allow(unused_imports)]
12663        use std::option::Option::Some;
12664        let mut state = serializer.serialize_map(std::option::Option::None)?;
12665        if !self.hostname.is_empty() {
12666            state.serialize_entry("hostname", &self.hostname)?;
12667        }
12668        if !self.username.is_empty() {
12669            state.serialize_entry("username", &self.username)?;
12670        }
12671        if !wkt::internal::is_default(&self.port) {
12672            struct __With<'a>(&'a i32);
12673            impl<'a> serde::ser::Serialize for __With<'a> {
12674                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12675                where
12676                    S: serde::ser::Serializer,
12677                {
12678                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
12679                }
12680            }
12681            state.serialize_entry("port", &__With(&self.port))?;
12682        }
12683        if let Some(value) = self.password() {
12684            state.serialize_entry("password", value)?;
12685        }
12686        if let Some(value) = self.private_key() {
12687            state.serialize_entry("privateKey", value)?;
12688        }
12689        if !self._unknown_fields.is_empty() {
12690            for (key, value) in self._unknown_fields.iter() {
12691                state.serialize_entry(key, &value)?;
12692            }
12693        }
12694        state.end()
12695    }
12696}
12697
12698impl std::fmt::Debug for ForwardSshTunnelConnectivity {
12699    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12700        let mut debug_struct = f.debug_struct("ForwardSshTunnelConnectivity");
12701        debug_struct.field("hostname", &self.hostname);
12702        debug_struct.field("username", &self.username);
12703        debug_struct.field("port", &self.port);
12704        debug_struct.field("authentication_method", &self.authentication_method);
12705        if !self._unknown_fields.is_empty() {
12706            debug_struct.field("_unknown_fields", &self._unknown_fields);
12707        }
12708        debug_struct.finish()
12709    }
12710}
12711
12712/// Defines additional types related to [ForwardSshTunnelConnectivity].
12713pub mod forward_ssh_tunnel_connectivity {
12714    #[allow(unused_imports)]
12715    use super::*;
12716
12717    #[derive(Clone, Debug, PartialEq)]
12718    #[non_exhaustive]
12719    pub enum AuthenticationMethod {
12720        /// Input only. SSH password.
12721        Password(std::string::String),
12722        /// Input only. SSH private key.
12723        PrivateKey(std::string::String),
12724    }
12725}
12726
12727/// The VPC Peering configuration is used to create VPC peering between
12728/// Datastream and the consumer's VPC.
12729#[derive(Clone, Default, PartialEq)]
12730#[non_exhaustive]
12731pub struct VpcPeeringConfig {
12732    /// Required. Fully qualified name of the VPC that Datastream will peer to.
12733    /// Format: `projects/{project}/global/{networks}/{name}`
12734    pub vpc: std::string::String,
12735
12736    /// Required. A free subnet for peering. (CIDR of /29)
12737    pub subnet: std::string::String,
12738
12739    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12740}
12741
12742impl VpcPeeringConfig {
12743    pub fn new() -> Self {
12744        std::default::Default::default()
12745    }
12746
12747    /// Sets the value of [vpc][crate::model::VpcPeeringConfig::vpc].
12748    pub fn set_vpc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12749        self.vpc = v.into();
12750        self
12751    }
12752
12753    /// Sets the value of [subnet][crate::model::VpcPeeringConfig::subnet].
12754    pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12755        self.subnet = v.into();
12756        self
12757    }
12758}
12759
12760impl wkt::message::Message for VpcPeeringConfig {
12761    fn typename() -> &'static str {
12762        "type.googleapis.com/google.cloud.datastream.v1.VpcPeeringConfig"
12763    }
12764}
12765
12766#[doc(hidden)]
12767impl<'de> serde::de::Deserialize<'de> for VpcPeeringConfig {
12768    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12769    where
12770        D: serde::Deserializer<'de>,
12771    {
12772        #[allow(non_camel_case_types)]
12773        #[doc(hidden)]
12774        #[derive(PartialEq, Eq, Hash)]
12775        enum __FieldTag {
12776            __vpc,
12777            __subnet,
12778            Unknown(std::string::String),
12779        }
12780        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12781            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12782            where
12783                D: serde::Deserializer<'de>,
12784            {
12785                struct Visitor;
12786                impl<'de> serde::de::Visitor<'de> for Visitor {
12787                    type Value = __FieldTag;
12788                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12789                        formatter.write_str("a field name for VpcPeeringConfig")
12790                    }
12791                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12792                    where
12793                        E: serde::de::Error,
12794                    {
12795                        use std::result::Result::Ok;
12796                        use std::string::ToString;
12797                        match value {
12798                            "vpc" => Ok(__FieldTag::__vpc),
12799                            "subnet" => Ok(__FieldTag::__subnet),
12800                            _ => Ok(__FieldTag::Unknown(value.to_string())),
12801                        }
12802                    }
12803                }
12804                deserializer.deserialize_identifier(Visitor)
12805            }
12806        }
12807        struct Visitor;
12808        impl<'de> serde::de::Visitor<'de> for Visitor {
12809            type Value = VpcPeeringConfig;
12810            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12811                formatter.write_str("struct VpcPeeringConfig")
12812            }
12813            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12814            where
12815                A: serde::de::MapAccess<'de>,
12816            {
12817                #[allow(unused_imports)]
12818                use serde::de::Error;
12819                use std::option::Option::Some;
12820                let mut fields = std::collections::HashSet::new();
12821                let mut result = Self::Value::new();
12822                while let Some(tag) = map.next_key::<__FieldTag>()? {
12823                    #[allow(clippy::match_single_binding)]
12824                    match tag {
12825                        __FieldTag::__vpc => {
12826                            if !fields.insert(__FieldTag::__vpc) {
12827                                return std::result::Result::Err(A::Error::duplicate_field(
12828                                    "multiple values for vpc",
12829                                ));
12830                            }
12831                            result.vpc = map
12832                                .next_value::<std::option::Option<std::string::String>>()?
12833                                .unwrap_or_default();
12834                        }
12835                        __FieldTag::__subnet => {
12836                            if !fields.insert(__FieldTag::__subnet) {
12837                                return std::result::Result::Err(A::Error::duplicate_field(
12838                                    "multiple values for subnet",
12839                                ));
12840                            }
12841                            result.subnet = map
12842                                .next_value::<std::option::Option<std::string::String>>()?
12843                                .unwrap_or_default();
12844                        }
12845                        __FieldTag::Unknown(key) => {
12846                            let value = map.next_value::<serde_json::Value>()?;
12847                            result._unknown_fields.insert(key, value);
12848                        }
12849                    }
12850                }
12851                std::result::Result::Ok(result)
12852            }
12853        }
12854        deserializer.deserialize_any(Visitor)
12855    }
12856}
12857
12858#[doc(hidden)]
12859impl serde::ser::Serialize for VpcPeeringConfig {
12860    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12861    where
12862        S: serde::ser::Serializer,
12863    {
12864        use serde::ser::SerializeMap;
12865        #[allow(unused_imports)]
12866        use std::option::Option::Some;
12867        let mut state = serializer.serialize_map(std::option::Option::None)?;
12868        if !self.vpc.is_empty() {
12869            state.serialize_entry("vpc", &self.vpc)?;
12870        }
12871        if !self.subnet.is_empty() {
12872            state.serialize_entry("subnet", &self.subnet)?;
12873        }
12874        if !self._unknown_fields.is_empty() {
12875            for (key, value) in self._unknown_fields.iter() {
12876                state.serialize_entry(key, &value)?;
12877            }
12878        }
12879        state.end()
12880    }
12881}
12882
12883impl std::fmt::Debug for VpcPeeringConfig {
12884    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12885        let mut debug_struct = f.debug_struct("VpcPeeringConfig");
12886        debug_struct.field("vpc", &self.vpc);
12887        debug_struct.field("subnet", &self.subnet);
12888        if !self._unknown_fields.is_empty() {
12889            debug_struct.field("_unknown_fields", &self._unknown_fields);
12890        }
12891        debug_struct.finish()
12892    }
12893}
12894
12895/// The PSC Interface configuration is used to create PSC Interface between
12896/// Datastream and the consumer's PSC.
12897#[derive(Clone, Default, PartialEq)]
12898#[non_exhaustive]
12899pub struct PscInterfaceConfig {
12900    /// Required. Fully qualified name of the Network Attachment that Datastream
12901    /// will connect to. Format:
12902    /// `projects/{project}/regions/{region}/networkAttachments/{name}`
12903    pub network_attachment: std::string::String,
12904
12905    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12906}
12907
12908impl PscInterfaceConfig {
12909    pub fn new() -> Self {
12910        std::default::Default::default()
12911    }
12912
12913    /// Sets the value of [network_attachment][crate::model::PscInterfaceConfig::network_attachment].
12914    pub fn set_network_attachment<T: std::convert::Into<std::string::String>>(
12915        mut self,
12916        v: T,
12917    ) -> Self {
12918        self.network_attachment = v.into();
12919        self
12920    }
12921}
12922
12923impl wkt::message::Message for PscInterfaceConfig {
12924    fn typename() -> &'static str {
12925        "type.googleapis.com/google.cloud.datastream.v1.PscInterfaceConfig"
12926    }
12927}
12928
12929#[doc(hidden)]
12930impl<'de> serde::de::Deserialize<'de> for PscInterfaceConfig {
12931    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12932    where
12933        D: serde::Deserializer<'de>,
12934    {
12935        #[allow(non_camel_case_types)]
12936        #[doc(hidden)]
12937        #[derive(PartialEq, Eq, Hash)]
12938        enum __FieldTag {
12939            __network_attachment,
12940            Unknown(std::string::String),
12941        }
12942        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12943            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12944            where
12945                D: serde::Deserializer<'de>,
12946            {
12947                struct Visitor;
12948                impl<'de> serde::de::Visitor<'de> for Visitor {
12949                    type Value = __FieldTag;
12950                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12951                        formatter.write_str("a field name for PscInterfaceConfig")
12952                    }
12953                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12954                    where
12955                        E: serde::de::Error,
12956                    {
12957                        use std::result::Result::Ok;
12958                        use std::string::ToString;
12959                        match value {
12960                            "networkAttachment" => Ok(__FieldTag::__network_attachment),
12961                            "network_attachment" => Ok(__FieldTag::__network_attachment),
12962                            _ => Ok(__FieldTag::Unknown(value.to_string())),
12963                        }
12964                    }
12965                }
12966                deserializer.deserialize_identifier(Visitor)
12967            }
12968        }
12969        struct Visitor;
12970        impl<'de> serde::de::Visitor<'de> for Visitor {
12971            type Value = PscInterfaceConfig;
12972            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12973                formatter.write_str("struct PscInterfaceConfig")
12974            }
12975            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12976            where
12977                A: serde::de::MapAccess<'de>,
12978            {
12979                #[allow(unused_imports)]
12980                use serde::de::Error;
12981                use std::option::Option::Some;
12982                let mut fields = std::collections::HashSet::new();
12983                let mut result = Self::Value::new();
12984                while let Some(tag) = map.next_key::<__FieldTag>()? {
12985                    #[allow(clippy::match_single_binding)]
12986                    match tag {
12987                        __FieldTag::__network_attachment => {
12988                            if !fields.insert(__FieldTag::__network_attachment) {
12989                                return std::result::Result::Err(A::Error::duplicate_field(
12990                                    "multiple values for network_attachment",
12991                                ));
12992                            }
12993                            result.network_attachment = map
12994                                .next_value::<std::option::Option<std::string::String>>()?
12995                                .unwrap_or_default();
12996                        }
12997                        __FieldTag::Unknown(key) => {
12998                            let value = map.next_value::<serde_json::Value>()?;
12999                            result._unknown_fields.insert(key, value);
13000                        }
13001                    }
13002                }
13003                std::result::Result::Ok(result)
13004            }
13005        }
13006        deserializer.deserialize_any(Visitor)
13007    }
13008}
13009
13010#[doc(hidden)]
13011impl serde::ser::Serialize for PscInterfaceConfig {
13012    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13013    where
13014        S: serde::ser::Serializer,
13015    {
13016        use serde::ser::SerializeMap;
13017        #[allow(unused_imports)]
13018        use std::option::Option::Some;
13019        let mut state = serializer.serialize_map(std::option::Option::None)?;
13020        if !self.network_attachment.is_empty() {
13021            state.serialize_entry("networkAttachment", &self.network_attachment)?;
13022        }
13023        if !self._unknown_fields.is_empty() {
13024            for (key, value) in self._unknown_fields.iter() {
13025                state.serialize_entry(key, &value)?;
13026            }
13027        }
13028        state.end()
13029    }
13030}
13031
13032impl std::fmt::Debug for PscInterfaceConfig {
13033    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13034        let mut debug_struct = f.debug_struct("PscInterfaceConfig");
13035        debug_struct.field("network_attachment", &self.network_attachment);
13036        if !self._unknown_fields.is_empty() {
13037            debug_struct.field("_unknown_fields", &self._unknown_fields);
13038        }
13039        debug_struct.finish()
13040    }
13041}
13042
13043/// The PrivateConnection resource is used to establish private connectivity
13044/// between Datastream and a customer's network.
13045#[derive(Clone, Default, PartialEq)]
13046#[non_exhaustive]
13047pub struct PrivateConnection {
13048    /// Output only. Identifier. The resource's name.
13049    pub name: std::string::String,
13050
13051    /// Output only. The create time of the resource.
13052    pub create_time: std::option::Option<wkt::Timestamp>,
13053
13054    /// Output only. The update time of the resource.
13055    pub update_time: std::option::Option<wkt::Timestamp>,
13056
13057    /// Labels.
13058    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
13059
13060    /// Required. Display name.
13061    pub display_name: std::string::String,
13062
13063    /// Output only. The state of the Private Connection.
13064    pub state: crate::model::private_connection::State,
13065
13066    /// Output only. In case of error, the details of the error in a user-friendly
13067    /// format.
13068    pub error: std::option::Option<crate::model::Error>,
13069
13070    /// Output only. Reserved for future use.
13071    pub satisfies_pzs: std::option::Option<bool>,
13072
13073    /// Output only. Reserved for future use.
13074    pub satisfies_pzi: std::option::Option<bool>,
13075
13076    /// VPC Peering Config.
13077    pub vpc_peering_config: std::option::Option<crate::model::VpcPeeringConfig>,
13078
13079    /// PSC Interface Config.
13080    pub psc_interface_config: std::option::Option<crate::model::PscInterfaceConfig>,
13081
13082    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13083}
13084
13085impl PrivateConnection {
13086    pub fn new() -> Self {
13087        std::default::Default::default()
13088    }
13089
13090    /// Sets the value of [name][crate::model::PrivateConnection::name].
13091    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13092        self.name = v.into();
13093        self
13094    }
13095
13096    /// Sets the value of [create_time][crate::model::PrivateConnection::create_time].
13097    pub fn set_create_time<T>(mut self, v: T) -> Self
13098    where
13099        T: std::convert::Into<wkt::Timestamp>,
13100    {
13101        self.create_time = std::option::Option::Some(v.into());
13102        self
13103    }
13104
13105    /// Sets or clears the value of [create_time][crate::model::PrivateConnection::create_time].
13106    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13107    where
13108        T: std::convert::Into<wkt::Timestamp>,
13109    {
13110        self.create_time = v.map(|x| x.into());
13111        self
13112    }
13113
13114    /// Sets the value of [update_time][crate::model::PrivateConnection::update_time].
13115    pub fn set_update_time<T>(mut self, v: T) -> Self
13116    where
13117        T: std::convert::Into<wkt::Timestamp>,
13118    {
13119        self.update_time = std::option::Option::Some(v.into());
13120        self
13121    }
13122
13123    /// Sets or clears the value of [update_time][crate::model::PrivateConnection::update_time].
13124    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13125    where
13126        T: std::convert::Into<wkt::Timestamp>,
13127    {
13128        self.update_time = v.map(|x| x.into());
13129        self
13130    }
13131
13132    /// Sets the value of [labels][crate::model::PrivateConnection::labels].
13133    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
13134    where
13135        T: std::iter::IntoIterator<Item = (K, V)>,
13136        K: std::convert::Into<std::string::String>,
13137        V: std::convert::Into<std::string::String>,
13138    {
13139        use std::iter::Iterator;
13140        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13141        self
13142    }
13143
13144    /// Sets the value of [display_name][crate::model::PrivateConnection::display_name].
13145    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13146        self.display_name = v.into();
13147        self
13148    }
13149
13150    /// Sets the value of [state][crate::model::PrivateConnection::state].
13151    pub fn set_state<T: std::convert::Into<crate::model::private_connection::State>>(
13152        mut self,
13153        v: T,
13154    ) -> Self {
13155        self.state = v.into();
13156        self
13157    }
13158
13159    /// Sets the value of [error][crate::model::PrivateConnection::error].
13160    pub fn set_error<T>(mut self, v: T) -> Self
13161    where
13162        T: std::convert::Into<crate::model::Error>,
13163    {
13164        self.error = std::option::Option::Some(v.into());
13165        self
13166    }
13167
13168    /// Sets or clears the value of [error][crate::model::PrivateConnection::error].
13169    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
13170    where
13171        T: std::convert::Into<crate::model::Error>,
13172    {
13173        self.error = v.map(|x| x.into());
13174        self
13175    }
13176
13177    /// Sets the value of [satisfies_pzs][crate::model::PrivateConnection::satisfies_pzs].
13178    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
13179    where
13180        T: std::convert::Into<bool>,
13181    {
13182        self.satisfies_pzs = std::option::Option::Some(v.into());
13183        self
13184    }
13185
13186    /// Sets or clears the value of [satisfies_pzs][crate::model::PrivateConnection::satisfies_pzs].
13187    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
13188    where
13189        T: std::convert::Into<bool>,
13190    {
13191        self.satisfies_pzs = v.map(|x| x.into());
13192        self
13193    }
13194
13195    /// Sets the value of [satisfies_pzi][crate::model::PrivateConnection::satisfies_pzi].
13196    pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
13197    where
13198        T: std::convert::Into<bool>,
13199    {
13200        self.satisfies_pzi = std::option::Option::Some(v.into());
13201        self
13202    }
13203
13204    /// Sets or clears the value of [satisfies_pzi][crate::model::PrivateConnection::satisfies_pzi].
13205    pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
13206    where
13207        T: std::convert::Into<bool>,
13208    {
13209        self.satisfies_pzi = v.map(|x| x.into());
13210        self
13211    }
13212
13213    /// Sets the value of [vpc_peering_config][crate::model::PrivateConnection::vpc_peering_config].
13214    pub fn set_vpc_peering_config<T>(mut self, v: T) -> Self
13215    where
13216        T: std::convert::Into<crate::model::VpcPeeringConfig>,
13217    {
13218        self.vpc_peering_config = std::option::Option::Some(v.into());
13219        self
13220    }
13221
13222    /// Sets or clears the value of [vpc_peering_config][crate::model::PrivateConnection::vpc_peering_config].
13223    pub fn set_or_clear_vpc_peering_config<T>(mut self, v: std::option::Option<T>) -> Self
13224    where
13225        T: std::convert::Into<crate::model::VpcPeeringConfig>,
13226    {
13227        self.vpc_peering_config = v.map(|x| x.into());
13228        self
13229    }
13230
13231    /// Sets the value of [psc_interface_config][crate::model::PrivateConnection::psc_interface_config].
13232    pub fn set_psc_interface_config<T>(mut self, v: T) -> Self
13233    where
13234        T: std::convert::Into<crate::model::PscInterfaceConfig>,
13235    {
13236        self.psc_interface_config = std::option::Option::Some(v.into());
13237        self
13238    }
13239
13240    /// Sets or clears the value of [psc_interface_config][crate::model::PrivateConnection::psc_interface_config].
13241    pub fn set_or_clear_psc_interface_config<T>(mut self, v: std::option::Option<T>) -> Self
13242    where
13243        T: std::convert::Into<crate::model::PscInterfaceConfig>,
13244    {
13245        self.psc_interface_config = v.map(|x| x.into());
13246        self
13247    }
13248}
13249
13250impl wkt::message::Message for PrivateConnection {
13251    fn typename() -> &'static str {
13252        "type.googleapis.com/google.cloud.datastream.v1.PrivateConnection"
13253    }
13254}
13255
13256#[doc(hidden)]
13257impl<'de> serde::de::Deserialize<'de> for PrivateConnection {
13258    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13259    where
13260        D: serde::Deserializer<'de>,
13261    {
13262        #[allow(non_camel_case_types)]
13263        #[doc(hidden)]
13264        #[derive(PartialEq, Eq, Hash)]
13265        enum __FieldTag {
13266            __name,
13267            __create_time,
13268            __update_time,
13269            __labels,
13270            __display_name,
13271            __state,
13272            __error,
13273            __satisfies_pzs,
13274            __satisfies_pzi,
13275            __vpc_peering_config,
13276            __psc_interface_config,
13277            Unknown(std::string::String),
13278        }
13279        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13280            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13281            where
13282                D: serde::Deserializer<'de>,
13283            {
13284                struct Visitor;
13285                impl<'de> serde::de::Visitor<'de> for Visitor {
13286                    type Value = __FieldTag;
13287                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13288                        formatter.write_str("a field name for PrivateConnection")
13289                    }
13290                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13291                    where
13292                        E: serde::de::Error,
13293                    {
13294                        use std::result::Result::Ok;
13295                        use std::string::ToString;
13296                        match value {
13297                            "name" => Ok(__FieldTag::__name),
13298                            "createTime" => Ok(__FieldTag::__create_time),
13299                            "create_time" => Ok(__FieldTag::__create_time),
13300                            "updateTime" => Ok(__FieldTag::__update_time),
13301                            "update_time" => Ok(__FieldTag::__update_time),
13302                            "labels" => Ok(__FieldTag::__labels),
13303                            "displayName" => Ok(__FieldTag::__display_name),
13304                            "display_name" => Ok(__FieldTag::__display_name),
13305                            "state" => Ok(__FieldTag::__state),
13306                            "error" => Ok(__FieldTag::__error),
13307                            "satisfiesPzs" => Ok(__FieldTag::__satisfies_pzs),
13308                            "satisfies_pzs" => Ok(__FieldTag::__satisfies_pzs),
13309                            "satisfiesPzi" => Ok(__FieldTag::__satisfies_pzi),
13310                            "satisfies_pzi" => Ok(__FieldTag::__satisfies_pzi),
13311                            "vpcPeeringConfig" => Ok(__FieldTag::__vpc_peering_config),
13312                            "vpc_peering_config" => Ok(__FieldTag::__vpc_peering_config),
13313                            "pscInterfaceConfig" => Ok(__FieldTag::__psc_interface_config),
13314                            "psc_interface_config" => Ok(__FieldTag::__psc_interface_config),
13315                            _ => Ok(__FieldTag::Unknown(value.to_string())),
13316                        }
13317                    }
13318                }
13319                deserializer.deserialize_identifier(Visitor)
13320            }
13321        }
13322        struct Visitor;
13323        impl<'de> serde::de::Visitor<'de> for Visitor {
13324            type Value = PrivateConnection;
13325            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13326                formatter.write_str("struct PrivateConnection")
13327            }
13328            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13329            where
13330                A: serde::de::MapAccess<'de>,
13331            {
13332                #[allow(unused_imports)]
13333                use serde::de::Error;
13334                use std::option::Option::Some;
13335                let mut fields = std::collections::HashSet::new();
13336                let mut result = Self::Value::new();
13337                while let Some(tag) = map.next_key::<__FieldTag>()? {
13338                    #[allow(clippy::match_single_binding)]
13339                    match tag {
13340                        __FieldTag::__name => {
13341                            if !fields.insert(__FieldTag::__name) {
13342                                return std::result::Result::Err(A::Error::duplicate_field(
13343                                    "multiple values for name",
13344                                ));
13345                            }
13346                            result.name = map
13347                                .next_value::<std::option::Option<std::string::String>>()?
13348                                .unwrap_or_default();
13349                        }
13350                        __FieldTag::__create_time => {
13351                            if !fields.insert(__FieldTag::__create_time) {
13352                                return std::result::Result::Err(A::Error::duplicate_field(
13353                                    "multiple values for create_time",
13354                                ));
13355                            }
13356                            result.create_time =
13357                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
13358                        }
13359                        __FieldTag::__update_time => {
13360                            if !fields.insert(__FieldTag::__update_time) {
13361                                return std::result::Result::Err(A::Error::duplicate_field(
13362                                    "multiple values for update_time",
13363                                ));
13364                            }
13365                            result.update_time =
13366                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
13367                        }
13368                        __FieldTag::__labels => {
13369                            if !fields.insert(__FieldTag::__labels) {
13370                                return std::result::Result::Err(A::Error::duplicate_field(
13371                                    "multiple values for labels",
13372                                ));
13373                            }
13374                            result.labels = map
13375                                .next_value::<std::option::Option<
13376                                    std::collections::HashMap<
13377                                        std::string::String,
13378                                        std::string::String,
13379                                    >,
13380                                >>()?
13381                                .unwrap_or_default();
13382                        }
13383                        __FieldTag::__display_name => {
13384                            if !fields.insert(__FieldTag::__display_name) {
13385                                return std::result::Result::Err(A::Error::duplicate_field(
13386                                    "multiple values for display_name",
13387                                ));
13388                            }
13389                            result.display_name = map
13390                                .next_value::<std::option::Option<std::string::String>>()?
13391                                .unwrap_or_default();
13392                        }
13393                        __FieldTag::__state => {
13394                            if !fields.insert(__FieldTag::__state) {
13395                                return std::result::Result::Err(A::Error::duplicate_field(
13396                                    "multiple values for state",
13397                                ));
13398                            }
13399                            result.state = map.next_value::<std::option::Option<crate::model::private_connection::State>>()?.unwrap_or_default();
13400                        }
13401                        __FieldTag::__error => {
13402                            if !fields.insert(__FieldTag::__error) {
13403                                return std::result::Result::Err(A::Error::duplicate_field(
13404                                    "multiple values for error",
13405                                ));
13406                            }
13407                            result.error =
13408                                map.next_value::<std::option::Option<crate::model::Error>>()?;
13409                        }
13410                        __FieldTag::__satisfies_pzs => {
13411                            if !fields.insert(__FieldTag::__satisfies_pzs) {
13412                                return std::result::Result::Err(A::Error::duplicate_field(
13413                                    "multiple values for satisfies_pzs",
13414                                ));
13415                            }
13416                            result.satisfies_pzs = map.next_value::<std::option::Option<bool>>()?;
13417                        }
13418                        __FieldTag::__satisfies_pzi => {
13419                            if !fields.insert(__FieldTag::__satisfies_pzi) {
13420                                return std::result::Result::Err(A::Error::duplicate_field(
13421                                    "multiple values for satisfies_pzi",
13422                                ));
13423                            }
13424                            result.satisfies_pzi = map.next_value::<std::option::Option<bool>>()?;
13425                        }
13426                        __FieldTag::__vpc_peering_config => {
13427                            if !fields.insert(__FieldTag::__vpc_peering_config) {
13428                                return std::result::Result::Err(A::Error::duplicate_field(
13429                                    "multiple values for vpc_peering_config",
13430                                ));
13431                            }
13432                            result.vpc_peering_config = map
13433                                .next_value::<std::option::Option<crate::model::VpcPeeringConfig>>(
13434                                )?;
13435                        }
13436                        __FieldTag::__psc_interface_config => {
13437                            if !fields.insert(__FieldTag::__psc_interface_config) {
13438                                return std::result::Result::Err(A::Error::duplicate_field(
13439                                    "multiple values for psc_interface_config",
13440                                ));
13441                            }
13442                            result.psc_interface_config = map.next_value::<std::option::Option<crate::model::PscInterfaceConfig>>()?
13443                                ;
13444                        }
13445                        __FieldTag::Unknown(key) => {
13446                            let value = map.next_value::<serde_json::Value>()?;
13447                            result._unknown_fields.insert(key, value);
13448                        }
13449                    }
13450                }
13451                std::result::Result::Ok(result)
13452            }
13453        }
13454        deserializer.deserialize_any(Visitor)
13455    }
13456}
13457
13458#[doc(hidden)]
13459impl serde::ser::Serialize for PrivateConnection {
13460    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13461    where
13462        S: serde::ser::Serializer,
13463    {
13464        use serde::ser::SerializeMap;
13465        #[allow(unused_imports)]
13466        use std::option::Option::Some;
13467        let mut state = serializer.serialize_map(std::option::Option::None)?;
13468        if !self.name.is_empty() {
13469            state.serialize_entry("name", &self.name)?;
13470        }
13471        if self.create_time.is_some() {
13472            state.serialize_entry("createTime", &self.create_time)?;
13473        }
13474        if self.update_time.is_some() {
13475            state.serialize_entry("updateTime", &self.update_time)?;
13476        }
13477        if !self.labels.is_empty() {
13478            state.serialize_entry("labels", &self.labels)?;
13479        }
13480        if !self.display_name.is_empty() {
13481            state.serialize_entry("displayName", &self.display_name)?;
13482        }
13483        if !wkt::internal::is_default(&self.state) {
13484            state.serialize_entry("state", &self.state)?;
13485        }
13486        if self.error.is_some() {
13487            state.serialize_entry("error", &self.error)?;
13488        }
13489        if self.satisfies_pzs.is_some() {
13490            state.serialize_entry("satisfiesPzs", &self.satisfies_pzs)?;
13491        }
13492        if self.satisfies_pzi.is_some() {
13493            state.serialize_entry("satisfiesPzi", &self.satisfies_pzi)?;
13494        }
13495        if self.vpc_peering_config.is_some() {
13496            state.serialize_entry("vpcPeeringConfig", &self.vpc_peering_config)?;
13497        }
13498        if self.psc_interface_config.is_some() {
13499            state.serialize_entry("pscInterfaceConfig", &self.psc_interface_config)?;
13500        }
13501        if !self._unknown_fields.is_empty() {
13502            for (key, value) in self._unknown_fields.iter() {
13503                state.serialize_entry(key, &value)?;
13504            }
13505        }
13506        state.end()
13507    }
13508}
13509
13510impl std::fmt::Debug for PrivateConnection {
13511    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13512        let mut debug_struct = f.debug_struct("PrivateConnection");
13513        debug_struct.field("name", &self.name);
13514        debug_struct.field("create_time", &self.create_time);
13515        debug_struct.field("update_time", &self.update_time);
13516        debug_struct.field("labels", &self.labels);
13517        debug_struct.field("display_name", &self.display_name);
13518        debug_struct.field("state", &self.state);
13519        debug_struct.field("error", &self.error);
13520        debug_struct.field("satisfies_pzs", &self.satisfies_pzs);
13521        debug_struct.field("satisfies_pzi", &self.satisfies_pzi);
13522        debug_struct.field("vpc_peering_config", &self.vpc_peering_config);
13523        debug_struct.field("psc_interface_config", &self.psc_interface_config);
13524        if !self._unknown_fields.is_empty() {
13525            debug_struct.field("_unknown_fields", &self._unknown_fields);
13526        }
13527        debug_struct.finish()
13528    }
13529}
13530
13531/// Defines additional types related to [PrivateConnection].
13532pub mod private_connection {
13533    #[allow(unused_imports)]
13534    use super::*;
13535
13536    /// Private Connection state.
13537    ///
13538    /// # Working with unknown values
13539    ///
13540    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13541    /// additional enum variants at any time. Adding new variants is not considered
13542    /// a breaking change. Applications should write their code in anticipation of:
13543    ///
13544    /// - New values appearing in future releases of the client library, **and**
13545    /// - New values received dynamically, without application changes.
13546    ///
13547    /// Please consult the [Working with enums] section in the user guide for some
13548    /// guidelines.
13549    ///
13550    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13551    #[derive(Clone, Debug, PartialEq)]
13552    #[non_exhaustive]
13553    pub enum State {
13554        /// Unspecified state.
13555        Unspecified,
13556        /// The private connection is in creation state - creating resources.
13557        Creating,
13558        /// The private connection has been created with all of its resources.
13559        Created,
13560        /// The private connection creation has failed.
13561        Failed,
13562        /// The private connection is being deleted.
13563        Deleting,
13564        /// Delete request has failed, resource is in invalid state.
13565        FailedToDelete,
13566        /// If set, the enum was initialized with an unknown value.
13567        ///
13568        /// Applications can examine the value using [State::value] or
13569        /// [State::name].
13570        UnknownValue(state::UnknownValue),
13571    }
13572
13573    #[doc(hidden)]
13574    pub mod state {
13575        #[allow(unused_imports)]
13576        use super::*;
13577        #[derive(Clone, Debug, PartialEq)]
13578        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13579    }
13580
13581    impl State {
13582        /// Gets the enum value.
13583        ///
13584        /// Returns `None` if the enum contains an unknown value deserialized from
13585        /// the string representation of enums.
13586        pub fn value(&self) -> std::option::Option<i32> {
13587            match self {
13588                Self::Unspecified => std::option::Option::Some(0),
13589                Self::Creating => std::option::Option::Some(1),
13590                Self::Created => std::option::Option::Some(2),
13591                Self::Failed => std::option::Option::Some(3),
13592                Self::Deleting => std::option::Option::Some(4),
13593                Self::FailedToDelete => std::option::Option::Some(5),
13594                Self::UnknownValue(u) => u.0.value(),
13595            }
13596        }
13597
13598        /// Gets the enum value as a string.
13599        ///
13600        /// Returns `None` if the enum contains an unknown value deserialized from
13601        /// the integer representation of enums.
13602        pub fn name(&self) -> std::option::Option<&str> {
13603            match self {
13604                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13605                Self::Creating => std::option::Option::Some("CREATING"),
13606                Self::Created => std::option::Option::Some("CREATED"),
13607                Self::Failed => std::option::Option::Some("FAILED"),
13608                Self::Deleting => std::option::Option::Some("DELETING"),
13609                Self::FailedToDelete => std::option::Option::Some("FAILED_TO_DELETE"),
13610                Self::UnknownValue(u) => u.0.name(),
13611            }
13612        }
13613    }
13614
13615    impl std::default::Default for State {
13616        fn default() -> Self {
13617            use std::convert::From;
13618            Self::from(0)
13619        }
13620    }
13621
13622    impl std::fmt::Display for State {
13623        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13624            wkt::internal::display_enum(f, self.name(), self.value())
13625        }
13626    }
13627
13628    impl std::convert::From<i32> for State {
13629        fn from(value: i32) -> Self {
13630            match value {
13631                0 => Self::Unspecified,
13632                1 => Self::Creating,
13633                2 => Self::Created,
13634                3 => Self::Failed,
13635                4 => Self::Deleting,
13636                5 => Self::FailedToDelete,
13637                _ => Self::UnknownValue(state::UnknownValue(
13638                    wkt::internal::UnknownEnumValue::Integer(value),
13639                )),
13640            }
13641        }
13642    }
13643
13644    impl std::convert::From<&str> for State {
13645        fn from(value: &str) -> Self {
13646            use std::string::ToString;
13647            match value {
13648                "STATE_UNSPECIFIED" => Self::Unspecified,
13649                "CREATING" => Self::Creating,
13650                "CREATED" => Self::Created,
13651                "FAILED" => Self::Failed,
13652                "DELETING" => Self::Deleting,
13653                "FAILED_TO_DELETE" => Self::FailedToDelete,
13654                _ => Self::UnknownValue(state::UnknownValue(
13655                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13656                )),
13657            }
13658        }
13659    }
13660
13661    impl serde::ser::Serialize for State {
13662        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13663        where
13664            S: serde::Serializer,
13665        {
13666            match self {
13667                Self::Unspecified => serializer.serialize_i32(0),
13668                Self::Creating => serializer.serialize_i32(1),
13669                Self::Created => serializer.serialize_i32(2),
13670                Self::Failed => serializer.serialize_i32(3),
13671                Self::Deleting => serializer.serialize_i32(4),
13672                Self::FailedToDelete => serializer.serialize_i32(5),
13673                Self::UnknownValue(u) => u.0.serialize(serializer),
13674            }
13675        }
13676    }
13677
13678    impl<'de> serde::de::Deserialize<'de> for State {
13679        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13680        where
13681            D: serde::Deserializer<'de>,
13682        {
13683            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13684                ".google.cloud.datastream.v1.PrivateConnection.State",
13685            ))
13686        }
13687    }
13688}
13689
13690/// Private Connectivity
13691#[derive(Clone, Default, PartialEq)]
13692#[non_exhaustive]
13693pub struct PrivateConnectivity {
13694    /// Required. A reference to a private connection resource.
13695    /// Format: `projects/{project}/locations/{location}/privateConnections/{name}`
13696    pub private_connection: std::string::String,
13697
13698    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13699}
13700
13701impl PrivateConnectivity {
13702    pub fn new() -> Self {
13703        std::default::Default::default()
13704    }
13705
13706    /// Sets the value of [private_connection][crate::model::PrivateConnectivity::private_connection].
13707    pub fn set_private_connection<T: std::convert::Into<std::string::String>>(
13708        mut self,
13709        v: T,
13710    ) -> Self {
13711        self.private_connection = v.into();
13712        self
13713    }
13714}
13715
13716impl wkt::message::Message for PrivateConnectivity {
13717    fn typename() -> &'static str {
13718        "type.googleapis.com/google.cloud.datastream.v1.PrivateConnectivity"
13719    }
13720}
13721
13722#[doc(hidden)]
13723impl<'de> serde::de::Deserialize<'de> for PrivateConnectivity {
13724    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13725    where
13726        D: serde::Deserializer<'de>,
13727    {
13728        #[allow(non_camel_case_types)]
13729        #[doc(hidden)]
13730        #[derive(PartialEq, Eq, Hash)]
13731        enum __FieldTag {
13732            __private_connection,
13733            Unknown(std::string::String),
13734        }
13735        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13736            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13737            where
13738                D: serde::Deserializer<'de>,
13739            {
13740                struct Visitor;
13741                impl<'de> serde::de::Visitor<'de> for Visitor {
13742                    type Value = __FieldTag;
13743                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13744                        formatter.write_str("a field name for PrivateConnectivity")
13745                    }
13746                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13747                    where
13748                        E: serde::de::Error,
13749                    {
13750                        use std::result::Result::Ok;
13751                        use std::string::ToString;
13752                        match value {
13753                            "privateConnection" => Ok(__FieldTag::__private_connection),
13754                            "private_connection" => Ok(__FieldTag::__private_connection),
13755                            _ => Ok(__FieldTag::Unknown(value.to_string())),
13756                        }
13757                    }
13758                }
13759                deserializer.deserialize_identifier(Visitor)
13760            }
13761        }
13762        struct Visitor;
13763        impl<'de> serde::de::Visitor<'de> for Visitor {
13764            type Value = PrivateConnectivity;
13765            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13766                formatter.write_str("struct PrivateConnectivity")
13767            }
13768            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13769            where
13770                A: serde::de::MapAccess<'de>,
13771            {
13772                #[allow(unused_imports)]
13773                use serde::de::Error;
13774                use std::option::Option::Some;
13775                let mut fields = std::collections::HashSet::new();
13776                let mut result = Self::Value::new();
13777                while let Some(tag) = map.next_key::<__FieldTag>()? {
13778                    #[allow(clippy::match_single_binding)]
13779                    match tag {
13780                        __FieldTag::__private_connection => {
13781                            if !fields.insert(__FieldTag::__private_connection) {
13782                                return std::result::Result::Err(A::Error::duplicate_field(
13783                                    "multiple values for private_connection",
13784                                ));
13785                            }
13786                            result.private_connection = map
13787                                .next_value::<std::option::Option<std::string::String>>()?
13788                                .unwrap_or_default();
13789                        }
13790                        __FieldTag::Unknown(key) => {
13791                            let value = map.next_value::<serde_json::Value>()?;
13792                            result._unknown_fields.insert(key, value);
13793                        }
13794                    }
13795                }
13796                std::result::Result::Ok(result)
13797            }
13798        }
13799        deserializer.deserialize_any(Visitor)
13800    }
13801}
13802
13803#[doc(hidden)]
13804impl serde::ser::Serialize for PrivateConnectivity {
13805    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13806    where
13807        S: serde::ser::Serializer,
13808    {
13809        use serde::ser::SerializeMap;
13810        #[allow(unused_imports)]
13811        use std::option::Option::Some;
13812        let mut state = serializer.serialize_map(std::option::Option::None)?;
13813        if !self.private_connection.is_empty() {
13814            state.serialize_entry("privateConnection", &self.private_connection)?;
13815        }
13816        if !self._unknown_fields.is_empty() {
13817            for (key, value) in self._unknown_fields.iter() {
13818                state.serialize_entry(key, &value)?;
13819            }
13820        }
13821        state.end()
13822    }
13823}
13824
13825impl std::fmt::Debug for PrivateConnectivity {
13826    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13827        let mut debug_struct = f.debug_struct("PrivateConnectivity");
13828        debug_struct.field("private_connection", &self.private_connection);
13829        if !self._unknown_fields.is_empty() {
13830            debug_struct.field("_unknown_fields", &self._unknown_fields);
13831        }
13832        debug_struct.finish()
13833    }
13834}
13835
13836/// The route resource is the child of the private connection resource,
13837/// used for defining a route for a private connection.
13838#[derive(Clone, Default, PartialEq)]
13839#[non_exhaustive]
13840pub struct Route {
13841    /// Output only. Identifier. The resource's name.
13842    pub name: std::string::String,
13843
13844    /// Output only. The create time of the resource.
13845    pub create_time: std::option::Option<wkt::Timestamp>,
13846
13847    /// Output only. The update time of the resource.
13848    pub update_time: std::option::Option<wkt::Timestamp>,
13849
13850    /// Labels.
13851    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
13852
13853    /// Required. Display name.
13854    pub display_name: std::string::String,
13855
13856    /// Required. Destination address for connection
13857    pub destination_address: std::string::String,
13858
13859    /// Destination port for connection
13860    pub destination_port: i32,
13861
13862    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13863}
13864
13865impl Route {
13866    pub fn new() -> Self {
13867        std::default::Default::default()
13868    }
13869
13870    /// Sets the value of [name][crate::model::Route::name].
13871    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13872        self.name = v.into();
13873        self
13874    }
13875
13876    /// Sets the value of [create_time][crate::model::Route::create_time].
13877    pub fn set_create_time<T>(mut self, v: T) -> Self
13878    where
13879        T: std::convert::Into<wkt::Timestamp>,
13880    {
13881        self.create_time = std::option::Option::Some(v.into());
13882        self
13883    }
13884
13885    /// Sets or clears the value of [create_time][crate::model::Route::create_time].
13886    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13887    where
13888        T: std::convert::Into<wkt::Timestamp>,
13889    {
13890        self.create_time = v.map(|x| x.into());
13891        self
13892    }
13893
13894    /// Sets the value of [update_time][crate::model::Route::update_time].
13895    pub fn set_update_time<T>(mut self, v: T) -> Self
13896    where
13897        T: std::convert::Into<wkt::Timestamp>,
13898    {
13899        self.update_time = std::option::Option::Some(v.into());
13900        self
13901    }
13902
13903    /// Sets or clears the value of [update_time][crate::model::Route::update_time].
13904    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13905    where
13906        T: std::convert::Into<wkt::Timestamp>,
13907    {
13908        self.update_time = v.map(|x| x.into());
13909        self
13910    }
13911
13912    /// Sets the value of [labels][crate::model::Route::labels].
13913    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
13914    where
13915        T: std::iter::IntoIterator<Item = (K, V)>,
13916        K: std::convert::Into<std::string::String>,
13917        V: std::convert::Into<std::string::String>,
13918    {
13919        use std::iter::Iterator;
13920        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13921        self
13922    }
13923
13924    /// Sets the value of [display_name][crate::model::Route::display_name].
13925    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13926        self.display_name = v.into();
13927        self
13928    }
13929
13930    /// Sets the value of [destination_address][crate::model::Route::destination_address].
13931    pub fn set_destination_address<T: std::convert::Into<std::string::String>>(
13932        mut self,
13933        v: T,
13934    ) -> Self {
13935        self.destination_address = v.into();
13936        self
13937    }
13938
13939    /// Sets the value of [destination_port][crate::model::Route::destination_port].
13940    pub fn set_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13941        self.destination_port = v.into();
13942        self
13943    }
13944}
13945
13946impl wkt::message::Message for Route {
13947    fn typename() -> &'static str {
13948        "type.googleapis.com/google.cloud.datastream.v1.Route"
13949    }
13950}
13951
13952#[doc(hidden)]
13953impl<'de> serde::de::Deserialize<'de> for Route {
13954    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13955    where
13956        D: serde::Deserializer<'de>,
13957    {
13958        #[allow(non_camel_case_types)]
13959        #[doc(hidden)]
13960        #[derive(PartialEq, Eq, Hash)]
13961        enum __FieldTag {
13962            __name,
13963            __create_time,
13964            __update_time,
13965            __labels,
13966            __display_name,
13967            __destination_address,
13968            __destination_port,
13969            Unknown(std::string::String),
13970        }
13971        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13972            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13973            where
13974                D: serde::Deserializer<'de>,
13975            {
13976                struct Visitor;
13977                impl<'de> serde::de::Visitor<'de> for Visitor {
13978                    type Value = __FieldTag;
13979                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13980                        formatter.write_str("a field name for Route")
13981                    }
13982                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13983                    where
13984                        E: serde::de::Error,
13985                    {
13986                        use std::result::Result::Ok;
13987                        use std::string::ToString;
13988                        match value {
13989                            "name" => Ok(__FieldTag::__name),
13990                            "createTime" => Ok(__FieldTag::__create_time),
13991                            "create_time" => Ok(__FieldTag::__create_time),
13992                            "updateTime" => Ok(__FieldTag::__update_time),
13993                            "update_time" => Ok(__FieldTag::__update_time),
13994                            "labels" => Ok(__FieldTag::__labels),
13995                            "displayName" => Ok(__FieldTag::__display_name),
13996                            "display_name" => Ok(__FieldTag::__display_name),
13997                            "destinationAddress" => Ok(__FieldTag::__destination_address),
13998                            "destination_address" => Ok(__FieldTag::__destination_address),
13999                            "destinationPort" => Ok(__FieldTag::__destination_port),
14000                            "destination_port" => Ok(__FieldTag::__destination_port),
14001                            _ => Ok(__FieldTag::Unknown(value.to_string())),
14002                        }
14003                    }
14004                }
14005                deserializer.deserialize_identifier(Visitor)
14006            }
14007        }
14008        struct Visitor;
14009        impl<'de> serde::de::Visitor<'de> for Visitor {
14010            type Value = Route;
14011            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14012                formatter.write_str("struct Route")
14013            }
14014            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14015            where
14016                A: serde::de::MapAccess<'de>,
14017            {
14018                #[allow(unused_imports)]
14019                use serde::de::Error;
14020                use std::option::Option::Some;
14021                let mut fields = std::collections::HashSet::new();
14022                let mut result = Self::Value::new();
14023                while let Some(tag) = map.next_key::<__FieldTag>()? {
14024                    #[allow(clippy::match_single_binding)]
14025                    match tag {
14026                        __FieldTag::__name => {
14027                            if !fields.insert(__FieldTag::__name) {
14028                                return std::result::Result::Err(A::Error::duplicate_field(
14029                                    "multiple values for name",
14030                                ));
14031                            }
14032                            result.name = map
14033                                .next_value::<std::option::Option<std::string::String>>()?
14034                                .unwrap_or_default();
14035                        }
14036                        __FieldTag::__create_time => {
14037                            if !fields.insert(__FieldTag::__create_time) {
14038                                return std::result::Result::Err(A::Error::duplicate_field(
14039                                    "multiple values for create_time",
14040                                ));
14041                            }
14042                            result.create_time =
14043                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
14044                        }
14045                        __FieldTag::__update_time => {
14046                            if !fields.insert(__FieldTag::__update_time) {
14047                                return std::result::Result::Err(A::Error::duplicate_field(
14048                                    "multiple values for update_time",
14049                                ));
14050                            }
14051                            result.update_time =
14052                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
14053                        }
14054                        __FieldTag::__labels => {
14055                            if !fields.insert(__FieldTag::__labels) {
14056                                return std::result::Result::Err(A::Error::duplicate_field(
14057                                    "multiple values for labels",
14058                                ));
14059                            }
14060                            result.labels = map
14061                                .next_value::<std::option::Option<
14062                                    std::collections::HashMap<
14063                                        std::string::String,
14064                                        std::string::String,
14065                                    >,
14066                                >>()?
14067                                .unwrap_or_default();
14068                        }
14069                        __FieldTag::__display_name => {
14070                            if !fields.insert(__FieldTag::__display_name) {
14071                                return std::result::Result::Err(A::Error::duplicate_field(
14072                                    "multiple values for display_name",
14073                                ));
14074                            }
14075                            result.display_name = map
14076                                .next_value::<std::option::Option<std::string::String>>()?
14077                                .unwrap_or_default();
14078                        }
14079                        __FieldTag::__destination_address => {
14080                            if !fields.insert(__FieldTag::__destination_address) {
14081                                return std::result::Result::Err(A::Error::duplicate_field(
14082                                    "multiple values for destination_address",
14083                                ));
14084                            }
14085                            result.destination_address = map
14086                                .next_value::<std::option::Option<std::string::String>>()?
14087                                .unwrap_or_default();
14088                        }
14089                        __FieldTag::__destination_port => {
14090                            if !fields.insert(__FieldTag::__destination_port) {
14091                                return std::result::Result::Err(A::Error::duplicate_field(
14092                                    "multiple values for destination_port",
14093                                ));
14094                            }
14095                            struct __With(std::option::Option<i32>);
14096                            impl<'de> serde::de::Deserialize<'de> for __With {
14097                                fn deserialize<D>(
14098                                    deserializer: D,
14099                                ) -> std::result::Result<Self, D::Error>
14100                                where
14101                                    D: serde::de::Deserializer<'de>,
14102                                {
14103                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
14104                                }
14105                            }
14106                            result.destination_port =
14107                                map.next_value::<__With>()?.0.unwrap_or_default();
14108                        }
14109                        __FieldTag::Unknown(key) => {
14110                            let value = map.next_value::<serde_json::Value>()?;
14111                            result._unknown_fields.insert(key, value);
14112                        }
14113                    }
14114                }
14115                std::result::Result::Ok(result)
14116            }
14117        }
14118        deserializer.deserialize_any(Visitor)
14119    }
14120}
14121
14122#[doc(hidden)]
14123impl serde::ser::Serialize for Route {
14124    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14125    where
14126        S: serde::ser::Serializer,
14127    {
14128        use serde::ser::SerializeMap;
14129        #[allow(unused_imports)]
14130        use std::option::Option::Some;
14131        let mut state = serializer.serialize_map(std::option::Option::None)?;
14132        if !self.name.is_empty() {
14133            state.serialize_entry("name", &self.name)?;
14134        }
14135        if self.create_time.is_some() {
14136            state.serialize_entry("createTime", &self.create_time)?;
14137        }
14138        if self.update_time.is_some() {
14139            state.serialize_entry("updateTime", &self.update_time)?;
14140        }
14141        if !self.labels.is_empty() {
14142            state.serialize_entry("labels", &self.labels)?;
14143        }
14144        if !self.display_name.is_empty() {
14145            state.serialize_entry("displayName", &self.display_name)?;
14146        }
14147        if !self.destination_address.is_empty() {
14148            state.serialize_entry("destinationAddress", &self.destination_address)?;
14149        }
14150        if !wkt::internal::is_default(&self.destination_port) {
14151            struct __With<'a>(&'a i32);
14152            impl<'a> serde::ser::Serialize for __With<'a> {
14153                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14154                where
14155                    S: serde::ser::Serializer,
14156                {
14157                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
14158                }
14159            }
14160            state.serialize_entry("destinationPort", &__With(&self.destination_port))?;
14161        }
14162        if !self._unknown_fields.is_empty() {
14163            for (key, value) in self._unknown_fields.iter() {
14164                state.serialize_entry(key, &value)?;
14165            }
14166        }
14167        state.end()
14168    }
14169}
14170
14171impl std::fmt::Debug for Route {
14172    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14173        let mut debug_struct = f.debug_struct("Route");
14174        debug_struct.field("name", &self.name);
14175        debug_struct.field("create_time", &self.create_time);
14176        debug_struct.field("update_time", &self.update_time);
14177        debug_struct.field("labels", &self.labels);
14178        debug_struct.field("display_name", &self.display_name);
14179        debug_struct.field("destination_address", &self.destination_address);
14180        debug_struct.field("destination_port", &self.destination_port);
14181        if !self._unknown_fields.is_empty() {
14182            debug_struct.field("_unknown_fields", &self._unknown_fields);
14183        }
14184        debug_struct.finish()
14185    }
14186}
14187
14188/// MongoDB SSL configuration information.
14189#[derive(Clone, Default, PartialEq)]
14190#[non_exhaustive]
14191pub struct MongodbSslConfig {
14192    /// Optional. Input only. PEM-encoded private key associated with the Client
14193    /// Certificate. If this field is used then the 'client_certificate' and the
14194    /// 'ca_certificate' fields are mandatory.
14195    pub client_key: std::string::String,
14196
14197    /// Output only. Indicates whether the client_key field is set.
14198    pub client_key_set: bool,
14199
14200    /// Optional. Input only. PEM-encoded certificate that will be used by the
14201    /// replica to authenticate against the source database server. If this field
14202    /// is used then the 'client_key' and the 'ca_certificate' fields are
14203    /// mandatory.
14204    pub client_certificate: std::string::String,
14205
14206    /// Output only. Indicates whether the client_certificate field is set.
14207    pub client_certificate_set: bool,
14208
14209    /// Optional. Input only. PEM-encoded certificate of the CA that signed the
14210    /// source database server's certificate.
14211    pub ca_certificate: std::string::String,
14212
14213    /// Output only. Indicates whether the ca_certificate field is set.
14214    pub ca_certificate_set: bool,
14215
14216    /// Optional. Input only. A reference to a Secret Manager resource name storing
14217    /// the PEM-encoded private key associated with the Client Certificate. If this
14218    /// field is used then the 'client_certificate' and the 'ca_certificate' fields
14219    /// are mandatory. Mutually exclusive with the `client_key` field.
14220    pub secret_manager_stored_client_key: std::string::String,
14221
14222    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14223}
14224
14225impl MongodbSslConfig {
14226    pub fn new() -> Self {
14227        std::default::Default::default()
14228    }
14229
14230    /// Sets the value of [client_key][crate::model::MongodbSslConfig::client_key].
14231    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14232        self.client_key = v.into();
14233        self
14234    }
14235
14236    /// Sets the value of [client_key_set][crate::model::MongodbSslConfig::client_key_set].
14237    pub fn set_client_key_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14238        self.client_key_set = v.into();
14239        self
14240    }
14241
14242    /// Sets the value of [client_certificate][crate::model::MongodbSslConfig::client_certificate].
14243    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
14244        mut self,
14245        v: T,
14246    ) -> Self {
14247        self.client_certificate = v.into();
14248        self
14249    }
14250
14251    /// Sets the value of [client_certificate_set][crate::model::MongodbSslConfig::client_certificate_set].
14252    pub fn set_client_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14253        self.client_certificate_set = v.into();
14254        self
14255    }
14256
14257    /// Sets the value of [ca_certificate][crate::model::MongodbSslConfig::ca_certificate].
14258    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14259        self.ca_certificate = v.into();
14260        self
14261    }
14262
14263    /// Sets the value of [ca_certificate_set][crate::model::MongodbSslConfig::ca_certificate_set].
14264    pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14265        self.ca_certificate_set = v.into();
14266        self
14267    }
14268
14269    /// Sets the value of [secret_manager_stored_client_key][crate::model::MongodbSslConfig::secret_manager_stored_client_key].
14270    pub fn set_secret_manager_stored_client_key<T: std::convert::Into<std::string::String>>(
14271        mut self,
14272        v: T,
14273    ) -> Self {
14274        self.secret_manager_stored_client_key = v.into();
14275        self
14276    }
14277}
14278
14279impl wkt::message::Message for MongodbSslConfig {
14280    fn typename() -> &'static str {
14281        "type.googleapis.com/google.cloud.datastream.v1.MongodbSslConfig"
14282    }
14283}
14284
14285#[doc(hidden)]
14286impl<'de> serde::de::Deserialize<'de> for MongodbSslConfig {
14287    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14288    where
14289        D: serde::Deserializer<'de>,
14290    {
14291        #[allow(non_camel_case_types)]
14292        #[doc(hidden)]
14293        #[derive(PartialEq, Eq, Hash)]
14294        enum __FieldTag {
14295            __client_key,
14296            __client_key_set,
14297            __client_certificate,
14298            __client_certificate_set,
14299            __ca_certificate,
14300            __ca_certificate_set,
14301            __secret_manager_stored_client_key,
14302            Unknown(std::string::String),
14303        }
14304        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14305            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14306            where
14307                D: serde::Deserializer<'de>,
14308            {
14309                struct Visitor;
14310                impl<'de> serde::de::Visitor<'de> for Visitor {
14311                    type Value = __FieldTag;
14312                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14313                        formatter.write_str("a field name for MongodbSslConfig")
14314                    }
14315                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14316                    where
14317                        E: serde::de::Error,
14318                    {
14319                        use std::result::Result::Ok;
14320                        use std::string::ToString;
14321                        match value {
14322                            "clientKey" => Ok(__FieldTag::__client_key),
14323                            "client_key" => Ok(__FieldTag::__client_key),
14324                            "clientKeySet" => Ok(__FieldTag::__client_key_set),
14325                            "client_key_set" => Ok(__FieldTag::__client_key_set),
14326                            "clientCertificate" => Ok(__FieldTag::__client_certificate),
14327                            "client_certificate" => Ok(__FieldTag::__client_certificate),
14328                            "clientCertificateSet" => Ok(__FieldTag::__client_certificate_set),
14329                            "client_certificate_set" => Ok(__FieldTag::__client_certificate_set),
14330                            "caCertificate" => Ok(__FieldTag::__ca_certificate),
14331                            "ca_certificate" => Ok(__FieldTag::__ca_certificate),
14332                            "caCertificateSet" => Ok(__FieldTag::__ca_certificate_set),
14333                            "ca_certificate_set" => Ok(__FieldTag::__ca_certificate_set),
14334                            "secretManagerStoredClientKey" => {
14335                                Ok(__FieldTag::__secret_manager_stored_client_key)
14336                            }
14337                            "secret_manager_stored_client_key" => {
14338                                Ok(__FieldTag::__secret_manager_stored_client_key)
14339                            }
14340                            _ => Ok(__FieldTag::Unknown(value.to_string())),
14341                        }
14342                    }
14343                }
14344                deserializer.deserialize_identifier(Visitor)
14345            }
14346        }
14347        struct Visitor;
14348        impl<'de> serde::de::Visitor<'de> for Visitor {
14349            type Value = MongodbSslConfig;
14350            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14351                formatter.write_str("struct MongodbSslConfig")
14352            }
14353            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14354            where
14355                A: serde::de::MapAccess<'de>,
14356            {
14357                #[allow(unused_imports)]
14358                use serde::de::Error;
14359                use std::option::Option::Some;
14360                let mut fields = std::collections::HashSet::new();
14361                let mut result = Self::Value::new();
14362                while let Some(tag) = map.next_key::<__FieldTag>()? {
14363                    #[allow(clippy::match_single_binding)]
14364                    match tag {
14365                        __FieldTag::__client_key => {
14366                            if !fields.insert(__FieldTag::__client_key) {
14367                                return std::result::Result::Err(A::Error::duplicate_field(
14368                                    "multiple values for client_key",
14369                                ));
14370                            }
14371                            result.client_key = map
14372                                .next_value::<std::option::Option<std::string::String>>()?
14373                                .unwrap_or_default();
14374                        }
14375                        __FieldTag::__client_key_set => {
14376                            if !fields.insert(__FieldTag::__client_key_set) {
14377                                return std::result::Result::Err(A::Error::duplicate_field(
14378                                    "multiple values for client_key_set",
14379                                ));
14380                            }
14381                            result.client_key_set = map
14382                                .next_value::<std::option::Option<bool>>()?
14383                                .unwrap_or_default();
14384                        }
14385                        __FieldTag::__client_certificate => {
14386                            if !fields.insert(__FieldTag::__client_certificate) {
14387                                return std::result::Result::Err(A::Error::duplicate_field(
14388                                    "multiple values for client_certificate",
14389                                ));
14390                            }
14391                            result.client_certificate = map
14392                                .next_value::<std::option::Option<std::string::String>>()?
14393                                .unwrap_or_default();
14394                        }
14395                        __FieldTag::__client_certificate_set => {
14396                            if !fields.insert(__FieldTag::__client_certificate_set) {
14397                                return std::result::Result::Err(A::Error::duplicate_field(
14398                                    "multiple values for client_certificate_set",
14399                                ));
14400                            }
14401                            result.client_certificate_set = map
14402                                .next_value::<std::option::Option<bool>>()?
14403                                .unwrap_or_default();
14404                        }
14405                        __FieldTag::__ca_certificate => {
14406                            if !fields.insert(__FieldTag::__ca_certificate) {
14407                                return std::result::Result::Err(A::Error::duplicate_field(
14408                                    "multiple values for ca_certificate",
14409                                ));
14410                            }
14411                            result.ca_certificate = map
14412                                .next_value::<std::option::Option<std::string::String>>()?
14413                                .unwrap_or_default();
14414                        }
14415                        __FieldTag::__ca_certificate_set => {
14416                            if !fields.insert(__FieldTag::__ca_certificate_set) {
14417                                return std::result::Result::Err(A::Error::duplicate_field(
14418                                    "multiple values for ca_certificate_set",
14419                                ));
14420                            }
14421                            result.ca_certificate_set = map
14422                                .next_value::<std::option::Option<bool>>()?
14423                                .unwrap_or_default();
14424                        }
14425                        __FieldTag::__secret_manager_stored_client_key => {
14426                            if !fields.insert(__FieldTag::__secret_manager_stored_client_key) {
14427                                return std::result::Result::Err(A::Error::duplicate_field(
14428                                    "multiple values for secret_manager_stored_client_key",
14429                                ));
14430                            }
14431                            result.secret_manager_stored_client_key = map
14432                                .next_value::<std::option::Option<std::string::String>>()?
14433                                .unwrap_or_default();
14434                        }
14435                        __FieldTag::Unknown(key) => {
14436                            let value = map.next_value::<serde_json::Value>()?;
14437                            result._unknown_fields.insert(key, value);
14438                        }
14439                    }
14440                }
14441                std::result::Result::Ok(result)
14442            }
14443        }
14444        deserializer.deserialize_any(Visitor)
14445    }
14446}
14447
14448#[doc(hidden)]
14449impl serde::ser::Serialize for MongodbSslConfig {
14450    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14451    where
14452        S: serde::ser::Serializer,
14453    {
14454        use serde::ser::SerializeMap;
14455        #[allow(unused_imports)]
14456        use std::option::Option::Some;
14457        let mut state = serializer.serialize_map(std::option::Option::None)?;
14458        if !self.client_key.is_empty() {
14459            state.serialize_entry("clientKey", &self.client_key)?;
14460        }
14461        if !wkt::internal::is_default(&self.client_key_set) {
14462            state.serialize_entry("clientKeySet", &self.client_key_set)?;
14463        }
14464        if !self.client_certificate.is_empty() {
14465            state.serialize_entry("clientCertificate", &self.client_certificate)?;
14466        }
14467        if !wkt::internal::is_default(&self.client_certificate_set) {
14468            state.serialize_entry("clientCertificateSet", &self.client_certificate_set)?;
14469        }
14470        if !self.ca_certificate.is_empty() {
14471            state.serialize_entry("caCertificate", &self.ca_certificate)?;
14472        }
14473        if !wkt::internal::is_default(&self.ca_certificate_set) {
14474            state.serialize_entry("caCertificateSet", &self.ca_certificate_set)?;
14475        }
14476        if !self.secret_manager_stored_client_key.is_empty() {
14477            state.serialize_entry(
14478                "secretManagerStoredClientKey",
14479                &self.secret_manager_stored_client_key,
14480            )?;
14481        }
14482        if !self._unknown_fields.is_empty() {
14483            for (key, value) in self._unknown_fields.iter() {
14484                state.serialize_entry(key, &value)?;
14485            }
14486        }
14487        state.end()
14488    }
14489}
14490
14491impl std::fmt::Debug for MongodbSslConfig {
14492    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14493        let mut debug_struct = f.debug_struct("MongodbSslConfig");
14494        debug_struct.field("client_key", &self.client_key);
14495        debug_struct.field("client_key_set", &self.client_key_set);
14496        debug_struct.field("client_certificate", &self.client_certificate);
14497        debug_struct.field("client_certificate_set", &self.client_certificate_set);
14498        debug_struct.field("ca_certificate", &self.ca_certificate);
14499        debug_struct.field("ca_certificate_set", &self.ca_certificate_set);
14500        debug_struct.field(
14501            "secret_manager_stored_client_key",
14502            &self.secret_manager_stored_client_key,
14503        );
14504        if !self._unknown_fields.is_empty() {
14505            debug_struct.field("_unknown_fields", &self._unknown_fields);
14506        }
14507        debug_struct.finish()
14508    }
14509}
14510
14511/// MySQL SSL configuration information.
14512#[derive(Clone, Default, PartialEq)]
14513#[non_exhaustive]
14514pub struct MysqlSslConfig {
14515    /// Optional. Input only. PEM-encoded private key associated with the Client
14516    /// Certificate. If this field is used then the 'client_certificate' and the
14517    /// 'ca_certificate' fields are mandatory.
14518    pub client_key: std::string::String,
14519
14520    /// Output only. Indicates whether the client_key field is set.
14521    pub client_key_set: bool,
14522
14523    /// Optional. Input only. PEM-encoded certificate that will be used by the
14524    /// replica to authenticate against the source database server. If this field
14525    /// is used then the 'client_key' and the 'ca_certificate' fields are
14526    /// mandatory.
14527    pub client_certificate: std::string::String,
14528
14529    /// Output only. Indicates whether the client_certificate field is set.
14530    pub client_certificate_set: bool,
14531
14532    /// Input only. PEM-encoded certificate of the CA that signed the source
14533    /// database server's certificate.
14534    pub ca_certificate: std::string::String,
14535
14536    /// Output only. Indicates whether the ca_certificate field is set.
14537    pub ca_certificate_set: bool,
14538
14539    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14540}
14541
14542impl MysqlSslConfig {
14543    pub fn new() -> Self {
14544        std::default::Default::default()
14545    }
14546
14547    /// Sets the value of [client_key][crate::model::MysqlSslConfig::client_key].
14548    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14549        self.client_key = v.into();
14550        self
14551    }
14552
14553    /// Sets the value of [client_key_set][crate::model::MysqlSslConfig::client_key_set].
14554    pub fn set_client_key_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14555        self.client_key_set = v.into();
14556        self
14557    }
14558
14559    /// Sets the value of [client_certificate][crate::model::MysqlSslConfig::client_certificate].
14560    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
14561        mut self,
14562        v: T,
14563    ) -> Self {
14564        self.client_certificate = v.into();
14565        self
14566    }
14567
14568    /// Sets the value of [client_certificate_set][crate::model::MysqlSslConfig::client_certificate_set].
14569    pub fn set_client_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14570        self.client_certificate_set = v.into();
14571        self
14572    }
14573
14574    /// Sets the value of [ca_certificate][crate::model::MysqlSslConfig::ca_certificate].
14575    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14576        self.ca_certificate = v.into();
14577        self
14578    }
14579
14580    /// Sets the value of [ca_certificate_set][crate::model::MysqlSslConfig::ca_certificate_set].
14581    pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14582        self.ca_certificate_set = v.into();
14583        self
14584    }
14585}
14586
14587impl wkt::message::Message for MysqlSslConfig {
14588    fn typename() -> &'static str {
14589        "type.googleapis.com/google.cloud.datastream.v1.MysqlSslConfig"
14590    }
14591}
14592
14593#[doc(hidden)]
14594impl<'de> serde::de::Deserialize<'de> for MysqlSslConfig {
14595    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14596    where
14597        D: serde::Deserializer<'de>,
14598    {
14599        #[allow(non_camel_case_types)]
14600        #[doc(hidden)]
14601        #[derive(PartialEq, Eq, Hash)]
14602        enum __FieldTag {
14603            __client_key,
14604            __client_key_set,
14605            __client_certificate,
14606            __client_certificate_set,
14607            __ca_certificate,
14608            __ca_certificate_set,
14609            Unknown(std::string::String),
14610        }
14611        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14612            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14613            where
14614                D: serde::Deserializer<'de>,
14615            {
14616                struct Visitor;
14617                impl<'de> serde::de::Visitor<'de> for Visitor {
14618                    type Value = __FieldTag;
14619                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14620                        formatter.write_str("a field name for MysqlSslConfig")
14621                    }
14622                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14623                    where
14624                        E: serde::de::Error,
14625                    {
14626                        use std::result::Result::Ok;
14627                        use std::string::ToString;
14628                        match value {
14629                            "clientKey" => Ok(__FieldTag::__client_key),
14630                            "client_key" => Ok(__FieldTag::__client_key),
14631                            "clientKeySet" => Ok(__FieldTag::__client_key_set),
14632                            "client_key_set" => Ok(__FieldTag::__client_key_set),
14633                            "clientCertificate" => Ok(__FieldTag::__client_certificate),
14634                            "client_certificate" => Ok(__FieldTag::__client_certificate),
14635                            "clientCertificateSet" => Ok(__FieldTag::__client_certificate_set),
14636                            "client_certificate_set" => Ok(__FieldTag::__client_certificate_set),
14637                            "caCertificate" => Ok(__FieldTag::__ca_certificate),
14638                            "ca_certificate" => Ok(__FieldTag::__ca_certificate),
14639                            "caCertificateSet" => Ok(__FieldTag::__ca_certificate_set),
14640                            "ca_certificate_set" => Ok(__FieldTag::__ca_certificate_set),
14641                            _ => Ok(__FieldTag::Unknown(value.to_string())),
14642                        }
14643                    }
14644                }
14645                deserializer.deserialize_identifier(Visitor)
14646            }
14647        }
14648        struct Visitor;
14649        impl<'de> serde::de::Visitor<'de> for Visitor {
14650            type Value = MysqlSslConfig;
14651            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14652                formatter.write_str("struct MysqlSslConfig")
14653            }
14654            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14655            where
14656                A: serde::de::MapAccess<'de>,
14657            {
14658                #[allow(unused_imports)]
14659                use serde::de::Error;
14660                use std::option::Option::Some;
14661                let mut fields = std::collections::HashSet::new();
14662                let mut result = Self::Value::new();
14663                while let Some(tag) = map.next_key::<__FieldTag>()? {
14664                    #[allow(clippy::match_single_binding)]
14665                    match tag {
14666                        __FieldTag::__client_key => {
14667                            if !fields.insert(__FieldTag::__client_key) {
14668                                return std::result::Result::Err(A::Error::duplicate_field(
14669                                    "multiple values for client_key",
14670                                ));
14671                            }
14672                            result.client_key = map
14673                                .next_value::<std::option::Option<std::string::String>>()?
14674                                .unwrap_or_default();
14675                        }
14676                        __FieldTag::__client_key_set => {
14677                            if !fields.insert(__FieldTag::__client_key_set) {
14678                                return std::result::Result::Err(A::Error::duplicate_field(
14679                                    "multiple values for client_key_set",
14680                                ));
14681                            }
14682                            result.client_key_set = map
14683                                .next_value::<std::option::Option<bool>>()?
14684                                .unwrap_or_default();
14685                        }
14686                        __FieldTag::__client_certificate => {
14687                            if !fields.insert(__FieldTag::__client_certificate) {
14688                                return std::result::Result::Err(A::Error::duplicate_field(
14689                                    "multiple values for client_certificate",
14690                                ));
14691                            }
14692                            result.client_certificate = map
14693                                .next_value::<std::option::Option<std::string::String>>()?
14694                                .unwrap_or_default();
14695                        }
14696                        __FieldTag::__client_certificate_set => {
14697                            if !fields.insert(__FieldTag::__client_certificate_set) {
14698                                return std::result::Result::Err(A::Error::duplicate_field(
14699                                    "multiple values for client_certificate_set",
14700                                ));
14701                            }
14702                            result.client_certificate_set = map
14703                                .next_value::<std::option::Option<bool>>()?
14704                                .unwrap_or_default();
14705                        }
14706                        __FieldTag::__ca_certificate => {
14707                            if !fields.insert(__FieldTag::__ca_certificate) {
14708                                return std::result::Result::Err(A::Error::duplicate_field(
14709                                    "multiple values for ca_certificate",
14710                                ));
14711                            }
14712                            result.ca_certificate = map
14713                                .next_value::<std::option::Option<std::string::String>>()?
14714                                .unwrap_or_default();
14715                        }
14716                        __FieldTag::__ca_certificate_set => {
14717                            if !fields.insert(__FieldTag::__ca_certificate_set) {
14718                                return std::result::Result::Err(A::Error::duplicate_field(
14719                                    "multiple values for ca_certificate_set",
14720                                ));
14721                            }
14722                            result.ca_certificate_set = map
14723                                .next_value::<std::option::Option<bool>>()?
14724                                .unwrap_or_default();
14725                        }
14726                        __FieldTag::Unknown(key) => {
14727                            let value = map.next_value::<serde_json::Value>()?;
14728                            result._unknown_fields.insert(key, value);
14729                        }
14730                    }
14731                }
14732                std::result::Result::Ok(result)
14733            }
14734        }
14735        deserializer.deserialize_any(Visitor)
14736    }
14737}
14738
14739#[doc(hidden)]
14740impl serde::ser::Serialize for MysqlSslConfig {
14741    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14742    where
14743        S: serde::ser::Serializer,
14744    {
14745        use serde::ser::SerializeMap;
14746        #[allow(unused_imports)]
14747        use std::option::Option::Some;
14748        let mut state = serializer.serialize_map(std::option::Option::None)?;
14749        if !self.client_key.is_empty() {
14750            state.serialize_entry("clientKey", &self.client_key)?;
14751        }
14752        if !wkt::internal::is_default(&self.client_key_set) {
14753            state.serialize_entry("clientKeySet", &self.client_key_set)?;
14754        }
14755        if !self.client_certificate.is_empty() {
14756            state.serialize_entry("clientCertificate", &self.client_certificate)?;
14757        }
14758        if !wkt::internal::is_default(&self.client_certificate_set) {
14759            state.serialize_entry("clientCertificateSet", &self.client_certificate_set)?;
14760        }
14761        if !self.ca_certificate.is_empty() {
14762            state.serialize_entry("caCertificate", &self.ca_certificate)?;
14763        }
14764        if !wkt::internal::is_default(&self.ca_certificate_set) {
14765            state.serialize_entry("caCertificateSet", &self.ca_certificate_set)?;
14766        }
14767        if !self._unknown_fields.is_empty() {
14768            for (key, value) in self._unknown_fields.iter() {
14769                state.serialize_entry(key, &value)?;
14770            }
14771        }
14772        state.end()
14773    }
14774}
14775
14776impl std::fmt::Debug for MysqlSslConfig {
14777    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14778        let mut debug_struct = f.debug_struct("MysqlSslConfig");
14779        debug_struct.field("client_key", &self.client_key);
14780        debug_struct.field("client_key_set", &self.client_key_set);
14781        debug_struct.field("client_certificate", &self.client_certificate);
14782        debug_struct.field("client_certificate_set", &self.client_certificate_set);
14783        debug_struct.field("ca_certificate", &self.ca_certificate);
14784        debug_struct.field("ca_certificate_set", &self.ca_certificate_set);
14785        if !self._unknown_fields.is_empty() {
14786            debug_struct.field("_unknown_fields", &self._unknown_fields);
14787        }
14788        debug_struct.finish()
14789    }
14790}
14791
14792/// Oracle SSL configuration information.
14793#[derive(Clone, Default, PartialEq)]
14794#[non_exhaustive]
14795pub struct OracleSslConfig {
14796    /// Input only. PEM-encoded certificate of the CA that signed the source
14797    /// database server's certificate.
14798    pub ca_certificate: std::string::String,
14799
14800    /// Output only. Indicates whether the ca_certificate field has been set for
14801    /// this Connection-Profile.
14802    pub ca_certificate_set: bool,
14803
14804    /// Optional. The distinguished name (DN) mentioned in the server
14805    /// certificate. This corresponds to SSL_SERVER_CERT_DN sqlnet parameter.
14806    /// Refer
14807    /// <https://docs.oracle.com/en/database/oracle/oracle-database/19/netrf/local-naming-parameters-in-tns-ora-file.html#GUID-70AB0695-A9AA-4A94-B141-4C605236EEB7>
14808    /// If this field is not provided, the DN matching is not enforced.
14809    pub server_certificate_distinguished_name: std::string::String,
14810
14811    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14812}
14813
14814impl OracleSslConfig {
14815    pub fn new() -> Self {
14816        std::default::Default::default()
14817    }
14818
14819    /// Sets the value of [ca_certificate][crate::model::OracleSslConfig::ca_certificate].
14820    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14821        self.ca_certificate = v.into();
14822        self
14823    }
14824
14825    /// Sets the value of [ca_certificate_set][crate::model::OracleSslConfig::ca_certificate_set].
14826    pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14827        self.ca_certificate_set = v.into();
14828        self
14829    }
14830
14831    /// Sets the value of [server_certificate_distinguished_name][crate::model::OracleSslConfig::server_certificate_distinguished_name].
14832    pub fn set_server_certificate_distinguished_name<T: std::convert::Into<std::string::String>>(
14833        mut self,
14834        v: T,
14835    ) -> Self {
14836        self.server_certificate_distinguished_name = v.into();
14837        self
14838    }
14839}
14840
14841impl wkt::message::Message for OracleSslConfig {
14842    fn typename() -> &'static str {
14843        "type.googleapis.com/google.cloud.datastream.v1.OracleSslConfig"
14844    }
14845}
14846
14847#[doc(hidden)]
14848impl<'de> serde::de::Deserialize<'de> for OracleSslConfig {
14849    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14850    where
14851        D: serde::Deserializer<'de>,
14852    {
14853        #[allow(non_camel_case_types)]
14854        #[doc(hidden)]
14855        #[derive(PartialEq, Eq, Hash)]
14856        enum __FieldTag {
14857            __ca_certificate,
14858            __ca_certificate_set,
14859            __server_certificate_distinguished_name,
14860            Unknown(std::string::String),
14861        }
14862        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14863            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14864            where
14865                D: serde::Deserializer<'de>,
14866            {
14867                struct Visitor;
14868                impl<'de> serde::de::Visitor<'de> for Visitor {
14869                    type Value = __FieldTag;
14870                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14871                        formatter.write_str("a field name for OracleSslConfig")
14872                    }
14873                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14874                    where
14875                        E: serde::de::Error,
14876                    {
14877                        use std::result::Result::Ok;
14878                        use std::string::ToString;
14879                        match value {
14880                            "caCertificate" => Ok(__FieldTag::__ca_certificate),
14881                            "ca_certificate" => Ok(__FieldTag::__ca_certificate),
14882                            "caCertificateSet" => Ok(__FieldTag::__ca_certificate_set),
14883                            "ca_certificate_set" => Ok(__FieldTag::__ca_certificate_set),
14884                            "serverCertificateDistinguishedName" => {
14885                                Ok(__FieldTag::__server_certificate_distinguished_name)
14886                            }
14887                            "server_certificate_distinguished_name" => {
14888                                Ok(__FieldTag::__server_certificate_distinguished_name)
14889                            }
14890                            _ => Ok(__FieldTag::Unknown(value.to_string())),
14891                        }
14892                    }
14893                }
14894                deserializer.deserialize_identifier(Visitor)
14895            }
14896        }
14897        struct Visitor;
14898        impl<'de> serde::de::Visitor<'de> for Visitor {
14899            type Value = OracleSslConfig;
14900            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14901                formatter.write_str("struct OracleSslConfig")
14902            }
14903            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14904            where
14905                A: serde::de::MapAccess<'de>,
14906            {
14907                #[allow(unused_imports)]
14908                use serde::de::Error;
14909                use std::option::Option::Some;
14910                let mut fields = std::collections::HashSet::new();
14911                let mut result = Self::Value::new();
14912                while let Some(tag) = map.next_key::<__FieldTag>()? {
14913                    #[allow(clippy::match_single_binding)]
14914                    match tag {
14915                        __FieldTag::__ca_certificate => {
14916                            if !fields.insert(__FieldTag::__ca_certificate) {
14917                                return std::result::Result::Err(A::Error::duplicate_field(
14918                                    "multiple values for ca_certificate",
14919                                ));
14920                            }
14921                            result.ca_certificate = map
14922                                .next_value::<std::option::Option<std::string::String>>()?
14923                                .unwrap_or_default();
14924                        }
14925                        __FieldTag::__ca_certificate_set => {
14926                            if !fields.insert(__FieldTag::__ca_certificate_set) {
14927                                return std::result::Result::Err(A::Error::duplicate_field(
14928                                    "multiple values for ca_certificate_set",
14929                                ));
14930                            }
14931                            result.ca_certificate_set = map
14932                                .next_value::<std::option::Option<bool>>()?
14933                                .unwrap_or_default();
14934                        }
14935                        __FieldTag::__server_certificate_distinguished_name => {
14936                            if !fields.insert(__FieldTag::__server_certificate_distinguished_name) {
14937                                return std::result::Result::Err(A::Error::duplicate_field(
14938                                    "multiple values for server_certificate_distinguished_name",
14939                                ));
14940                            }
14941                            result.server_certificate_distinguished_name = map
14942                                .next_value::<std::option::Option<std::string::String>>()?
14943                                .unwrap_or_default();
14944                        }
14945                        __FieldTag::Unknown(key) => {
14946                            let value = map.next_value::<serde_json::Value>()?;
14947                            result._unknown_fields.insert(key, value);
14948                        }
14949                    }
14950                }
14951                std::result::Result::Ok(result)
14952            }
14953        }
14954        deserializer.deserialize_any(Visitor)
14955    }
14956}
14957
14958#[doc(hidden)]
14959impl serde::ser::Serialize for OracleSslConfig {
14960    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14961    where
14962        S: serde::ser::Serializer,
14963    {
14964        use serde::ser::SerializeMap;
14965        #[allow(unused_imports)]
14966        use std::option::Option::Some;
14967        let mut state = serializer.serialize_map(std::option::Option::None)?;
14968        if !self.ca_certificate.is_empty() {
14969            state.serialize_entry("caCertificate", &self.ca_certificate)?;
14970        }
14971        if !wkt::internal::is_default(&self.ca_certificate_set) {
14972            state.serialize_entry("caCertificateSet", &self.ca_certificate_set)?;
14973        }
14974        if !self.server_certificate_distinguished_name.is_empty() {
14975            state.serialize_entry(
14976                "serverCertificateDistinguishedName",
14977                &self.server_certificate_distinguished_name,
14978            )?;
14979        }
14980        if !self._unknown_fields.is_empty() {
14981            for (key, value) in self._unknown_fields.iter() {
14982                state.serialize_entry(key, &value)?;
14983            }
14984        }
14985        state.end()
14986    }
14987}
14988
14989impl std::fmt::Debug for OracleSslConfig {
14990    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14991        let mut debug_struct = f.debug_struct("OracleSslConfig");
14992        debug_struct.field("ca_certificate", &self.ca_certificate);
14993        debug_struct.field("ca_certificate_set", &self.ca_certificate_set);
14994        debug_struct.field(
14995            "server_certificate_distinguished_name",
14996            &self.server_certificate_distinguished_name,
14997        );
14998        if !self._unknown_fields.is_empty() {
14999            debug_struct.field("_unknown_fields", &self._unknown_fields);
15000        }
15001        debug_struct.finish()
15002    }
15003}
15004
15005/// PostgreSQL SSL configuration information.
15006#[derive(Clone, Default, PartialEq)]
15007#[non_exhaustive]
15008pub struct PostgresqlSslConfig {
15009    /// The encryption settings available for PostgreSQL connection profiles.
15010    /// This captures various SSL mode supported by PostgreSQL, which includes
15011    /// TLS encryption with server verification, TLS encryption with both server
15012    /// and client verification and no TLS encryption.
15013    pub encryption_setting:
15014        std::option::Option<crate::model::postgresql_ssl_config::EncryptionSetting>,
15015
15016    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15017}
15018
15019impl PostgresqlSslConfig {
15020    pub fn new() -> Self {
15021        std::default::Default::default()
15022    }
15023
15024    /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting].
15025    ///
15026    /// Note that all the setters affecting `encryption_setting` are mutually
15027    /// exclusive.
15028    pub fn set_encryption_setting<
15029        T: std::convert::Into<
15030                std::option::Option<crate::model::postgresql_ssl_config::EncryptionSetting>,
15031            >,
15032    >(
15033        mut self,
15034        v: T,
15035    ) -> Self {
15036        self.encryption_setting = v.into();
15037        self
15038    }
15039
15040    /// The value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
15041    /// if it holds a `ServerVerification`, `None` if the field is not set or
15042    /// holds a different branch.
15043    pub fn server_verification(
15044        &self,
15045    ) -> std::option::Option<
15046        &std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
15047    > {
15048        #[allow(unreachable_patterns)]
15049        self.encryption_setting.as_ref().and_then(|v| match v {
15050            crate::model::postgresql_ssl_config::EncryptionSetting::ServerVerification(v) => {
15051                std::option::Option::Some(v)
15052            }
15053            _ => std::option::Option::None,
15054        })
15055    }
15056
15057    /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
15058    /// to hold a `ServerVerification`.
15059    ///
15060    /// Note that all the setters affecting `encryption_setting` are
15061    /// mutually exclusive.
15062    pub fn set_server_verification<
15063        T: std::convert::Into<
15064                std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
15065            >,
15066    >(
15067        mut self,
15068        v: T,
15069    ) -> Self {
15070        self.encryption_setting = std::option::Option::Some(
15071            crate::model::postgresql_ssl_config::EncryptionSetting::ServerVerification(v.into()),
15072        );
15073        self
15074    }
15075
15076    /// The value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
15077    /// if it holds a `ServerAndClientVerification`, `None` if the field is not set or
15078    /// holds a different branch.
15079    pub fn server_and_client_verification(
15080        &self,
15081    ) -> std::option::Option<
15082        &std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
15083    > {
15084        #[allow(unreachable_patterns)]
15085        self.encryption_setting.as_ref().and_then(|v| match v {
15086            crate::model::postgresql_ssl_config::EncryptionSetting::ServerAndClientVerification(
15087                v,
15088            ) => std::option::Option::Some(v),
15089            _ => std::option::Option::None,
15090        })
15091    }
15092
15093    /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
15094    /// to hold a `ServerAndClientVerification`.
15095    ///
15096    /// Note that all the setters affecting `encryption_setting` are
15097    /// mutually exclusive.
15098    pub fn set_server_and_client_verification<
15099        T: std::convert::Into<
15100                std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
15101            >,
15102    >(
15103        mut self,
15104        v: T,
15105    ) -> Self {
15106        self.encryption_setting = std::option::Option::Some(
15107            crate::model::postgresql_ssl_config::EncryptionSetting::ServerAndClientVerification(
15108                v.into(),
15109            ),
15110        );
15111        self
15112    }
15113}
15114
15115impl wkt::message::Message for PostgresqlSslConfig {
15116    fn typename() -> &'static str {
15117        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig"
15118    }
15119}
15120
15121#[doc(hidden)]
15122impl<'de> serde::de::Deserialize<'de> for PostgresqlSslConfig {
15123    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15124    where
15125        D: serde::Deserializer<'de>,
15126    {
15127        #[allow(non_camel_case_types)]
15128        #[doc(hidden)]
15129        #[derive(PartialEq, Eq, Hash)]
15130        enum __FieldTag {
15131            __server_verification,
15132            __server_and_client_verification,
15133            Unknown(std::string::String),
15134        }
15135        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
15136            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15137            where
15138                D: serde::Deserializer<'de>,
15139            {
15140                struct Visitor;
15141                impl<'de> serde::de::Visitor<'de> for Visitor {
15142                    type Value = __FieldTag;
15143                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15144                        formatter.write_str("a field name for PostgresqlSslConfig")
15145                    }
15146                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
15147                    where
15148                        E: serde::de::Error,
15149                    {
15150                        use std::result::Result::Ok;
15151                        use std::string::ToString;
15152                        match value {
15153                            "serverVerification" => Ok(__FieldTag::__server_verification),
15154                            "server_verification" => Ok(__FieldTag::__server_verification),
15155                            "serverAndClientVerification" => {
15156                                Ok(__FieldTag::__server_and_client_verification)
15157                            }
15158                            "server_and_client_verification" => {
15159                                Ok(__FieldTag::__server_and_client_verification)
15160                            }
15161                            _ => Ok(__FieldTag::Unknown(value.to_string())),
15162                        }
15163                    }
15164                }
15165                deserializer.deserialize_identifier(Visitor)
15166            }
15167        }
15168        struct Visitor;
15169        impl<'de> serde::de::Visitor<'de> for Visitor {
15170            type Value = PostgresqlSslConfig;
15171            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15172                formatter.write_str("struct PostgresqlSslConfig")
15173            }
15174            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
15175            where
15176                A: serde::de::MapAccess<'de>,
15177            {
15178                #[allow(unused_imports)]
15179                use serde::de::Error;
15180                use std::option::Option::Some;
15181                let mut fields = std::collections::HashSet::new();
15182                let mut result = Self::Value::new();
15183                while let Some(tag) = map.next_key::<__FieldTag>()? {
15184                    #[allow(clippy::match_single_binding)]
15185                    match tag {
15186                        __FieldTag::__server_verification => {
15187                            if !fields.insert(__FieldTag::__server_verification) {
15188                                return std::result::Result::Err(A::Error::duplicate_field(
15189                                    "multiple values for server_verification",
15190                                ));
15191                            }
15192                            if result.encryption_setting.is_some() {
15193                                return std::result::Result::Err(A::Error::duplicate_field(
15194                                    "multiple values for `encryption_setting`, a oneof with full ID .google.cloud.datastream.v1.PostgresqlSslConfig.server_verification, latest field was serverVerification",
15195                                ));
15196                            }
15197                            result.encryption_setting = std::option::Option::Some(
15198                                crate::model::postgresql_ssl_config::EncryptionSetting::ServerVerification(
15199                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>>>()?.unwrap_or_default()
15200                                ),
15201                            );
15202                        }
15203                        __FieldTag::__server_and_client_verification => {
15204                            if !fields.insert(__FieldTag::__server_and_client_verification) {
15205                                return std::result::Result::Err(A::Error::duplicate_field(
15206                                    "multiple values for server_and_client_verification",
15207                                ));
15208                            }
15209                            if result.encryption_setting.is_some() {
15210                                return std::result::Result::Err(A::Error::duplicate_field(
15211                                    "multiple values for `encryption_setting`, a oneof with full ID .google.cloud.datastream.v1.PostgresqlSslConfig.server_and_client_verification, latest field was serverAndClientVerification",
15212                                ));
15213                            }
15214                            result.encryption_setting = std::option::Option::Some(
15215                                crate::model::postgresql_ssl_config::EncryptionSetting::ServerAndClientVerification(
15216                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>>>()?.unwrap_or_default()
15217                                ),
15218                            );
15219                        }
15220                        __FieldTag::Unknown(key) => {
15221                            let value = map.next_value::<serde_json::Value>()?;
15222                            result._unknown_fields.insert(key, value);
15223                        }
15224                    }
15225                }
15226                std::result::Result::Ok(result)
15227            }
15228        }
15229        deserializer.deserialize_any(Visitor)
15230    }
15231}
15232
15233#[doc(hidden)]
15234impl serde::ser::Serialize for PostgresqlSslConfig {
15235    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15236    where
15237        S: serde::ser::Serializer,
15238    {
15239        use serde::ser::SerializeMap;
15240        #[allow(unused_imports)]
15241        use std::option::Option::Some;
15242        let mut state = serializer.serialize_map(std::option::Option::None)?;
15243        if let Some(value) = self.server_verification() {
15244            state.serialize_entry("serverVerification", value)?;
15245        }
15246        if let Some(value) = self.server_and_client_verification() {
15247            state.serialize_entry("serverAndClientVerification", value)?;
15248        }
15249        if !self._unknown_fields.is_empty() {
15250            for (key, value) in self._unknown_fields.iter() {
15251                state.serialize_entry(key, &value)?;
15252            }
15253        }
15254        state.end()
15255    }
15256}
15257
15258impl std::fmt::Debug for PostgresqlSslConfig {
15259    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15260        let mut debug_struct = f.debug_struct("PostgresqlSslConfig");
15261        debug_struct.field("encryption_setting", &self.encryption_setting);
15262        if !self._unknown_fields.is_empty() {
15263            debug_struct.field("_unknown_fields", &self._unknown_fields);
15264        }
15265        debug_struct.finish()
15266    }
15267}
15268
15269/// Defines additional types related to [PostgresqlSslConfig].
15270pub mod postgresql_ssl_config {
15271    #[allow(unused_imports)]
15272    use super::*;
15273
15274    /// Message represents the option where Datastream will enforce the encryption
15275    /// and authenticate the server identity. ca_certificate must be set if user
15276    /// selects this option.
15277    #[derive(Clone, Default, PartialEq)]
15278    #[non_exhaustive]
15279    pub struct ServerVerification {
15280        /// Required. Input only. PEM-encoded server root CA certificate.
15281        pub ca_certificate: std::string::String,
15282
15283        /// Optional. The hostname mentioned in the Subject or SAN extension of the
15284        /// server certificate. If this field is not provided, the hostname in the
15285        /// server certificate is not validated.
15286        pub server_certificate_hostname: std::string::String,
15287
15288        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15289    }
15290
15291    impl ServerVerification {
15292        pub fn new() -> Self {
15293            std::default::Default::default()
15294        }
15295
15296        /// Sets the value of [ca_certificate][crate::model::postgresql_ssl_config::ServerVerification::ca_certificate].
15297        pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(
15298            mut self,
15299            v: T,
15300        ) -> Self {
15301            self.ca_certificate = v.into();
15302            self
15303        }
15304
15305        /// Sets the value of [server_certificate_hostname][crate::model::postgresql_ssl_config::ServerVerification::server_certificate_hostname].
15306        pub fn set_server_certificate_hostname<T: std::convert::Into<std::string::String>>(
15307            mut self,
15308            v: T,
15309        ) -> Self {
15310            self.server_certificate_hostname = v.into();
15311            self
15312        }
15313    }
15314
15315    impl wkt::message::Message for ServerVerification {
15316        fn typename() -> &'static str {
15317            "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig.ServerVerification"
15318        }
15319    }
15320
15321    #[doc(hidden)]
15322    impl<'de> serde::de::Deserialize<'de> for ServerVerification {
15323        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15324        where
15325            D: serde::Deserializer<'de>,
15326        {
15327            #[allow(non_camel_case_types)]
15328            #[doc(hidden)]
15329            #[derive(PartialEq, Eq, Hash)]
15330            enum __FieldTag {
15331                __ca_certificate,
15332                __server_certificate_hostname,
15333                Unknown(std::string::String),
15334            }
15335            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
15336                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15337                where
15338                    D: serde::Deserializer<'de>,
15339                {
15340                    struct Visitor;
15341                    impl<'de> serde::de::Visitor<'de> for Visitor {
15342                        type Value = __FieldTag;
15343                        fn expecting(
15344                            &self,
15345                            formatter: &mut std::fmt::Formatter,
15346                        ) -> std::fmt::Result {
15347                            formatter.write_str("a field name for ServerVerification")
15348                        }
15349                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
15350                        where
15351                            E: serde::de::Error,
15352                        {
15353                            use std::result::Result::Ok;
15354                            use std::string::ToString;
15355                            match value {
15356                                "caCertificate" => Ok(__FieldTag::__ca_certificate),
15357                                "ca_certificate" => Ok(__FieldTag::__ca_certificate),
15358                                "serverCertificateHostname" => {
15359                                    Ok(__FieldTag::__server_certificate_hostname)
15360                                }
15361                                "server_certificate_hostname" => {
15362                                    Ok(__FieldTag::__server_certificate_hostname)
15363                                }
15364                                _ => Ok(__FieldTag::Unknown(value.to_string())),
15365                            }
15366                        }
15367                    }
15368                    deserializer.deserialize_identifier(Visitor)
15369                }
15370            }
15371            struct Visitor;
15372            impl<'de> serde::de::Visitor<'de> for Visitor {
15373                type Value = ServerVerification;
15374                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15375                    formatter.write_str("struct ServerVerification")
15376                }
15377                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
15378                where
15379                    A: serde::de::MapAccess<'de>,
15380                {
15381                    #[allow(unused_imports)]
15382                    use serde::de::Error;
15383                    use std::option::Option::Some;
15384                    let mut fields = std::collections::HashSet::new();
15385                    let mut result = Self::Value::new();
15386                    while let Some(tag) = map.next_key::<__FieldTag>()? {
15387                        #[allow(clippy::match_single_binding)]
15388                        match tag {
15389                            __FieldTag::__ca_certificate => {
15390                                if !fields.insert(__FieldTag::__ca_certificate) {
15391                                    return std::result::Result::Err(A::Error::duplicate_field(
15392                                        "multiple values for ca_certificate",
15393                                    ));
15394                                }
15395                                result.ca_certificate = map
15396                                    .next_value::<std::option::Option<std::string::String>>()?
15397                                    .unwrap_or_default();
15398                            }
15399                            __FieldTag::__server_certificate_hostname => {
15400                                if !fields.insert(__FieldTag::__server_certificate_hostname) {
15401                                    return std::result::Result::Err(A::Error::duplicate_field(
15402                                        "multiple values for server_certificate_hostname",
15403                                    ));
15404                                }
15405                                result.server_certificate_hostname = map
15406                                    .next_value::<std::option::Option<std::string::String>>()?
15407                                    .unwrap_or_default();
15408                            }
15409                            __FieldTag::Unknown(key) => {
15410                                let value = map.next_value::<serde_json::Value>()?;
15411                                result._unknown_fields.insert(key, value);
15412                            }
15413                        }
15414                    }
15415                    std::result::Result::Ok(result)
15416                }
15417            }
15418            deserializer.deserialize_any(Visitor)
15419        }
15420    }
15421
15422    #[doc(hidden)]
15423    impl serde::ser::Serialize for ServerVerification {
15424        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15425        where
15426            S: serde::ser::Serializer,
15427        {
15428            use serde::ser::SerializeMap;
15429            #[allow(unused_imports)]
15430            use std::option::Option::Some;
15431            let mut state = serializer.serialize_map(std::option::Option::None)?;
15432            if !self.ca_certificate.is_empty() {
15433                state.serialize_entry("caCertificate", &self.ca_certificate)?;
15434            }
15435            if !self.server_certificate_hostname.is_empty() {
15436                state.serialize_entry(
15437                    "serverCertificateHostname",
15438                    &self.server_certificate_hostname,
15439                )?;
15440            }
15441            if !self._unknown_fields.is_empty() {
15442                for (key, value) in self._unknown_fields.iter() {
15443                    state.serialize_entry(key, &value)?;
15444                }
15445            }
15446            state.end()
15447        }
15448    }
15449
15450    impl std::fmt::Debug for ServerVerification {
15451        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15452            let mut debug_struct = f.debug_struct("ServerVerification");
15453            debug_struct.field("ca_certificate", &self.ca_certificate);
15454            debug_struct.field(
15455                "server_certificate_hostname",
15456                &self.server_certificate_hostname,
15457            );
15458            if !self._unknown_fields.is_empty() {
15459                debug_struct.field("_unknown_fields", &self._unknown_fields);
15460            }
15461            debug_struct.finish()
15462        }
15463    }
15464
15465    /// Message represents the option where Datastream will enforce the encryption
15466    /// and authenticate the server identity as well as the client identity.
15467    /// ca_certificate, client_certificate and client_key must be set if user
15468    /// selects this option.
15469    #[derive(Clone, Default, PartialEq)]
15470    #[non_exhaustive]
15471    pub struct ServerAndClientVerification {
15472        /// Required. Input only. PEM-encoded certificate used by the source database
15473        /// to authenticate the client identity (i.e., the Datastream's identity).
15474        /// This certificate is signed by either a root certificate trusted by the
15475        /// server or one or more intermediate certificates (which is stored with the
15476        /// leaf certificate) to link the this certificate to the trusted root
15477        /// certificate.
15478        pub client_certificate: std::string::String,
15479
15480        /// Optional. Input only. PEM-encoded private key associated with the client
15481        /// certificate. This value will be used during the SSL/TLS handshake,
15482        /// allowing the PostgreSQL server to authenticate the client's identity,
15483        /// i.e. identity of the Datastream.
15484        pub client_key: std::string::String,
15485
15486        /// Required. Input only. PEM-encoded server root CA certificate.
15487        pub ca_certificate: std::string::String,
15488
15489        /// Optional. The hostname mentioned in the Subject or SAN extension of the
15490        /// server certificate. If this field is not provided, the hostname in the
15491        /// server certificate is not validated.
15492        pub server_certificate_hostname: std::string::String,
15493
15494        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15495    }
15496
15497    impl ServerAndClientVerification {
15498        pub fn new() -> Self {
15499            std::default::Default::default()
15500        }
15501
15502        /// Sets the value of [client_certificate][crate::model::postgresql_ssl_config::ServerAndClientVerification::client_certificate].
15503        pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
15504            mut self,
15505            v: T,
15506        ) -> Self {
15507            self.client_certificate = v.into();
15508            self
15509        }
15510
15511        /// Sets the value of [client_key][crate::model::postgresql_ssl_config::ServerAndClientVerification::client_key].
15512        pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15513            self.client_key = v.into();
15514            self
15515        }
15516
15517        /// Sets the value of [ca_certificate][crate::model::postgresql_ssl_config::ServerAndClientVerification::ca_certificate].
15518        pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(
15519            mut self,
15520            v: T,
15521        ) -> Self {
15522            self.ca_certificate = v.into();
15523            self
15524        }
15525
15526        /// Sets the value of [server_certificate_hostname][crate::model::postgresql_ssl_config::ServerAndClientVerification::server_certificate_hostname].
15527        pub fn set_server_certificate_hostname<T: std::convert::Into<std::string::String>>(
15528            mut self,
15529            v: T,
15530        ) -> Self {
15531            self.server_certificate_hostname = v.into();
15532            self
15533        }
15534    }
15535
15536    impl wkt::message::Message for ServerAndClientVerification {
15537        fn typename() -> &'static str {
15538            "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig.ServerAndClientVerification"
15539        }
15540    }
15541
15542    #[doc(hidden)]
15543    impl<'de> serde::de::Deserialize<'de> for ServerAndClientVerification {
15544        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15545        where
15546            D: serde::Deserializer<'de>,
15547        {
15548            #[allow(non_camel_case_types)]
15549            #[doc(hidden)]
15550            #[derive(PartialEq, Eq, Hash)]
15551            enum __FieldTag {
15552                __client_certificate,
15553                __client_key,
15554                __ca_certificate,
15555                __server_certificate_hostname,
15556                Unknown(std::string::String),
15557            }
15558            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
15559                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15560                where
15561                    D: serde::Deserializer<'de>,
15562                {
15563                    struct Visitor;
15564                    impl<'de> serde::de::Visitor<'de> for Visitor {
15565                        type Value = __FieldTag;
15566                        fn expecting(
15567                            &self,
15568                            formatter: &mut std::fmt::Formatter,
15569                        ) -> std::fmt::Result {
15570                            formatter.write_str("a field name for ServerAndClientVerification")
15571                        }
15572                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
15573                        where
15574                            E: serde::de::Error,
15575                        {
15576                            use std::result::Result::Ok;
15577                            use std::string::ToString;
15578                            match value {
15579                                "clientCertificate" => Ok(__FieldTag::__client_certificate),
15580                                "client_certificate" => Ok(__FieldTag::__client_certificate),
15581                                "clientKey" => Ok(__FieldTag::__client_key),
15582                                "client_key" => Ok(__FieldTag::__client_key),
15583                                "caCertificate" => Ok(__FieldTag::__ca_certificate),
15584                                "ca_certificate" => Ok(__FieldTag::__ca_certificate),
15585                                "serverCertificateHostname" => {
15586                                    Ok(__FieldTag::__server_certificate_hostname)
15587                                }
15588                                "server_certificate_hostname" => {
15589                                    Ok(__FieldTag::__server_certificate_hostname)
15590                                }
15591                                _ => Ok(__FieldTag::Unknown(value.to_string())),
15592                            }
15593                        }
15594                    }
15595                    deserializer.deserialize_identifier(Visitor)
15596                }
15597            }
15598            struct Visitor;
15599            impl<'de> serde::de::Visitor<'de> for Visitor {
15600                type Value = ServerAndClientVerification;
15601                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15602                    formatter.write_str("struct ServerAndClientVerification")
15603                }
15604                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
15605                where
15606                    A: serde::de::MapAccess<'de>,
15607                {
15608                    #[allow(unused_imports)]
15609                    use serde::de::Error;
15610                    use std::option::Option::Some;
15611                    let mut fields = std::collections::HashSet::new();
15612                    let mut result = Self::Value::new();
15613                    while let Some(tag) = map.next_key::<__FieldTag>()? {
15614                        #[allow(clippy::match_single_binding)]
15615                        match tag {
15616                            __FieldTag::__client_certificate => {
15617                                if !fields.insert(__FieldTag::__client_certificate) {
15618                                    return std::result::Result::Err(A::Error::duplicate_field(
15619                                        "multiple values for client_certificate",
15620                                    ));
15621                                }
15622                                result.client_certificate = map
15623                                    .next_value::<std::option::Option<std::string::String>>()?
15624                                    .unwrap_or_default();
15625                            }
15626                            __FieldTag::__client_key => {
15627                                if !fields.insert(__FieldTag::__client_key) {
15628                                    return std::result::Result::Err(A::Error::duplicate_field(
15629                                        "multiple values for client_key",
15630                                    ));
15631                                }
15632                                result.client_key = map
15633                                    .next_value::<std::option::Option<std::string::String>>()?
15634                                    .unwrap_or_default();
15635                            }
15636                            __FieldTag::__ca_certificate => {
15637                                if !fields.insert(__FieldTag::__ca_certificate) {
15638                                    return std::result::Result::Err(A::Error::duplicate_field(
15639                                        "multiple values for ca_certificate",
15640                                    ));
15641                                }
15642                                result.ca_certificate = map
15643                                    .next_value::<std::option::Option<std::string::String>>()?
15644                                    .unwrap_or_default();
15645                            }
15646                            __FieldTag::__server_certificate_hostname => {
15647                                if !fields.insert(__FieldTag::__server_certificate_hostname) {
15648                                    return std::result::Result::Err(A::Error::duplicate_field(
15649                                        "multiple values for server_certificate_hostname",
15650                                    ));
15651                                }
15652                                result.server_certificate_hostname = map
15653                                    .next_value::<std::option::Option<std::string::String>>()?
15654                                    .unwrap_or_default();
15655                            }
15656                            __FieldTag::Unknown(key) => {
15657                                let value = map.next_value::<serde_json::Value>()?;
15658                                result._unknown_fields.insert(key, value);
15659                            }
15660                        }
15661                    }
15662                    std::result::Result::Ok(result)
15663                }
15664            }
15665            deserializer.deserialize_any(Visitor)
15666        }
15667    }
15668
15669    #[doc(hidden)]
15670    impl serde::ser::Serialize for ServerAndClientVerification {
15671        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15672        where
15673            S: serde::ser::Serializer,
15674        {
15675            use serde::ser::SerializeMap;
15676            #[allow(unused_imports)]
15677            use std::option::Option::Some;
15678            let mut state = serializer.serialize_map(std::option::Option::None)?;
15679            if !self.client_certificate.is_empty() {
15680                state.serialize_entry("clientCertificate", &self.client_certificate)?;
15681            }
15682            if !self.client_key.is_empty() {
15683                state.serialize_entry("clientKey", &self.client_key)?;
15684            }
15685            if !self.ca_certificate.is_empty() {
15686                state.serialize_entry("caCertificate", &self.ca_certificate)?;
15687            }
15688            if !self.server_certificate_hostname.is_empty() {
15689                state.serialize_entry(
15690                    "serverCertificateHostname",
15691                    &self.server_certificate_hostname,
15692                )?;
15693            }
15694            if !self._unknown_fields.is_empty() {
15695                for (key, value) in self._unknown_fields.iter() {
15696                    state.serialize_entry(key, &value)?;
15697                }
15698            }
15699            state.end()
15700        }
15701    }
15702
15703    impl std::fmt::Debug for ServerAndClientVerification {
15704        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15705            let mut debug_struct = f.debug_struct("ServerAndClientVerification");
15706            debug_struct.field("client_certificate", &self.client_certificate);
15707            debug_struct.field("client_key", &self.client_key);
15708            debug_struct.field("ca_certificate", &self.ca_certificate);
15709            debug_struct.field(
15710                "server_certificate_hostname",
15711                &self.server_certificate_hostname,
15712            );
15713            if !self._unknown_fields.is_empty() {
15714                debug_struct.field("_unknown_fields", &self._unknown_fields);
15715            }
15716            debug_struct.finish()
15717        }
15718    }
15719
15720    /// The encryption settings available for PostgreSQL connection profiles.
15721    /// This captures various SSL mode supported by PostgreSQL, which includes
15722    /// TLS encryption with server verification, TLS encryption with both server
15723    /// and client verification and no TLS encryption.
15724    #[derive(Clone, Debug, PartialEq)]
15725    #[non_exhaustive]
15726    pub enum EncryptionSetting {
15727        ///  If this field is set, the communication will be encrypted with TLS
15728        /// encryption and the server identity will be authenticated.
15729        ServerVerification(
15730            std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
15731        ),
15732        /// If this field is set, the communication will be encrypted with TLS
15733        /// encryption and both the server identity and the client identity will be
15734        /// authenticated.
15735        ServerAndClientVerification(
15736            std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
15737        ),
15738    }
15739}
15740
15741/// A set of reusable connection configurations to be used as a source or
15742/// destination for a stream.
15743#[derive(Clone, Default, PartialEq)]
15744#[non_exhaustive]
15745pub struct ConnectionProfile {
15746    /// Output only. Identifier. The resource's name.
15747    pub name: std::string::String,
15748
15749    /// Output only. The create time of the resource.
15750    pub create_time: std::option::Option<wkt::Timestamp>,
15751
15752    /// Output only. The update time of the resource.
15753    pub update_time: std::option::Option<wkt::Timestamp>,
15754
15755    /// Labels.
15756    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
15757
15758    /// Required. Display name.
15759    pub display_name: std::string::String,
15760
15761    /// Output only. Reserved for future use.
15762    pub satisfies_pzs: std::option::Option<bool>,
15763
15764    /// Output only. Reserved for future use.
15765    pub satisfies_pzi: std::option::Option<bool>,
15766
15767    /// Connection configuration for the ConnectionProfile.
15768    pub profile: std::option::Option<crate::model::connection_profile::Profile>,
15769
15770    /// Connectivity options used to establish a connection to the profile.
15771    pub connectivity: std::option::Option<crate::model::connection_profile::Connectivity>,
15772
15773    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15774}
15775
15776impl ConnectionProfile {
15777    pub fn new() -> Self {
15778        std::default::Default::default()
15779    }
15780
15781    /// Sets the value of [name][crate::model::ConnectionProfile::name].
15782    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15783        self.name = v.into();
15784        self
15785    }
15786
15787    /// Sets the value of [create_time][crate::model::ConnectionProfile::create_time].
15788    pub fn set_create_time<T>(mut self, v: T) -> Self
15789    where
15790        T: std::convert::Into<wkt::Timestamp>,
15791    {
15792        self.create_time = std::option::Option::Some(v.into());
15793        self
15794    }
15795
15796    /// Sets or clears the value of [create_time][crate::model::ConnectionProfile::create_time].
15797    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15798    where
15799        T: std::convert::Into<wkt::Timestamp>,
15800    {
15801        self.create_time = v.map(|x| x.into());
15802        self
15803    }
15804
15805    /// Sets the value of [update_time][crate::model::ConnectionProfile::update_time].
15806    pub fn set_update_time<T>(mut self, v: T) -> Self
15807    where
15808        T: std::convert::Into<wkt::Timestamp>,
15809    {
15810        self.update_time = std::option::Option::Some(v.into());
15811        self
15812    }
15813
15814    /// Sets or clears the value of [update_time][crate::model::ConnectionProfile::update_time].
15815    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
15816    where
15817        T: std::convert::Into<wkt::Timestamp>,
15818    {
15819        self.update_time = v.map(|x| x.into());
15820        self
15821    }
15822
15823    /// Sets the value of [labels][crate::model::ConnectionProfile::labels].
15824    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
15825    where
15826        T: std::iter::IntoIterator<Item = (K, V)>,
15827        K: std::convert::Into<std::string::String>,
15828        V: std::convert::Into<std::string::String>,
15829    {
15830        use std::iter::Iterator;
15831        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
15832        self
15833    }
15834
15835    /// Sets the value of [display_name][crate::model::ConnectionProfile::display_name].
15836    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15837        self.display_name = v.into();
15838        self
15839    }
15840
15841    /// Sets the value of [satisfies_pzs][crate::model::ConnectionProfile::satisfies_pzs].
15842    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
15843    where
15844        T: std::convert::Into<bool>,
15845    {
15846        self.satisfies_pzs = std::option::Option::Some(v.into());
15847        self
15848    }
15849
15850    /// Sets or clears the value of [satisfies_pzs][crate::model::ConnectionProfile::satisfies_pzs].
15851    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
15852    where
15853        T: std::convert::Into<bool>,
15854    {
15855        self.satisfies_pzs = v.map(|x| x.into());
15856        self
15857    }
15858
15859    /// Sets the value of [satisfies_pzi][crate::model::ConnectionProfile::satisfies_pzi].
15860    pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
15861    where
15862        T: std::convert::Into<bool>,
15863    {
15864        self.satisfies_pzi = std::option::Option::Some(v.into());
15865        self
15866    }
15867
15868    /// Sets or clears the value of [satisfies_pzi][crate::model::ConnectionProfile::satisfies_pzi].
15869    pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
15870    where
15871        T: std::convert::Into<bool>,
15872    {
15873        self.satisfies_pzi = v.map(|x| x.into());
15874        self
15875    }
15876
15877    /// Sets the value of [profile][crate::model::ConnectionProfile::profile].
15878    ///
15879    /// Note that all the setters affecting `profile` are mutually
15880    /// exclusive.
15881    pub fn set_profile<
15882        T: std::convert::Into<std::option::Option<crate::model::connection_profile::Profile>>,
15883    >(
15884        mut self,
15885        v: T,
15886    ) -> Self {
15887        self.profile = v.into();
15888        self
15889    }
15890
15891    /// The value of [profile][crate::model::ConnectionProfile::profile]
15892    /// if it holds a `OracleProfile`, `None` if the field is not set or
15893    /// holds a different branch.
15894    pub fn oracle_profile(
15895        &self,
15896    ) -> std::option::Option<&std::boxed::Box<crate::model::OracleProfile>> {
15897        #[allow(unreachable_patterns)]
15898        self.profile.as_ref().and_then(|v| match v {
15899            crate::model::connection_profile::Profile::OracleProfile(v) => {
15900                std::option::Option::Some(v)
15901            }
15902            _ => std::option::Option::None,
15903        })
15904    }
15905
15906    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
15907    /// to hold a `OracleProfile`.
15908    ///
15909    /// Note that all the setters affecting `profile` are
15910    /// mutually exclusive.
15911    pub fn set_oracle_profile<
15912        T: std::convert::Into<std::boxed::Box<crate::model::OracleProfile>>,
15913    >(
15914        mut self,
15915        v: T,
15916    ) -> Self {
15917        self.profile = std::option::Option::Some(
15918            crate::model::connection_profile::Profile::OracleProfile(v.into()),
15919        );
15920        self
15921    }
15922
15923    /// The value of [profile][crate::model::ConnectionProfile::profile]
15924    /// if it holds a `GcsProfile`, `None` if the field is not set or
15925    /// holds a different branch.
15926    pub fn gcs_profile(&self) -> std::option::Option<&std::boxed::Box<crate::model::GcsProfile>> {
15927        #[allow(unreachable_patterns)]
15928        self.profile.as_ref().and_then(|v| match v {
15929            crate::model::connection_profile::Profile::GcsProfile(v) => {
15930                std::option::Option::Some(v)
15931            }
15932            _ => std::option::Option::None,
15933        })
15934    }
15935
15936    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
15937    /// to hold a `GcsProfile`.
15938    ///
15939    /// Note that all the setters affecting `profile` are
15940    /// mutually exclusive.
15941    pub fn set_gcs_profile<T: std::convert::Into<std::boxed::Box<crate::model::GcsProfile>>>(
15942        mut self,
15943        v: T,
15944    ) -> Self {
15945        self.profile = std::option::Option::Some(
15946            crate::model::connection_profile::Profile::GcsProfile(v.into()),
15947        );
15948        self
15949    }
15950
15951    /// The value of [profile][crate::model::ConnectionProfile::profile]
15952    /// if it holds a `MysqlProfile`, `None` if the field is not set or
15953    /// holds a different branch.
15954    pub fn mysql_profile(
15955        &self,
15956    ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlProfile>> {
15957        #[allow(unreachable_patterns)]
15958        self.profile.as_ref().and_then(|v| match v {
15959            crate::model::connection_profile::Profile::MysqlProfile(v) => {
15960                std::option::Option::Some(v)
15961            }
15962            _ => std::option::Option::None,
15963        })
15964    }
15965
15966    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
15967    /// to hold a `MysqlProfile`.
15968    ///
15969    /// Note that all the setters affecting `profile` are
15970    /// mutually exclusive.
15971    pub fn set_mysql_profile<T: std::convert::Into<std::boxed::Box<crate::model::MysqlProfile>>>(
15972        mut self,
15973        v: T,
15974    ) -> Self {
15975        self.profile = std::option::Option::Some(
15976            crate::model::connection_profile::Profile::MysqlProfile(v.into()),
15977        );
15978        self
15979    }
15980
15981    /// The value of [profile][crate::model::ConnectionProfile::profile]
15982    /// if it holds a `BigqueryProfile`, `None` if the field is not set or
15983    /// holds a different branch.
15984    pub fn bigquery_profile(
15985        &self,
15986    ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryProfile>> {
15987        #[allow(unreachable_patterns)]
15988        self.profile.as_ref().and_then(|v| match v {
15989            crate::model::connection_profile::Profile::BigqueryProfile(v) => {
15990                std::option::Option::Some(v)
15991            }
15992            _ => std::option::Option::None,
15993        })
15994    }
15995
15996    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
15997    /// to hold a `BigqueryProfile`.
15998    ///
15999    /// Note that all the setters affecting `profile` are
16000    /// mutually exclusive.
16001    pub fn set_bigquery_profile<
16002        T: std::convert::Into<std::boxed::Box<crate::model::BigQueryProfile>>,
16003    >(
16004        mut self,
16005        v: T,
16006    ) -> Self {
16007        self.profile = std::option::Option::Some(
16008            crate::model::connection_profile::Profile::BigqueryProfile(v.into()),
16009        );
16010        self
16011    }
16012
16013    /// The value of [profile][crate::model::ConnectionProfile::profile]
16014    /// if it holds a `PostgresqlProfile`, `None` if the field is not set or
16015    /// holds a different branch.
16016    pub fn postgresql_profile(
16017        &self,
16018    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlProfile>> {
16019        #[allow(unreachable_patterns)]
16020        self.profile.as_ref().and_then(|v| match v {
16021            crate::model::connection_profile::Profile::PostgresqlProfile(v) => {
16022                std::option::Option::Some(v)
16023            }
16024            _ => std::option::Option::None,
16025        })
16026    }
16027
16028    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
16029    /// to hold a `PostgresqlProfile`.
16030    ///
16031    /// Note that all the setters affecting `profile` are
16032    /// mutually exclusive.
16033    pub fn set_postgresql_profile<
16034        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlProfile>>,
16035    >(
16036        mut self,
16037        v: T,
16038    ) -> Self {
16039        self.profile = std::option::Option::Some(
16040            crate::model::connection_profile::Profile::PostgresqlProfile(v.into()),
16041        );
16042        self
16043    }
16044
16045    /// The value of [profile][crate::model::ConnectionProfile::profile]
16046    /// if it holds a `SqlServerProfile`, `None` if the field is not set or
16047    /// holds a different branch.
16048    pub fn sql_server_profile(
16049        &self,
16050    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerProfile>> {
16051        #[allow(unreachable_patterns)]
16052        self.profile.as_ref().and_then(|v| match v {
16053            crate::model::connection_profile::Profile::SqlServerProfile(v) => {
16054                std::option::Option::Some(v)
16055            }
16056            _ => std::option::Option::None,
16057        })
16058    }
16059
16060    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
16061    /// to hold a `SqlServerProfile`.
16062    ///
16063    /// Note that all the setters affecting `profile` are
16064    /// mutually exclusive.
16065    pub fn set_sql_server_profile<
16066        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerProfile>>,
16067    >(
16068        mut self,
16069        v: T,
16070    ) -> Self {
16071        self.profile = std::option::Option::Some(
16072            crate::model::connection_profile::Profile::SqlServerProfile(v.into()),
16073        );
16074        self
16075    }
16076
16077    /// The value of [profile][crate::model::ConnectionProfile::profile]
16078    /// if it holds a `SalesforceProfile`, `None` if the field is not set or
16079    /// holds a different branch.
16080    pub fn salesforce_profile(
16081        &self,
16082    ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceProfile>> {
16083        #[allow(unreachable_patterns)]
16084        self.profile.as_ref().and_then(|v| match v {
16085            crate::model::connection_profile::Profile::SalesforceProfile(v) => {
16086                std::option::Option::Some(v)
16087            }
16088            _ => std::option::Option::None,
16089        })
16090    }
16091
16092    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
16093    /// to hold a `SalesforceProfile`.
16094    ///
16095    /// Note that all the setters affecting `profile` are
16096    /// mutually exclusive.
16097    pub fn set_salesforce_profile<
16098        T: std::convert::Into<std::boxed::Box<crate::model::SalesforceProfile>>,
16099    >(
16100        mut self,
16101        v: T,
16102    ) -> Self {
16103        self.profile = std::option::Option::Some(
16104            crate::model::connection_profile::Profile::SalesforceProfile(v.into()),
16105        );
16106        self
16107    }
16108
16109    /// The value of [profile][crate::model::ConnectionProfile::profile]
16110    /// if it holds a `MongodbProfile`, `None` if the field is not set or
16111    /// holds a different branch.
16112    pub fn mongodb_profile(
16113        &self,
16114    ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbProfile>> {
16115        #[allow(unreachable_patterns)]
16116        self.profile.as_ref().and_then(|v| match v {
16117            crate::model::connection_profile::Profile::MongodbProfile(v) => {
16118                std::option::Option::Some(v)
16119            }
16120            _ => std::option::Option::None,
16121        })
16122    }
16123
16124    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
16125    /// to hold a `MongodbProfile`.
16126    ///
16127    /// Note that all the setters affecting `profile` are
16128    /// mutually exclusive.
16129    pub fn set_mongodb_profile<
16130        T: std::convert::Into<std::boxed::Box<crate::model::MongodbProfile>>,
16131    >(
16132        mut self,
16133        v: T,
16134    ) -> Self {
16135        self.profile = std::option::Option::Some(
16136            crate::model::connection_profile::Profile::MongodbProfile(v.into()),
16137        );
16138        self
16139    }
16140
16141    /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity].
16142    ///
16143    /// Note that all the setters affecting `connectivity` are mutually
16144    /// exclusive.
16145    pub fn set_connectivity<
16146        T: std::convert::Into<std::option::Option<crate::model::connection_profile::Connectivity>>,
16147    >(
16148        mut self,
16149        v: T,
16150    ) -> Self {
16151        self.connectivity = v.into();
16152        self
16153    }
16154
16155    /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
16156    /// if it holds a `StaticServiceIpConnectivity`, `None` if the field is not set or
16157    /// holds a different branch.
16158    pub fn static_service_ip_connectivity(
16159        &self,
16160    ) -> std::option::Option<&std::boxed::Box<crate::model::StaticServiceIpConnectivity>> {
16161        #[allow(unreachable_patterns)]
16162        self.connectivity.as_ref().and_then(|v| match v {
16163            crate::model::connection_profile::Connectivity::StaticServiceIpConnectivity(v) => {
16164                std::option::Option::Some(v)
16165            }
16166            _ => std::option::Option::None,
16167        })
16168    }
16169
16170    /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
16171    /// to hold a `StaticServiceIpConnectivity`.
16172    ///
16173    /// Note that all the setters affecting `connectivity` are
16174    /// mutually exclusive.
16175    pub fn set_static_service_ip_connectivity<
16176        T: std::convert::Into<std::boxed::Box<crate::model::StaticServiceIpConnectivity>>,
16177    >(
16178        mut self,
16179        v: T,
16180    ) -> Self {
16181        self.connectivity = std::option::Option::Some(
16182            crate::model::connection_profile::Connectivity::StaticServiceIpConnectivity(v.into()),
16183        );
16184        self
16185    }
16186
16187    /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
16188    /// if it holds a `ForwardSshConnectivity`, `None` if the field is not set or
16189    /// holds a different branch.
16190    pub fn forward_ssh_connectivity(
16191        &self,
16192    ) -> std::option::Option<&std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>> {
16193        #[allow(unreachable_patterns)]
16194        self.connectivity.as_ref().and_then(|v| match v {
16195            crate::model::connection_profile::Connectivity::ForwardSshConnectivity(v) => {
16196                std::option::Option::Some(v)
16197            }
16198            _ => std::option::Option::None,
16199        })
16200    }
16201
16202    /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
16203    /// to hold a `ForwardSshConnectivity`.
16204    ///
16205    /// Note that all the setters affecting `connectivity` are
16206    /// mutually exclusive.
16207    pub fn set_forward_ssh_connectivity<
16208        T: std::convert::Into<std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>>,
16209    >(
16210        mut self,
16211        v: T,
16212    ) -> Self {
16213        self.connectivity = std::option::Option::Some(
16214            crate::model::connection_profile::Connectivity::ForwardSshConnectivity(v.into()),
16215        );
16216        self
16217    }
16218
16219    /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
16220    /// if it holds a `PrivateConnectivity`, `None` if the field is not set or
16221    /// holds a different branch.
16222    pub fn private_connectivity(
16223        &self,
16224    ) -> std::option::Option<&std::boxed::Box<crate::model::PrivateConnectivity>> {
16225        #[allow(unreachable_patterns)]
16226        self.connectivity.as_ref().and_then(|v| match v {
16227            crate::model::connection_profile::Connectivity::PrivateConnectivity(v) => {
16228                std::option::Option::Some(v)
16229            }
16230            _ => std::option::Option::None,
16231        })
16232    }
16233
16234    /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
16235    /// to hold a `PrivateConnectivity`.
16236    ///
16237    /// Note that all the setters affecting `connectivity` are
16238    /// mutually exclusive.
16239    pub fn set_private_connectivity<
16240        T: std::convert::Into<std::boxed::Box<crate::model::PrivateConnectivity>>,
16241    >(
16242        mut self,
16243        v: T,
16244    ) -> Self {
16245        self.connectivity = std::option::Option::Some(
16246            crate::model::connection_profile::Connectivity::PrivateConnectivity(v.into()),
16247        );
16248        self
16249    }
16250}
16251
16252impl wkt::message::Message for ConnectionProfile {
16253    fn typename() -> &'static str {
16254        "type.googleapis.com/google.cloud.datastream.v1.ConnectionProfile"
16255    }
16256}
16257
16258#[doc(hidden)]
16259impl<'de> serde::de::Deserialize<'de> for ConnectionProfile {
16260    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16261    where
16262        D: serde::Deserializer<'de>,
16263    {
16264        #[allow(non_camel_case_types)]
16265        #[doc(hidden)]
16266        #[derive(PartialEq, Eq, Hash)]
16267        enum __FieldTag {
16268            __name,
16269            __create_time,
16270            __update_time,
16271            __labels,
16272            __display_name,
16273            __satisfies_pzs,
16274            __satisfies_pzi,
16275            __oracle_profile,
16276            __gcs_profile,
16277            __mysql_profile,
16278            __bigquery_profile,
16279            __postgresql_profile,
16280            __sql_server_profile,
16281            __salesforce_profile,
16282            __mongodb_profile,
16283            __static_service_ip_connectivity,
16284            __forward_ssh_connectivity,
16285            __private_connectivity,
16286            Unknown(std::string::String),
16287        }
16288        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16289            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16290            where
16291                D: serde::Deserializer<'de>,
16292            {
16293                struct Visitor;
16294                impl<'de> serde::de::Visitor<'de> for Visitor {
16295                    type Value = __FieldTag;
16296                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16297                        formatter.write_str("a field name for ConnectionProfile")
16298                    }
16299                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16300                    where
16301                        E: serde::de::Error,
16302                    {
16303                        use std::result::Result::Ok;
16304                        use std::string::ToString;
16305                        match value {
16306                            "name" => Ok(__FieldTag::__name),
16307                            "createTime" => Ok(__FieldTag::__create_time),
16308                            "create_time" => Ok(__FieldTag::__create_time),
16309                            "updateTime" => Ok(__FieldTag::__update_time),
16310                            "update_time" => Ok(__FieldTag::__update_time),
16311                            "labels" => Ok(__FieldTag::__labels),
16312                            "displayName" => Ok(__FieldTag::__display_name),
16313                            "display_name" => Ok(__FieldTag::__display_name),
16314                            "satisfiesPzs" => Ok(__FieldTag::__satisfies_pzs),
16315                            "satisfies_pzs" => Ok(__FieldTag::__satisfies_pzs),
16316                            "satisfiesPzi" => Ok(__FieldTag::__satisfies_pzi),
16317                            "satisfies_pzi" => Ok(__FieldTag::__satisfies_pzi),
16318                            "oracleProfile" => Ok(__FieldTag::__oracle_profile),
16319                            "oracle_profile" => Ok(__FieldTag::__oracle_profile),
16320                            "gcsProfile" => Ok(__FieldTag::__gcs_profile),
16321                            "gcs_profile" => Ok(__FieldTag::__gcs_profile),
16322                            "mysqlProfile" => Ok(__FieldTag::__mysql_profile),
16323                            "mysql_profile" => Ok(__FieldTag::__mysql_profile),
16324                            "bigqueryProfile" => Ok(__FieldTag::__bigquery_profile),
16325                            "bigquery_profile" => Ok(__FieldTag::__bigquery_profile),
16326                            "postgresqlProfile" => Ok(__FieldTag::__postgresql_profile),
16327                            "postgresql_profile" => Ok(__FieldTag::__postgresql_profile),
16328                            "sqlServerProfile" => Ok(__FieldTag::__sql_server_profile),
16329                            "sql_server_profile" => Ok(__FieldTag::__sql_server_profile),
16330                            "salesforceProfile" => Ok(__FieldTag::__salesforce_profile),
16331                            "salesforce_profile" => Ok(__FieldTag::__salesforce_profile),
16332                            "mongodbProfile" => Ok(__FieldTag::__mongodb_profile),
16333                            "mongodb_profile" => Ok(__FieldTag::__mongodb_profile),
16334                            "staticServiceIpConnectivity" => {
16335                                Ok(__FieldTag::__static_service_ip_connectivity)
16336                            }
16337                            "static_service_ip_connectivity" => {
16338                                Ok(__FieldTag::__static_service_ip_connectivity)
16339                            }
16340                            "forwardSshConnectivity" => Ok(__FieldTag::__forward_ssh_connectivity),
16341                            "forward_ssh_connectivity" => {
16342                                Ok(__FieldTag::__forward_ssh_connectivity)
16343                            }
16344                            "privateConnectivity" => Ok(__FieldTag::__private_connectivity),
16345                            "private_connectivity" => Ok(__FieldTag::__private_connectivity),
16346                            _ => Ok(__FieldTag::Unknown(value.to_string())),
16347                        }
16348                    }
16349                }
16350                deserializer.deserialize_identifier(Visitor)
16351            }
16352        }
16353        struct Visitor;
16354        impl<'de> serde::de::Visitor<'de> for Visitor {
16355            type Value = ConnectionProfile;
16356            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16357                formatter.write_str("struct ConnectionProfile")
16358            }
16359            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16360            where
16361                A: serde::de::MapAccess<'de>,
16362            {
16363                #[allow(unused_imports)]
16364                use serde::de::Error;
16365                use std::option::Option::Some;
16366                let mut fields = std::collections::HashSet::new();
16367                let mut result = Self::Value::new();
16368                while let Some(tag) = map.next_key::<__FieldTag>()? {
16369                    #[allow(clippy::match_single_binding)]
16370                    match tag {
16371                        __FieldTag::__name => {
16372                            if !fields.insert(__FieldTag::__name) {
16373                                return std::result::Result::Err(A::Error::duplicate_field(
16374                                    "multiple values for name",
16375                                ));
16376                            }
16377                            result.name = map
16378                                .next_value::<std::option::Option<std::string::String>>()?
16379                                .unwrap_or_default();
16380                        }
16381                        __FieldTag::__create_time => {
16382                            if !fields.insert(__FieldTag::__create_time) {
16383                                return std::result::Result::Err(A::Error::duplicate_field(
16384                                    "multiple values for create_time",
16385                                ));
16386                            }
16387                            result.create_time =
16388                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
16389                        }
16390                        __FieldTag::__update_time => {
16391                            if !fields.insert(__FieldTag::__update_time) {
16392                                return std::result::Result::Err(A::Error::duplicate_field(
16393                                    "multiple values for update_time",
16394                                ));
16395                            }
16396                            result.update_time =
16397                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
16398                        }
16399                        __FieldTag::__labels => {
16400                            if !fields.insert(__FieldTag::__labels) {
16401                                return std::result::Result::Err(A::Error::duplicate_field(
16402                                    "multiple values for labels",
16403                                ));
16404                            }
16405                            result.labels = map
16406                                .next_value::<std::option::Option<
16407                                    std::collections::HashMap<
16408                                        std::string::String,
16409                                        std::string::String,
16410                                    >,
16411                                >>()?
16412                                .unwrap_or_default();
16413                        }
16414                        __FieldTag::__display_name => {
16415                            if !fields.insert(__FieldTag::__display_name) {
16416                                return std::result::Result::Err(A::Error::duplicate_field(
16417                                    "multiple values for display_name",
16418                                ));
16419                            }
16420                            result.display_name = map
16421                                .next_value::<std::option::Option<std::string::String>>()?
16422                                .unwrap_or_default();
16423                        }
16424                        __FieldTag::__satisfies_pzs => {
16425                            if !fields.insert(__FieldTag::__satisfies_pzs) {
16426                                return std::result::Result::Err(A::Error::duplicate_field(
16427                                    "multiple values for satisfies_pzs",
16428                                ));
16429                            }
16430                            result.satisfies_pzs = map.next_value::<std::option::Option<bool>>()?;
16431                        }
16432                        __FieldTag::__satisfies_pzi => {
16433                            if !fields.insert(__FieldTag::__satisfies_pzi) {
16434                                return std::result::Result::Err(A::Error::duplicate_field(
16435                                    "multiple values for satisfies_pzi",
16436                                ));
16437                            }
16438                            result.satisfies_pzi = map.next_value::<std::option::Option<bool>>()?;
16439                        }
16440                        __FieldTag::__oracle_profile => {
16441                            if !fields.insert(__FieldTag::__oracle_profile) {
16442                                return std::result::Result::Err(A::Error::duplicate_field(
16443                                    "multiple values for oracle_profile",
16444                                ));
16445                            }
16446                            if result.profile.is_some() {
16447                                return std::result::Result::Err(A::Error::duplicate_field(
16448                                    "multiple values for `profile`, a oneof with full ID .google.cloud.datastream.v1.ConnectionProfile.oracle_profile, latest field was oracleProfile",
16449                                ));
16450                            }
16451                            result.profile = std::option::Option::Some(
16452                                crate::model::connection_profile::Profile::OracleProfile(
16453                                    map.next_value::<std::option::Option<
16454                                        std::boxed::Box<crate::model::OracleProfile>,
16455                                    >>()?
16456                                    .unwrap_or_default(),
16457                                ),
16458                            );
16459                        }
16460                        __FieldTag::__gcs_profile => {
16461                            if !fields.insert(__FieldTag::__gcs_profile) {
16462                                return std::result::Result::Err(A::Error::duplicate_field(
16463                                    "multiple values for gcs_profile",
16464                                ));
16465                            }
16466                            if result.profile.is_some() {
16467                                return std::result::Result::Err(A::Error::duplicate_field(
16468                                    "multiple values for `profile`, a oneof with full ID .google.cloud.datastream.v1.ConnectionProfile.gcs_profile, latest field was gcsProfile",
16469                                ));
16470                            }
16471                            result.profile = std::option::Option::Some(
16472                                crate::model::connection_profile::Profile::GcsProfile(
16473                                    map.next_value::<std::option::Option<
16474                                        std::boxed::Box<crate::model::GcsProfile>,
16475                                    >>()?
16476                                    .unwrap_or_default(),
16477                                ),
16478                            );
16479                        }
16480                        __FieldTag::__mysql_profile => {
16481                            if !fields.insert(__FieldTag::__mysql_profile) {
16482                                return std::result::Result::Err(A::Error::duplicate_field(
16483                                    "multiple values for mysql_profile",
16484                                ));
16485                            }
16486                            if result.profile.is_some() {
16487                                return std::result::Result::Err(A::Error::duplicate_field(
16488                                    "multiple values for `profile`, a oneof with full ID .google.cloud.datastream.v1.ConnectionProfile.mysql_profile, latest field was mysqlProfile",
16489                                ));
16490                            }
16491                            result.profile = std::option::Option::Some(
16492                                crate::model::connection_profile::Profile::MysqlProfile(
16493                                    map.next_value::<std::option::Option<
16494                                        std::boxed::Box<crate::model::MysqlProfile>,
16495                                    >>()?
16496                                    .unwrap_or_default(),
16497                                ),
16498                            );
16499                        }
16500                        __FieldTag::__bigquery_profile => {
16501                            if !fields.insert(__FieldTag::__bigquery_profile) {
16502                                return std::result::Result::Err(A::Error::duplicate_field(
16503                                    "multiple values for bigquery_profile",
16504                                ));
16505                            }
16506                            if result.profile.is_some() {
16507                                return std::result::Result::Err(A::Error::duplicate_field(
16508                                    "multiple values for `profile`, a oneof with full ID .google.cloud.datastream.v1.ConnectionProfile.bigquery_profile, latest field was bigqueryProfile",
16509                                ));
16510                            }
16511                            result.profile = std::option::Option::Some(
16512                                crate::model::connection_profile::Profile::BigqueryProfile(
16513                                    map.next_value::<std::option::Option<
16514                                        std::boxed::Box<crate::model::BigQueryProfile>,
16515                                    >>()?
16516                                    .unwrap_or_default(),
16517                                ),
16518                            );
16519                        }
16520                        __FieldTag::__postgresql_profile => {
16521                            if !fields.insert(__FieldTag::__postgresql_profile) {
16522                                return std::result::Result::Err(A::Error::duplicate_field(
16523                                    "multiple values for postgresql_profile",
16524                                ));
16525                            }
16526                            if result.profile.is_some() {
16527                                return std::result::Result::Err(A::Error::duplicate_field(
16528                                    "multiple values for `profile`, a oneof with full ID .google.cloud.datastream.v1.ConnectionProfile.postgresql_profile, latest field was postgresqlProfile",
16529                                ));
16530                            }
16531                            result.profile = std::option::Option::Some(
16532                                crate::model::connection_profile::Profile::PostgresqlProfile(
16533                                    map.next_value::<std::option::Option<
16534                                        std::boxed::Box<crate::model::PostgresqlProfile>,
16535                                    >>()?
16536                                    .unwrap_or_default(),
16537                                ),
16538                            );
16539                        }
16540                        __FieldTag::__sql_server_profile => {
16541                            if !fields.insert(__FieldTag::__sql_server_profile) {
16542                                return std::result::Result::Err(A::Error::duplicate_field(
16543                                    "multiple values for sql_server_profile",
16544                                ));
16545                            }
16546                            if result.profile.is_some() {
16547                                return std::result::Result::Err(A::Error::duplicate_field(
16548                                    "multiple values for `profile`, a oneof with full ID .google.cloud.datastream.v1.ConnectionProfile.sql_server_profile, latest field was sqlServerProfile",
16549                                ));
16550                            }
16551                            result.profile = std::option::Option::Some(
16552                                crate::model::connection_profile::Profile::SqlServerProfile(
16553                                    map.next_value::<std::option::Option<
16554                                        std::boxed::Box<crate::model::SqlServerProfile>,
16555                                    >>()?
16556                                    .unwrap_or_default(),
16557                                ),
16558                            );
16559                        }
16560                        __FieldTag::__salesforce_profile => {
16561                            if !fields.insert(__FieldTag::__salesforce_profile) {
16562                                return std::result::Result::Err(A::Error::duplicate_field(
16563                                    "multiple values for salesforce_profile",
16564                                ));
16565                            }
16566                            if result.profile.is_some() {
16567                                return std::result::Result::Err(A::Error::duplicate_field(
16568                                    "multiple values for `profile`, a oneof with full ID .google.cloud.datastream.v1.ConnectionProfile.salesforce_profile, latest field was salesforceProfile",
16569                                ));
16570                            }
16571                            result.profile = std::option::Option::Some(
16572                                crate::model::connection_profile::Profile::SalesforceProfile(
16573                                    map.next_value::<std::option::Option<
16574                                        std::boxed::Box<crate::model::SalesforceProfile>,
16575                                    >>()?
16576                                    .unwrap_or_default(),
16577                                ),
16578                            );
16579                        }
16580                        __FieldTag::__mongodb_profile => {
16581                            if !fields.insert(__FieldTag::__mongodb_profile) {
16582                                return std::result::Result::Err(A::Error::duplicate_field(
16583                                    "multiple values for mongodb_profile",
16584                                ));
16585                            }
16586                            if result.profile.is_some() {
16587                                return std::result::Result::Err(A::Error::duplicate_field(
16588                                    "multiple values for `profile`, a oneof with full ID .google.cloud.datastream.v1.ConnectionProfile.mongodb_profile, latest field was mongodbProfile",
16589                                ));
16590                            }
16591                            result.profile = std::option::Option::Some(
16592                                crate::model::connection_profile::Profile::MongodbProfile(
16593                                    map.next_value::<std::option::Option<
16594                                        std::boxed::Box<crate::model::MongodbProfile>,
16595                                    >>()?
16596                                    .unwrap_or_default(),
16597                                ),
16598                            );
16599                        }
16600                        __FieldTag::__static_service_ip_connectivity => {
16601                            if !fields.insert(__FieldTag::__static_service_ip_connectivity) {
16602                                return std::result::Result::Err(A::Error::duplicate_field(
16603                                    "multiple values for static_service_ip_connectivity",
16604                                ));
16605                            }
16606                            if result.connectivity.is_some() {
16607                                return std::result::Result::Err(A::Error::duplicate_field(
16608                                    "multiple values for `connectivity`, a oneof with full ID .google.cloud.datastream.v1.ConnectionProfile.static_service_ip_connectivity, latest field was staticServiceIpConnectivity",
16609                                ));
16610                            }
16611                            result.connectivity = std::option::Option::Some(
16612                                crate::model::connection_profile::Connectivity::StaticServiceIpConnectivity(
16613                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::StaticServiceIpConnectivity>>>()?.unwrap_or_default()
16614                                ),
16615                            );
16616                        }
16617                        __FieldTag::__forward_ssh_connectivity => {
16618                            if !fields.insert(__FieldTag::__forward_ssh_connectivity) {
16619                                return std::result::Result::Err(A::Error::duplicate_field(
16620                                    "multiple values for forward_ssh_connectivity",
16621                                ));
16622                            }
16623                            if result.connectivity.is_some() {
16624                                return std::result::Result::Err(A::Error::duplicate_field(
16625                                    "multiple values for `connectivity`, a oneof with full ID .google.cloud.datastream.v1.ConnectionProfile.forward_ssh_connectivity, latest field was forwardSshConnectivity",
16626                                ));
16627                            }
16628                            result.connectivity = std::option::Option::Some(
16629                                crate::model::connection_profile::Connectivity::ForwardSshConnectivity(
16630                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>>>()?.unwrap_or_default()
16631                                ),
16632                            );
16633                        }
16634                        __FieldTag::__private_connectivity => {
16635                            if !fields.insert(__FieldTag::__private_connectivity) {
16636                                return std::result::Result::Err(A::Error::duplicate_field(
16637                                    "multiple values for private_connectivity",
16638                                ));
16639                            }
16640                            if result.connectivity.is_some() {
16641                                return std::result::Result::Err(A::Error::duplicate_field(
16642                                    "multiple values for `connectivity`, a oneof with full ID .google.cloud.datastream.v1.ConnectionProfile.private_connectivity, latest field was privateConnectivity",
16643                                ));
16644                            }
16645                            result.connectivity = std::option::Option::Some(
16646                                crate::model::connection_profile::Connectivity::PrivateConnectivity(
16647                                    map.next_value::<std::option::Option<
16648                                        std::boxed::Box<crate::model::PrivateConnectivity>,
16649                                    >>()?
16650                                    .unwrap_or_default(),
16651                                ),
16652                            );
16653                        }
16654                        __FieldTag::Unknown(key) => {
16655                            let value = map.next_value::<serde_json::Value>()?;
16656                            result._unknown_fields.insert(key, value);
16657                        }
16658                    }
16659                }
16660                std::result::Result::Ok(result)
16661            }
16662        }
16663        deserializer.deserialize_any(Visitor)
16664    }
16665}
16666
16667#[doc(hidden)]
16668impl serde::ser::Serialize for ConnectionProfile {
16669    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16670    where
16671        S: serde::ser::Serializer,
16672    {
16673        use serde::ser::SerializeMap;
16674        #[allow(unused_imports)]
16675        use std::option::Option::Some;
16676        let mut state = serializer.serialize_map(std::option::Option::None)?;
16677        if !self.name.is_empty() {
16678            state.serialize_entry("name", &self.name)?;
16679        }
16680        if self.create_time.is_some() {
16681            state.serialize_entry("createTime", &self.create_time)?;
16682        }
16683        if self.update_time.is_some() {
16684            state.serialize_entry("updateTime", &self.update_time)?;
16685        }
16686        if !self.labels.is_empty() {
16687            state.serialize_entry("labels", &self.labels)?;
16688        }
16689        if !self.display_name.is_empty() {
16690            state.serialize_entry("displayName", &self.display_name)?;
16691        }
16692        if self.satisfies_pzs.is_some() {
16693            state.serialize_entry("satisfiesPzs", &self.satisfies_pzs)?;
16694        }
16695        if self.satisfies_pzi.is_some() {
16696            state.serialize_entry("satisfiesPzi", &self.satisfies_pzi)?;
16697        }
16698        if let Some(value) = self.oracle_profile() {
16699            state.serialize_entry("oracleProfile", value)?;
16700        }
16701        if let Some(value) = self.gcs_profile() {
16702            state.serialize_entry("gcsProfile", value)?;
16703        }
16704        if let Some(value) = self.mysql_profile() {
16705            state.serialize_entry("mysqlProfile", value)?;
16706        }
16707        if let Some(value) = self.bigquery_profile() {
16708            state.serialize_entry("bigqueryProfile", value)?;
16709        }
16710        if let Some(value) = self.postgresql_profile() {
16711            state.serialize_entry("postgresqlProfile", value)?;
16712        }
16713        if let Some(value) = self.sql_server_profile() {
16714            state.serialize_entry("sqlServerProfile", value)?;
16715        }
16716        if let Some(value) = self.salesforce_profile() {
16717            state.serialize_entry("salesforceProfile", value)?;
16718        }
16719        if let Some(value) = self.mongodb_profile() {
16720            state.serialize_entry("mongodbProfile", value)?;
16721        }
16722        if let Some(value) = self.static_service_ip_connectivity() {
16723            state.serialize_entry("staticServiceIpConnectivity", value)?;
16724        }
16725        if let Some(value) = self.forward_ssh_connectivity() {
16726            state.serialize_entry("forwardSshConnectivity", value)?;
16727        }
16728        if let Some(value) = self.private_connectivity() {
16729            state.serialize_entry("privateConnectivity", value)?;
16730        }
16731        if !self._unknown_fields.is_empty() {
16732            for (key, value) in self._unknown_fields.iter() {
16733                state.serialize_entry(key, &value)?;
16734            }
16735        }
16736        state.end()
16737    }
16738}
16739
16740impl std::fmt::Debug for ConnectionProfile {
16741    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16742        let mut debug_struct = f.debug_struct("ConnectionProfile");
16743        debug_struct.field("name", &self.name);
16744        debug_struct.field("create_time", &self.create_time);
16745        debug_struct.field("update_time", &self.update_time);
16746        debug_struct.field("labels", &self.labels);
16747        debug_struct.field("display_name", &self.display_name);
16748        debug_struct.field("satisfies_pzs", &self.satisfies_pzs);
16749        debug_struct.field("satisfies_pzi", &self.satisfies_pzi);
16750        debug_struct.field("profile", &self.profile);
16751        debug_struct.field("connectivity", &self.connectivity);
16752        if !self._unknown_fields.is_empty() {
16753            debug_struct.field("_unknown_fields", &self._unknown_fields);
16754        }
16755        debug_struct.finish()
16756    }
16757}
16758
16759/// Defines additional types related to [ConnectionProfile].
16760pub mod connection_profile {
16761    #[allow(unused_imports)]
16762    use super::*;
16763
16764    /// Connection configuration for the ConnectionProfile.
16765    #[derive(Clone, Debug, PartialEq)]
16766    #[non_exhaustive]
16767    pub enum Profile {
16768        /// Oracle ConnectionProfile configuration.
16769        OracleProfile(std::boxed::Box<crate::model::OracleProfile>),
16770        /// Cloud Storage ConnectionProfile configuration.
16771        GcsProfile(std::boxed::Box<crate::model::GcsProfile>),
16772        /// MySQL ConnectionProfile configuration.
16773        MysqlProfile(std::boxed::Box<crate::model::MysqlProfile>),
16774        /// BigQuery Connection Profile configuration.
16775        BigqueryProfile(std::boxed::Box<crate::model::BigQueryProfile>),
16776        /// PostgreSQL Connection Profile configuration.
16777        PostgresqlProfile(std::boxed::Box<crate::model::PostgresqlProfile>),
16778        /// SQLServer Connection Profile configuration.
16779        SqlServerProfile(std::boxed::Box<crate::model::SqlServerProfile>),
16780        /// Salesforce Connection Profile configuration.
16781        SalesforceProfile(std::boxed::Box<crate::model::SalesforceProfile>),
16782        /// MongoDB Connection Profile configuration.
16783        MongodbProfile(std::boxed::Box<crate::model::MongodbProfile>),
16784    }
16785
16786    /// Connectivity options used to establish a connection to the profile.
16787    #[derive(Clone, Debug, PartialEq)]
16788    #[non_exhaustive]
16789    pub enum Connectivity {
16790        /// Static Service IP connectivity.
16791        StaticServiceIpConnectivity(std::boxed::Box<crate::model::StaticServiceIpConnectivity>),
16792        /// Forward SSH tunnel connectivity.
16793        ForwardSshConnectivity(std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>),
16794        /// Private connectivity.
16795        PrivateConnectivity(std::boxed::Box<crate::model::PrivateConnectivity>),
16796    }
16797}
16798
16799/// Oracle Column.
16800#[derive(Clone, Default, PartialEq)]
16801#[non_exhaustive]
16802pub struct OracleColumn {
16803    /// Column name.
16804    pub column: std::string::String,
16805
16806    /// The Oracle data type.
16807    pub data_type: std::string::String,
16808
16809    /// Column length.
16810    pub length: i32,
16811
16812    /// Column precision.
16813    pub precision: i32,
16814
16815    /// Column scale.
16816    pub scale: i32,
16817
16818    /// Column encoding.
16819    pub encoding: std::string::String,
16820
16821    /// Whether or not the column represents a primary key.
16822    pub primary_key: bool,
16823
16824    /// Whether or not the column can accept a null value.
16825    pub nullable: bool,
16826
16827    /// The ordinal position of the column in the table.
16828    pub ordinal_position: i32,
16829
16830    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16831}
16832
16833impl OracleColumn {
16834    pub fn new() -> Self {
16835        std::default::Default::default()
16836    }
16837
16838    /// Sets the value of [column][crate::model::OracleColumn::column].
16839    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16840        self.column = v.into();
16841        self
16842    }
16843
16844    /// Sets the value of [data_type][crate::model::OracleColumn::data_type].
16845    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16846        self.data_type = v.into();
16847        self
16848    }
16849
16850    /// Sets the value of [length][crate::model::OracleColumn::length].
16851    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16852        self.length = v.into();
16853        self
16854    }
16855
16856    /// Sets the value of [precision][crate::model::OracleColumn::precision].
16857    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16858        self.precision = v.into();
16859        self
16860    }
16861
16862    /// Sets the value of [scale][crate::model::OracleColumn::scale].
16863    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16864        self.scale = v.into();
16865        self
16866    }
16867
16868    /// Sets the value of [encoding][crate::model::OracleColumn::encoding].
16869    pub fn set_encoding<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16870        self.encoding = v.into();
16871        self
16872    }
16873
16874    /// Sets the value of [primary_key][crate::model::OracleColumn::primary_key].
16875    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16876        self.primary_key = v.into();
16877        self
16878    }
16879
16880    /// Sets the value of [nullable][crate::model::OracleColumn::nullable].
16881    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16882        self.nullable = v.into();
16883        self
16884    }
16885
16886    /// Sets the value of [ordinal_position][crate::model::OracleColumn::ordinal_position].
16887    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16888        self.ordinal_position = v.into();
16889        self
16890    }
16891}
16892
16893impl wkt::message::Message for OracleColumn {
16894    fn typename() -> &'static str {
16895        "type.googleapis.com/google.cloud.datastream.v1.OracleColumn"
16896    }
16897}
16898
16899#[doc(hidden)]
16900impl<'de> serde::de::Deserialize<'de> for OracleColumn {
16901    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16902    where
16903        D: serde::Deserializer<'de>,
16904    {
16905        #[allow(non_camel_case_types)]
16906        #[doc(hidden)]
16907        #[derive(PartialEq, Eq, Hash)]
16908        enum __FieldTag {
16909            __column,
16910            __data_type,
16911            __length,
16912            __precision,
16913            __scale,
16914            __encoding,
16915            __primary_key,
16916            __nullable,
16917            __ordinal_position,
16918            Unknown(std::string::String),
16919        }
16920        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16921            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16922            where
16923                D: serde::Deserializer<'de>,
16924            {
16925                struct Visitor;
16926                impl<'de> serde::de::Visitor<'de> for Visitor {
16927                    type Value = __FieldTag;
16928                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16929                        formatter.write_str("a field name for OracleColumn")
16930                    }
16931                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16932                    where
16933                        E: serde::de::Error,
16934                    {
16935                        use std::result::Result::Ok;
16936                        use std::string::ToString;
16937                        match value {
16938                            "column" => Ok(__FieldTag::__column),
16939                            "dataType" => Ok(__FieldTag::__data_type),
16940                            "data_type" => Ok(__FieldTag::__data_type),
16941                            "length" => Ok(__FieldTag::__length),
16942                            "precision" => Ok(__FieldTag::__precision),
16943                            "scale" => Ok(__FieldTag::__scale),
16944                            "encoding" => Ok(__FieldTag::__encoding),
16945                            "primaryKey" => Ok(__FieldTag::__primary_key),
16946                            "primary_key" => Ok(__FieldTag::__primary_key),
16947                            "nullable" => Ok(__FieldTag::__nullable),
16948                            "ordinalPosition" => Ok(__FieldTag::__ordinal_position),
16949                            "ordinal_position" => Ok(__FieldTag::__ordinal_position),
16950                            _ => Ok(__FieldTag::Unknown(value.to_string())),
16951                        }
16952                    }
16953                }
16954                deserializer.deserialize_identifier(Visitor)
16955            }
16956        }
16957        struct Visitor;
16958        impl<'de> serde::de::Visitor<'de> for Visitor {
16959            type Value = OracleColumn;
16960            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16961                formatter.write_str("struct OracleColumn")
16962            }
16963            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16964            where
16965                A: serde::de::MapAccess<'de>,
16966            {
16967                #[allow(unused_imports)]
16968                use serde::de::Error;
16969                use std::option::Option::Some;
16970                let mut fields = std::collections::HashSet::new();
16971                let mut result = Self::Value::new();
16972                while let Some(tag) = map.next_key::<__FieldTag>()? {
16973                    #[allow(clippy::match_single_binding)]
16974                    match tag {
16975                        __FieldTag::__column => {
16976                            if !fields.insert(__FieldTag::__column) {
16977                                return std::result::Result::Err(A::Error::duplicate_field(
16978                                    "multiple values for column",
16979                                ));
16980                            }
16981                            result.column = map
16982                                .next_value::<std::option::Option<std::string::String>>()?
16983                                .unwrap_or_default();
16984                        }
16985                        __FieldTag::__data_type => {
16986                            if !fields.insert(__FieldTag::__data_type) {
16987                                return std::result::Result::Err(A::Error::duplicate_field(
16988                                    "multiple values for data_type",
16989                                ));
16990                            }
16991                            result.data_type = map
16992                                .next_value::<std::option::Option<std::string::String>>()?
16993                                .unwrap_or_default();
16994                        }
16995                        __FieldTag::__length => {
16996                            if !fields.insert(__FieldTag::__length) {
16997                                return std::result::Result::Err(A::Error::duplicate_field(
16998                                    "multiple values for length",
16999                                ));
17000                            }
17001                            struct __With(std::option::Option<i32>);
17002                            impl<'de> serde::de::Deserialize<'de> for __With {
17003                                fn deserialize<D>(
17004                                    deserializer: D,
17005                                ) -> std::result::Result<Self, D::Error>
17006                                where
17007                                    D: serde::de::Deserializer<'de>,
17008                                {
17009                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
17010                                }
17011                            }
17012                            result.length = map.next_value::<__With>()?.0.unwrap_or_default();
17013                        }
17014                        __FieldTag::__precision => {
17015                            if !fields.insert(__FieldTag::__precision) {
17016                                return std::result::Result::Err(A::Error::duplicate_field(
17017                                    "multiple values for precision",
17018                                ));
17019                            }
17020                            struct __With(std::option::Option<i32>);
17021                            impl<'de> serde::de::Deserialize<'de> for __With {
17022                                fn deserialize<D>(
17023                                    deserializer: D,
17024                                ) -> std::result::Result<Self, D::Error>
17025                                where
17026                                    D: serde::de::Deserializer<'de>,
17027                                {
17028                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
17029                                }
17030                            }
17031                            result.precision = map.next_value::<__With>()?.0.unwrap_or_default();
17032                        }
17033                        __FieldTag::__scale => {
17034                            if !fields.insert(__FieldTag::__scale) {
17035                                return std::result::Result::Err(A::Error::duplicate_field(
17036                                    "multiple values for scale",
17037                                ));
17038                            }
17039                            struct __With(std::option::Option<i32>);
17040                            impl<'de> serde::de::Deserialize<'de> for __With {
17041                                fn deserialize<D>(
17042                                    deserializer: D,
17043                                ) -> std::result::Result<Self, D::Error>
17044                                where
17045                                    D: serde::de::Deserializer<'de>,
17046                                {
17047                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
17048                                }
17049                            }
17050                            result.scale = map.next_value::<__With>()?.0.unwrap_or_default();
17051                        }
17052                        __FieldTag::__encoding => {
17053                            if !fields.insert(__FieldTag::__encoding) {
17054                                return std::result::Result::Err(A::Error::duplicate_field(
17055                                    "multiple values for encoding",
17056                                ));
17057                            }
17058                            result.encoding = map
17059                                .next_value::<std::option::Option<std::string::String>>()?
17060                                .unwrap_or_default();
17061                        }
17062                        __FieldTag::__primary_key => {
17063                            if !fields.insert(__FieldTag::__primary_key) {
17064                                return std::result::Result::Err(A::Error::duplicate_field(
17065                                    "multiple values for primary_key",
17066                                ));
17067                            }
17068                            result.primary_key = map
17069                                .next_value::<std::option::Option<bool>>()?
17070                                .unwrap_or_default();
17071                        }
17072                        __FieldTag::__nullable => {
17073                            if !fields.insert(__FieldTag::__nullable) {
17074                                return std::result::Result::Err(A::Error::duplicate_field(
17075                                    "multiple values for nullable",
17076                                ));
17077                            }
17078                            result.nullable = map
17079                                .next_value::<std::option::Option<bool>>()?
17080                                .unwrap_or_default();
17081                        }
17082                        __FieldTag::__ordinal_position => {
17083                            if !fields.insert(__FieldTag::__ordinal_position) {
17084                                return std::result::Result::Err(A::Error::duplicate_field(
17085                                    "multiple values for ordinal_position",
17086                                ));
17087                            }
17088                            struct __With(std::option::Option<i32>);
17089                            impl<'de> serde::de::Deserialize<'de> for __With {
17090                                fn deserialize<D>(
17091                                    deserializer: D,
17092                                ) -> std::result::Result<Self, D::Error>
17093                                where
17094                                    D: serde::de::Deserializer<'de>,
17095                                {
17096                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
17097                                }
17098                            }
17099                            result.ordinal_position =
17100                                map.next_value::<__With>()?.0.unwrap_or_default();
17101                        }
17102                        __FieldTag::Unknown(key) => {
17103                            let value = map.next_value::<serde_json::Value>()?;
17104                            result._unknown_fields.insert(key, value);
17105                        }
17106                    }
17107                }
17108                std::result::Result::Ok(result)
17109            }
17110        }
17111        deserializer.deserialize_any(Visitor)
17112    }
17113}
17114
17115#[doc(hidden)]
17116impl serde::ser::Serialize for OracleColumn {
17117    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17118    where
17119        S: serde::ser::Serializer,
17120    {
17121        use serde::ser::SerializeMap;
17122        #[allow(unused_imports)]
17123        use std::option::Option::Some;
17124        let mut state = serializer.serialize_map(std::option::Option::None)?;
17125        if !self.column.is_empty() {
17126            state.serialize_entry("column", &self.column)?;
17127        }
17128        if !self.data_type.is_empty() {
17129            state.serialize_entry("dataType", &self.data_type)?;
17130        }
17131        if !wkt::internal::is_default(&self.length) {
17132            struct __With<'a>(&'a i32);
17133            impl<'a> serde::ser::Serialize for __With<'a> {
17134                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17135                where
17136                    S: serde::ser::Serializer,
17137                {
17138                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
17139                }
17140            }
17141            state.serialize_entry("length", &__With(&self.length))?;
17142        }
17143        if !wkt::internal::is_default(&self.precision) {
17144            struct __With<'a>(&'a i32);
17145            impl<'a> serde::ser::Serialize for __With<'a> {
17146                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17147                where
17148                    S: serde::ser::Serializer,
17149                {
17150                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
17151                }
17152            }
17153            state.serialize_entry("precision", &__With(&self.precision))?;
17154        }
17155        if !wkt::internal::is_default(&self.scale) {
17156            struct __With<'a>(&'a i32);
17157            impl<'a> serde::ser::Serialize for __With<'a> {
17158                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17159                where
17160                    S: serde::ser::Serializer,
17161                {
17162                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
17163                }
17164            }
17165            state.serialize_entry("scale", &__With(&self.scale))?;
17166        }
17167        if !self.encoding.is_empty() {
17168            state.serialize_entry("encoding", &self.encoding)?;
17169        }
17170        if !wkt::internal::is_default(&self.primary_key) {
17171            state.serialize_entry("primaryKey", &self.primary_key)?;
17172        }
17173        if !wkt::internal::is_default(&self.nullable) {
17174            state.serialize_entry("nullable", &self.nullable)?;
17175        }
17176        if !wkt::internal::is_default(&self.ordinal_position) {
17177            struct __With<'a>(&'a i32);
17178            impl<'a> serde::ser::Serialize for __With<'a> {
17179                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17180                where
17181                    S: serde::ser::Serializer,
17182                {
17183                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
17184                }
17185            }
17186            state.serialize_entry("ordinalPosition", &__With(&self.ordinal_position))?;
17187        }
17188        if !self._unknown_fields.is_empty() {
17189            for (key, value) in self._unknown_fields.iter() {
17190                state.serialize_entry(key, &value)?;
17191            }
17192        }
17193        state.end()
17194    }
17195}
17196
17197impl std::fmt::Debug for OracleColumn {
17198    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17199        let mut debug_struct = f.debug_struct("OracleColumn");
17200        debug_struct.field("column", &self.column);
17201        debug_struct.field("data_type", &self.data_type);
17202        debug_struct.field("length", &self.length);
17203        debug_struct.field("precision", &self.precision);
17204        debug_struct.field("scale", &self.scale);
17205        debug_struct.field("encoding", &self.encoding);
17206        debug_struct.field("primary_key", &self.primary_key);
17207        debug_struct.field("nullable", &self.nullable);
17208        debug_struct.field("ordinal_position", &self.ordinal_position);
17209        if !self._unknown_fields.is_empty() {
17210            debug_struct.field("_unknown_fields", &self._unknown_fields);
17211        }
17212        debug_struct.finish()
17213    }
17214}
17215
17216/// Oracle table.
17217#[derive(Clone, Default, PartialEq)]
17218#[non_exhaustive]
17219pub struct OracleTable {
17220    /// Table name.
17221    pub table: std::string::String,
17222
17223    /// Oracle columns in the schema.
17224    /// When unspecified as part of include/exclude objects, includes/excludes
17225    /// everything.
17226    pub oracle_columns: std::vec::Vec<crate::model::OracleColumn>,
17227
17228    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17229}
17230
17231impl OracleTable {
17232    pub fn new() -> Self {
17233        std::default::Default::default()
17234    }
17235
17236    /// Sets the value of [table][crate::model::OracleTable::table].
17237    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17238        self.table = v.into();
17239        self
17240    }
17241
17242    /// Sets the value of [oracle_columns][crate::model::OracleTable::oracle_columns].
17243    pub fn set_oracle_columns<T, V>(mut self, v: T) -> Self
17244    where
17245        T: std::iter::IntoIterator<Item = V>,
17246        V: std::convert::Into<crate::model::OracleColumn>,
17247    {
17248        use std::iter::Iterator;
17249        self.oracle_columns = v.into_iter().map(|i| i.into()).collect();
17250        self
17251    }
17252}
17253
17254impl wkt::message::Message for OracleTable {
17255    fn typename() -> &'static str {
17256        "type.googleapis.com/google.cloud.datastream.v1.OracleTable"
17257    }
17258}
17259
17260#[doc(hidden)]
17261impl<'de> serde::de::Deserialize<'de> for OracleTable {
17262    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17263    where
17264        D: serde::Deserializer<'de>,
17265    {
17266        #[allow(non_camel_case_types)]
17267        #[doc(hidden)]
17268        #[derive(PartialEq, Eq, Hash)]
17269        enum __FieldTag {
17270            __table,
17271            __oracle_columns,
17272            Unknown(std::string::String),
17273        }
17274        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
17275            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17276            where
17277                D: serde::Deserializer<'de>,
17278            {
17279                struct Visitor;
17280                impl<'de> serde::de::Visitor<'de> for Visitor {
17281                    type Value = __FieldTag;
17282                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17283                        formatter.write_str("a field name for OracleTable")
17284                    }
17285                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
17286                    where
17287                        E: serde::de::Error,
17288                    {
17289                        use std::result::Result::Ok;
17290                        use std::string::ToString;
17291                        match value {
17292                            "table" => Ok(__FieldTag::__table),
17293                            "oracleColumns" => Ok(__FieldTag::__oracle_columns),
17294                            "oracle_columns" => Ok(__FieldTag::__oracle_columns),
17295                            _ => Ok(__FieldTag::Unknown(value.to_string())),
17296                        }
17297                    }
17298                }
17299                deserializer.deserialize_identifier(Visitor)
17300            }
17301        }
17302        struct Visitor;
17303        impl<'de> serde::de::Visitor<'de> for Visitor {
17304            type Value = OracleTable;
17305            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17306                formatter.write_str("struct OracleTable")
17307            }
17308            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
17309            where
17310                A: serde::de::MapAccess<'de>,
17311            {
17312                #[allow(unused_imports)]
17313                use serde::de::Error;
17314                use std::option::Option::Some;
17315                let mut fields = std::collections::HashSet::new();
17316                let mut result = Self::Value::new();
17317                while let Some(tag) = map.next_key::<__FieldTag>()? {
17318                    #[allow(clippy::match_single_binding)]
17319                    match tag {
17320                        __FieldTag::__table => {
17321                            if !fields.insert(__FieldTag::__table) {
17322                                return std::result::Result::Err(A::Error::duplicate_field(
17323                                    "multiple values for table",
17324                                ));
17325                            }
17326                            result.table = map
17327                                .next_value::<std::option::Option<std::string::String>>()?
17328                                .unwrap_or_default();
17329                        }
17330                        __FieldTag::__oracle_columns => {
17331                            if !fields.insert(__FieldTag::__oracle_columns) {
17332                                return std::result::Result::Err(A::Error::duplicate_field(
17333                                    "multiple values for oracle_columns",
17334                                ));
17335                            }
17336                            result.oracle_columns = map.next_value::<std::option::Option<std::vec::Vec<crate::model::OracleColumn>>>()?.unwrap_or_default();
17337                        }
17338                        __FieldTag::Unknown(key) => {
17339                            let value = map.next_value::<serde_json::Value>()?;
17340                            result._unknown_fields.insert(key, value);
17341                        }
17342                    }
17343                }
17344                std::result::Result::Ok(result)
17345            }
17346        }
17347        deserializer.deserialize_any(Visitor)
17348    }
17349}
17350
17351#[doc(hidden)]
17352impl serde::ser::Serialize for OracleTable {
17353    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17354    where
17355        S: serde::ser::Serializer,
17356    {
17357        use serde::ser::SerializeMap;
17358        #[allow(unused_imports)]
17359        use std::option::Option::Some;
17360        let mut state = serializer.serialize_map(std::option::Option::None)?;
17361        if !self.table.is_empty() {
17362            state.serialize_entry("table", &self.table)?;
17363        }
17364        if !self.oracle_columns.is_empty() {
17365            state.serialize_entry("oracleColumns", &self.oracle_columns)?;
17366        }
17367        if !self._unknown_fields.is_empty() {
17368            for (key, value) in self._unknown_fields.iter() {
17369                state.serialize_entry(key, &value)?;
17370            }
17371        }
17372        state.end()
17373    }
17374}
17375
17376impl std::fmt::Debug for OracleTable {
17377    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17378        let mut debug_struct = f.debug_struct("OracleTable");
17379        debug_struct.field("table", &self.table);
17380        debug_struct.field("oracle_columns", &self.oracle_columns);
17381        if !self._unknown_fields.is_empty() {
17382            debug_struct.field("_unknown_fields", &self._unknown_fields);
17383        }
17384        debug_struct.finish()
17385    }
17386}
17387
17388/// Oracle schema.
17389#[derive(Clone, Default, PartialEq)]
17390#[non_exhaustive]
17391pub struct OracleSchema {
17392    /// Schema name.
17393    pub schema: std::string::String,
17394
17395    /// Tables in the schema.
17396    pub oracle_tables: std::vec::Vec<crate::model::OracleTable>,
17397
17398    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17399}
17400
17401impl OracleSchema {
17402    pub fn new() -> Self {
17403        std::default::Default::default()
17404    }
17405
17406    /// Sets the value of [schema][crate::model::OracleSchema::schema].
17407    pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17408        self.schema = v.into();
17409        self
17410    }
17411
17412    /// Sets the value of [oracle_tables][crate::model::OracleSchema::oracle_tables].
17413    pub fn set_oracle_tables<T, V>(mut self, v: T) -> Self
17414    where
17415        T: std::iter::IntoIterator<Item = V>,
17416        V: std::convert::Into<crate::model::OracleTable>,
17417    {
17418        use std::iter::Iterator;
17419        self.oracle_tables = v.into_iter().map(|i| i.into()).collect();
17420        self
17421    }
17422}
17423
17424impl wkt::message::Message for OracleSchema {
17425    fn typename() -> &'static str {
17426        "type.googleapis.com/google.cloud.datastream.v1.OracleSchema"
17427    }
17428}
17429
17430#[doc(hidden)]
17431impl<'de> serde::de::Deserialize<'de> for OracleSchema {
17432    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17433    where
17434        D: serde::Deserializer<'de>,
17435    {
17436        #[allow(non_camel_case_types)]
17437        #[doc(hidden)]
17438        #[derive(PartialEq, Eq, Hash)]
17439        enum __FieldTag {
17440            __schema,
17441            __oracle_tables,
17442            Unknown(std::string::String),
17443        }
17444        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
17445            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17446            where
17447                D: serde::Deserializer<'de>,
17448            {
17449                struct Visitor;
17450                impl<'de> serde::de::Visitor<'de> for Visitor {
17451                    type Value = __FieldTag;
17452                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17453                        formatter.write_str("a field name for OracleSchema")
17454                    }
17455                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
17456                    where
17457                        E: serde::de::Error,
17458                    {
17459                        use std::result::Result::Ok;
17460                        use std::string::ToString;
17461                        match value {
17462                            "schema" => Ok(__FieldTag::__schema),
17463                            "oracleTables" => Ok(__FieldTag::__oracle_tables),
17464                            "oracle_tables" => Ok(__FieldTag::__oracle_tables),
17465                            _ => Ok(__FieldTag::Unknown(value.to_string())),
17466                        }
17467                    }
17468                }
17469                deserializer.deserialize_identifier(Visitor)
17470            }
17471        }
17472        struct Visitor;
17473        impl<'de> serde::de::Visitor<'de> for Visitor {
17474            type Value = OracleSchema;
17475            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17476                formatter.write_str("struct OracleSchema")
17477            }
17478            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
17479            where
17480                A: serde::de::MapAccess<'de>,
17481            {
17482                #[allow(unused_imports)]
17483                use serde::de::Error;
17484                use std::option::Option::Some;
17485                let mut fields = std::collections::HashSet::new();
17486                let mut result = Self::Value::new();
17487                while let Some(tag) = map.next_key::<__FieldTag>()? {
17488                    #[allow(clippy::match_single_binding)]
17489                    match tag {
17490                        __FieldTag::__schema => {
17491                            if !fields.insert(__FieldTag::__schema) {
17492                                return std::result::Result::Err(A::Error::duplicate_field(
17493                                    "multiple values for schema",
17494                                ));
17495                            }
17496                            result.schema = map
17497                                .next_value::<std::option::Option<std::string::String>>()?
17498                                .unwrap_or_default();
17499                        }
17500                        __FieldTag::__oracle_tables => {
17501                            if !fields.insert(__FieldTag::__oracle_tables) {
17502                                return std::result::Result::Err(A::Error::duplicate_field(
17503                                    "multiple values for oracle_tables",
17504                                ));
17505                            }
17506                            result.oracle_tables = map.next_value::<std::option::Option<std::vec::Vec<crate::model::OracleTable>>>()?.unwrap_or_default();
17507                        }
17508                        __FieldTag::Unknown(key) => {
17509                            let value = map.next_value::<serde_json::Value>()?;
17510                            result._unknown_fields.insert(key, value);
17511                        }
17512                    }
17513                }
17514                std::result::Result::Ok(result)
17515            }
17516        }
17517        deserializer.deserialize_any(Visitor)
17518    }
17519}
17520
17521#[doc(hidden)]
17522impl serde::ser::Serialize for OracleSchema {
17523    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17524    where
17525        S: serde::ser::Serializer,
17526    {
17527        use serde::ser::SerializeMap;
17528        #[allow(unused_imports)]
17529        use std::option::Option::Some;
17530        let mut state = serializer.serialize_map(std::option::Option::None)?;
17531        if !self.schema.is_empty() {
17532            state.serialize_entry("schema", &self.schema)?;
17533        }
17534        if !self.oracle_tables.is_empty() {
17535            state.serialize_entry("oracleTables", &self.oracle_tables)?;
17536        }
17537        if !self._unknown_fields.is_empty() {
17538            for (key, value) in self._unknown_fields.iter() {
17539                state.serialize_entry(key, &value)?;
17540            }
17541        }
17542        state.end()
17543    }
17544}
17545
17546impl std::fmt::Debug for OracleSchema {
17547    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17548        let mut debug_struct = f.debug_struct("OracleSchema");
17549        debug_struct.field("schema", &self.schema);
17550        debug_struct.field("oracle_tables", &self.oracle_tables);
17551        if !self._unknown_fields.is_empty() {
17552            debug_struct.field("_unknown_fields", &self._unknown_fields);
17553        }
17554        debug_struct.finish()
17555    }
17556}
17557
17558/// Oracle database structure.
17559#[derive(Clone, Default, PartialEq)]
17560#[non_exhaustive]
17561pub struct OracleRdbms {
17562    /// Oracle schemas/databases in the database server.
17563    pub oracle_schemas: std::vec::Vec<crate::model::OracleSchema>,
17564
17565    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17566}
17567
17568impl OracleRdbms {
17569    pub fn new() -> Self {
17570        std::default::Default::default()
17571    }
17572
17573    /// Sets the value of [oracle_schemas][crate::model::OracleRdbms::oracle_schemas].
17574    pub fn set_oracle_schemas<T, V>(mut self, v: T) -> Self
17575    where
17576        T: std::iter::IntoIterator<Item = V>,
17577        V: std::convert::Into<crate::model::OracleSchema>,
17578    {
17579        use std::iter::Iterator;
17580        self.oracle_schemas = v.into_iter().map(|i| i.into()).collect();
17581        self
17582    }
17583}
17584
17585impl wkt::message::Message for OracleRdbms {
17586    fn typename() -> &'static str {
17587        "type.googleapis.com/google.cloud.datastream.v1.OracleRdbms"
17588    }
17589}
17590
17591#[doc(hidden)]
17592impl<'de> serde::de::Deserialize<'de> for OracleRdbms {
17593    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17594    where
17595        D: serde::Deserializer<'de>,
17596    {
17597        #[allow(non_camel_case_types)]
17598        #[doc(hidden)]
17599        #[derive(PartialEq, Eq, Hash)]
17600        enum __FieldTag {
17601            __oracle_schemas,
17602            Unknown(std::string::String),
17603        }
17604        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
17605            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17606            where
17607                D: serde::Deserializer<'de>,
17608            {
17609                struct Visitor;
17610                impl<'de> serde::de::Visitor<'de> for Visitor {
17611                    type Value = __FieldTag;
17612                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17613                        formatter.write_str("a field name for OracleRdbms")
17614                    }
17615                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
17616                    where
17617                        E: serde::de::Error,
17618                    {
17619                        use std::result::Result::Ok;
17620                        use std::string::ToString;
17621                        match value {
17622                            "oracleSchemas" => Ok(__FieldTag::__oracle_schemas),
17623                            "oracle_schemas" => Ok(__FieldTag::__oracle_schemas),
17624                            _ => Ok(__FieldTag::Unknown(value.to_string())),
17625                        }
17626                    }
17627                }
17628                deserializer.deserialize_identifier(Visitor)
17629            }
17630        }
17631        struct Visitor;
17632        impl<'de> serde::de::Visitor<'de> for Visitor {
17633            type Value = OracleRdbms;
17634            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17635                formatter.write_str("struct OracleRdbms")
17636            }
17637            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
17638            where
17639                A: serde::de::MapAccess<'de>,
17640            {
17641                #[allow(unused_imports)]
17642                use serde::de::Error;
17643                use std::option::Option::Some;
17644                let mut fields = std::collections::HashSet::new();
17645                let mut result = Self::Value::new();
17646                while let Some(tag) = map.next_key::<__FieldTag>()? {
17647                    #[allow(clippy::match_single_binding)]
17648                    match tag {
17649                        __FieldTag::__oracle_schemas => {
17650                            if !fields.insert(__FieldTag::__oracle_schemas) {
17651                                return std::result::Result::Err(A::Error::duplicate_field(
17652                                    "multiple values for oracle_schemas",
17653                                ));
17654                            }
17655                            result.oracle_schemas = map.next_value::<std::option::Option<std::vec::Vec<crate::model::OracleSchema>>>()?.unwrap_or_default();
17656                        }
17657                        __FieldTag::Unknown(key) => {
17658                            let value = map.next_value::<serde_json::Value>()?;
17659                            result._unknown_fields.insert(key, value);
17660                        }
17661                    }
17662                }
17663                std::result::Result::Ok(result)
17664            }
17665        }
17666        deserializer.deserialize_any(Visitor)
17667    }
17668}
17669
17670#[doc(hidden)]
17671impl serde::ser::Serialize for OracleRdbms {
17672    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17673    where
17674        S: serde::ser::Serializer,
17675    {
17676        use serde::ser::SerializeMap;
17677        #[allow(unused_imports)]
17678        use std::option::Option::Some;
17679        let mut state = serializer.serialize_map(std::option::Option::None)?;
17680        if !self.oracle_schemas.is_empty() {
17681            state.serialize_entry("oracleSchemas", &self.oracle_schemas)?;
17682        }
17683        if !self._unknown_fields.is_empty() {
17684            for (key, value) in self._unknown_fields.iter() {
17685                state.serialize_entry(key, &value)?;
17686            }
17687        }
17688        state.end()
17689    }
17690}
17691
17692impl std::fmt::Debug for OracleRdbms {
17693    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17694        let mut debug_struct = f.debug_struct("OracleRdbms");
17695        debug_struct.field("oracle_schemas", &self.oracle_schemas);
17696        if !self._unknown_fields.is_empty() {
17697            debug_struct.field("_unknown_fields", &self._unknown_fields);
17698        }
17699        debug_struct.finish()
17700    }
17701}
17702
17703/// Oracle data source configuration
17704#[derive(Clone, Default, PartialEq)]
17705#[non_exhaustive]
17706pub struct OracleSourceConfig {
17707    /// Oracle objects to include in the stream.
17708    pub include_objects: std::option::Option<crate::model::OracleRdbms>,
17709
17710    /// Oracle objects to exclude from the stream.
17711    pub exclude_objects: std::option::Option<crate::model::OracleRdbms>,
17712
17713    /// Maximum number of concurrent CDC tasks. The number should be non-negative.
17714    /// If not set (or set to 0), the system's default value is used.
17715    pub max_concurrent_cdc_tasks: i32,
17716
17717    /// Maximum number of concurrent backfill tasks. The number should be
17718    /// non-negative. If not set (or set to 0), the system's default value is used.
17719    pub max_concurrent_backfill_tasks: i32,
17720
17721    /// The configuration for handle Oracle large objects.
17722    pub large_objects_handling:
17723        std::option::Option<crate::model::oracle_source_config::LargeObjectsHandling>,
17724
17725    /// Configuration to select the CDC method.
17726    pub cdc_method: std::option::Option<crate::model::oracle_source_config::CdcMethod>,
17727
17728    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17729}
17730
17731impl OracleSourceConfig {
17732    pub fn new() -> Self {
17733        std::default::Default::default()
17734    }
17735
17736    /// Sets the value of [include_objects][crate::model::OracleSourceConfig::include_objects].
17737    pub fn set_include_objects<T>(mut self, v: T) -> Self
17738    where
17739        T: std::convert::Into<crate::model::OracleRdbms>,
17740    {
17741        self.include_objects = std::option::Option::Some(v.into());
17742        self
17743    }
17744
17745    /// Sets or clears the value of [include_objects][crate::model::OracleSourceConfig::include_objects].
17746    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
17747    where
17748        T: std::convert::Into<crate::model::OracleRdbms>,
17749    {
17750        self.include_objects = v.map(|x| x.into());
17751        self
17752    }
17753
17754    /// Sets the value of [exclude_objects][crate::model::OracleSourceConfig::exclude_objects].
17755    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
17756    where
17757        T: std::convert::Into<crate::model::OracleRdbms>,
17758    {
17759        self.exclude_objects = std::option::Option::Some(v.into());
17760        self
17761    }
17762
17763    /// Sets or clears the value of [exclude_objects][crate::model::OracleSourceConfig::exclude_objects].
17764    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
17765    where
17766        T: std::convert::Into<crate::model::OracleRdbms>,
17767    {
17768        self.exclude_objects = v.map(|x| x.into());
17769        self
17770    }
17771
17772    /// Sets the value of [max_concurrent_cdc_tasks][crate::model::OracleSourceConfig::max_concurrent_cdc_tasks].
17773    pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17774        self.max_concurrent_cdc_tasks = v.into();
17775        self
17776    }
17777
17778    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::OracleSourceConfig::max_concurrent_backfill_tasks].
17779    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17780        self.max_concurrent_backfill_tasks = v.into();
17781        self
17782    }
17783
17784    /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling].
17785    ///
17786    /// Note that all the setters affecting `large_objects_handling` are mutually
17787    /// exclusive.
17788    pub fn set_large_objects_handling<
17789        T: std::convert::Into<
17790                std::option::Option<crate::model::oracle_source_config::LargeObjectsHandling>,
17791            >,
17792    >(
17793        mut self,
17794        v: T,
17795    ) -> Self {
17796        self.large_objects_handling = v.into();
17797        self
17798    }
17799
17800    /// The value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
17801    /// if it holds a `DropLargeObjects`, `None` if the field is not set or
17802    /// holds a different branch.
17803    pub fn drop_large_objects(
17804        &self,
17805    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>>
17806    {
17807        #[allow(unreachable_patterns)]
17808        self.large_objects_handling.as_ref().and_then(|v| match v {
17809            crate::model::oracle_source_config::LargeObjectsHandling::DropLargeObjects(v) => {
17810                std::option::Option::Some(v)
17811            }
17812            _ => std::option::Option::None,
17813        })
17814    }
17815
17816    /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
17817    /// to hold a `DropLargeObjects`.
17818    ///
17819    /// Note that all the setters affecting `large_objects_handling` are
17820    /// mutually exclusive.
17821    pub fn set_drop_large_objects<
17822        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>>,
17823    >(
17824        mut self,
17825        v: T,
17826    ) -> Self {
17827        self.large_objects_handling = std::option::Option::Some(
17828            crate::model::oracle_source_config::LargeObjectsHandling::DropLargeObjects(v.into()),
17829        );
17830        self
17831    }
17832
17833    /// The value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
17834    /// if it holds a `StreamLargeObjects`, `None` if the field is not set or
17835    /// holds a different branch.
17836    pub fn stream_large_objects(
17837        &self,
17838    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>>
17839    {
17840        #[allow(unreachable_patterns)]
17841        self.large_objects_handling.as_ref().and_then(|v| match v {
17842            crate::model::oracle_source_config::LargeObjectsHandling::StreamLargeObjects(v) => {
17843                std::option::Option::Some(v)
17844            }
17845            _ => std::option::Option::None,
17846        })
17847    }
17848
17849    /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
17850    /// to hold a `StreamLargeObjects`.
17851    ///
17852    /// Note that all the setters affecting `large_objects_handling` are
17853    /// mutually exclusive.
17854    pub fn set_stream_large_objects<
17855        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>>,
17856    >(
17857        mut self,
17858        v: T,
17859    ) -> Self {
17860        self.large_objects_handling = std::option::Option::Some(
17861            crate::model::oracle_source_config::LargeObjectsHandling::StreamLargeObjects(v.into()),
17862        );
17863        self
17864    }
17865
17866    /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method].
17867    ///
17868    /// Note that all the setters affecting `cdc_method` are mutually
17869    /// exclusive.
17870    pub fn set_cdc_method<
17871        T: std::convert::Into<std::option::Option<crate::model::oracle_source_config::CdcMethod>>,
17872    >(
17873        mut self,
17874        v: T,
17875    ) -> Self {
17876        self.cdc_method = v.into();
17877        self
17878    }
17879
17880    /// The value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
17881    /// if it holds a `LogMiner`, `None` if the field is not set or
17882    /// holds a different branch.
17883    pub fn log_miner(
17884        &self,
17885    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::LogMiner>> {
17886        #[allow(unreachable_patterns)]
17887        self.cdc_method.as_ref().and_then(|v| match v {
17888            crate::model::oracle_source_config::CdcMethod::LogMiner(v) => {
17889                std::option::Option::Some(v)
17890            }
17891            _ => std::option::Option::None,
17892        })
17893    }
17894
17895    /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
17896    /// to hold a `LogMiner`.
17897    ///
17898    /// Note that all the setters affecting `cdc_method` are
17899    /// mutually exclusive.
17900    pub fn set_log_miner<
17901        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::LogMiner>>,
17902    >(
17903        mut self,
17904        v: T,
17905    ) -> Self {
17906        self.cdc_method = std::option::Option::Some(
17907            crate::model::oracle_source_config::CdcMethod::LogMiner(v.into()),
17908        );
17909        self
17910    }
17911
17912    /// The value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
17913    /// if it holds a `BinaryLogParser`, `None` if the field is not set or
17914    /// holds a different branch.
17915    pub fn binary_log_parser(
17916        &self,
17917    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>>
17918    {
17919        #[allow(unreachable_patterns)]
17920        self.cdc_method.as_ref().and_then(|v| match v {
17921            crate::model::oracle_source_config::CdcMethod::BinaryLogParser(v) => {
17922                std::option::Option::Some(v)
17923            }
17924            _ => std::option::Option::None,
17925        })
17926    }
17927
17928    /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
17929    /// to hold a `BinaryLogParser`.
17930    ///
17931    /// Note that all the setters affecting `cdc_method` are
17932    /// mutually exclusive.
17933    pub fn set_binary_log_parser<
17934        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>>,
17935    >(
17936        mut self,
17937        v: T,
17938    ) -> Self {
17939        self.cdc_method = std::option::Option::Some(
17940            crate::model::oracle_source_config::CdcMethod::BinaryLogParser(v.into()),
17941        );
17942        self
17943    }
17944}
17945
17946impl wkt::message::Message for OracleSourceConfig {
17947    fn typename() -> &'static str {
17948        "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig"
17949    }
17950}
17951
17952#[doc(hidden)]
17953impl<'de> serde::de::Deserialize<'de> for OracleSourceConfig {
17954    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17955    where
17956        D: serde::Deserializer<'de>,
17957    {
17958        #[allow(non_camel_case_types)]
17959        #[doc(hidden)]
17960        #[derive(PartialEq, Eq, Hash)]
17961        enum __FieldTag {
17962            __include_objects,
17963            __exclude_objects,
17964            __max_concurrent_cdc_tasks,
17965            __max_concurrent_backfill_tasks,
17966            __drop_large_objects,
17967            __stream_large_objects,
17968            __log_miner,
17969            __binary_log_parser,
17970            Unknown(std::string::String),
17971        }
17972        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
17973            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17974            where
17975                D: serde::Deserializer<'de>,
17976            {
17977                struct Visitor;
17978                impl<'de> serde::de::Visitor<'de> for Visitor {
17979                    type Value = __FieldTag;
17980                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17981                        formatter.write_str("a field name for OracleSourceConfig")
17982                    }
17983                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
17984                    where
17985                        E: serde::de::Error,
17986                    {
17987                        use std::result::Result::Ok;
17988                        use std::string::ToString;
17989                        match value {
17990                            "includeObjects" => Ok(__FieldTag::__include_objects),
17991                            "include_objects" => Ok(__FieldTag::__include_objects),
17992                            "excludeObjects" => Ok(__FieldTag::__exclude_objects),
17993                            "exclude_objects" => Ok(__FieldTag::__exclude_objects),
17994                            "maxConcurrentCdcTasks" => Ok(__FieldTag::__max_concurrent_cdc_tasks),
17995                            "max_concurrent_cdc_tasks" => {
17996                                Ok(__FieldTag::__max_concurrent_cdc_tasks)
17997                            }
17998                            "maxConcurrentBackfillTasks" => {
17999                                Ok(__FieldTag::__max_concurrent_backfill_tasks)
18000                            }
18001                            "max_concurrent_backfill_tasks" => {
18002                                Ok(__FieldTag::__max_concurrent_backfill_tasks)
18003                            }
18004                            "dropLargeObjects" => Ok(__FieldTag::__drop_large_objects),
18005                            "drop_large_objects" => Ok(__FieldTag::__drop_large_objects),
18006                            "streamLargeObjects" => Ok(__FieldTag::__stream_large_objects),
18007                            "stream_large_objects" => Ok(__FieldTag::__stream_large_objects),
18008                            "logMiner" => Ok(__FieldTag::__log_miner),
18009                            "log_miner" => Ok(__FieldTag::__log_miner),
18010                            "binaryLogParser" => Ok(__FieldTag::__binary_log_parser),
18011                            "binary_log_parser" => Ok(__FieldTag::__binary_log_parser),
18012                            _ => Ok(__FieldTag::Unknown(value.to_string())),
18013                        }
18014                    }
18015                }
18016                deserializer.deserialize_identifier(Visitor)
18017            }
18018        }
18019        struct Visitor;
18020        impl<'de> serde::de::Visitor<'de> for Visitor {
18021            type Value = OracleSourceConfig;
18022            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18023                formatter.write_str("struct OracleSourceConfig")
18024            }
18025            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
18026            where
18027                A: serde::de::MapAccess<'de>,
18028            {
18029                #[allow(unused_imports)]
18030                use serde::de::Error;
18031                use std::option::Option::Some;
18032                let mut fields = std::collections::HashSet::new();
18033                let mut result = Self::Value::new();
18034                while let Some(tag) = map.next_key::<__FieldTag>()? {
18035                    #[allow(clippy::match_single_binding)]
18036                    match tag {
18037                        __FieldTag::__include_objects => {
18038                            if !fields.insert(__FieldTag::__include_objects) {
18039                                return std::result::Result::Err(A::Error::duplicate_field(
18040                                    "multiple values for include_objects",
18041                                ));
18042                            }
18043                            result.include_objects =
18044                                map.next_value::<std::option::Option<crate::model::OracleRdbms>>()?;
18045                        }
18046                        __FieldTag::__exclude_objects => {
18047                            if !fields.insert(__FieldTag::__exclude_objects) {
18048                                return std::result::Result::Err(A::Error::duplicate_field(
18049                                    "multiple values for exclude_objects",
18050                                ));
18051                            }
18052                            result.exclude_objects =
18053                                map.next_value::<std::option::Option<crate::model::OracleRdbms>>()?;
18054                        }
18055                        __FieldTag::__max_concurrent_cdc_tasks => {
18056                            if !fields.insert(__FieldTag::__max_concurrent_cdc_tasks) {
18057                                return std::result::Result::Err(A::Error::duplicate_field(
18058                                    "multiple values for max_concurrent_cdc_tasks",
18059                                ));
18060                            }
18061                            struct __With(std::option::Option<i32>);
18062                            impl<'de> serde::de::Deserialize<'de> for __With {
18063                                fn deserialize<D>(
18064                                    deserializer: D,
18065                                ) -> std::result::Result<Self, D::Error>
18066                                where
18067                                    D: serde::de::Deserializer<'de>,
18068                                {
18069                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
18070                                }
18071                            }
18072                            result.max_concurrent_cdc_tasks =
18073                                map.next_value::<__With>()?.0.unwrap_or_default();
18074                        }
18075                        __FieldTag::__max_concurrent_backfill_tasks => {
18076                            if !fields.insert(__FieldTag::__max_concurrent_backfill_tasks) {
18077                                return std::result::Result::Err(A::Error::duplicate_field(
18078                                    "multiple values for max_concurrent_backfill_tasks",
18079                                ));
18080                            }
18081                            struct __With(std::option::Option<i32>);
18082                            impl<'de> serde::de::Deserialize<'de> for __With {
18083                                fn deserialize<D>(
18084                                    deserializer: D,
18085                                ) -> std::result::Result<Self, D::Error>
18086                                where
18087                                    D: serde::de::Deserializer<'de>,
18088                                {
18089                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
18090                                }
18091                            }
18092                            result.max_concurrent_backfill_tasks =
18093                                map.next_value::<__With>()?.0.unwrap_or_default();
18094                        }
18095                        __FieldTag::__drop_large_objects => {
18096                            if !fields.insert(__FieldTag::__drop_large_objects) {
18097                                return std::result::Result::Err(A::Error::duplicate_field(
18098                                    "multiple values for drop_large_objects",
18099                                ));
18100                            }
18101                            if result.large_objects_handling.is_some() {
18102                                return std::result::Result::Err(A::Error::duplicate_field(
18103                                    "multiple values for `large_objects_handling`, a oneof with full ID .google.cloud.datastream.v1.OracleSourceConfig.drop_large_objects, latest field was dropLargeObjects",
18104                                ));
18105                            }
18106                            result.large_objects_handling = std::option::Option::Some(
18107                                crate::model::oracle_source_config::LargeObjectsHandling::DropLargeObjects(
18108                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>>>()?.unwrap_or_default()
18109                                ),
18110                            );
18111                        }
18112                        __FieldTag::__stream_large_objects => {
18113                            if !fields.insert(__FieldTag::__stream_large_objects) {
18114                                return std::result::Result::Err(A::Error::duplicate_field(
18115                                    "multiple values for stream_large_objects",
18116                                ));
18117                            }
18118                            if result.large_objects_handling.is_some() {
18119                                return std::result::Result::Err(A::Error::duplicate_field(
18120                                    "multiple values for `large_objects_handling`, a oneof with full ID .google.cloud.datastream.v1.OracleSourceConfig.stream_large_objects, latest field was streamLargeObjects",
18121                                ));
18122                            }
18123                            result.large_objects_handling = std::option::Option::Some(
18124                                crate::model::oracle_source_config::LargeObjectsHandling::StreamLargeObjects(
18125                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>>>()?.unwrap_or_default()
18126                                ),
18127                            );
18128                        }
18129                        __FieldTag::__log_miner => {
18130                            if !fields.insert(__FieldTag::__log_miner) {
18131                                return std::result::Result::Err(A::Error::duplicate_field(
18132                                    "multiple values for log_miner",
18133                                ));
18134                            }
18135                            if result.cdc_method.is_some() {
18136                                return std::result::Result::Err(A::Error::duplicate_field(
18137                                    "multiple values for `cdc_method`, a oneof with full ID .google.cloud.datastream.v1.OracleSourceConfig.log_miner, latest field was logMiner",
18138                                ));
18139                            }
18140                            result.cdc_method = std::option::Option::Some(
18141                                crate::model::oracle_source_config::CdcMethod::LogMiner(
18142                                    map.next_value::<std::option::Option<
18143                                        std::boxed::Box<
18144                                            crate::model::oracle_source_config::LogMiner,
18145                                        >,
18146                                    >>()?
18147                                    .unwrap_or_default(),
18148                                ),
18149                            );
18150                        }
18151                        __FieldTag::__binary_log_parser => {
18152                            if !fields.insert(__FieldTag::__binary_log_parser) {
18153                                return std::result::Result::Err(A::Error::duplicate_field(
18154                                    "multiple values for binary_log_parser",
18155                                ));
18156                            }
18157                            if result.cdc_method.is_some() {
18158                                return std::result::Result::Err(A::Error::duplicate_field(
18159                                    "multiple values for `cdc_method`, a oneof with full ID .google.cloud.datastream.v1.OracleSourceConfig.binary_log_parser, latest field was binaryLogParser",
18160                                ));
18161                            }
18162                            result.cdc_method = std::option::Option::Some(
18163                                crate::model::oracle_source_config::CdcMethod::BinaryLogParser(
18164                                    map.next_value::<std::option::Option<
18165                                        std::boxed::Box<
18166                                            crate::model::oracle_source_config::BinaryLogParser,
18167                                        >,
18168                                    >>()?
18169                                    .unwrap_or_default(),
18170                                ),
18171                            );
18172                        }
18173                        __FieldTag::Unknown(key) => {
18174                            let value = map.next_value::<serde_json::Value>()?;
18175                            result._unknown_fields.insert(key, value);
18176                        }
18177                    }
18178                }
18179                std::result::Result::Ok(result)
18180            }
18181        }
18182        deserializer.deserialize_any(Visitor)
18183    }
18184}
18185
18186#[doc(hidden)]
18187impl serde::ser::Serialize for OracleSourceConfig {
18188    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18189    where
18190        S: serde::ser::Serializer,
18191    {
18192        use serde::ser::SerializeMap;
18193        #[allow(unused_imports)]
18194        use std::option::Option::Some;
18195        let mut state = serializer.serialize_map(std::option::Option::None)?;
18196        if self.include_objects.is_some() {
18197            state.serialize_entry("includeObjects", &self.include_objects)?;
18198        }
18199        if self.exclude_objects.is_some() {
18200            state.serialize_entry("excludeObjects", &self.exclude_objects)?;
18201        }
18202        if !wkt::internal::is_default(&self.max_concurrent_cdc_tasks) {
18203            struct __With<'a>(&'a i32);
18204            impl<'a> serde::ser::Serialize for __With<'a> {
18205                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18206                where
18207                    S: serde::ser::Serializer,
18208                {
18209                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
18210                }
18211            }
18212            state.serialize_entry(
18213                "maxConcurrentCdcTasks",
18214                &__With(&self.max_concurrent_cdc_tasks),
18215            )?;
18216        }
18217        if !wkt::internal::is_default(&self.max_concurrent_backfill_tasks) {
18218            struct __With<'a>(&'a i32);
18219            impl<'a> serde::ser::Serialize for __With<'a> {
18220                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18221                where
18222                    S: serde::ser::Serializer,
18223                {
18224                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
18225                }
18226            }
18227            state.serialize_entry(
18228                "maxConcurrentBackfillTasks",
18229                &__With(&self.max_concurrent_backfill_tasks),
18230            )?;
18231        }
18232        if let Some(value) = self.drop_large_objects() {
18233            state.serialize_entry("dropLargeObjects", value)?;
18234        }
18235        if let Some(value) = self.stream_large_objects() {
18236            state.serialize_entry("streamLargeObjects", value)?;
18237        }
18238        if let Some(value) = self.log_miner() {
18239            state.serialize_entry("logMiner", value)?;
18240        }
18241        if let Some(value) = self.binary_log_parser() {
18242            state.serialize_entry("binaryLogParser", value)?;
18243        }
18244        if !self._unknown_fields.is_empty() {
18245            for (key, value) in self._unknown_fields.iter() {
18246                state.serialize_entry(key, &value)?;
18247            }
18248        }
18249        state.end()
18250    }
18251}
18252
18253impl std::fmt::Debug for OracleSourceConfig {
18254    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18255        let mut debug_struct = f.debug_struct("OracleSourceConfig");
18256        debug_struct.field("include_objects", &self.include_objects);
18257        debug_struct.field("exclude_objects", &self.exclude_objects);
18258        debug_struct.field("max_concurrent_cdc_tasks", &self.max_concurrent_cdc_tasks);
18259        debug_struct.field(
18260            "max_concurrent_backfill_tasks",
18261            &self.max_concurrent_backfill_tasks,
18262        );
18263        debug_struct.field("large_objects_handling", &self.large_objects_handling);
18264        debug_struct.field("cdc_method", &self.cdc_method);
18265        if !self._unknown_fields.is_empty() {
18266            debug_struct.field("_unknown_fields", &self._unknown_fields);
18267        }
18268        debug_struct.finish()
18269    }
18270}
18271
18272/// Defines additional types related to [OracleSourceConfig].
18273pub mod oracle_source_config {
18274    #[allow(unused_imports)]
18275    use super::*;
18276
18277    /// Configuration to drop large object values.
18278    #[derive(Clone, Default, PartialEq)]
18279    #[non_exhaustive]
18280    pub struct DropLargeObjects {
18281        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18282    }
18283
18284    impl DropLargeObjects {
18285        pub fn new() -> Self {
18286            std::default::Default::default()
18287        }
18288    }
18289
18290    impl wkt::message::Message for DropLargeObjects {
18291        fn typename() -> &'static str {
18292            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.DropLargeObjects"
18293        }
18294    }
18295
18296    #[doc(hidden)]
18297    impl<'de> serde::de::Deserialize<'de> for DropLargeObjects {
18298        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18299        where
18300            D: serde::Deserializer<'de>,
18301        {
18302            #[allow(non_camel_case_types)]
18303            #[doc(hidden)]
18304            #[derive(PartialEq, Eq, Hash)]
18305            enum __FieldTag {
18306                Unknown(std::string::String),
18307            }
18308            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
18309                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18310                where
18311                    D: serde::Deserializer<'de>,
18312                {
18313                    struct Visitor;
18314                    impl<'de> serde::de::Visitor<'de> for Visitor {
18315                        type Value = __FieldTag;
18316                        fn expecting(
18317                            &self,
18318                            formatter: &mut std::fmt::Formatter,
18319                        ) -> std::fmt::Result {
18320                            formatter.write_str("a field name for DropLargeObjects")
18321                        }
18322                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
18323                        where
18324                            E: serde::de::Error,
18325                        {
18326                            use std::result::Result::Ok;
18327                            use std::string::ToString;
18328                            Ok(__FieldTag::Unknown(value.to_string()))
18329                        }
18330                    }
18331                    deserializer.deserialize_identifier(Visitor)
18332                }
18333            }
18334            struct Visitor;
18335            impl<'de> serde::de::Visitor<'de> for Visitor {
18336                type Value = DropLargeObjects;
18337                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18338                    formatter.write_str("struct DropLargeObjects")
18339                }
18340                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
18341                where
18342                    A: serde::de::MapAccess<'de>,
18343                {
18344                    #[allow(unused_imports)]
18345                    use serde::de::Error;
18346                    use std::option::Option::Some;
18347                    let mut result = Self::Value::new();
18348                    while let Some(tag) = map.next_key::<__FieldTag>()? {
18349                        #[allow(clippy::match_single_binding)]
18350                        match tag {
18351                            __FieldTag::Unknown(key) => {
18352                                let value = map.next_value::<serde_json::Value>()?;
18353                                result._unknown_fields.insert(key, value);
18354                            }
18355                        }
18356                    }
18357                    std::result::Result::Ok(result)
18358                }
18359            }
18360            deserializer.deserialize_any(Visitor)
18361        }
18362    }
18363
18364    #[doc(hidden)]
18365    impl serde::ser::Serialize for DropLargeObjects {
18366        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18367        where
18368            S: serde::ser::Serializer,
18369        {
18370            use serde::ser::SerializeMap;
18371            #[allow(unused_imports)]
18372            use std::option::Option::Some;
18373            let mut state = serializer.serialize_map(std::option::Option::None)?;
18374            if !self._unknown_fields.is_empty() {
18375                for (key, value) in self._unknown_fields.iter() {
18376                    state.serialize_entry(key, &value)?;
18377                }
18378            }
18379            state.end()
18380        }
18381    }
18382
18383    impl std::fmt::Debug for DropLargeObjects {
18384        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18385            let mut debug_struct = f.debug_struct("DropLargeObjects");
18386            if !self._unknown_fields.is_empty() {
18387                debug_struct.field("_unknown_fields", &self._unknown_fields);
18388            }
18389            debug_struct.finish()
18390        }
18391    }
18392
18393    /// Configuration to stream large object values.
18394    #[derive(Clone, Default, PartialEq)]
18395    #[non_exhaustive]
18396    pub struct StreamLargeObjects {
18397        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18398    }
18399
18400    impl StreamLargeObjects {
18401        pub fn new() -> Self {
18402            std::default::Default::default()
18403        }
18404    }
18405
18406    impl wkt::message::Message for StreamLargeObjects {
18407        fn typename() -> &'static str {
18408            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.StreamLargeObjects"
18409        }
18410    }
18411
18412    #[doc(hidden)]
18413    impl<'de> serde::de::Deserialize<'de> for StreamLargeObjects {
18414        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18415        where
18416            D: serde::Deserializer<'de>,
18417        {
18418            #[allow(non_camel_case_types)]
18419            #[doc(hidden)]
18420            #[derive(PartialEq, Eq, Hash)]
18421            enum __FieldTag {
18422                Unknown(std::string::String),
18423            }
18424            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
18425                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18426                where
18427                    D: serde::Deserializer<'de>,
18428                {
18429                    struct Visitor;
18430                    impl<'de> serde::de::Visitor<'de> for Visitor {
18431                        type Value = __FieldTag;
18432                        fn expecting(
18433                            &self,
18434                            formatter: &mut std::fmt::Formatter,
18435                        ) -> std::fmt::Result {
18436                            formatter.write_str("a field name for StreamLargeObjects")
18437                        }
18438                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
18439                        where
18440                            E: serde::de::Error,
18441                        {
18442                            use std::result::Result::Ok;
18443                            use std::string::ToString;
18444                            Ok(__FieldTag::Unknown(value.to_string()))
18445                        }
18446                    }
18447                    deserializer.deserialize_identifier(Visitor)
18448                }
18449            }
18450            struct Visitor;
18451            impl<'de> serde::de::Visitor<'de> for Visitor {
18452                type Value = StreamLargeObjects;
18453                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18454                    formatter.write_str("struct StreamLargeObjects")
18455                }
18456                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
18457                where
18458                    A: serde::de::MapAccess<'de>,
18459                {
18460                    #[allow(unused_imports)]
18461                    use serde::de::Error;
18462                    use std::option::Option::Some;
18463                    let mut result = Self::Value::new();
18464                    while let Some(tag) = map.next_key::<__FieldTag>()? {
18465                        #[allow(clippy::match_single_binding)]
18466                        match tag {
18467                            __FieldTag::Unknown(key) => {
18468                                let value = map.next_value::<serde_json::Value>()?;
18469                                result._unknown_fields.insert(key, value);
18470                            }
18471                        }
18472                    }
18473                    std::result::Result::Ok(result)
18474                }
18475            }
18476            deserializer.deserialize_any(Visitor)
18477        }
18478    }
18479
18480    #[doc(hidden)]
18481    impl serde::ser::Serialize for StreamLargeObjects {
18482        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18483        where
18484            S: serde::ser::Serializer,
18485        {
18486            use serde::ser::SerializeMap;
18487            #[allow(unused_imports)]
18488            use std::option::Option::Some;
18489            let mut state = serializer.serialize_map(std::option::Option::None)?;
18490            if !self._unknown_fields.is_empty() {
18491                for (key, value) in self._unknown_fields.iter() {
18492                    state.serialize_entry(key, &value)?;
18493                }
18494            }
18495            state.end()
18496        }
18497    }
18498
18499    impl std::fmt::Debug for StreamLargeObjects {
18500        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18501            let mut debug_struct = f.debug_struct("StreamLargeObjects");
18502            if !self._unknown_fields.is_empty() {
18503                debug_struct.field("_unknown_fields", &self._unknown_fields);
18504            }
18505            debug_struct.finish()
18506        }
18507    }
18508
18509    /// Configuration to use LogMiner CDC method.
18510    #[derive(Clone, Default, PartialEq)]
18511    #[non_exhaustive]
18512    pub struct LogMiner {
18513        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18514    }
18515
18516    impl LogMiner {
18517        pub fn new() -> Self {
18518            std::default::Default::default()
18519        }
18520    }
18521
18522    impl wkt::message::Message for LogMiner {
18523        fn typename() -> &'static str {
18524            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.LogMiner"
18525        }
18526    }
18527
18528    #[doc(hidden)]
18529    impl<'de> serde::de::Deserialize<'de> for LogMiner {
18530        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18531        where
18532            D: serde::Deserializer<'de>,
18533        {
18534            #[allow(non_camel_case_types)]
18535            #[doc(hidden)]
18536            #[derive(PartialEq, Eq, Hash)]
18537            enum __FieldTag {
18538                Unknown(std::string::String),
18539            }
18540            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
18541                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18542                where
18543                    D: serde::Deserializer<'de>,
18544                {
18545                    struct Visitor;
18546                    impl<'de> serde::de::Visitor<'de> for Visitor {
18547                        type Value = __FieldTag;
18548                        fn expecting(
18549                            &self,
18550                            formatter: &mut std::fmt::Formatter,
18551                        ) -> std::fmt::Result {
18552                            formatter.write_str("a field name for LogMiner")
18553                        }
18554                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
18555                        where
18556                            E: serde::de::Error,
18557                        {
18558                            use std::result::Result::Ok;
18559                            use std::string::ToString;
18560                            Ok(__FieldTag::Unknown(value.to_string()))
18561                        }
18562                    }
18563                    deserializer.deserialize_identifier(Visitor)
18564                }
18565            }
18566            struct Visitor;
18567            impl<'de> serde::de::Visitor<'de> for Visitor {
18568                type Value = LogMiner;
18569                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18570                    formatter.write_str("struct LogMiner")
18571                }
18572                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
18573                where
18574                    A: serde::de::MapAccess<'de>,
18575                {
18576                    #[allow(unused_imports)]
18577                    use serde::de::Error;
18578                    use std::option::Option::Some;
18579                    let mut result = Self::Value::new();
18580                    while let Some(tag) = map.next_key::<__FieldTag>()? {
18581                        #[allow(clippy::match_single_binding)]
18582                        match tag {
18583                            __FieldTag::Unknown(key) => {
18584                                let value = map.next_value::<serde_json::Value>()?;
18585                                result._unknown_fields.insert(key, value);
18586                            }
18587                        }
18588                    }
18589                    std::result::Result::Ok(result)
18590                }
18591            }
18592            deserializer.deserialize_any(Visitor)
18593        }
18594    }
18595
18596    #[doc(hidden)]
18597    impl serde::ser::Serialize for LogMiner {
18598        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18599        where
18600            S: serde::ser::Serializer,
18601        {
18602            use serde::ser::SerializeMap;
18603            #[allow(unused_imports)]
18604            use std::option::Option::Some;
18605            let mut state = serializer.serialize_map(std::option::Option::None)?;
18606            if !self._unknown_fields.is_empty() {
18607                for (key, value) in self._unknown_fields.iter() {
18608                    state.serialize_entry(key, &value)?;
18609                }
18610            }
18611            state.end()
18612        }
18613    }
18614
18615    impl std::fmt::Debug for LogMiner {
18616        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18617            let mut debug_struct = f.debug_struct("LogMiner");
18618            if !self._unknown_fields.is_empty() {
18619                debug_struct.field("_unknown_fields", &self._unknown_fields);
18620            }
18621            debug_struct.finish()
18622        }
18623    }
18624
18625    /// Configuration to use Binary Log Parser CDC technique.
18626    #[derive(Clone, Default, PartialEq)]
18627    #[non_exhaustive]
18628    pub struct BinaryLogParser {
18629        /// Configuration to specify how the log file should be accessed.
18630        pub log_file_access: std::option::Option<
18631            crate::model::oracle_source_config::binary_log_parser::LogFileAccess,
18632        >,
18633
18634        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18635    }
18636
18637    impl BinaryLogParser {
18638        pub fn new() -> Self {
18639            std::default::Default::default()
18640        }
18641
18642        /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access].
18643        ///
18644        /// Note that all the setters affecting `log_file_access` are mutually
18645        /// exclusive.
18646        pub fn set_log_file_access<
18647            T: std::convert::Into<
18648                    std::option::Option<
18649                        crate::model::oracle_source_config::binary_log_parser::LogFileAccess,
18650                    >,
18651                >,
18652        >(
18653            mut self,
18654            v: T,
18655        ) -> Self {
18656            self.log_file_access = v.into();
18657            self
18658        }
18659
18660        /// The value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
18661        /// if it holds a `OracleAsmLogFileAccess`, `None` if the field is not set or
18662        /// holds a different branch.
18663        pub fn oracle_asm_log_file_access(
18664            &self,
18665        ) -> std::option::Option<
18666            &std::boxed::Box<
18667                crate::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess,
18668            >,
18669        > {
18670            #[allow(unreachable_patterns)]
18671            self.log_file_access.as_ref().and_then(|v| match v {
18672                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::OracleAsmLogFileAccess(v) => std::option::Option::Some(v),
18673                _ => std::option::Option::None,
18674            })
18675        }
18676
18677        /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
18678        /// to hold a `OracleAsmLogFileAccess`.
18679        ///
18680        /// Note that all the setters affecting `log_file_access` are
18681        /// mutually exclusive.
18682        pub fn set_oracle_asm_log_file_access<T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess>>>(mut self, v: T) -> Self{
18683            self.log_file_access = std::option::Option::Some(
18684                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::OracleAsmLogFileAccess(
18685                    v.into()
18686                )
18687            );
18688            self
18689        }
18690
18691        /// The value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
18692        /// if it holds a `LogFileDirectories`, `None` if the field is not set or
18693        /// holds a different branch.
18694        pub fn log_file_directories(
18695            &self,
18696        ) -> std::option::Option<
18697            &std::boxed::Box<
18698                crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
18699            >,
18700        > {
18701            #[allow(unreachable_patterns)]
18702            self.log_file_access.as_ref().and_then(|v| match v {
18703                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::LogFileDirectories(v) => std::option::Option::Some(v),
18704                _ => std::option::Option::None,
18705            })
18706        }
18707
18708        /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
18709        /// to hold a `LogFileDirectories`.
18710        ///
18711        /// Note that all the setters affecting `log_file_access` are
18712        /// mutually exclusive.
18713        pub fn set_log_file_directories<
18714            T: std::convert::Into<
18715                    std::boxed::Box<
18716                        crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
18717                    >,
18718                >,
18719        >(
18720            mut self,
18721            v: T,
18722        ) -> Self {
18723            self.log_file_access = std::option::Option::Some(
18724                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::LogFileDirectories(
18725                    v.into()
18726                )
18727            );
18728            self
18729        }
18730    }
18731
18732    impl wkt::message::Message for BinaryLogParser {
18733        fn typename() -> &'static str {
18734            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser"
18735        }
18736    }
18737
18738    #[doc(hidden)]
18739    impl<'de> serde::de::Deserialize<'de> for BinaryLogParser {
18740        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18741        where
18742            D: serde::Deserializer<'de>,
18743        {
18744            #[allow(non_camel_case_types)]
18745            #[doc(hidden)]
18746            #[derive(PartialEq, Eq, Hash)]
18747            enum __FieldTag {
18748                __oracle_asm_log_file_access,
18749                __log_file_directories,
18750                Unknown(std::string::String),
18751            }
18752            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
18753                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18754                where
18755                    D: serde::Deserializer<'de>,
18756                {
18757                    struct Visitor;
18758                    impl<'de> serde::de::Visitor<'de> for Visitor {
18759                        type Value = __FieldTag;
18760                        fn expecting(
18761                            &self,
18762                            formatter: &mut std::fmt::Formatter,
18763                        ) -> std::fmt::Result {
18764                            formatter.write_str("a field name for BinaryLogParser")
18765                        }
18766                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
18767                        where
18768                            E: serde::de::Error,
18769                        {
18770                            use std::result::Result::Ok;
18771                            use std::string::ToString;
18772                            match value {
18773                                "oracleAsmLogFileAccess" => {
18774                                    Ok(__FieldTag::__oracle_asm_log_file_access)
18775                                }
18776                                "oracle_asm_log_file_access" => {
18777                                    Ok(__FieldTag::__oracle_asm_log_file_access)
18778                                }
18779                                "logFileDirectories" => Ok(__FieldTag::__log_file_directories),
18780                                "log_file_directories" => Ok(__FieldTag::__log_file_directories),
18781                                _ => Ok(__FieldTag::Unknown(value.to_string())),
18782                            }
18783                        }
18784                    }
18785                    deserializer.deserialize_identifier(Visitor)
18786                }
18787            }
18788            struct Visitor;
18789            impl<'de> serde::de::Visitor<'de> for Visitor {
18790                type Value = BinaryLogParser;
18791                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18792                    formatter.write_str("struct BinaryLogParser")
18793                }
18794                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
18795                where
18796                    A: serde::de::MapAccess<'de>,
18797                {
18798                    #[allow(unused_imports)]
18799                    use serde::de::Error;
18800                    use std::option::Option::Some;
18801                    let mut fields = std::collections::HashSet::new();
18802                    let mut result = Self::Value::new();
18803                    while let Some(tag) = map.next_key::<__FieldTag>()? {
18804                        #[allow(clippy::match_single_binding)]
18805                        match tag {
18806                            __FieldTag::__oracle_asm_log_file_access => {
18807                                if !fields.insert(__FieldTag::__oracle_asm_log_file_access) {
18808                                    return std::result::Result::Err(A::Error::duplicate_field(
18809                                        "multiple values for oracle_asm_log_file_access",
18810                                    ));
18811                                }
18812                                if result.log_file_access.is_some() {
18813                                    return std::result::Result::Err(A::Error::duplicate_field(
18814                                        "multiple values for `log_file_access`, a oneof with full ID .google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser.oracle_asm_log_file_access, latest field was oracleAsmLogFileAccess",
18815                                    ));
18816                                }
18817                                result.log_file_access = std::option::Option::Some(
18818                                    crate::model::oracle_source_config::binary_log_parser::LogFileAccess::OracleAsmLogFileAccess(
18819                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess>>>()?.unwrap_or_default()
18820                                    ),
18821                                );
18822                            }
18823                            __FieldTag::__log_file_directories => {
18824                                if !fields.insert(__FieldTag::__log_file_directories) {
18825                                    return std::result::Result::Err(A::Error::duplicate_field(
18826                                        "multiple values for log_file_directories",
18827                                    ));
18828                                }
18829                                if result.log_file_access.is_some() {
18830                                    return std::result::Result::Err(A::Error::duplicate_field(
18831                                        "multiple values for `log_file_access`, a oneof with full ID .google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser.log_file_directories, latest field was logFileDirectories",
18832                                    ));
18833                                }
18834                                result.log_file_access = std::option::Option::Some(
18835                                    crate::model::oracle_source_config::binary_log_parser::LogFileAccess::LogFileDirectories(
18836                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::oracle_source_config::binary_log_parser::LogFileDirectories>>>()?.unwrap_or_default()
18837                                    ),
18838                                );
18839                            }
18840                            __FieldTag::Unknown(key) => {
18841                                let value = map.next_value::<serde_json::Value>()?;
18842                                result._unknown_fields.insert(key, value);
18843                            }
18844                        }
18845                    }
18846                    std::result::Result::Ok(result)
18847                }
18848            }
18849            deserializer.deserialize_any(Visitor)
18850        }
18851    }
18852
18853    #[doc(hidden)]
18854    impl serde::ser::Serialize for BinaryLogParser {
18855        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18856        where
18857            S: serde::ser::Serializer,
18858        {
18859            use serde::ser::SerializeMap;
18860            #[allow(unused_imports)]
18861            use std::option::Option::Some;
18862            let mut state = serializer.serialize_map(std::option::Option::None)?;
18863            if let Some(value) = self.oracle_asm_log_file_access() {
18864                state.serialize_entry("oracleAsmLogFileAccess", value)?;
18865            }
18866            if let Some(value) = self.log_file_directories() {
18867                state.serialize_entry("logFileDirectories", value)?;
18868            }
18869            if !self._unknown_fields.is_empty() {
18870                for (key, value) in self._unknown_fields.iter() {
18871                    state.serialize_entry(key, &value)?;
18872                }
18873            }
18874            state.end()
18875        }
18876    }
18877
18878    impl std::fmt::Debug for BinaryLogParser {
18879        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18880            let mut debug_struct = f.debug_struct("BinaryLogParser");
18881            debug_struct.field("log_file_access", &self.log_file_access);
18882            if !self._unknown_fields.is_empty() {
18883                debug_struct.field("_unknown_fields", &self._unknown_fields);
18884            }
18885            debug_struct.finish()
18886        }
18887    }
18888
18889    /// Defines additional types related to [BinaryLogParser].
18890    pub mod binary_log_parser {
18891        #[allow(unused_imports)]
18892        use super::*;
18893
18894        /// Configuration to use Oracle ASM to access the log files.
18895        #[derive(Clone, Default, PartialEq)]
18896        #[non_exhaustive]
18897        pub struct OracleAsmLogFileAccess {
18898            _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18899        }
18900
18901        impl OracleAsmLogFileAccess {
18902            pub fn new() -> Self {
18903                std::default::Default::default()
18904            }
18905        }
18906
18907        impl wkt::message::Message for OracleAsmLogFileAccess {
18908            fn typename() -> &'static str {
18909                "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser.OracleAsmLogFileAccess"
18910            }
18911        }
18912
18913        #[doc(hidden)]
18914        impl<'de> serde::de::Deserialize<'de> for OracleAsmLogFileAccess {
18915            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18916            where
18917                D: serde::Deserializer<'de>,
18918            {
18919                #[allow(non_camel_case_types)]
18920                #[doc(hidden)]
18921                #[derive(PartialEq, Eq, Hash)]
18922                enum __FieldTag {
18923                    Unknown(std::string::String),
18924                }
18925                impl<'de> serde::de::Deserialize<'de> for __FieldTag {
18926                    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18927                    where
18928                        D: serde::Deserializer<'de>,
18929                    {
18930                        struct Visitor;
18931                        impl<'de> serde::de::Visitor<'de> for Visitor {
18932                            type Value = __FieldTag;
18933                            fn expecting(
18934                                &self,
18935                                formatter: &mut std::fmt::Formatter,
18936                            ) -> std::fmt::Result {
18937                                formatter.write_str("a field name for OracleAsmLogFileAccess")
18938                            }
18939                            fn visit_str<E>(
18940                                self,
18941                                value: &str,
18942                            ) -> std::result::Result<Self::Value, E>
18943                            where
18944                                E: serde::de::Error,
18945                            {
18946                                use std::result::Result::Ok;
18947                                use std::string::ToString;
18948                                Ok(__FieldTag::Unknown(value.to_string()))
18949                            }
18950                        }
18951                        deserializer.deserialize_identifier(Visitor)
18952                    }
18953                }
18954                struct Visitor;
18955                impl<'de> serde::de::Visitor<'de> for Visitor {
18956                    type Value = OracleAsmLogFileAccess;
18957                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18958                        formatter.write_str("struct OracleAsmLogFileAccess")
18959                    }
18960                    fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
18961                    where
18962                        A: serde::de::MapAccess<'de>,
18963                    {
18964                        #[allow(unused_imports)]
18965                        use serde::de::Error;
18966                        use std::option::Option::Some;
18967                        let mut result = Self::Value::new();
18968                        while let Some(tag) = map.next_key::<__FieldTag>()? {
18969                            #[allow(clippy::match_single_binding)]
18970                            match tag {
18971                                __FieldTag::Unknown(key) => {
18972                                    let value = map.next_value::<serde_json::Value>()?;
18973                                    result._unknown_fields.insert(key, value);
18974                                }
18975                            }
18976                        }
18977                        std::result::Result::Ok(result)
18978                    }
18979                }
18980                deserializer.deserialize_any(Visitor)
18981            }
18982        }
18983
18984        #[doc(hidden)]
18985        impl serde::ser::Serialize for OracleAsmLogFileAccess {
18986            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18987            where
18988                S: serde::ser::Serializer,
18989            {
18990                use serde::ser::SerializeMap;
18991                #[allow(unused_imports)]
18992                use std::option::Option::Some;
18993                let mut state = serializer.serialize_map(std::option::Option::None)?;
18994                if !self._unknown_fields.is_empty() {
18995                    for (key, value) in self._unknown_fields.iter() {
18996                        state.serialize_entry(key, &value)?;
18997                    }
18998                }
18999                state.end()
19000            }
19001        }
19002
19003        impl std::fmt::Debug for OracleAsmLogFileAccess {
19004            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19005                let mut debug_struct = f.debug_struct("OracleAsmLogFileAccess");
19006                if !self._unknown_fields.is_empty() {
19007                    debug_struct.field("_unknown_fields", &self._unknown_fields);
19008                }
19009                debug_struct.finish()
19010            }
19011        }
19012
19013        /// Configuration to specify the Oracle directories to access the log files.
19014        #[derive(Clone, Default, PartialEq)]
19015        #[non_exhaustive]
19016        pub struct LogFileDirectories {
19017            /// Required. Oracle directory for online logs.
19018            pub online_log_directory: std::string::String,
19019
19020            /// Required. Oracle directory for archived logs.
19021            pub archived_log_directory: std::string::String,
19022
19023            _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19024        }
19025
19026        impl LogFileDirectories {
19027            pub fn new() -> Self {
19028                std::default::Default::default()
19029            }
19030
19031            /// Sets the value of [online_log_directory][crate::model::oracle_source_config::binary_log_parser::LogFileDirectories::online_log_directory].
19032            pub fn set_online_log_directory<T: std::convert::Into<std::string::String>>(
19033                mut self,
19034                v: T,
19035            ) -> Self {
19036                self.online_log_directory = v.into();
19037                self
19038            }
19039
19040            /// Sets the value of [archived_log_directory][crate::model::oracle_source_config::binary_log_parser::LogFileDirectories::archived_log_directory].
19041            pub fn set_archived_log_directory<T: std::convert::Into<std::string::String>>(
19042                mut self,
19043                v: T,
19044            ) -> Self {
19045                self.archived_log_directory = v.into();
19046                self
19047            }
19048        }
19049
19050        impl wkt::message::Message for LogFileDirectories {
19051            fn typename() -> &'static str {
19052                "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser.LogFileDirectories"
19053            }
19054        }
19055
19056        #[doc(hidden)]
19057        impl<'de> serde::de::Deserialize<'de> for LogFileDirectories {
19058            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19059            where
19060                D: serde::Deserializer<'de>,
19061            {
19062                #[allow(non_camel_case_types)]
19063                #[doc(hidden)]
19064                #[derive(PartialEq, Eq, Hash)]
19065                enum __FieldTag {
19066                    __online_log_directory,
19067                    __archived_log_directory,
19068                    Unknown(std::string::String),
19069                }
19070                impl<'de> serde::de::Deserialize<'de> for __FieldTag {
19071                    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19072                    where
19073                        D: serde::Deserializer<'de>,
19074                    {
19075                        struct Visitor;
19076                        impl<'de> serde::de::Visitor<'de> for Visitor {
19077                            type Value = __FieldTag;
19078                            fn expecting(
19079                                &self,
19080                                formatter: &mut std::fmt::Formatter,
19081                            ) -> std::fmt::Result {
19082                                formatter.write_str("a field name for LogFileDirectories")
19083                            }
19084                            fn visit_str<E>(
19085                                self,
19086                                value: &str,
19087                            ) -> std::result::Result<Self::Value, E>
19088                            where
19089                                E: serde::de::Error,
19090                            {
19091                                use std::result::Result::Ok;
19092                                use std::string::ToString;
19093                                match value {
19094                                    "onlineLogDirectory" => Ok(__FieldTag::__online_log_directory),
19095                                    "online_log_directory" => {
19096                                        Ok(__FieldTag::__online_log_directory)
19097                                    }
19098                                    "archivedLogDirectory" => {
19099                                        Ok(__FieldTag::__archived_log_directory)
19100                                    }
19101                                    "archived_log_directory" => {
19102                                        Ok(__FieldTag::__archived_log_directory)
19103                                    }
19104                                    _ => Ok(__FieldTag::Unknown(value.to_string())),
19105                                }
19106                            }
19107                        }
19108                        deserializer.deserialize_identifier(Visitor)
19109                    }
19110                }
19111                struct Visitor;
19112                impl<'de> serde::de::Visitor<'de> for Visitor {
19113                    type Value = LogFileDirectories;
19114                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19115                        formatter.write_str("struct LogFileDirectories")
19116                    }
19117                    fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
19118                    where
19119                        A: serde::de::MapAccess<'de>,
19120                    {
19121                        #[allow(unused_imports)]
19122                        use serde::de::Error;
19123                        use std::option::Option::Some;
19124                        let mut fields = std::collections::HashSet::new();
19125                        let mut result = Self::Value::new();
19126                        while let Some(tag) = map.next_key::<__FieldTag>()? {
19127                            #[allow(clippy::match_single_binding)]
19128                            match tag {
19129                                __FieldTag::__online_log_directory => {
19130                                    if !fields.insert(__FieldTag::__online_log_directory) {
19131                                        return std::result::Result::Err(
19132                                            A::Error::duplicate_field(
19133                                                "multiple values for online_log_directory",
19134                                            ),
19135                                        );
19136                                    }
19137                                    result.online_log_directory = map
19138                                        .next_value::<std::option::Option<std::string::String>>()?
19139                                        .unwrap_or_default();
19140                                }
19141                                __FieldTag::__archived_log_directory => {
19142                                    if !fields.insert(__FieldTag::__archived_log_directory) {
19143                                        return std::result::Result::Err(
19144                                            A::Error::duplicate_field(
19145                                                "multiple values for archived_log_directory",
19146                                            ),
19147                                        );
19148                                    }
19149                                    result.archived_log_directory = map
19150                                        .next_value::<std::option::Option<std::string::String>>()?
19151                                        .unwrap_or_default();
19152                                }
19153                                __FieldTag::Unknown(key) => {
19154                                    let value = map.next_value::<serde_json::Value>()?;
19155                                    result._unknown_fields.insert(key, value);
19156                                }
19157                            }
19158                        }
19159                        std::result::Result::Ok(result)
19160                    }
19161                }
19162                deserializer.deserialize_any(Visitor)
19163            }
19164        }
19165
19166        #[doc(hidden)]
19167        impl serde::ser::Serialize for LogFileDirectories {
19168            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19169            where
19170                S: serde::ser::Serializer,
19171            {
19172                use serde::ser::SerializeMap;
19173                #[allow(unused_imports)]
19174                use std::option::Option::Some;
19175                let mut state = serializer.serialize_map(std::option::Option::None)?;
19176                if !self.online_log_directory.is_empty() {
19177                    state.serialize_entry("onlineLogDirectory", &self.online_log_directory)?;
19178                }
19179                if !self.archived_log_directory.is_empty() {
19180                    state.serialize_entry("archivedLogDirectory", &self.archived_log_directory)?;
19181                }
19182                if !self._unknown_fields.is_empty() {
19183                    for (key, value) in self._unknown_fields.iter() {
19184                        state.serialize_entry(key, &value)?;
19185                    }
19186                }
19187                state.end()
19188            }
19189        }
19190
19191        impl std::fmt::Debug for LogFileDirectories {
19192            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19193                let mut debug_struct = f.debug_struct("LogFileDirectories");
19194                debug_struct.field("online_log_directory", &self.online_log_directory);
19195                debug_struct.field("archived_log_directory", &self.archived_log_directory);
19196                if !self._unknown_fields.is_empty() {
19197                    debug_struct.field("_unknown_fields", &self._unknown_fields);
19198                }
19199                debug_struct.finish()
19200            }
19201        }
19202
19203        /// Configuration to specify how the log file should be accessed.
19204        #[derive(Clone, Debug, PartialEq)]
19205        #[non_exhaustive]
19206        pub enum LogFileAccess {
19207            /// Use Oracle ASM.
19208            OracleAsmLogFileAccess(
19209                std::boxed::Box<
19210                    crate::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess,
19211                >,
19212            ),
19213            /// Use Oracle directories.
19214            LogFileDirectories(
19215                std::boxed::Box<
19216                    crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
19217                >,
19218            ),
19219        }
19220    }
19221
19222    /// The configuration for handle Oracle large objects.
19223    #[derive(Clone, Debug, PartialEq)]
19224    #[non_exhaustive]
19225    pub enum LargeObjectsHandling {
19226        /// Drop large object values.
19227        DropLargeObjects(std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>),
19228        /// Stream large object values.
19229        StreamLargeObjects(std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>),
19230    }
19231
19232    /// Configuration to select the CDC method.
19233    #[derive(Clone, Debug, PartialEq)]
19234    #[non_exhaustive]
19235    pub enum CdcMethod {
19236        /// Use LogMiner.
19237        LogMiner(std::boxed::Box<crate::model::oracle_source_config::LogMiner>),
19238        /// Use Binary Log Parser.
19239        BinaryLogParser(std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>),
19240    }
19241}
19242
19243/// PostgreSQL Column.
19244#[derive(Clone, Default, PartialEq)]
19245#[non_exhaustive]
19246pub struct PostgresqlColumn {
19247    /// Column name.
19248    pub column: std::string::String,
19249
19250    /// The PostgreSQL data type.
19251    pub data_type: std::string::String,
19252
19253    /// Column length.
19254    pub length: i32,
19255
19256    /// Column precision.
19257    pub precision: i32,
19258
19259    /// Column scale.
19260    pub scale: i32,
19261
19262    /// Whether or not the column represents a primary key.
19263    pub primary_key: bool,
19264
19265    /// Whether or not the column can accept a null value.
19266    pub nullable: bool,
19267
19268    /// The ordinal position of the column in the table.
19269    pub ordinal_position: i32,
19270
19271    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19272}
19273
19274impl PostgresqlColumn {
19275    pub fn new() -> Self {
19276        std::default::Default::default()
19277    }
19278
19279    /// Sets the value of [column][crate::model::PostgresqlColumn::column].
19280    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19281        self.column = v.into();
19282        self
19283    }
19284
19285    /// Sets the value of [data_type][crate::model::PostgresqlColumn::data_type].
19286    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19287        self.data_type = v.into();
19288        self
19289    }
19290
19291    /// Sets the value of [length][crate::model::PostgresqlColumn::length].
19292    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19293        self.length = v.into();
19294        self
19295    }
19296
19297    /// Sets the value of [precision][crate::model::PostgresqlColumn::precision].
19298    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19299        self.precision = v.into();
19300        self
19301    }
19302
19303    /// Sets the value of [scale][crate::model::PostgresqlColumn::scale].
19304    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19305        self.scale = v.into();
19306        self
19307    }
19308
19309    /// Sets the value of [primary_key][crate::model::PostgresqlColumn::primary_key].
19310    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
19311        self.primary_key = v.into();
19312        self
19313    }
19314
19315    /// Sets the value of [nullable][crate::model::PostgresqlColumn::nullable].
19316    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
19317        self.nullable = v.into();
19318        self
19319    }
19320
19321    /// Sets the value of [ordinal_position][crate::model::PostgresqlColumn::ordinal_position].
19322    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19323        self.ordinal_position = v.into();
19324        self
19325    }
19326}
19327
19328impl wkt::message::Message for PostgresqlColumn {
19329    fn typename() -> &'static str {
19330        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlColumn"
19331    }
19332}
19333
19334#[doc(hidden)]
19335impl<'de> serde::de::Deserialize<'de> for PostgresqlColumn {
19336    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19337    where
19338        D: serde::Deserializer<'de>,
19339    {
19340        #[allow(non_camel_case_types)]
19341        #[doc(hidden)]
19342        #[derive(PartialEq, Eq, Hash)]
19343        enum __FieldTag {
19344            __column,
19345            __data_type,
19346            __length,
19347            __precision,
19348            __scale,
19349            __primary_key,
19350            __nullable,
19351            __ordinal_position,
19352            Unknown(std::string::String),
19353        }
19354        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
19355            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19356            where
19357                D: serde::Deserializer<'de>,
19358            {
19359                struct Visitor;
19360                impl<'de> serde::de::Visitor<'de> for Visitor {
19361                    type Value = __FieldTag;
19362                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19363                        formatter.write_str("a field name for PostgresqlColumn")
19364                    }
19365                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
19366                    where
19367                        E: serde::de::Error,
19368                    {
19369                        use std::result::Result::Ok;
19370                        use std::string::ToString;
19371                        match value {
19372                            "column" => Ok(__FieldTag::__column),
19373                            "dataType" => Ok(__FieldTag::__data_type),
19374                            "data_type" => Ok(__FieldTag::__data_type),
19375                            "length" => Ok(__FieldTag::__length),
19376                            "precision" => Ok(__FieldTag::__precision),
19377                            "scale" => Ok(__FieldTag::__scale),
19378                            "primaryKey" => Ok(__FieldTag::__primary_key),
19379                            "primary_key" => Ok(__FieldTag::__primary_key),
19380                            "nullable" => Ok(__FieldTag::__nullable),
19381                            "ordinalPosition" => Ok(__FieldTag::__ordinal_position),
19382                            "ordinal_position" => Ok(__FieldTag::__ordinal_position),
19383                            _ => Ok(__FieldTag::Unknown(value.to_string())),
19384                        }
19385                    }
19386                }
19387                deserializer.deserialize_identifier(Visitor)
19388            }
19389        }
19390        struct Visitor;
19391        impl<'de> serde::de::Visitor<'de> for Visitor {
19392            type Value = PostgresqlColumn;
19393            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19394                formatter.write_str("struct PostgresqlColumn")
19395            }
19396            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
19397            where
19398                A: serde::de::MapAccess<'de>,
19399            {
19400                #[allow(unused_imports)]
19401                use serde::de::Error;
19402                use std::option::Option::Some;
19403                let mut fields = std::collections::HashSet::new();
19404                let mut result = Self::Value::new();
19405                while let Some(tag) = map.next_key::<__FieldTag>()? {
19406                    #[allow(clippy::match_single_binding)]
19407                    match tag {
19408                        __FieldTag::__column => {
19409                            if !fields.insert(__FieldTag::__column) {
19410                                return std::result::Result::Err(A::Error::duplicate_field(
19411                                    "multiple values for column",
19412                                ));
19413                            }
19414                            result.column = map
19415                                .next_value::<std::option::Option<std::string::String>>()?
19416                                .unwrap_or_default();
19417                        }
19418                        __FieldTag::__data_type => {
19419                            if !fields.insert(__FieldTag::__data_type) {
19420                                return std::result::Result::Err(A::Error::duplicate_field(
19421                                    "multiple values for data_type",
19422                                ));
19423                            }
19424                            result.data_type = map
19425                                .next_value::<std::option::Option<std::string::String>>()?
19426                                .unwrap_or_default();
19427                        }
19428                        __FieldTag::__length => {
19429                            if !fields.insert(__FieldTag::__length) {
19430                                return std::result::Result::Err(A::Error::duplicate_field(
19431                                    "multiple values for length",
19432                                ));
19433                            }
19434                            struct __With(std::option::Option<i32>);
19435                            impl<'de> serde::de::Deserialize<'de> for __With {
19436                                fn deserialize<D>(
19437                                    deserializer: D,
19438                                ) -> std::result::Result<Self, D::Error>
19439                                where
19440                                    D: serde::de::Deserializer<'de>,
19441                                {
19442                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
19443                                }
19444                            }
19445                            result.length = map.next_value::<__With>()?.0.unwrap_or_default();
19446                        }
19447                        __FieldTag::__precision => {
19448                            if !fields.insert(__FieldTag::__precision) {
19449                                return std::result::Result::Err(A::Error::duplicate_field(
19450                                    "multiple values for precision",
19451                                ));
19452                            }
19453                            struct __With(std::option::Option<i32>);
19454                            impl<'de> serde::de::Deserialize<'de> for __With {
19455                                fn deserialize<D>(
19456                                    deserializer: D,
19457                                ) -> std::result::Result<Self, D::Error>
19458                                where
19459                                    D: serde::de::Deserializer<'de>,
19460                                {
19461                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
19462                                }
19463                            }
19464                            result.precision = map.next_value::<__With>()?.0.unwrap_or_default();
19465                        }
19466                        __FieldTag::__scale => {
19467                            if !fields.insert(__FieldTag::__scale) {
19468                                return std::result::Result::Err(A::Error::duplicate_field(
19469                                    "multiple values for scale",
19470                                ));
19471                            }
19472                            struct __With(std::option::Option<i32>);
19473                            impl<'de> serde::de::Deserialize<'de> for __With {
19474                                fn deserialize<D>(
19475                                    deserializer: D,
19476                                ) -> std::result::Result<Self, D::Error>
19477                                where
19478                                    D: serde::de::Deserializer<'de>,
19479                                {
19480                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
19481                                }
19482                            }
19483                            result.scale = map.next_value::<__With>()?.0.unwrap_or_default();
19484                        }
19485                        __FieldTag::__primary_key => {
19486                            if !fields.insert(__FieldTag::__primary_key) {
19487                                return std::result::Result::Err(A::Error::duplicate_field(
19488                                    "multiple values for primary_key",
19489                                ));
19490                            }
19491                            result.primary_key = map
19492                                .next_value::<std::option::Option<bool>>()?
19493                                .unwrap_or_default();
19494                        }
19495                        __FieldTag::__nullable => {
19496                            if !fields.insert(__FieldTag::__nullable) {
19497                                return std::result::Result::Err(A::Error::duplicate_field(
19498                                    "multiple values for nullable",
19499                                ));
19500                            }
19501                            result.nullable = map
19502                                .next_value::<std::option::Option<bool>>()?
19503                                .unwrap_or_default();
19504                        }
19505                        __FieldTag::__ordinal_position => {
19506                            if !fields.insert(__FieldTag::__ordinal_position) {
19507                                return std::result::Result::Err(A::Error::duplicate_field(
19508                                    "multiple values for ordinal_position",
19509                                ));
19510                            }
19511                            struct __With(std::option::Option<i32>);
19512                            impl<'de> serde::de::Deserialize<'de> for __With {
19513                                fn deserialize<D>(
19514                                    deserializer: D,
19515                                ) -> std::result::Result<Self, D::Error>
19516                                where
19517                                    D: serde::de::Deserializer<'de>,
19518                                {
19519                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
19520                                }
19521                            }
19522                            result.ordinal_position =
19523                                map.next_value::<__With>()?.0.unwrap_or_default();
19524                        }
19525                        __FieldTag::Unknown(key) => {
19526                            let value = map.next_value::<serde_json::Value>()?;
19527                            result._unknown_fields.insert(key, value);
19528                        }
19529                    }
19530                }
19531                std::result::Result::Ok(result)
19532            }
19533        }
19534        deserializer.deserialize_any(Visitor)
19535    }
19536}
19537
19538#[doc(hidden)]
19539impl serde::ser::Serialize for PostgresqlColumn {
19540    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19541    where
19542        S: serde::ser::Serializer,
19543    {
19544        use serde::ser::SerializeMap;
19545        #[allow(unused_imports)]
19546        use std::option::Option::Some;
19547        let mut state = serializer.serialize_map(std::option::Option::None)?;
19548        if !self.column.is_empty() {
19549            state.serialize_entry("column", &self.column)?;
19550        }
19551        if !self.data_type.is_empty() {
19552            state.serialize_entry("dataType", &self.data_type)?;
19553        }
19554        if !wkt::internal::is_default(&self.length) {
19555            struct __With<'a>(&'a i32);
19556            impl<'a> serde::ser::Serialize for __With<'a> {
19557                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19558                where
19559                    S: serde::ser::Serializer,
19560                {
19561                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
19562                }
19563            }
19564            state.serialize_entry("length", &__With(&self.length))?;
19565        }
19566        if !wkt::internal::is_default(&self.precision) {
19567            struct __With<'a>(&'a i32);
19568            impl<'a> serde::ser::Serialize for __With<'a> {
19569                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19570                where
19571                    S: serde::ser::Serializer,
19572                {
19573                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
19574                }
19575            }
19576            state.serialize_entry("precision", &__With(&self.precision))?;
19577        }
19578        if !wkt::internal::is_default(&self.scale) {
19579            struct __With<'a>(&'a i32);
19580            impl<'a> serde::ser::Serialize for __With<'a> {
19581                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19582                where
19583                    S: serde::ser::Serializer,
19584                {
19585                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
19586                }
19587            }
19588            state.serialize_entry("scale", &__With(&self.scale))?;
19589        }
19590        if !wkt::internal::is_default(&self.primary_key) {
19591            state.serialize_entry("primaryKey", &self.primary_key)?;
19592        }
19593        if !wkt::internal::is_default(&self.nullable) {
19594            state.serialize_entry("nullable", &self.nullable)?;
19595        }
19596        if !wkt::internal::is_default(&self.ordinal_position) {
19597            struct __With<'a>(&'a i32);
19598            impl<'a> serde::ser::Serialize for __With<'a> {
19599                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19600                where
19601                    S: serde::ser::Serializer,
19602                {
19603                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
19604                }
19605            }
19606            state.serialize_entry("ordinalPosition", &__With(&self.ordinal_position))?;
19607        }
19608        if !self._unknown_fields.is_empty() {
19609            for (key, value) in self._unknown_fields.iter() {
19610                state.serialize_entry(key, &value)?;
19611            }
19612        }
19613        state.end()
19614    }
19615}
19616
19617impl std::fmt::Debug for PostgresqlColumn {
19618    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19619        let mut debug_struct = f.debug_struct("PostgresqlColumn");
19620        debug_struct.field("column", &self.column);
19621        debug_struct.field("data_type", &self.data_type);
19622        debug_struct.field("length", &self.length);
19623        debug_struct.field("precision", &self.precision);
19624        debug_struct.field("scale", &self.scale);
19625        debug_struct.field("primary_key", &self.primary_key);
19626        debug_struct.field("nullable", &self.nullable);
19627        debug_struct.field("ordinal_position", &self.ordinal_position);
19628        if !self._unknown_fields.is_empty() {
19629            debug_struct.field("_unknown_fields", &self._unknown_fields);
19630        }
19631        debug_struct.finish()
19632    }
19633}
19634
19635/// PostgreSQL table.
19636#[derive(Clone, Default, PartialEq)]
19637#[non_exhaustive]
19638pub struct PostgresqlTable {
19639    /// Table name.
19640    pub table: std::string::String,
19641
19642    /// PostgreSQL columns in the schema.
19643    /// When unspecified as part of include/exclude objects,
19644    /// includes/excludes everything.
19645    pub postgresql_columns: std::vec::Vec<crate::model::PostgresqlColumn>,
19646
19647    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19648}
19649
19650impl PostgresqlTable {
19651    pub fn new() -> Self {
19652        std::default::Default::default()
19653    }
19654
19655    /// Sets the value of [table][crate::model::PostgresqlTable::table].
19656    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19657        self.table = v.into();
19658        self
19659    }
19660
19661    /// Sets the value of [postgresql_columns][crate::model::PostgresqlTable::postgresql_columns].
19662    pub fn set_postgresql_columns<T, V>(mut self, v: T) -> Self
19663    where
19664        T: std::iter::IntoIterator<Item = V>,
19665        V: std::convert::Into<crate::model::PostgresqlColumn>,
19666    {
19667        use std::iter::Iterator;
19668        self.postgresql_columns = v.into_iter().map(|i| i.into()).collect();
19669        self
19670    }
19671}
19672
19673impl wkt::message::Message for PostgresqlTable {
19674    fn typename() -> &'static str {
19675        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlTable"
19676    }
19677}
19678
19679#[doc(hidden)]
19680impl<'de> serde::de::Deserialize<'de> for PostgresqlTable {
19681    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19682    where
19683        D: serde::Deserializer<'de>,
19684    {
19685        #[allow(non_camel_case_types)]
19686        #[doc(hidden)]
19687        #[derive(PartialEq, Eq, Hash)]
19688        enum __FieldTag {
19689            __table,
19690            __postgresql_columns,
19691            Unknown(std::string::String),
19692        }
19693        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
19694            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19695            where
19696                D: serde::Deserializer<'de>,
19697            {
19698                struct Visitor;
19699                impl<'de> serde::de::Visitor<'de> for Visitor {
19700                    type Value = __FieldTag;
19701                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19702                        formatter.write_str("a field name for PostgresqlTable")
19703                    }
19704                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
19705                    where
19706                        E: serde::de::Error,
19707                    {
19708                        use std::result::Result::Ok;
19709                        use std::string::ToString;
19710                        match value {
19711                            "table" => Ok(__FieldTag::__table),
19712                            "postgresqlColumns" => Ok(__FieldTag::__postgresql_columns),
19713                            "postgresql_columns" => Ok(__FieldTag::__postgresql_columns),
19714                            _ => Ok(__FieldTag::Unknown(value.to_string())),
19715                        }
19716                    }
19717                }
19718                deserializer.deserialize_identifier(Visitor)
19719            }
19720        }
19721        struct Visitor;
19722        impl<'de> serde::de::Visitor<'de> for Visitor {
19723            type Value = PostgresqlTable;
19724            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19725                formatter.write_str("struct PostgresqlTable")
19726            }
19727            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
19728            where
19729                A: serde::de::MapAccess<'de>,
19730            {
19731                #[allow(unused_imports)]
19732                use serde::de::Error;
19733                use std::option::Option::Some;
19734                let mut fields = std::collections::HashSet::new();
19735                let mut result = Self::Value::new();
19736                while let Some(tag) = map.next_key::<__FieldTag>()? {
19737                    #[allow(clippy::match_single_binding)]
19738                    match tag {
19739                        __FieldTag::__table => {
19740                            if !fields.insert(__FieldTag::__table) {
19741                                return std::result::Result::Err(A::Error::duplicate_field(
19742                                    "multiple values for table",
19743                                ));
19744                            }
19745                            result.table = map
19746                                .next_value::<std::option::Option<std::string::String>>()?
19747                                .unwrap_or_default();
19748                        }
19749                        __FieldTag::__postgresql_columns => {
19750                            if !fields.insert(__FieldTag::__postgresql_columns) {
19751                                return std::result::Result::Err(A::Error::duplicate_field(
19752                                    "multiple values for postgresql_columns",
19753                                ));
19754                            }
19755                            result.postgresql_columns =
19756                                map.next_value::<std::option::Option<
19757                                    std::vec::Vec<crate::model::PostgresqlColumn>,
19758                                >>()?
19759                                .unwrap_or_default();
19760                        }
19761                        __FieldTag::Unknown(key) => {
19762                            let value = map.next_value::<serde_json::Value>()?;
19763                            result._unknown_fields.insert(key, value);
19764                        }
19765                    }
19766                }
19767                std::result::Result::Ok(result)
19768            }
19769        }
19770        deserializer.deserialize_any(Visitor)
19771    }
19772}
19773
19774#[doc(hidden)]
19775impl serde::ser::Serialize for PostgresqlTable {
19776    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19777    where
19778        S: serde::ser::Serializer,
19779    {
19780        use serde::ser::SerializeMap;
19781        #[allow(unused_imports)]
19782        use std::option::Option::Some;
19783        let mut state = serializer.serialize_map(std::option::Option::None)?;
19784        if !self.table.is_empty() {
19785            state.serialize_entry("table", &self.table)?;
19786        }
19787        if !self.postgresql_columns.is_empty() {
19788            state.serialize_entry("postgresqlColumns", &self.postgresql_columns)?;
19789        }
19790        if !self._unknown_fields.is_empty() {
19791            for (key, value) in self._unknown_fields.iter() {
19792                state.serialize_entry(key, &value)?;
19793            }
19794        }
19795        state.end()
19796    }
19797}
19798
19799impl std::fmt::Debug for PostgresqlTable {
19800    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19801        let mut debug_struct = f.debug_struct("PostgresqlTable");
19802        debug_struct.field("table", &self.table);
19803        debug_struct.field("postgresql_columns", &self.postgresql_columns);
19804        if !self._unknown_fields.is_empty() {
19805            debug_struct.field("_unknown_fields", &self._unknown_fields);
19806        }
19807        debug_struct.finish()
19808    }
19809}
19810
19811/// PostgreSQL schema.
19812#[derive(Clone, Default, PartialEq)]
19813#[non_exhaustive]
19814pub struct PostgresqlSchema {
19815    /// Schema name.
19816    pub schema: std::string::String,
19817
19818    /// Tables in the schema.
19819    pub postgresql_tables: std::vec::Vec<crate::model::PostgresqlTable>,
19820
19821    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19822}
19823
19824impl PostgresqlSchema {
19825    pub fn new() -> Self {
19826        std::default::Default::default()
19827    }
19828
19829    /// Sets the value of [schema][crate::model::PostgresqlSchema::schema].
19830    pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19831        self.schema = v.into();
19832        self
19833    }
19834
19835    /// Sets the value of [postgresql_tables][crate::model::PostgresqlSchema::postgresql_tables].
19836    pub fn set_postgresql_tables<T, V>(mut self, v: T) -> Self
19837    where
19838        T: std::iter::IntoIterator<Item = V>,
19839        V: std::convert::Into<crate::model::PostgresqlTable>,
19840    {
19841        use std::iter::Iterator;
19842        self.postgresql_tables = v.into_iter().map(|i| i.into()).collect();
19843        self
19844    }
19845}
19846
19847impl wkt::message::Message for PostgresqlSchema {
19848    fn typename() -> &'static str {
19849        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSchema"
19850    }
19851}
19852
19853#[doc(hidden)]
19854impl<'de> serde::de::Deserialize<'de> for PostgresqlSchema {
19855    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19856    where
19857        D: serde::Deserializer<'de>,
19858    {
19859        #[allow(non_camel_case_types)]
19860        #[doc(hidden)]
19861        #[derive(PartialEq, Eq, Hash)]
19862        enum __FieldTag {
19863            __schema,
19864            __postgresql_tables,
19865            Unknown(std::string::String),
19866        }
19867        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
19868            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19869            where
19870                D: serde::Deserializer<'de>,
19871            {
19872                struct Visitor;
19873                impl<'de> serde::de::Visitor<'de> for Visitor {
19874                    type Value = __FieldTag;
19875                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19876                        formatter.write_str("a field name for PostgresqlSchema")
19877                    }
19878                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
19879                    where
19880                        E: serde::de::Error,
19881                    {
19882                        use std::result::Result::Ok;
19883                        use std::string::ToString;
19884                        match value {
19885                            "schema" => Ok(__FieldTag::__schema),
19886                            "postgresqlTables" => Ok(__FieldTag::__postgresql_tables),
19887                            "postgresql_tables" => Ok(__FieldTag::__postgresql_tables),
19888                            _ => Ok(__FieldTag::Unknown(value.to_string())),
19889                        }
19890                    }
19891                }
19892                deserializer.deserialize_identifier(Visitor)
19893            }
19894        }
19895        struct Visitor;
19896        impl<'de> serde::de::Visitor<'de> for Visitor {
19897            type Value = PostgresqlSchema;
19898            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19899                formatter.write_str("struct PostgresqlSchema")
19900            }
19901            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
19902            where
19903                A: serde::de::MapAccess<'de>,
19904            {
19905                #[allow(unused_imports)]
19906                use serde::de::Error;
19907                use std::option::Option::Some;
19908                let mut fields = std::collections::HashSet::new();
19909                let mut result = Self::Value::new();
19910                while let Some(tag) = map.next_key::<__FieldTag>()? {
19911                    #[allow(clippy::match_single_binding)]
19912                    match tag {
19913                        __FieldTag::__schema => {
19914                            if !fields.insert(__FieldTag::__schema) {
19915                                return std::result::Result::Err(A::Error::duplicate_field(
19916                                    "multiple values for schema",
19917                                ));
19918                            }
19919                            result.schema = map
19920                                .next_value::<std::option::Option<std::string::String>>()?
19921                                .unwrap_or_default();
19922                        }
19923                        __FieldTag::__postgresql_tables => {
19924                            if !fields.insert(__FieldTag::__postgresql_tables) {
19925                                return std::result::Result::Err(A::Error::duplicate_field(
19926                                    "multiple values for postgresql_tables",
19927                                ));
19928                            }
19929                            result.postgresql_tables =
19930                                map.next_value::<std::option::Option<
19931                                    std::vec::Vec<crate::model::PostgresqlTable>,
19932                                >>()?
19933                                .unwrap_or_default();
19934                        }
19935                        __FieldTag::Unknown(key) => {
19936                            let value = map.next_value::<serde_json::Value>()?;
19937                            result._unknown_fields.insert(key, value);
19938                        }
19939                    }
19940                }
19941                std::result::Result::Ok(result)
19942            }
19943        }
19944        deserializer.deserialize_any(Visitor)
19945    }
19946}
19947
19948#[doc(hidden)]
19949impl serde::ser::Serialize for PostgresqlSchema {
19950    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19951    where
19952        S: serde::ser::Serializer,
19953    {
19954        use serde::ser::SerializeMap;
19955        #[allow(unused_imports)]
19956        use std::option::Option::Some;
19957        let mut state = serializer.serialize_map(std::option::Option::None)?;
19958        if !self.schema.is_empty() {
19959            state.serialize_entry("schema", &self.schema)?;
19960        }
19961        if !self.postgresql_tables.is_empty() {
19962            state.serialize_entry("postgresqlTables", &self.postgresql_tables)?;
19963        }
19964        if !self._unknown_fields.is_empty() {
19965            for (key, value) in self._unknown_fields.iter() {
19966                state.serialize_entry(key, &value)?;
19967            }
19968        }
19969        state.end()
19970    }
19971}
19972
19973impl std::fmt::Debug for PostgresqlSchema {
19974    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19975        let mut debug_struct = f.debug_struct("PostgresqlSchema");
19976        debug_struct.field("schema", &self.schema);
19977        debug_struct.field("postgresql_tables", &self.postgresql_tables);
19978        if !self._unknown_fields.is_empty() {
19979            debug_struct.field("_unknown_fields", &self._unknown_fields);
19980        }
19981        debug_struct.finish()
19982    }
19983}
19984
19985/// PostgreSQL database structure.
19986#[derive(Clone, Default, PartialEq)]
19987#[non_exhaustive]
19988pub struct PostgresqlRdbms {
19989    /// PostgreSQL schemas in the database server.
19990    pub postgresql_schemas: std::vec::Vec<crate::model::PostgresqlSchema>,
19991
19992    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19993}
19994
19995impl PostgresqlRdbms {
19996    pub fn new() -> Self {
19997        std::default::Default::default()
19998    }
19999
20000    /// Sets the value of [postgresql_schemas][crate::model::PostgresqlRdbms::postgresql_schemas].
20001    pub fn set_postgresql_schemas<T, V>(mut self, v: T) -> Self
20002    where
20003        T: std::iter::IntoIterator<Item = V>,
20004        V: std::convert::Into<crate::model::PostgresqlSchema>,
20005    {
20006        use std::iter::Iterator;
20007        self.postgresql_schemas = v.into_iter().map(|i| i.into()).collect();
20008        self
20009    }
20010}
20011
20012impl wkt::message::Message for PostgresqlRdbms {
20013    fn typename() -> &'static str {
20014        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlRdbms"
20015    }
20016}
20017
20018#[doc(hidden)]
20019impl<'de> serde::de::Deserialize<'de> for PostgresqlRdbms {
20020    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20021    where
20022        D: serde::Deserializer<'de>,
20023    {
20024        #[allow(non_camel_case_types)]
20025        #[doc(hidden)]
20026        #[derive(PartialEq, Eq, Hash)]
20027        enum __FieldTag {
20028            __postgresql_schemas,
20029            Unknown(std::string::String),
20030        }
20031        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
20032            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20033            where
20034                D: serde::Deserializer<'de>,
20035            {
20036                struct Visitor;
20037                impl<'de> serde::de::Visitor<'de> for Visitor {
20038                    type Value = __FieldTag;
20039                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
20040                        formatter.write_str("a field name for PostgresqlRdbms")
20041                    }
20042                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
20043                    where
20044                        E: serde::de::Error,
20045                    {
20046                        use std::result::Result::Ok;
20047                        use std::string::ToString;
20048                        match value {
20049                            "postgresqlSchemas" => Ok(__FieldTag::__postgresql_schemas),
20050                            "postgresql_schemas" => Ok(__FieldTag::__postgresql_schemas),
20051                            _ => Ok(__FieldTag::Unknown(value.to_string())),
20052                        }
20053                    }
20054                }
20055                deserializer.deserialize_identifier(Visitor)
20056            }
20057        }
20058        struct Visitor;
20059        impl<'de> serde::de::Visitor<'de> for Visitor {
20060            type Value = PostgresqlRdbms;
20061            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
20062                formatter.write_str("struct PostgresqlRdbms")
20063            }
20064            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
20065            where
20066                A: serde::de::MapAccess<'de>,
20067            {
20068                #[allow(unused_imports)]
20069                use serde::de::Error;
20070                use std::option::Option::Some;
20071                let mut fields = std::collections::HashSet::new();
20072                let mut result = Self::Value::new();
20073                while let Some(tag) = map.next_key::<__FieldTag>()? {
20074                    #[allow(clippy::match_single_binding)]
20075                    match tag {
20076                        __FieldTag::__postgresql_schemas => {
20077                            if !fields.insert(__FieldTag::__postgresql_schemas) {
20078                                return std::result::Result::Err(A::Error::duplicate_field(
20079                                    "multiple values for postgresql_schemas",
20080                                ));
20081                            }
20082                            result.postgresql_schemas =
20083                                map.next_value::<std::option::Option<
20084                                    std::vec::Vec<crate::model::PostgresqlSchema>,
20085                                >>()?
20086                                .unwrap_or_default();
20087                        }
20088                        __FieldTag::Unknown(key) => {
20089                            let value = map.next_value::<serde_json::Value>()?;
20090                            result._unknown_fields.insert(key, value);
20091                        }
20092                    }
20093                }
20094                std::result::Result::Ok(result)
20095            }
20096        }
20097        deserializer.deserialize_any(Visitor)
20098    }
20099}
20100
20101#[doc(hidden)]
20102impl serde::ser::Serialize for PostgresqlRdbms {
20103    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20104    where
20105        S: serde::ser::Serializer,
20106    {
20107        use serde::ser::SerializeMap;
20108        #[allow(unused_imports)]
20109        use std::option::Option::Some;
20110        let mut state = serializer.serialize_map(std::option::Option::None)?;
20111        if !self.postgresql_schemas.is_empty() {
20112            state.serialize_entry("postgresqlSchemas", &self.postgresql_schemas)?;
20113        }
20114        if !self._unknown_fields.is_empty() {
20115            for (key, value) in self._unknown_fields.iter() {
20116                state.serialize_entry(key, &value)?;
20117            }
20118        }
20119        state.end()
20120    }
20121}
20122
20123impl std::fmt::Debug for PostgresqlRdbms {
20124    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20125        let mut debug_struct = f.debug_struct("PostgresqlRdbms");
20126        debug_struct.field("postgresql_schemas", &self.postgresql_schemas);
20127        if !self._unknown_fields.is_empty() {
20128            debug_struct.field("_unknown_fields", &self._unknown_fields);
20129        }
20130        debug_struct.finish()
20131    }
20132}
20133
20134/// PostgreSQL data source configuration
20135#[derive(Clone, Default, PartialEq)]
20136#[non_exhaustive]
20137pub struct PostgresqlSourceConfig {
20138    /// PostgreSQL objects to include in the stream.
20139    pub include_objects: std::option::Option<crate::model::PostgresqlRdbms>,
20140
20141    /// PostgreSQL objects to exclude from the stream.
20142    pub exclude_objects: std::option::Option<crate::model::PostgresqlRdbms>,
20143
20144    /// Required. Immutable. The name of the logical replication slot that's
20145    /// configured with the pgoutput plugin.
20146    pub replication_slot: std::string::String,
20147
20148    /// Required. The name of the publication that includes the set of all tables
20149    /// that are defined in the stream's include_objects.
20150    pub publication: std::string::String,
20151
20152    /// Maximum number of concurrent backfill tasks. The number should be non
20153    /// negative. If not set (or set to 0), the system's default value will be
20154    /// used.
20155    pub max_concurrent_backfill_tasks: i32,
20156
20157    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20158}
20159
20160impl PostgresqlSourceConfig {
20161    pub fn new() -> Self {
20162        std::default::Default::default()
20163    }
20164
20165    /// Sets the value of [include_objects][crate::model::PostgresqlSourceConfig::include_objects].
20166    pub fn set_include_objects<T>(mut self, v: T) -> Self
20167    where
20168        T: std::convert::Into<crate::model::PostgresqlRdbms>,
20169    {
20170        self.include_objects = std::option::Option::Some(v.into());
20171        self
20172    }
20173
20174    /// Sets or clears the value of [include_objects][crate::model::PostgresqlSourceConfig::include_objects].
20175    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
20176    where
20177        T: std::convert::Into<crate::model::PostgresqlRdbms>,
20178    {
20179        self.include_objects = v.map(|x| x.into());
20180        self
20181    }
20182
20183    /// Sets the value of [exclude_objects][crate::model::PostgresqlSourceConfig::exclude_objects].
20184    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
20185    where
20186        T: std::convert::Into<crate::model::PostgresqlRdbms>,
20187    {
20188        self.exclude_objects = std::option::Option::Some(v.into());
20189        self
20190    }
20191
20192    /// Sets or clears the value of [exclude_objects][crate::model::PostgresqlSourceConfig::exclude_objects].
20193    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
20194    where
20195        T: std::convert::Into<crate::model::PostgresqlRdbms>,
20196    {
20197        self.exclude_objects = v.map(|x| x.into());
20198        self
20199    }
20200
20201    /// Sets the value of [replication_slot][crate::model::PostgresqlSourceConfig::replication_slot].
20202    pub fn set_replication_slot<T: std::convert::Into<std::string::String>>(
20203        mut self,
20204        v: T,
20205    ) -> Self {
20206        self.replication_slot = v.into();
20207        self
20208    }
20209
20210    /// Sets the value of [publication][crate::model::PostgresqlSourceConfig::publication].
20211    pub fn set_publication<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20212        self.publication = v.into();
20213        self
20214    }
20215
20216    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::PostgresqlSourceConfig::max_concurrent_backfill_tasks].
20217    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20218        self.max_concurrent_backfill_tasks = v.into();
20219        self
20220    }
20221}
20222
20223impl wkt::message::Message for PostgresqlSourceConfig {
20224    fn typename() -> &'static str {
20225        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSourceConfig"
20226    }
20227}
20228
20229#[doc(hidden)]
20230impl<'de> serde::de::Deserialize<'de> for PostgresqlSourceConfig {
20231    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20232    where
20233        D: serde::Deserializer<'de>,
20234    {
20235        #[allow(non_camel_case_types)]
20236        #[doc(hidden)]
20237        #[derive(PartialEq, Eq, Hash)]
20238        enum __FieldTag {
20239            __include_objects,
20240            __exclude_objects,
20241            __replication_slot,
20242            __publication,
20243            __max_concurrent_backfill_tasks,
20244            Unknown(std::string::String),
20245        }
20246        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
20247            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20248            where
20249                D: serde::Deserializer<'de>,
20250            {
20251                struct Visitor;
20252                impl<'de> serde::de::Visitor<'de> for Visitor {
20253                    type Value = __FieldTag;
20254                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
20255                        formatter.write_str("a field name for PostgresqlSourceConfig")
20256                    }
20257                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
20258                    where
20259                        E: serde::de::Error,
20260                    {
20261                        use std::result::Result::Ok;
20262                        use std::string::ToString;
20263                        match value {
20264                            "includeObjects" => Ok(__FieldTag::__include_objects),
20265                            "include_objects" => Ok(__FieldTag::__include_objects),
20266                            "excludeObjects" => Ok(__FieldTag::__exclude_objects),
20267                            "exclude_objects" => Ok(__FieldTag::__exclude_objects),
20268                            "replicationSlot" => Ok(__FieldTag::__replication_slot),
20269                            "replication_slot" => Ok(__FieldTag::__replication_slot),
20270                            "publication" => Ok(__FieldTag::__publication),
20271                            "maxConcurrentBackfillTasks" => {
20272                                Ok(__FieldTag::__max_concurrent_backfill_tasks)
20273                            }
20274                            "max_concurrent_backfill_tasks" => {
20275                                Ok(__FieldTag::__max_concurrent_backfill_tasks)
20276                            }
20277                            _ => Ok(__FieldTag::Unknown(value.to_string())),
20278                        }
20279                    }
20280                }
20281                deserializer.deserialize_identifier(Visitor)
20282            }
20283        }
20284        struct Visitor;
20285        impl<'de> serde::de::Visitor<'de> for Visitor {
20286            type Value = PostgresqlSourceConfig;
20287            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
20288                formatter.write_str("struct PostgresqlSourceConfig")
20289            }
20290            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
20291            where
20292                A: serde::de::MapAccess<'de>,
20293            {
20294                #[allow(unused_imports)]
20295                use serde::de::Error;
20296                use std::option::Option::Some;
20297                let mut fields = std::collections::HashSet::new();
20298                let mut result = Self::Value::new();
20299                while let Some(tag) = map.next_key::<__FieldTag>()? {
20300                    #[allow(clippy::match_single_binding)]
20301                    match tag {
20302                        __FieldTag::__include_objects => {
20303                            if !fields.insert(__FieldTag::__include_objects) {
20304                                return std::result::Result::Err(A::Error::duplicate_field(
20305                                    "multiple values for include_objects",
20306                                ));
20307                            }
20308                            result.include_objects = map
20309                                .next_value::<std::option::Option<crate::model::PostgresqlRdbms>>(
20310                                )?;
20311                        }
20312                        __FieldTag::__exclude_objects => {
20313                            if !fields.insert(__FieldTag::__exclude_objects) {
20314                                return std::result::Result::Err(A::Error::duplicate_field(
20315                                    "multiple values for exclude_objects",
20316                                ));
20317                            }
20318                            result.exclude_objects = map
20319                                .next_value::<std::option::Option<crate::model::PostgresqlRdbms>>(
20320                                )?;
20321                        }
20322                        __FieldTag::__replication_slot => {
20323                            if !fields.insert(__FieldTag::__replication_slot) {
20324                                return std::result::Result::Err(A::Error::duplicate_field(
20325                                    "multiple values for replication_slot",
20326                                ));
20327                            }
20328                            result.replication_slot = map
20329                                .next_value::<std::option::Option<std::string::String>>()?
20330                                .unwrap_or_default();
20331                        }
20332                        __FieldTag::__publication => {
20333                            if !fields.insert(__FieldTag::__publication) {
20334                                return std::result::Result::Err(A::Error::duplicate_field(
20335                                    "multiple values for publication",
20336                                ));
20337                            }
20338                            result.publication = map
20339                                .next_value::<std::option::Option<std::string::String>>()?
20340                                .unwrap_or_default();
20341                        }
20342                        __FieldTag::__max_concurrent_backfill_tasks => {
20343                            if !fields.insert(__FieldTag::__max_concurrent_backfill_tasks) {
20344                                return std::result::Result::Err(A::Error::duplicate_field(
20345                                    "multiple values for max_concurrent_backfill_tasks",
20346                                ));
20347                            }
20348                            struct __With(std::option::Option<i32>);
20349                            impl<'de> serde::de::Deserialize<'de> for __With {
20350                                fn deserialize<D>(
20351                                    deserializer: D,
20352                                ) -> std::result::Result<Self, D::Error>
20353                                where
20354                                    D: serde::de::Deserializer<'de>,
20355                                {
20356                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
20357                                }
20358                            }
20359                            result.max_concurrent_backfill_tasks =
20360                                map.next_value::<__With>()?.0.unwrap_or_default();
20361                        }
20362                        __FieldTag::Unknown(key) => {
20363                            let value = map.next_value::<serde_json::Value>()?;
20364                            result._unknown_fields.insert(key, value);
20365                        }
20366                    }
20367                }
20368                std::result::Result::Ok(result)
20369            }
20370        }
20371        deserializer.deserialize_any(Visitor)
20372    }
20373}
20374
20375#[doc(hidden)]
20376impl serde::ser::Serialize for PostgresqlSourceConfig {
20377    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20378    where
20379        S: serde::ser::Serializer,
20380    {
20381        use serde::ser::SerializeMap;
20382        #[allow(unused_imports)]
20383        use std::option::Option::Some;
20384        let mut state = serializer.serialize_map(std::option::Option::None)?;
20385        if self.include_objects.is_some() {
20386            state.serialize_entry("includeObjects", &self.include_objects)?;
20387        }
20388        if self.exclude_objects.is_some() {
20389            state.serialize_entry("excludeObjects", &self.exclude_objects)?;
20390        }
20391        if !self.replication_slot.is_empty() {
20392            state.serialize_entry("replicationSlot", &self.replication_slot)?;
20393        }
20394        if !self.publication.is_empty() {
20395            state.serialize_entry("publication", &self.publication)?;
20396        }
20397        if !wkt::internal::is_default(&self.max_concurrent_backfill_tasks) {
20398            struct __With<'a>(&'a i32);
20399            impl<'a> serde::ser::Serialize for __With<'a> {
20400                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20401                where
20402                    S: serde::ser::Serializer,
20403                {
20404                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
20405                }
20406            }
20407            state.serialize_entry(
20408                "maxConcurrentBackfillTasks",
20409                &__With(&self.max_concurrent_backfill_tasks),
20410            )?;
20411        }
20412        if !self._unknown_fields.is_empty() {
20413            for (key, value) in self._unknown_fields.iter() {
20414                state.serialize_entry(key, &value)?;
20415            }
20416        }
20417        state.end()
20418    }
20419}
20420
20421impl std::fmt::Debug for PostgresqlSourceConfig {
20422    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20423        let mut debug_struct = f.debug_struct("PostgresqlSourceConfig");
20424        debug_struct.field("include_objects", &self.include_objects);
20425        debug_struct.field("exclude_objects", &self.exclude_objects);
20426        debug_struct.field("replication_slot", &self.replication_slot);
20427        debug_struct.field("publication", &self.publication);
20428        debug_struct.field(
20429            "max_concurrent_backfill_tasks",
20430            &self.max_concurrent_backfill_tasks,
20431        );
20432        if !self._unknown_fields.is_empty() {
20433            debug_struct.field("_unknown_fields", &self._unknown_fields);
20434        }
20435        debug_struct.finish()
20436    }
20437}
20438
20439/// SQLServer Column.
20440#[derive(Clone, Default, PartialEq)]
20441#[non_exhaustive]
20442pub struct SqlServerColumn {
20443    /// Column name.
20444    pub column: std::string::String,
20445
20446    /// The SQLServer data type.
20447    pub data_type: std::string::String,
20448
20449    /// Column length.
20450    pub length: i32,
20451
20452    /// Column precision.
20453    pub precision: i32,
20454
20455    /// Column scale.
20456    pub scale: i32,
20457
20458    /// Whether or not the column represents a primary key.
20459    pub primary_key: bool,
20460
20461    /// Whether or not the column can accept a null value.
20462    pub nullable: bool,
20463
20464    /// The ordinal position of the column in the table.
20465    pub ordinal_position: i32,
20466
20467    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20468}
20469
20470impl SqlServerColumn {
20471    pub fn new() -> Self {
20472        std::default::Default::default()
20473    }
20474
20475    /// Sets the value of [column][crate::model::SqlServerColumn::column].
20476    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20477        self.column = v.into();
20478        self
20479    }
20480
20481    /// Sets the value of [data_type][crate::model::SqlServerColumn::data_type].
20482    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20483        self.data_type = v.into();
20484        self
20485    }
20486
20487    /// Sets the value of [length][crate::model::SqlServerColumn::length].
20488    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20489        self.length = v.into();
20490        self
20491    }
20492
20493    /// Sets the value of [precision][crate::model::SqlServerColumn::precision].
20494    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20495        self.precision = v.into();
20496        self
20497    }
20498
20499    /// Sets the value of [scale][crate::model::SqlServerColumn::scale].
20500    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20501        self.scale = v.into();
20502        self
20503    }
20504
20505    /// Sets the value of [primary_key][crate::model::SqlServerColumn::primary_key].
20506    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20507        self.primary_key = v.into();
20508        self
20509    }
20510
20511    /// Sets the value of [nullable][crate::model::SqlServerColumn::nullable].
20512    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20513        self.nullable = v.into();
20514        self
20515    }
20516
20517    /// Sets the value of [ordinal_position][crate::model::SqlServerColumn::ordinal_position].
20518    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20519        self.ordinal_position = v.into();
20520        self
20521    }
20522}
20523
20524impl wkt::message::Message for SqlServerColumn {
20525    fn typename() -> &'static str {
20526        "type.googleapis.com/google.cloud.datastream.v1.SqlServerColumn"
20527    }
20528}
20529
20530#[doc(hidden)]
20531impl<'de> serde::de::Deserialize<'de> for SqlServerColumn {
20532    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20533    where
20534        D: serde::Deserializer<'de>,
20535    {
20536        #[allow(non_camel_case_types)]
20537        #[doc(hidden)]
20538        #[derive(PartialEq, Eq, Hash)]
20539        enum __FieldTag {
20540            __column,
20541            __data_type,
20542            __length,
20543            __precision,
20544            __scale,
20545            __primary_key,
20546            __nullable,
20547            __ordinal_position,
20548            Unknown(std::string::String),
20549        }
20550        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
20551            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20552            where
20553                D: serde::Deserializer<'de>,
20554            {
20555                struct Visitor;
20556                impl<'de> serde::de::Visitor<'de> for Visitor {
20557                    type Value = __FieldTag;
20558                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
20559                        formatter.write_str("a field name for SqlServerColumn")
20560                    }
20561                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
20562                    where
20563                        E: serde::de::Error,
20564                    {
20565                        use std::result::Result::Ok;
20566                        use std::string::ToString;
20567                        match value {
20568                            "column" => Ok(__FieldTag::__column),
20569                            "dataType" => Ok(__FieldTag::__data_type),
20570                            "data_type" => Ok(__FieldTag::__data_type),
20571                            "length" => Ok(__FieldTag::__length),
20572                            "precision" => Ok(__FieldTag::__precision),
20573                            "scale" => Ok(__FieldTag::__scale),
20574                            "primaryKey" => Ok(__FieldTag::__primary_key),
20575                            "primary_key" => Ok(__FieldTag::__primary_key),
20576                            "nullable" => Ok(__FieldTag::__nullable),
20577                            "ordinalPosition" => Ok(__FieldTag::__ordinal_position),
20578                            "ordinal_position" => Ok(__FieldTag::__ordinal_position),
20579                            _ => Ok(__FieldTag::Unknown(value.to_string())),
20580                        }
20581                    }
20582                }
20583                deserializer.deserialize_identifier(Visitor)
20584            }
20585        }
20586        struct Visitor;
20587        impl<'de> serde::de::Visitor<'de> for Visitor {
20588            type Value = SqlServerColumn;
20589            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
20590                formatter.write_str("struct SqlServerColumn")
20591            }
20592            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
20593            where
20594                A: serde::de::MapAccess<'de>,
20595            {
20596                #[allow(unused_imports)]
20597                use serde::de::Error;
20598                use std::option::Option::Some;
20599                let mut fields = std::collections::HashSet::new();
20600                let mut result = Self::Value::new();
20601                while let Some(tag) = map.next_key::<__FieldTag>()? {
20602                    #[allow(clippy::match_single_binding)]
20603                    match tag {
20604                        __FieldTag::__column => {
20605                            if !fields.insert(__FieldTag::__column) {
20606                                return std::result::Result::Err(A::Error::duplicate_field(
20607                                    "multiple values for column",
20608                                ));
20609                            }
20610                            result.column = map
20611                                .next_value::<std::option::Option<std::string::String>>()?
20612                                .unwrap_or_default();
20613                        }
20614                        __FieldTag::__data_type => {
20615                            if !fields.insert(__FieldTag::__data_type) {
20616                                return std::result::Result::Err(A::Error::duplicate_field(
20617                                    "multiple values for data_type",
20618                                ));
20619                            }
20620                            result.data_type = map
20621                                .next_value::<std::option::Option<std::string::String>>()?
20622                                .unwrap_or_default();
20623                        }
20624                        __FieldTag::__length => {
20625                            if !fields.insert(__FieldTag::__length) {
20626                                return std::result::Result::Err(A::Error::duplicate_field(
20627                                    "multiple values for length",
20628                                ));
20629                            }
20630                            struct __With(std::option::Option<i32>);
20631                            impl<'de> serde::de::Deserialize<'de> for __With {
20632                                fn deserialize<D>(
20633                                    deserializer: D,
20634                                ) -> std::result::Result<Self, D::Error>
20635                                where
20636                                    D: serde::de::Deserializer<'de>,
20637                                {
20638                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
20639                                }
20640                            }
20641                            result.length = map.next_value::<__With>()?.0.unwrap_or_default();
20642                        }
20643                        __FieldTag::__precision => {
20644                            if !fields.insert(__FieldTag::__precision) {
20645                                return std::result::Result::Err(A::Error::duplicate_field(
20646                                    "multiple values for precision",
20647                                ));
20648                            }
20649                            struct __With(std::option::Option<i32>);
20650                            impl<'de> serde::de::Deserialize<'de> for __With {
20651                                fn deserialize<D>(
20652                                    deserializer: D,
20653                                ) -> std::result::Result<Self, D::Error>
20654                                where
20655                                    D: serde::de::Deserializer<'de>,
20656                                {
20657                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
20658                                }
20659                            }
20660                            result.precision = map.next_value::<__With>()?.0.unwrap_or_default();
20661                        }
20662                        __FieldTag::__scale => {
20663                            if !fields.insert(__FieldTag::__scale) {
20664                                return std::result::Result::Err(A::Error::duplicate_field(
20665                                    "multiple values for scale",
20666                                ));
20667                            }
20668                            struct __With(std::option::Option<i32>);
20669                            impl<'de> serde::de::Deserialize<'de> for __With {
20670                                fn deserialize<D>(
20671                                    deserializer: D,
20672                                ) -> std::result::Result<Self, D::Error>
20673                                where
20674                                    D: serde::de::Deserializer<'de>,
20675                                {
20676                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
20677                                }
20678                            }
20679                            result.scale = map.next_value::<__With>()?.0.unwrap_or_default();
20680                        }
20681                        __FieldTag::__primary_key => {
20682                            if !fields.insert(__FieldTag::__primary_key) {
20683                                return std::result::Result::Err(A::Error::duplicate_field(
20684                                    "multiple values for primary_key",
20685                                ));
20686                            }
20687                            result.primary_key = map
20688                                .next_value::<std::option::Option<bool>>()?
20689                                .unwrap_or_default();
20690                        }
20691                        __FieldTag::__nullable => {
20692                            if !fields.insert(__FieldTag::__nullable) {
20693                                return std::result::Result::Err(A::Error::duplicate_field(
20694                                    "multiple values for nullable",
20695                                ));
20696                            }
20697                            result.nullable = map
20698                                .next_value::<std::option::Option<bool>>()?
20699                                .unwrap_or_default();
20700                        }
20701                        __FieldTag::__ordinal_position => {
20702                            if !fields.insert(__FieldTag::__ordinal_position) {
20703                                return std::result::Result::Err(A::Error::duplicate_field(
20704                                    "multiple values for ordinal_position",
20705                                ));
20706                            }
20707                            struct __With(std::option::Option<i32>);
20708                            impl<'de> serde::de::Deserialize<'de> for __With {
20709                                fn deserialize<D>(
20710                                    deserializer: D,
20711                                ) -> std::result::Result<Self, D::Error>
20712                                where
20713                                    D: serde::de::Deserializer<'de>,
20714                                {
20715                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
20716                                }
20717                            }
20718                            result.ordinal_position =
20719                                map.next_value::<__With>()?.0.unwrap_or_default();
20720                        }
20721                        __FieldTag::Unknown(key) => {
20722                            let value = map.next_value::<serde_json::Value>()?;
20723                            result._unknown_fields.insert(key, value);
20724                        }
20725                    }
20726                }
20727                std::result::Result::Ok(result)
20728            }
20729        }
20730        deserializer.deserialize_any(Visitor)
20731    }
20732}
20733
20734#[doc(hidden)]
20735impl serde::ser::Serialize for SqlServerColumn {
20736    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20737    where
20738        S: serde::ser::Serializer,
20739    {
20740        use serde::ser::SerializeMap;
20741        #[allow(unused_imports)]
20742        use std::option::Option::Some;
20743        let mut state = serializer.serialize_map(std::option::Option::None)?;
20744        if !self.column.is_empty() {
20745            state.serialize_entry("column", &self.column)?;
20746        }
20747        if !self.data_type.is_empty() {
20748            state.serialize_entry("dataType", &self.data_type)?;
20749        }
20750        if !wkt::internal::is_default(&self.length) {
20751            struct __With<'a>(&'a i32);
20752            impl<'a> serde::ser::Serialize for __With<'a> {
20753                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20754                where
20755                    S: serde::ser::Serializer,
20756                {
20757                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
20758                }
20759            }
20760            state.serialize_entry("length", &__With(&self.length))?;
20761        }
20762        if !wkt::internal::is_default(&self.precision) {
20763            struct __With<'a>(&'a i32);
20764            impl<'a> serde::ser::Serialize for __With<'a> {
20765                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20766                where
20767                    S: serde::ser::Serializer,
20768                {
20769                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
20770                }
20771            }
20772            state.serialize_entry("precision", &__With(&self.precision))?;
20773        }
20774        if !wkt::internal::is_default(&self.scale) {
20775            struct __With<'a>(&'a i32);
20776            impl<'a> serde::ser::Serialize for __With<'a> {
20777                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20778                where
20779                    S: serde::ser::Serializer,
20780                {
20781                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
20782                }
20783            }
20784            state.serialize_entry("scale", &__With(&self.scale))?;
20785        }
20786        if !wkt::internal::is_default(&self.primary_key) {
20787            state.serialize_entry("primaryKey", &self.primary_key)?;
20788        }
20789        if !wkt::internal::is_default(&self.nullable) {
20790            state.serialize_entry("nullable", &self.nullable)?;
20791        }
20792        if !wkt::internal::is_default(&self.ordinal_position) {
20793            struct __With<'a>(&'a i32);
20794            impl<'a> serde::ser::Serialize for __With<'a> {
20795                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20796                where
20797                    S: serde::ser::Serializer,
20798                {
20799                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
20800                }
20801            }
20802            state.serialize_entry("ordinalPosition", &__With(&self.ordinal_position))?;
20803        }
20804        if !self._unknown_fields.is_empty() {
20805            for (key, value) in self._unknown_fields.iter() {
20806                state.serialize_entry(key, &value)?;
20807            }
20808        }
20809        state.end()
20810    }
20811}
20812
20813impl std::fmt::Debug for SqlServerColumn {
20814    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20815        let mut debug_struct = f.debug_struct("SqlServerColumn");
20816        debug_struct.field("column", &self.column);
20817        debug_struct.field("data_type", &self.data_type);
20818        debug_struct.field("length", &self.length);
20819        debug_struct.field("precision", &self.precision);
20820        debug_struct.field("scale", &self.scale);
20821        debug_struct.field("primary_key", &self.primary_key);
20822        debug_struct.field("nullable", &self.nullable);
20823        debug_struct.field("ordinal_position", &self.ordinal_position);
20824        if !self._unknown_fields.is_empty() {
20825            debug_struct.field("_unknown_fields", &self._unknown_fields);
20826        }
20827        debug_struct.finish()
20828    }
20829}
20830
20831/// SQLServer table.
20832#[derive(Clone, Default, PartialEq)]
20833#[non_exhaustive]
20834pub struct SqlServerTable {
20835    /// Table name.
20836    pub table: std::string::String,
20837
20838    /// SQLServer columns in the schema.
20839    /// When unspecified as part of include/exclude objects,
20840    /// includes/excludes everything.
20841    pub columns: std::vec::Vec<crate::model::SqlServerColumn>,
20842
20843    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20844}
20845
20846impl SqlServerTable {
20847    pub fn new() -> Self {
20848        std::default::Default::default()
20849    }
20850
20851    /// Sets the value of [table][crate::model::SqlServerTable::table].
20852    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20853        self.table = v.into();
20854        self
20855    }
20856
20857    /// Sets the value of [columns][crate::model::SqlServerTable::columns].
20858    pub fn set_columns<T, V>(mut self, v: T) -> Self
20859    where
20860        T: std::iter::IntoIterator<Item = V>,
20861        V: std::convert::Into<crate::model::SqlServerColumn>,
20862    {
20863        use std::iter::Iterator;
20864        self.columns = v.into_iter().map(|i| i.into()).collect();
20865        self
20866    }
20867}
20868
20869impl wkt::message::Message for SqlServerTable {
20870    fn typename() -> &'static str {
20871        "type.googleapis.com/google.cloud.datastream.v1.SqlServerTable"
20872    }
20873}
20874
20875#[doc(hidden)]
20876impl<'de> serde::de::Deserialize<'de> for SqlServerTable {
20877    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20878    where
20879        D: serde::Deserializer<'de>,
20880    {
20881        #[allow(non_camel_case_types)]
20882        #[doc(hidden)]
20883        #[derive(PartialEq, Eq, Hash)]
20884        enum __FieldTag {
20885            __table,
20886            __columns,
20887            Unknown(std::string::String),
20888        }
20889        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
20890            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20891            where
20892                D: serde::Deserializer<'de>,
20893            {
20894                struct Visitor;
20895                impl<'de> serde::de::Visitor<'de> for Visitor {
20896                    type Value = __FieldTag;
20897                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
20898                        formatter.write_str("a field name for SqlServerTable")
20899                    }
20900                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
20901                    where
20902                        E: serde::de::Error,
20903                    {
20904                        use std::result::Result::Ok;
20905                        use std::string::ToString;
20906                        match value {
20907                            "table" => Ok(__FieldTag::__table),
20908                            "columns" => Ok(__FieldTag::__columns),
20909                            _ => Ok(__FieldTag::Unknown(value.to_string())),
20910                        }
20911                    }
20912                }
20913                deserializer.deserialize_identifier(Visitor)
20914            }
20915        }
20916        struct Visitor;
20917        impl<'de> serde::de::Visitor<'de> for Visitor {
20918            type Value = SqlServerTable;
20919            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
20920                formatter.write_str("struct SqlServerTable")
20921            }
20922            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
20923            where
20924                A: serde::de::MapAccess<'de>,
20925            {
20926                #[allow(unused_imports)]
20927                use serde::de::Error;
20928                use std::option::Option::Some;
20929                let mut fields = std::collections::HashSet::new();
20930                let mut result = Self::Value::new();
20931                while let Some(tag) = map.next_key::<__FieldTag>()? {
20932                    #[allow(clippy::match_single_binding)]
20933                    match tag {
20934                        __FieldTag::__table => {
20935                            if !fields.insert(__FieldTag::__table) {
20936                                return std::result::Result::Err(A::Error::duplicate_field(
20937                                    "multiple values for table",
20938                                ));
20939                            }
20940                            result.table = map
20941                                .next_value::<std::option::Option<std::string::String>>()?
20942                                .unwrap_or_default();
20943                        }
20944                        __FieldTag::__columns => {
20945                            if !fields.insert(__FieldTag::__columns) {
20946                                return std::result::Result::Err(A::Error::duplicate_field(
20947                                    "multiple values for columns",
20948                                ));
20949                            }
20950                            result.columns =
20951                                map.next_value::<std::option::Option<
20952                                    std::vec::Vec<crate::model::SqlServerColumn>,
20953                                >>()?
20954                                .unwrap_or_default();
20955                        }
20956                        __FieldTag::Unknown(key) => {
20957                            let value = map.next_value::<serde_json::Value>()?;
20958                            result._unknown_fields.insert(key, value);
20959                        }
20960                    }
20961                }
20962                std::result::Result::Ok(result)
20963            }
20964        }
20965        deserializer.deserialize_any(Visitor)
20966    }
20967}
20968
20969#[doc(hidden)]
20970impl serde::ser::Serialize for SqlServerTable {
20971    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20972    where
20973        S: serde::ser::Serializer,
20974    {
20975        use serde::ser::SerializeMap;
20976        #[allow(unused_imports)]
20977        use std::option::Option::Some;
20978        let mut state = serializer.serialize_map(std::option::Option::None)?;
20979        if !self.table.is_empty() {
20980            state.serialize_entry("table", &self.table)?;
20981        }
20982        if !self.columns.is_empty() {
20983            state.serialize_entry("columns", &self.columns)?;
20984        }
20985        if !self._unknown_fields.is_empty() {
20986            for (key, value) in self._unknown_fields.iter() {
20987                state.serialize_entry(key, &value)?;
20988            }
20989        }
20990        state.end()
20991    }
20992}
20993
20994impl std::fmt::Debug for SqlServerTable {
20995    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20996        let mut debug_struct = f.debug_struct("SqlServerTable");
20997        debug_struct.field("table", &self.table);
20998        debug_struct.field("columns", &self.columns);
20999        if !self._unknown_fields.is_empty() {
21000            debug_struct.field("_unknown_fields", &self._unknown_fields);
21001        }
21002        debug_struct.finish()
21003    }
21004}
21005
21006/// SQLServer schema.
21007#[derive(Clone, Default, PartialEq)]
21008#[non_exhaustive]
21009pub struct SqlServerSchema {
21010    /// Schema name.
21011    pub schema: std::string::String,
21012
21013    /// Tables in the schema.
21014    pub tables: std::vec::Vec<crate::model::SqlServerTable>,
21015
21016    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21017}
21018
21019impl SqlServerSchema {
21020    pub fn new() -> Self {
21021        std::default::Default::default()
21022    }
21023
21024    /// Sets the value of [schema][crate::model::SqlServerSchema::schema].
21025    pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21026        self.schema = v.into();
21027        self
21028    }
21029
21030    /// Sets the value of [tables][crate::model::SqlServerSchema::tables].
21031    pub fn set_tables<T, V>(mut self, v: T) -> Self
21032    where
21033        T: std::iter::IntoIterator<Item = V>,
21034        V: std::convert::Into<crate::model::SqlServerTable>,
21035    {
21036        use std::iter::Iterator;
21037        self.tables = v.into_iter().map(|i| i.into()).collect();
21038        self
21039    }
21040}
21041
21042impl wkt::message::Message for SqlServerSchema {
21043    fn typename() -> &'static str {
21044        "type.googleapis.com/google.cloud.datastream.v1.SqlServerSchema"
21045    }
21046}
21047
21048#[doc(hidden)]
21049impl<'de> serde::de::Deserialize<'de> for SqlServerSchema {
21050    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21051    where
21052        D: serde::Deserializer<'de>,
21053    {
21054        #[allow(non_camel_case_types)]
21055        #[doc(hidden)]
21056        #[derive(PartialEq, Eq, Hash)]
21057        enum __FieldTag {
21058            __schema,
21059            __tables,
21060            Unknown(std::string::String),
21061        }
21062        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
21063            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21064            where
21065                D: serde::Deserializer<'de>,
21066            {
21067                struct Visitor;
21068                impl<'de> serde::de::Visitor<'de> for Visitor {
21069                    type Value = __FieldTag;
21070                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
21071                        formatter.write_str("a field name for SqlServerSchema")
21072                    }
21073                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
21074                    where
21075                        E: serde::de::Error,
21076                    {
21077                        use std::result::Result::Ok;
21078                        use std::string::ToString;
21079                        match value {
21080                            "schema" => Ok(__FieldTag::__schema),
21081                            "tables" => Ok(__FieldTag::__tables),
21082                            _ => Ok(__FieldTag::Unknown(value.to_string())),
21083                        }
21084                    }
21085                }
21086                deserializer.deserialize_identifier(Visitor)
21087            }
21088        }
21089        struct Visitor;
21090        impl<'de> serde::de::Visitor<'de> for Visitor {
21091            type Value = SqlServerSchema;
21092            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
21093                formatter.write_str("struct SqlServerSchema")
21094            }
21095            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
21096            where
21097                A: serde::de::MapAccess<'de>,
21098            {
21099                #[allow(unused_imports)]
21100                use serde::de::Error;
21101                use std::option::Option::Some;
21102                let mut fields = std::collections::HashSet::new();
21103                let mut result = Self::Value::new();
21104                while let Some(tag) = map.next_key::<__FieldTag>()? {
21105                    #[allow(clippy::match_single_binding)]
21106                    match tag {
21107                        __FieldTag::__schema => {
21108                            if !fields.insert(__FieldTag::__schema) {
21109                                return std::result::Result::Err(A::Error::duplicate_field(
21110                                    "multiple values for schema",
21111                                ));
21112                            }
21113                            result.schema = map
21114                                .next_value::<std::option::Option<std::string::String>>()?
21115                                .unwrap_or_default();
21116                        }
21117                        __FieldTag::__tables => {
21118                            if !fields.insert(__FieldTag::__tables) {
21119                                return std::result::Result::Err(A::Error::duplicate_field(
21120                                    "multiple values for tables",
21121                                ));
21122                            }
21123                            result.tables =
21124                                map.next_value::<std::option::Option<
21125                                    std::vec::Vec<crate::model::SqlServerTable>,
21126                                >>()?
21127                                .unwrap_or_default();
21128                        }
21129                        __FieldTag::Unknown(key) => {
21130                            let value = map.next_value::<serde_json::Value>()?;
21131                            result._unknown_fields.insert(key, value);
21132                        }
21133                    }
21134                }
21135                std::result::Result::Ok(result)
21136            }
21137        }
21138        deserializer.deserialize_any(Visitor)
21139    }
21140}
21141
21142#[doc(hidden)]
21143impl serde::ser::Serialize for SqlServerSchema {
21144    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21145    where
21146        S: serde::ser::Serializer,
21147    {
21148        use serde::ser::SerializeMap;
21149        #[allow(unused_imports)]
21150        use std::option::Option::Some;
21151        let mut state = serializer.serialize_map(std::option::Option::None)?;
21152        if !self.schema.is_empty() {
21153            state.serialize_entry("schema", &self.schema)?;
21154        }
21155        if !self.tables.is_empty() {
21156            state.serialize_entry("tables", &self.tables)?;
21157        }
21158        if !self._unknown_fields.is_empty() {
21159            for (key, value) in self._unknown_fields.iter() {
21160                state.serialize_entry(key, &value)?;
21161            }
21162        }
21163        state.end()
21164    }
21165}
21166
21167impl std::fmt::Debug for SqlServerSchema {
21168    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
21169        let mut debug_struct = f.debug_struct("SqlServerSchema");
21170        debug_struct.field("schema", &self.schema);
21171        debug_struct.field("tables", &self.tables);
21172        if !self._unknown_fields.is_empty() {
21173            debug_struct.field("_unknown_fields", &self._unknown_fields);
21174        }
21175        debug_struct.finish()
21176    }
21177}
21178
21179/// SQLServer database structure.
21180#[derive(Clone, Default, PartialEq)]
21181#[non_exhaustive]
21182pub struct SqlServerRdbms {
21183    /// SQLServer schemas in the database server.
21184    pub schemas: std::vec::Vec<crate::model::SqlServerSchema>,
21185
21186    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21187}
21188
21189impl SqlServerRdbms {
21190    pub fn new() -> Self {
21191        std::default::Default::default()
21192    }
21193
21194    /// Sets the value of [schemas][crate::model::SqlServerRdbms::schemas].
21195    pub fn set_schemas<T, V>(mut self, v: T) -> Self
21196    where
21197        T: std::iter::IntoIterator<Item = V>,
21198        V: std::convert::Into<crate::model::SqlServerSchema>,
21199    {
21200        use std::iter::Iterator;
21201        self.schemas = v.into_iter().map(|i| i.into()).collect();
21202        self
21203    }
21204}
21205
21206impl wkt::message::Message for SqlServerRdbms {
21207    fn typename() -> &'static str {
21208        "type.googleapis.com/google.cloud.datastream.v1.SqlServerRdbms"
21209    }
21210}
21211
21212#[doc(hidden)]
21213impl<'de> serde::de::Deserialize<'de> for SqlServerRdbms {
21214    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21215    where
21216        D: serde::Deserializer<'de>,
21217    {
21218        #[allow(non_camel_case_types)]
21219        #[doc(hidden)]
21220        #[derive(PartialEq, Eq, Hash)]
21221        enum __FieldTag {
21222            __schemas,
21223            Unknown(std::string::String),
21224        }
21225        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
21226            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21227            where
21228                D: serde::Deserializer<'de>,
21229            {
21230                struct Visitor;
21231                impl<'de> serde::de::Visitor<'de> for Visitor {
21232                    type Value = __FieldTag;
21233                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
21234                        formatter.write_str("a field name for SqlServerRdbms")
21235                    }
21236                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
21237                    where
21238                        E: serde::de::Error,
21239                    {
21240                        use std::result::Result::Ok;
21241                        use std::string::ToString;
21242                        match value {
21243                            "schemas" => Ok(__FieldTag::__schemas),
21244                            _ => Ok(__FieldTag::Unknown(value.to_string())),
21245                        }
21246                    }
21247                }
21248                deserializer.deserialize_identifier(Visitor)
21249            }
21250        }
21251        struct Visitor;
21252        impl<'de> serde::de::Visitor<'de> for Visitor {
21253            type Value = SqlServerRdbms;
21254            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
21255                formatter.write_str("struct SqlServerRdbms")
21256            }
21257            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
21258            where
21259                A: serde::de::MapAccess<'de>,
21260            {
21261                #[allow(unused_imports)]
21262                use serde::de::Error;
21263                use std::option::Option::Some;
21264                let mut fields = std::collections::HashSet::new();
21265                let mut result = Self::Value::new();
21266                while let Some(tag) = map.next_key::<__FieldTag>()? {
21267                    #[allow(clippy::match_single_binding)]
21268                    match tag {
21269                        __FieldTag::__schemas => {
21270                            if !fields.insert(__FieldTag::__schemas) {
21271                                return std::result::Result::Err(A::Error::duplicate_field(
21272                                    "multiple values for schemas",
21273                                ));
21274                            }
21275                            result.schemas =
21276                                map.next_value::<std::option::Option<
21277                                    std::vec::Vec<crate::model::SqlServerSchema>,
21278                                >>()?
21279                                .unwrap_or_default();
21280                        }
21281                        __FieldTag::Unknown(key) => {
21282                            let value = map.next_value::<serde_json::Value>()?;
21283                            result._unknown_fields.insert(key, value);
21284                        }
21285                    }
21286                }
21287                std::result::Result::Ok(result)
21288            }
21289        }
21290        deserializer.deserialize_any(Visitor)
21291    }
21292}
21293
21294#[doc(hidden)]
21295impl serde::ser::Serialize for SqlServerRdbms {
21296    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21297    where
21298        S: serde::ser::Serializer,
21299    {
21300        use serde::ser::SerializeMap;
21301        #[allow(unused_imports)]
21302        use std::option::Option::Some;
21303        let mut state = serializer.serialize_map(std::option::Option::None)?;
21304        if !self.schemas.is_empty() {
21305            state.serialize_entry("schemas", &self.schemas)?;
21306        }
21307        if !self._unknown_fields.is_empty() {
21308            for (key, value) in self._unknown_fields.iter() {
21309                state.serialize_entry(key, &value)?;
21310            }
21311        }
21312        state.end()
21313    }
21314}
21315
21316impl std::fmt::Debug for SqlServerRdbms {
21317    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
21318        let mut debug_struct = f.debug_struct("SqlServerRdbms");
21319        debug_struct.field("schemas", &self.schemas);
21320        if !self._unknown_fields.is_empty() {
21321            debug_struct.field("_unknown_fields", &self._unknown_fields);
21322        }
21323        debug_struct.finish()
21324    }
21325}
21326
21327/// SQLServer data source configuration
21328#[derive(Clone, Default, PartialEq)]
21329#[non_exhaustive]
21330pub struct SqlServerSourceConfig {
21331    /// SQLServer objects to include in the stream.
21332    pub include_objects: std::option::Option<crate::model::SqlServerRdbms>,
21333
21334    /// SQLServer objects to exclude from the stream.
21335    pub exclude_objects: std::option::Option<crate::model::SqlServerRdbms>,
21336
21337    /// Max concurrent CDC tasks.
21338    pub max_concurrent_cdc_tasks: i32,
21339
21340    /// Max concurrent backfill tasks.
21341    pub max_concurrent_backfill_tasks: i32,
21342
21343    /// Configuration to select the CDC read method for the stream.
21344    pub cdc_method: std::option::Option<crate::model::sql_server_source_config::CdcMethod>,
21345
21346    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21347}
21348
21349impl SqlServerSourceConfig {
21350    pub fn new() -> Self {
21351        std::default::Default::default()
21352    }
21353
21354    /// Sets the value of [include_objects][crate::model::SqlServerSourceConfig::include_objects].
21355    pub fn set_include_objects<T>(mut self, v: T) -> Self
21356    where
21357        T: std::convert::Into<crate::model::SqlServerRdbms>,
21358    {
21359        self.include_objects = std::option::Option::Some(v.into());
21360        self
21361    }
21362
21363    /// Sets or clears the value of [include_objects][crate::model::SqlServerSourceConfig::include_objects].
21364    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
21365    where
21366        T: std::convert::Into<crate::model::SqlServerRdbms>,
21367    {
21368        self.include_objects = v.map(|x| x.into());
21369        self
21370    }
21371
21372    /// Sets the value of [exclude_objects][crate::model::SqlServerSourceConfig::exclude_objects].
21373    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
21374    where
21375        T: std::convert::Into<crate::model::SqlServerRdbms>,
21376    {
21377        self.exclude_objects = std::option::Option::Some(v.into());
21378        self
21379    }
21380
21381    /// Sets or clears the value of [exclude_objects][crate::model::SqlServerSourceConfig::exclude_objects].
21382    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
21383    where
21384        T: std::convert::Into<crate::model::SqlServerRdbms>,
21385    {
21386        self.exclude_objects = v.map(|x| x.into());
21387        self
21388    }
21389
21390    /// Sets the value of [max_concurrent_cdc_tasks][crate::model::SqlServerSourceConfig::max_concurrent_cdc_tasks].
21391    pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
21392        self.max_concurrent_cdc_tasks = v.into();
21393        self
21394    }
21395
21396    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::SqlServerSourceConfig::max_concurrent_backfill_tasks].
21397    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
21398        self.max_concurrent_backfill_tasks = v.into();
21399        self
21400    }
21401
21402    /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method].
21403    ///
21404    /// Note that all the setters affecting `cdc_method` are mutually
21405    /// exclusive.
21406    pub fn set_cdc_method<
21407        T: std::convert::Into<std::option::Option<crate::model::sql_server_source_config::CdcMethod>>,
21408    >(
21409        mut self,
21410        v: T,
21411    ) -> Self {
21412        self.cdc_method = v.into();
21413        self
21414    }
21415
21416    /// The value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
21417    /// if it holds a `TransactionLogs`, `None` if the field is not set or
21418    /// holds a different branch.
21419    pub fn transaction_logs(
21420        &self,
21421    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerTransactionLogs>> {
21422        #[allow(unreachable_patterns)]
21423        self.cdc_method.as_ref().and_then(|v| match v {
21424            crate::model::sql_server_source_config::CdcMethod::TransactionLogs(v) => {
21425                std::option::Option::Some(v)
21426            }
21427            _ => std::option::Option::None,
21428        })
21429    }
21430
21431    /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
21432    /// to hold a `TransactionLogs`.
21433    ///
21434    /// Note that all the setters affecting `cdc_method` are
21435    /// mutually exclusive.
21436    pub fn set_transaction_logs<
21437        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerTransactionLogs>>,
21438    >(
21439        mut self,
21440        v: T,
21441    ) -> Self {
21442        self.cdc_method = std::option::Option::Some(
21443            crate::model::sql_server_source_config::CdcMethod::TransactionLogs(v.into()),
21444        );
21445        self
21446    }
21447
21448    /// The value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
21449    /// if it holds a `ChangeTables`, `None` if the field is not set or
21450    /// holds a different branch.
21451    pub fn change_tables(
21452        &self,
21453    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerChangeTables>> {
21454        #[allow(unreachable_patterns)]
21455        self.cdc_method.as_ref().and_then(|v| match v {
21456            crate::model::sql_server_source_config::CdcMethod::ChangeTables(v) => {
21457                std::option::Option::Some(v)
21458            }
21459            _ => std::option::Option::None,
21460        })
21461    }
21462
21463    /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
21464    /// to hold a `ChangeTables`.
21465    ///
21466    /// Note that all the setters affecting `cdc_method` are
21467    /// mutually exclusive.
21468    pub fn set_change_tables<
21469        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerChangeTables>>,
21470    >(
21471        mut self,
21472        v: T,
21473    ) -> Self {
21474        self.cdc_method = std::option::Option::Some(
21475            crate::model::sql_server_source_config::CdcMethod::ChangeTables(v.into()),
21476        );
21477        self
21478    }
21479}
21480
21481impl wkt::message::Message for SqlServerSourceConfig {
21482    fn typename() -> &'static str {
21483        "type.googleapis.com/google.cloud.datastream.v1.SqlServerSourceConfig"
21484    }
21485}
21486
21487#[doc(hidden)]
21488impl<'de> serde::de::Deserialize<'de> for SqlServerSourceConfig {
21489    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21490    where
21491        D: serde::Deserializer<'de>,
21492    {
21493        #[allow(non_camel_case_types)]
21494        #[doc(hidden)]
21495        #[derive(PartialEq, Eq, Hash)]
21496        enum __FieldTag {
21497            __include_objects,
21498            __exclude_objects,
21499            __max_concurrent_cdc_tasks,
21500            __max_concurrent_backfill_tasks,
21501            __transaction_logs,
21502            __change_tables,
21503            Unknown(std::string::String),
21504        }
21505        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
21506            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21507            where
21508                D: serde::Deserializer<'de>,
21509            {
21510                struct Visitor;
21511                impl<'de> serde::de::Visitor<'de> for Visitor {
21512                    type Value = __FieldTag;
21513                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
21514                        formatter.write_str("a field name for SqlServerSourceConfig")
21515                    }
21516                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
21517                    where
21518                        E: serde::de::Error,
21519                    {
21520                        use std::result::Result::Ok;
21521                        use std::string::ToString;
21522                        match value {
21523                            "includeObjects" => Ok(__FieldTag::__include_objects),
21524                            "include_objects" => Ok(__FieldTag::__include_objects),
21525                            "excludeObjects" => Ok(__FieldTag::__exclude_objects),
21526                            "exclude_objects" => Ok(__FieldTag::__exclude_objects),
21527                            "maxConcurrentCdcTasks" => Ok(__FieldTag::__max_concurrent_cdc_tasks),
21528                            "max_concurrent_cdc_tasks" => {
21529                                Ok(__FieldTag::__max_concurrent_cdc_tasks)
21530                            }
21531                            "maxConcurrentBackfillTasks" => {
21532                                Ok(__FieldTag::__max_concurrent_backfill_tasks)
21533                            }
21534                            "max_concurrent_backfill_tasks" => {
21535                                Ok(__FieldTag::__max_concurrent_backfill_tasks)
21536                            }
21537                            "transactionLogs" => Ok(__FieldTag::__transaction_logs),
21538                            "transaction_logs" => Ok(__FieldTag::__transaction_logs),
21539                            "changeTables" => Ok(__FieldTag::__change_tables),
21540                            "change_tables" => Ok(__FieldTag::__change_tables),
21541                            _ => Ok(__FieldTag::Unknown(value.to_string())),
21542                        }
21543                    }
21544                }
21545                deserializer.deserialize_identifier(Visitor)
21546            }
21547        }
21548        struct Visitor;
21549        impl<'de> serde::de::Visitor<'de> for Visitor {
21550            type Value = SqlServerSourceConfig;
21551            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
21552                formatter.write_str("struct SqlServerSourceConfig")
21553            }
21554            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
21555            where
21556                A: serde::de::MapAccess<'de>,
21557            {
21558                #[allow(unused_imports)]
21559                use serde::de::Error;
21560                use std::option::Option::Some;
21561                let mut fields = std::collections::HashSet::new();
21562                let mut result = Self::Value::new();
21563                while let Some(tag) = map.next_key::<__FieldTag>()? {
21564                    #[allow(clippy::match_single_binding)]
21565                    match tag {
21566                        __FieldTag::__include_objects => {
21567                            if !fields.insert(__FieldTag::__include_objects) {
21568                                return std::result::Result::Err(A::Error::duplicate_field(
21569                                    "multiple values for include_objects",
21570                                ));
21571                            }
21572                            result.include_objects = map
21573                                .next_value::<std::option::Option<crate::model::SqlServerRdbms>>(
21574                                )?;
21575                        }
21576                        __FieldTag::__exclude_objects => {
21577                            if !fields.insert(__FieldTag::__exclude_objects) {
21578                                return std::result::Result::Err(A::Error::duplicate_field(
21579                                    "multiple values for exclude_objects",
21580                                ));
21581                            }
21582                            result.exclude_objects = map
21583                                .next_value::<std::option::Option<crate::model::SqlServerRdbms>>(
21584                                )?;
21585                        }
21586                        __FieldTag::__max_concurrent_cdc_tasks => {
21587                            if !fields.insert(__FieldTag::__max_concurrent_cdc_tasks) {
21588                                return std::result::Result::Err(A::Error::duplicate_field(
21589                                    "multiple values for max_concurrent_cdc_tasks",
21590                                ));
21591                            }
21592                            struct __With(std::option::Option<i32>);
21593                            impl<'de> serde::de::Deserialize<'de> for __With {
21594                                fn deserialize<D>(
21595                                    deserializer: D,
21596                                ) -> std::result::Result<Self, D::Error>
21597                                where
21598                                    D: serde::de::Deserializer<'de>,
21599                                {
21600                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
21601                                }
21602                            }
21603                            result.max_concurrent_cdc_tasks =
21604                                map.next_value::<__With>()?.0.unwrap_or_default();
21605                        }
21606                        __FieldTag::__max_concurrent_backfill_tasks => {
21607                            if !fields.insert(__FieldTag::__max_concurrent_backfill_tasks) {
21608                                return std::result::Result::Err(A::Error::duplicate_field(
21609                                    "multiple values for max_concurrent_backfill_tasks",
21610                                ));
21611                            }
21612                            struct __With(std::option::Option<i32>);
21613                            impl<'de> serde::de::Deserialize<'de> for __With {
21614                                fn deserialize<D>(
21615                                    deserializer: D,
21616                                ) -> std::result::Result<Self, D::Error>
21617                                where
21618                                    D: serde::de::Deserializer<'de>,
21619                                {
21620                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
21621                                }
21622                            }
21623                            result.max_concurrent_backfill_tasks =
21624                                map.next_value::<__With>()?.0.unwrap_or_default();
21625                        }
21626                        __FieldTag::__transaction_logs => {
21627                            if !fields.insert(__FieldTag::__transaction_logs) {
21628                                return std::result::Result::Err(A::Error::duplicate_field(
21629                                    "multiple values for transaction_logs",
21630                                ));
21631                            }
21632                            if result.cdc_method.is_some() {
21633                                return std::result::Result::Err(A::Error::duplicate_field(
21634                                    "multiple values for `cdc_method`, a oneof with full ID .google.cloud.datastream.v1.SqlServerSourceConfig.transaction_logs, latest field was transactionLogs",
21635                                ));
21636                            }
21637                            result.cdc_method = std::option::Option::Some(
21638                                crate::model::sql_server_source_config::CdcMethod::TransactionLogs(
21639                                    map.next_value::<std::option::Option<
21640                                        std::boxed::Box<crate::model::SqlServerTransactionLogs>,
21641                                    >>()?
21642                                    .unwrap_or_default(),
21643                                ),
21644                            );
21645                        }
21646                        __FieldTag::__change_tables => {
21647                            if !fields.insert(__FieldTag::__change_tables) {
21648                                return std::result::Result::Err(A::Error::duplicate_field(
21649                                    "multiple values for change_tables",
21650                                ));
21651                            }
21652                            if result.cdc_method.is_some() {
21653                                return std::result::Result::Err(A::Error::duplicate_field(
21654                                    "multiple values for `cdc_method`, a oneof with full ID .google.cloud.datastream.v1.SqlServerSourceConfig.change_tables, latest field was changeTables",
21655                                ));
21656                            }
21657                            result.cdc_method = std::option::Option::Some(
21658                                crate::model::sql_server_source_config::CdcMethod::ChangeTables(
21659                                    map.next_value::<std::option::Option<
21660                                        std::boxed::Box<crate::model::SqlServerChangeTables>,
21661                                    >>()?
21662                                    .unwrap_or_default(),
21663                                ),
21664                            );
21665                        }
21666                        __FieldTag::Unknown(key) => {
21667                            let value = map.next_value::<serde_json::Value>()?;
21668                            result._unknown_fields.insert(key, value);
21669                        }
21670                    }
21671                }
21672                std::result::Result::Ok(result)
21673            }
21674        }
21675        deserializer.deserialize_any(Visitor)
21676    }
21677}
21678
21679#[doc(hidden)]
21680impl serde::ser::Serialize for SqlServerSourceConfig {
21681    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21682    where
21683        S: serde::ser::Serializer,
21684    {
21685        use serde::ser::SerializeMap;
21686        #[allow(unused_imports)]
21687        use std::option::Option::Some;
21688        let mut state = serializer.serialize_map(std::option::Option::None)?;
21689        if self.include_objects.is_some() {
21690            state.serialize_entry("includeObjects", &self.include_objects)?;
21691        }
21692        if self.exclude_objects.is_some() {
21693            state.serialize_entry("excludeObjects", &self.exclude_objects)?;
21694        }
21695        if !wkt::internal::is_default(&self.max_concurrent_cdc_tasks) {
21696            struct __With<'a>(&'a i32);
21697            impl<'a> serde::ser::Serialize for __With<'a> {
21698                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21699                where
21700                    S: serde::ser::Serializer,
21701                {
21702                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
21703                }
21704            }
21705            state.serialize_entry(
21706                "maxConcurrentCdcTasks",
21707                &__With(&self.max_concurrent_cdc_tasks),
21708            )?;
21709        }
21710        if !wkt::internal::is_default(&self.max_concurrent_backfill_tasks) {
21711            struct __With<'a>(&'a i32);
21712            impl<'a> serde::ser::Serialize for __With<'a> {
21713                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21714                where
21715                    S: serde::ser::Serializer,
21716                {
21717                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
21718                }
21719            }
21720            state.serialize_entry(
21721                "maxConcurrentBackfillTasks",
21722                &__With(&self.max_concurrent_backfill_tasks),
21723            )?;
21724        }
21725        if let Some(value) = self.transaction_logs() {
21726            state.serialize_entry("transactionLogs", value)?;
21727        }
21728        if let Some(value) = self.change_tables() {
21729            state.serialize_entry("changeTables", value)?;
21730        }
21731        if !self._unknown_fields.is_empty() {
21732            for (key, value) in self._unknown_fields.iter() {
21733                state.serialize_entry(key, &value)?;
21734            }
21735        }
21736        state.end()
21737    }
21738}
21739
21740impl std::fmt::Debug for SqlServerSourceConfig {
21741    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
21742        let mut debug_struct = f.debug_struct("SqlServerSourceConfig");
21743        debug_struct.field("include_objects", &self.include_objects);
21744        debug_struct.field("exclude_objects", &self.exclude_objects);
21745        debug_struct.field("max_concurrent_cdc_tasks", &self.max_concurrent_cdc_tasks);
21746        debug_struct.field(
21747            "max_concurrent_backfill_tasks",
21748            &self.max_concurrent_backfill_tasks,
21749        );
21750        debug_struct.field("cdc_method", &self.cdc_method);
21751        if !self._unknown_fields.is_empty() {
21752            debug_struct.field("_unknown_fields", &self._unknown_fields);
21753        }
21754        debug_struct.finish()
21755    }
21756}
21757
21758/// Defines additional types related to [SqlServerSourceConfig].
21759pub mod sql_server_source_config {
21760    #[allow(unused_imports)]
21761    use super::*;
21762
21763    /// Configuration to select the CDC read method for the stream.
21764    #[derive(Clone, Debug, PartialEq)]
21765    #[non_exhaustive]
21766    pub enum CdcMethod {
21767        /// CDC reader reads from transaction logs.
21768        TransactionLogs(std::boxed::Box<crate::model::SqlServerTransactionLogs>),
21769        /// CDC reader reads from change tables.
21770        ChangeTables(std::boxed::Box<crate::model::SqlServerChangeTables>),
21771    }
21772}
21773
21774/// Configuration to use Transaction Logs CDC read method.
21775#[derive(Clone, Default, PartialEq)]
21776#[non_exhaustive]
21777pub struct SqlServerTransactionLogs {
21778    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21779}
21780
21781impl SqlServerTransactionLogs {
21782    pub fn new() -> Self {
21783        std::default::Default::default()
21784    }
21785}
21786
21787impl wkt::message::Message for SqlServerTransactionLogs {
21788    fn typename() -> &'static str {
21789        "type.googleapis.com/google.cloud.datastream.v1.SqlServerTransactionLogs"
21790    }
21791}
21792
21793#[doc(hidden)]
21794impl<'de> serde::de::Deserialize<'de> for SqlServerTransactionLogs {
21795    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21796    where
21797        D: serde::Deserializer<'de>,
21798    {
21799        #[allow(non_camel_case_types)]
21800        #[doc(hidden)]
21801        #[derive(PartialEq, Eq, Hash)]
21802        enum __FieldTag {
21803            Unknown(std::string::String),
21804        }
21805        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
21806            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21807            where
21808                D: serde::Deserializer<'de>,
21809            {
21810                struct Visitor;
21811                impl<'de> serde::de::Visitor<'de> for Visitor {
21812                    type Value = __FieldTag;
21813                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
21814                        formatter.write_str("a field name for SqlServerTransactionLogs")
21815                    }
21816                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
21817                    where
21818                        E: serde::de::Error,
21819                    {
21820                        use std::result::Result::Ok;
21821                        use std::string::ToString;
21822                        Ok(__FieldTag::Unknown(value.to_string()))
21823                    }
21824                }
21825                deserializer.deserialize_identifier(Visitor)
21826            }
21827        }
21828        struct Visitor;
21829        impl<'de> serde::de::Visitor<'de> for Visitor {
21830            type Value = SqlServerTransactionLogs;
21831            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
21832                formatter.write_str("struct SqlServerTransactionLogs")
21833            }
21834            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
21835            where
21836                A: serde::de::MapAccess<'de>,
21837            {
21838                #[allow(unused_imports)]
21839                use serde::de::Error;
21840                use std::option::Option::Some;
21841                let mut result = Self::Value::new();
21842                while let Some(tag) = map.next_key::<__FieldTag>()? {
21843                    #[allow(clippy::match_single_binding)]
21844                    match tag {
21845                        __FieldTag::Unknown(key) => {
21846                            let value = map.next_value::<serde_json::Value>()?;
21847                            result._unknown_fields.insert(key, value);
21848                        }
21849                    }
21850                }
21851                std::result::Result::Ok(result)
21852            }
21853        }
21854        deserializer.deserialize_any(Visitor)
21855    }
21856}
21857
21858#[doc(hidden)]
21859impl serde::ser::Serialize for SqlServerTransactionLogs {
21860    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21861    where
21862        S: serde::ser::Serializer,
21863    {
21864        use serde::ser::SerializeMap;
21865        #[allow(unused_imports)]
21866        use std::option::Option::Some;
21867        let mut state = serializer.serialize_map(std::option::Option::None)?;
21868        if !self._unknown_fields.is_empty() {
21869            for (key, value) in self._unknown_fields.iter() {
21870                state.serialize_entry(key, &value)?;
21871            }
21872        }
21873        state.end()
21874    }
21875}
21876
21877impl std::fmt::Debug for SqlServerTransactionLogs {
21878    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
21879        let mut debug_struct = f.debug_struct("SqlServerTransactionLogs");
21880        if !self._unknown_fields.is_empty() {
21881            debug_struct.field("_unknown_fields", &self._unknown_fields);
21882        }
21883        debug_struct.finish()
21884    }
21885}
21886
21887/// Configuration to use Change Tables CDC read method.
21888#[derive(Clone, Default, PartialEq)]
21889#[non_exhaustive]
21890pub struct SqlServerChangeTables {
21891    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21892}
21893
21894impl SqlServerChangeTables {
21895    pub fn new() -> Self {
21896        std::default::Default::default()
21897    }
21898}
21899
21900impl wkt::message::Message for SqlServerChangeTables {
21901    fn typename() -> &'static str {
21902        "type.googleapis.com/google.cloud.datastream.v1.SqlServerChangeTables"
21903    }
21904}
21905
21906#[doc(hidden)]
21907impl<'de> serde::de::Deserialize<'de> for SqlServerChangeTables {
21908    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21909    where
21910        D: serde::Deserializer<'de>,
21911    {
21912        #[allow(non_camel_case_types)]
21913        #[doc(hidden)]
21914        #[derive(PartialEq, Eq, Hash)]
21915        enum __FieldTag {
21916            Unknown(std::string::String),
21917        }
21918        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
21919            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21920            where
21921                D: serde::Deserializer<'de>,
21922            {
21923                struct Visitor;
21924                impl<'de> serde::de::Visitor<'de> for Visitor {
21925                    type Value = __FieldTag;
21926                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
21927                        formatter.write_str("a field name for SqlServerChangeTables")
21928                    }
21929                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
21930                    where
21931                        E: serde::de::Error,
21932                    {
21933                        use std::result::Result::Ok;
21934                        use std::string::ToString;
21935                        Ok(__FieldTag::Unknown(value.to_string()))
21936                    }
21937                }
21938                deserializer.deserialize_identifier(Visitor)
21939            }
21940        }
21941        struct Visitor;
21942        impl<'de> serde::de::Visitor<'de> for Visitor {
21943            type Value = SqlServerChangeTables;
21944            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
21945                formatter.write_str("struct SqlServerChangeTables")
21946            }
21947            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
21948            where
21949                A: serde::de::MapAccess<'de>,
21950            {
21951                #[allow(unused_imports)]
21952                use serde::de::Error;
21953                use std::option::Option::Some;
21954                let mut result = Self::Value::new();
21955                while let Some(tag) = map.next_key::<__FieldTag>()? {
21956                    #[allow(clippy::match_single_binding)]
21957                    match tag {
21958                        __FieldTag::Unknown(key) => {
21959                            let value = map.next_value::<serde_json::Value>()?;
21960                            result._unknown_fields.insert(key, value);
21961                        }
21962                    }
21963                }
21964                std::result::Result::Ok(result)
21965            }
21966        }
21967        deserializer.deserialize_any(Visitor)
21968    }
21969}
21970
21971#[doc(hidden)]
21972impl serde::ser::Serialize for SqlServerChangeTables {
21973    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21974    where
21975        S: serde::ser::Serializer,
21976    {
21977        use serde::ser::SerializeMap;
21978        #[allow(unused_imports)]
21979        use std::option::Option::Some;
21980        let mut state = serializer.serialize_map(std::option::Option::None)?;
21981        if !self._unknown_fields.is_empty() {
21982            for (key, value) in self._unknown_fields.iter() {
21983                state.serialize_entry(key, &value)?;
21984            }
21985        }
21986        state.end()
21987    }
21988}
21989
21990impl std::fmt::Debug for SqlServerChangeTables {
21991    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
21992        let mut debug_struct = f.debug_struct("SqlServerChangeTables");
21993        if !self._unknown_fields.is_empty() {
21994            debug_struct.field("_unknown_fields", &self._unknown_fields);
21995        }
21996        debug_struct.finish()
21997    }
21998}
21999
22000/// MySQL Column.
22001#[derive(Clone, Default, PartialEq)]
22002#[non_exhaustive]
22003pub struct MysqlColumn {
22004    /// Column name.
22005    pub column: std::string::String,
22006
22007    /// The MySQL data type. Full data types list can be found here:
22008    /// <https://dev.mysql.com/doc/refman/8.0/en/data-types.html>
22009    pub data_type: std::string::String,
22010
22011    /// Column length.
22012    pub length: i32,
22013
22014    /// Column collation.
22015    pub collation: std::string::String,
22016
22017    /// Whether or not the column represents a primary key.
22018    pub primary_key: bool,
22019
22020    /// Whether or not the column can accept a null value.
22021    pub nullable: bool,
22022
22023    /// The ordinal position of the column in the table.
22024    pub ordinal_position: i32,
22025
22026    /// Column precision.
22027    pub precision: i32,
22028
22029    /// Column scale.
22030    pub scale: i32,
22031
22032    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22033}
22034
22035impl MysqlColumn {
22036    pub fn new() -> Self {
22037        std::default::Default::default()
22038    }
22039
22040    /// Sets the value of [column][crate::model::MysqlColumn::column].
22041    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22042        self.column = v.into();
22043        self
22044    }
22045
22046    /// Sets the value of [data_type][crate::model::MysqlColumn::data_type].
22047    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22048        self.data_type = v.into();
22049        self
22050    }
22051
22052    /// Sets the value of [length][crate::model::MysqlColumn::length].
22053    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
22054        self.length = v.into();
22055        self
22056    }
22057
22058    /// Sets the value of [collation][crate::model::MysqlColumn::collation].
22059    pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22060        self.collation = v.into();
22061        self
22062    }
22063
22064    /// Sets the value of [primary_key][crate::model::MysqlColumn::primary_key].
22065    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
22066        self.primary_key = v.into();
22067        self
22068    }
22069
22070    /// Sets the value of [nullable][crate::model::MysqlColumn::nullable].
22071    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
22072        self.nullable = v.into();
22073        self
22074    }
22075
22076    /// Sets the value of [ordinal_position][crate::model::MysqlColumn::ordinal_position].
22077    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
22078        self.ordinal_position = v.into();
22079        self
22080    }
22081
22082    /// Sets the value of [precision][crate::model::MysqlColumn::precision].
22083    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
22084        self.precision = v.into();
22085        self
22086    }
22087
22088    /// Sets the value of [scale][crate::model::MysqlColumn::scale].
22089    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
22090        self.scale = v.into();
22091        self
22092    }
22093}
22094
22095impl wkt::message::Message for MysqlColumn {
22096    fn typename() -> &'static str {
22097        "type.googleapis.com/google.cloud.datastream.v1.MysqlColumn"
22098    }
22099}
22100
22101#[doc(hidden)]
22102impl<'de> serde::de::Deserialize<'de> for MysqlColumn {
22103    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22104    where
22105        D: serde::Deserializer<'de>,
22106    {
22107        #[allow(non_camel_case_types)]
22108        #[doc(hidden)]
22109        #[derive(PartialEq, Eq, Hash)]
22110        enum __FieldTag {
22111            __column,
22112            __data_type,
22113            __length,
22114            __collation,
22115            __primary_key,
22116            __nullable,
22117            __ordinal_position,
22118            __precision,
22119            __scale,
22120            Unknown(std::string::String),
22121        }
22122        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
22123            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22124            where
22125                D: serde::Deserializer<'de>,
22126            {
22127                struct Visitor;
22128                impl<'de> serde::de::Visitor<'de> for Visitor {
22129                    type Value = __FieldTag;
22130                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
22131                        formatter.write_str("a field name for MysqlColumn")
22132                    }
22133                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
22134                    where
22135                        E: serde::de::Error,
22136                    {
22137                        use std::result::Result::Ok;
22138                        use std::string::ToString;
22139                        match value {
22140                            "column" => Ok(__FieldTag::__column),
22141                            "dataType" => Ok(__FieldTag::__data_type),
22142                            "data_type" => Ok(__FieldTag::__data_type),
22143                            "length" => Ok(__FieldTag::__length),
22144                            "collation" => Ok(__FieldTag::__collation),
22145                            "primaryKey" => Ok(__FieldTag::__primary_key),
22146                            "primary_key" => Ok(__FieldTag::__primary_key),
22147                            "nullable" => Ok(__FieldTag::__nullable),
22148                            "ordinalPosition" => Ok(__FieldTag::__ordinal_position),
22149                            "ordinal_position" => Ok(__FieldTag::__ordinal_position),
22150                            "precision" => Ok(__FieldTag::__precision),
22151                            "scale" => Ok(__FieldTag::__scale),
22152                            _ => Ok(__FieldTag::Unknown(value.to_string())),
22153                        }
22154                    }
22155                }
22156                deserializer.deserialize_identifier(Visitor)
22157            }
22158        }
22159        struct Visitor;
22160        impl<'de> serde::de::Visitor<'de> for Visitor {
22161            type Value = MysqlColumn;
22162            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
22163                formatter.write_str("struct MysqlColumn")
22164            }
22165            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
22166            where
22167                A: serde::de::MapAccess<'de>,
22168            {
22169                #[allow(unused_imports)]
22170                use serde::de::Error;
22171                use std::option::Option::Some;
22172                let mut fields = std::collections::HashSet::new();
22173                let mut result = Self::Value::new();
22174                while let Some(tag) = map.next_key::<__FieldTag>()? {
22175                    #[allow(clippy::match_single_binding)]
22176                    match tag {
22177                        __FieldTag::__column => {
22178                            if !fields.insert(__FieldTag::__column) {
22179                                return std::result::Result::Err(A::Error::duplicate_field(
22180                                    "multiple values for column",
22181                                ));
22182                            }
22183                            result.column = map
22184                                .next_value::<std::option::Option<std::string::String>>()?
22185                                .unwrap_or_default();
22186                        }
22187                        __FieldTag::__data_type => {
22188                            if !fields.insert(__FieldTag::__data_type) {
22189                                return std::result::Result::Err(A::Error::duplicate_field(
22190                                    "multiple values for data_type",
22191                                ));
22192                            }
22193                            result.data_type = map
22194                                .next_value::<std::option::Option<std::string::String>>()?
22195                                .unwrap_or_default();
22196                        }
22197                        __FieldTag::__length => {
22198                            if !fields.insert(__FieldTag::__length) {
22199                                return std::result::Result::Err(A::Error::duplicate_field(
22200                                    "multiple values for length",
22201                                ));
22202                            }
22203                            struct __With(std::option::Option<i32>);
22204                            impl<'de> serde::de::Deserialize<'de> for __With {
22205                                fn deserialize<D>(
22206                                    deserializer: D,
22207                                ) -> std::result::Result<Self, D::Error>
22208                                where
22209                                    D: serde::de::Deserializer<'de>,
22210                                {
22211                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
22212                                }
22213                            }
22214                            result.length = map.next_value::<__With>()?.0.unwrap_or_default();
22215                        }
22216                        __FieldTag::__collation => {
22217                            if !fields.insert(__FieldTag::__collation) {
22218                                return std::result::Result::Err(A::Error::duplicate_field(
22219                                    "multiple values for collation",
22220                                ));
22221                            }
22222                            result.collation = map
22223                                .next_value::<std::option::Option<std::string::String>>()?
22224                                .unwrap_or_default();
22225                        }
22226                        __FieldTag::__primary_key => {
22227                            if !fields.insert(__FieldTag::__primary_key) {
22228                                return std::result::Result::Err(A::Error::duplicate_field(
22229                                    "multiple values for primary_key",
22230                                ));
22231                            }
22232                            result.primary_key = map
22233                                .next_value::<std::option::Option<bool>>()?
22234                                .unwrap_or_default();
22235                        }
22236                        __FieldTag::__nullable => {
22237                            if !fields.insert(__FieldTag::__nullable) {
22238                                return std::result::Result::Err(A::Error::duplicate_field(
22239                                    "multiple values for nullable",
22240                                ));
22241                            }
22242                            result.nullable = map
22243                                .next_value::<std::option::Option<bool>>()?
22244                                .unwrap_or_default();
22245                        }
22246                        __FieldTag::__ordinal_position => {
22247                            if !fields.insert(__FieldTag::__ordinal_position) {
22248                                return std::result::Result::Err(A::Error::duplicate_field(
22249                                    "multiple values for ordinal_position",
22250                                ));
22251                            }
22252                            struct __With(std::option::Option<i32>);
22253                            impl<'de> serde::de::Deserialize<'de> for __With {
22254                                fn deserialize<D>(
22255                                    deserializer: D,
22256                                ) -> std::result::Result<Self, D::Error>
22257                                where
22258                                    D: serde::de::Deserializer<'de>,
22259                                {
22260                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
22261                                }
22262                            }
22263                            result.ordinal_position =
22264                                map.next_value::<__With>()?.0.unwrap_or_default();
22265                        }
22266                        __FieldTag::__precision => {
22267                            if !fields.insert(__FieldTag::__precision) {
22268                                return std::result::Result::Err(A::Error::duplicate_field(
22269                                    "multiple values for precision",
22270                                ));
22271                            }
22272                            struct __With(std::option::Option<i32>);
22273                            impl<'de> serde::de::Deserialize<'de> for __With {
22274                                fn deserialize<D>(
22275                                    deserializer: D,
22276                                ) -> std::result::Result<Self, D::Error>
22277                                where
22278                                    D: serde::de::Deserializer<'de>,
22279                                {
22280                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
22281                                }
22282                            }
22283                            result.precision = map.next_value::<__With>()?.0.unwrap_or_default();
22284                        }
22285                        __FieldTag::__scale => {
22286                            if !fields.insert(__FieldTag::__scale) {
22287                                return std::result::Result::Err(A::Error::duplicate_field(
22288                                    "multiple values for scale",
22289                                ));
22290                            }
22291                            struct __With(std::option::Option<i32>);
22292                            impl<'de> serde::de::Deserialize<'de> for __With {
22293                                fn deserialize<D>(
22294                                    deserializer: D,
22295                                ) -> std::result::Result<Self, D::Error>
22296                                where
22297                                    D: serde::de::Deserializer<'de>,
22298                                {
22299                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
22300                                }
22301                            }
22302                            result.scale = map.next_value::<__With>()?.0.unwrap_or_default();
22303                        }
22304                        __FieldTag::Unknown(key) => {
22305                            let value = map.next_value::<serde_json::Value>()?;
22306                            result._unknown_fields.insert(key, value);
22307                        }
22308                    }
22309                }
22310                std::result::Result::Ok(result)
22311            }
22312        }
22313        deserializer.deserialize_any(Visitor)
22314    }
22315}
22316
22317#[doc(hidden)]
22318impl serde::ser::Serialize for MysqlColumn {
22319    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22320    where
22321        S: serde::ser::Serializer,
22322    {
22323        use serde::ser::SerializeMap;
22324        #[allow(unused_imports)]
22325        use std::option::Option::Some;
22326        let mut state = serializer.serialize_map(std::option::Option::None)?;
22327        if !self.column.is_empty() {
22328            state.serialize_entry("column", &self.column)?;
22329        }
22330        if !self.data_type.is_empty() {
22331            state.serialize_entry("dataType", &self.data_type)?;
22332        }
22333        if !wkt::internal::is_default(&self.length) {
22334            struct __With<'a>(&'a i32);
22335            impl<'a> serde::ser::Serialize for __With<'a> {
22336                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22337                where
22338                    S: serde::ser::Serializer,
22339                {
22340                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
22341                }
22342            }
22343            state.serialize_entry("length", &__With(&self.length))?;
22344        }
22345        if !self.collation.is_empty() {
22346            state.serialize_entry("collation", &self.collation)?;
22347        }
22348        if !wkt::internal::is_default(&self.primary_key) {
22349            state.serialize_entry("primaryKey", &self.primary_key)?;
22350        }
22351        if !wkt::internal::is_default(&self.nullable) {
22352            state.serialize_entry("nullable", &self.nullable)?;
22353        }
22354        if !wkt::internal::is_default(&self.ordinal_position) {
22355            struct __With<'a>(&'a i32);
22356            impl<'a> serde::ser::Serialize for __With<'a> {
22357                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22358                where
22359                    S: serde::ser::Serializer,
22360                {
22361                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
22362                }
22363            }
22364            state.serialize_entry("ordinalPosition", &__With(&self.ordinal_position))?;
22365        }
22366        if !wkt::internal::is_default(&self.precision) {
22367            struct __With<'a>(&'a i32);
22368            impl<'a> serde::ser::Serialize for __With<'a> {
22369                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22370                where
22371                    S: serde::ser::Serializer,
22372                {
22373                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
22374                }
22375            }
22376            state.serialize_entry("precision", &__With(&self.precision))?;
22377        }
22378        if !wkt::internal::is_default(&self.scale) {
22379            struct __With<'a>(&'a i32);
22380            impl<'a> serde::ser::Serialize for __With<'a> {
22381                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22382                where
22383                    S: serde::ser::Serializer,
22384                {
22385                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
22386                }
22387            }
22388            state.serialize_entry("scale", &__With(&self.scale))?;
22389        }
22390        if !self._unknown_fields.is_empty() {
22391            for (key, value) in self._unknown_fields.iter() {
22392                state.serialize_entry(key, &value)?;
22393            }
22394        }
22395        state.end()
22396    }
22397}
22398
22399impl std::fmt::Debug for MysqlColumn {
22400    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
22401        let mut debug_struct = f.debug_struct("MysqlColumn");
22402        debug_struct.field("column", &self.column);
22403        debug_struct.field("data_type", &self.data_type);
22404        debug_struct.field("length", &self.length);
22405        debug_struct.field("collation", &self.collation);
22406        debug_struct.field("primary_key", &self.primary_key);
22407        debug_struct.field("nullable", &self.nullable);
22408        debug_struct.field("ordinal_position", &self.ordinal_position);
22409        debug_struct.field("precision", &self.precision);
22410        debug_struct.field("scale", &self.scale);
22411        if !self._unknown_fields.is_empty() {
22412            debug_struct.field("_unknown_fields", &self._unknown_fields);
22413        }
22414        debug_struct.finish()
22415    }
22416}
22417
22418/// MySQL table.
22419#[derive(Clone, Default, PartialEq)]
22420#[non_exhaustive]
22421pub struct MysqlTable {
22422    /// Table name.
22423    pub table: std::string::String,
22424
22425    /// MySQL columns in the database.
22426    /// When unspecified as part of include/exclude objects, includes/excludes
22427    /// everything.
22428    pub mysql_columns: std::vec::Vec<crate::model::MysqlColumn>,
22429
22430    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22431}
22432
22433impl MysqlTable {
22434    pub fn new() -> Self {
22435        std::default::Default::default()
22436    }
22437
22438    /// Sets the value of [table][crate::model::MysqlTable::table].
22439    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22440        self.table = v.into();
22441        self
22442    }
22443
22444    /// Sets the value of [mysql_columns][crate::model::MysqlTable::mysql_columns].
22445    pub fn set_mysql_columns<T, V>(mut self, v: T) -> Self
22446    where
22447        T: std::iter::IntoIterator<Item = V>,
22448        V: std::convert::Into<crate::model::MysqlColumn>,
22449    {
22450        use std::iter::Iterator;
22451        self.mysql_columns = v.into_iter().map(|i| i.into()).collect();
22452        self
22453    }
22454}
22455
22456impl wkt::message::Message for MysqlTable {
22457    fn typename() -> &'static str {
22458        "type.googleapis.com/google.cloud.datastream.v1.MysqlTable"
22459    }
22460}
22461
22462#[doc(hidden)]
22463impl<'de> serde::de::Deserialize<'de> for MysqlTable {
22464    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22465    where
22466        D: serde::Deserializer<'de>,
22467    {
22468        #[allow(non_camel_case_types)]
22469        #[doc(hidden)]
22470        #[derive(PartialEq, Eq, Hash)]
22471        enum __FieldTag {
22472            __table,
22473            __mysql_columns,
22474            Unknown(std::string::String),
22475        }
22476        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
22477            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22478            where
22479                D: serde::Deserializer<'de>,
22480            {
22481                struct Visitor;
22482                impl<'de> serde::de::Visitor<'de> for Visitor {
22483                    type Value = __FieldTag;
22484                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
22485                        formatter.write_str("a field name for MysqlTable")
22486                    }
22487                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
22488                    where
22489                        E: serde::de::Error,
22490                    {
22491                        use std::result::Result::Ok;
22492                        use std::string::ToString;
22493                        match value {
22494                            "table" => Ok(__FieldTag::__table),
22495                            "mysqlColumns" => Ok(__FieldTag::__mysql_columns),
22496                            "mysql_columns" => Ok(__FieldTag::__mysql_columns),
22497                            _ => Ok(__FieldTag::Unknown(value.to_string())),
22498                        }
22499                    }
22500                }
22501                deserializer.deserialize_identifier(Visitor)
22502            }
22503        }
22504        struct Visitor;
22505        impl<'de> serde::de::Visitor<'de> for Visitor {
22506            type Value = MysqlTable;
22507            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
22508                formatter.write_str("struct MysqlTable")
22509            }
22510            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
22511            where
22512                A: serde::de::MapAccess<'de>,
22513            {
22514                #[allow(unused_imports)]
22515                use serde::de::Error;
22516                use std::option::Option::Some;
22517                let mut fields = std::collections::HashSet::new();
22518                let mut result = Self::Value::new();
22519                while let Some(tag) = map.next_key::<__FieldTag>()? {
22520                    #[allow(clippy::match_single_binding)]
22521                    match tag {
22522                        __FieldTag::__table => {
22523                            if !fields.insert(__FieldTag::__table) {
22524                                return std::result::Result::Err(A::Error::duplicate_field(
22525                                    "multiple values for table",
22526                                ));
22527                            }
22528                            result.table = map
22529                                .next_value::<std::option::Option<std::string::String>>()?
22530                                .unwrap_or_default();
22531                        }
22532                        __FieldTag::__mysql_columns => {
22533                            if !fields.insert(__FieldTag::__mysql_columns) {
22534                                return std::result::Result::Err(A::Error::duplicate_field(
22535                                    "multiple values for mysql_columns",
22536                                ));
22537                            }
22538                            result.mysql_columns = map.next_value::<std::option::Option<std::vec::Vec<crate::model::MysqlColumn>>>()?.unwrap_or_default();
22539                        }
22540                        __FieldTag::Unknown(key) => {
22541                            let value = map.next_value::<serde_json::Value>()?;
22542                            result._unknown_fields.insert(key, value);
22543                        }
22544                    }
22545                }
22546                std::result::Result::Ok(result)
22547            }
22548        }
22549        deserializer.deserialize_any(Visitor)
22550    }
22551}
22552
22553#[doc(hidden)]
22554impl serde::ser::Serialize for MysqlTable {
22555    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22556    where
22557        S: serde::ser::Serializer,
22558    {
22559        use serde::ser::SerializeMap;
22560        #[allow(unused_imports)]
22561        use std::option::Option::Some;
22562        let mut state = serializer.serialize_map(std::option::Option::None)?;
22563        if !self.table.is_empty() {
22564            state.serialize_entry("table", &self.table)?;
22565        }
22566        if !self.mysql_columns.is_empty() {
22567            state.serialize_entry("mysqlColumns", &self.mysql_columns)?;
22568        }
22569        if !self._unknown_fields.is_empty() {
22570            for (key, value) in self._unknown_fields.iter() {
22571                state.serialize_entry(key, &value)?;
22572            }
22573        }
22574        state.end()
22575    }
22576}
22577
22578impl std::fmt::Debug for MysqlTable {
22579    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
22580        let mut debug_struct = f.debug_struct("MysqlTable");
22581        debug_struct.field("table", &self.table);
22582        debug_struct.field("mysql_columns", &self.mysql_columns);
22583        if !self._unknown_fields.is_empty() {
22584            debug_struct.field("_unknown_fields", &self._unknown_fields);
22585        }
22586        debug_struct.finish()
22587    }
22588}
22589
22590/// MySQL database.
22591#[derive(Clone, Default, PartialEq)]
22592#[non_exhaustive]
22593pub struct MysqlDatabase {
22594    /// Database name.
22595    pub database: std::string::String,
22596
22597    /// Tables in the database.
22598    pub mysql_tables: std::vec::Vec<crate::model::MysqlTable>,
22599
22600    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22601}
22602
22603impl MysqlDatabase {
22604    pub fn new() -> Self {
22605        std::default::Default::default()
22606    }
22607
22608    /// Sets the value of [database][crate::model::MysqlDatabase::database].
22609    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22610        self.database = v.into();
22611        self
22612    }
22613
22614    /// Sets the value of [mysql_tables][crate::model::MysqlDatabase::mysql_tables].
22615    pub fn set_mysql_tables<T, V>(mut self, v: T) -> Self
22616    where
22617        T: std::iter::IntoIterator<Item = V>,
22618        V: std::convert::Into<crate::model::MysqlTable>,
22619    {
22620        use std::iter::Iterator;
22621        self.mysql_tables = v.into_iter().map(|i| i.into()).collect();
22622        self
22623    }
22624}
22625
22626impl wkt::message::Message for MysqlDatabase {
22627    fn typename() -> &'static str {
22628        "type.googleapis.com/google.cloud.datastream.v1.MysqlDatabase"
22629    }
22630}
22631
22632#[doc(hidden)]
22633impl<'de> serde::de::Deserialize<'de> for MysqlDatabase {
22634    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22635    where
22636        D: serde::Deserializer<'de>,
22637    {
22638        #[allow(non_camel_case_types)]
22639        #[doc(hidden)]
22640        #[derive(PartialEq, Eq, Hash)]
22641        enum __FieldTag {
22642            __database,
22643            __mysql_tables,
22644            Unknown(std::string::String),
22645        }
22646        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
22647            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22648            where
22649                D: serde::Deserializer<'de>,
22650            {
22651                struct Visitor;
22652                impl<'de> serde::de::Visitor<'de> for Visitor {
22653                    type Value = __FieldTag;
22654                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
22655                        formatter.write_str("a field name for MysqlDatabase")
22656                    }
22657                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
22658                    where
22659                        E: serde::de::Error,
22660                    {
22661                        use std::result::Result::Ok;
22662                        use std::string::ToString;
22663                        match value {
22664                            "database" => Ok(__FieldTag::__database),
22665                            "mysqlTables" => Ok(__FieldTag::__mysql_tables),
22666                            "mysql_tables" => Ok(__FieldTag::__mysql_tables),
22667                            _ => Ok(__FieldTag::Unknown(value.to_string())),
22668                        }
22669                    }
22670                }
22671                deserializer.deserialize_identifier(Visitor)
22672            }
22673        }
22674        struct Visitor;
22675        impl<'de> serde::de::Visitor<'de> for Visitor {
22676            type Value = MysqlDatabase;
22677            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
22678                formatter.write_str("struct MysqlDatabase")
22679            }
22680            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
22681            where
22682                A: serde::de::MapAccess<'de>,
22683            {
22684                #[allow(unused_imports)]
22685                use serde::de::Error;
22686                use std::option::Option::Some;
22687                let mut fields = std::collections::HashSet::new();
22688                let mut result = Self::Value::new();
22689                while let Some(tag) = map.next_key::<__FieldTag>()? {
22690                    #[allow(clippy::match_single_binding)]
22691                    match tag {
22692                        __FieldTag::__database => {
22693                            if !fields.insert(__FieldTag::__database) {
22694                                return std::result::Result::Err(A::Error::duplicate_field(
22695                                    "multiple values for database",
22696                                ));
22697                            }
22698                            result.database = map
22699                                .next_value::<std::option::Option<std::string::String>>()?
22700                                .unwrap_or_default();
22701                        }
22702                        __FieldTag::__mysql_tables => {
22703                            if !fields.insert(__FieldTag::__mysql_tables) {
22704                                return std::result::Result::Err(A::Error::duplicate_field(
22705                                    "multiple values for mysql_tables",
22706                                ));
22707                            }
22708                            result.mysql_tables = map.next_value::<std::option::Option<std::vec::Vec<crate::model::MysqlTable>>>()?.unwrap_or_default();
22709                        }
22710                        __FieldTag::Unknown(key) => {
22711                            let value = map.next_value::<serde_json::Value>()?;
22712                            result._unknown_fields.insert(key, value);
22713                        }
22714                    }
22715                }
22716                std::result::Result::Ok(result)
22717            }
22718        }
22719        deserializer.deserialize_any(Visitor)
22720    }
22721}
22722
22723#[doc(hidden)]
22724impl serde::ser::Serialize for MysqlDatabase {
22725    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22726    where
22727        S: serde::ser::Serializer,
22728    {
22729        use serde::ser::SerializeMap;
22730        #[allow(unused_imports)]
22731        use std::option::Option::Some;
22732        let mut state = serializer.serialize_map(std::option::Option::None)?;
22733        if !self.database.is_empty() {
22734            state.serialize_entry("database", &self.database)?;
22735        }
22736        if !self.mysql_tables.is_empty() {
22737            state.serialize_entry("mysqlTables", &self.mysql_tables)?;
22738        }
22739        if !self._unknown_fields.is_empty() {
22740            for (key, value) in self._unknown_fields.iter() {
22741                state.serialize_entry(key, &value)?;
22742            }
22743        }
22744        state.end()
22745    }
22746}
22747
22748impl std::fmt::Debug for MysqlDatabase {
22749    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
22750        let mut debug_struct = f.debug_struct("MysqlDatabase");
22751        debug_struct.field("database", &self.database);
22752        debug_struct.field("mysql_tables", &self.mysql_tables);
22753        if !self._unknown_fields.is_empty() {
22754            debug_struct.field("_unknown_fields", &self._unknown_fields);
22755        }
22756        debug_struct.finish()
22757    }
22758}
22759
22760/// MySQL database structure
22761#[derive(Clone, Default, PartialEq)]
22762#[non_exhaustive]
22763pub struct MysqlRdbms {
22764    /// Mysql databases on the server
22765    pub mysql_databases: std::vec::Vec<crate::model::MysqlDatabase>,
22766
22767    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22768}
22769
22770impl MysqlRdbms {
22771    pub fn new() -> Self {
22772        std::default::Default::default()
22773    }
22774
22775    /// Sets the value of [mysql_databases][crate::model::MysqlRdbms::mysql_databases].
22776    pub fn set_mysql_databases<T, V>(mut self, v: T) -> Self
22777    where
22778        T: std::iter::IntoIterator<Item = V>,
22779        V: std::convert::Into<crate::model::MysqlDatabase>,
22780    {
22781        use std::iter::Iterator;
22782        self.mysql_databases = v.into_iter().map(|i| i.into()).collect();
22783        self
22784    }
22785}
22786
22787impl wkt::message::Message for MysqlRdbms {
22788    fn typename() -> &'static str {
22789        "type.googleapis.com/google.cloud.datastream.v1.MysqlRdbms"
22790    }
22791}
22792
22793#[doc(hidden)]
22794impl<'de> serde::de::Deserialize<'de> for MysqlRdbms {
22795    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22796    where
22797        D: serde::Deserializer<'de>,
22798    {
22799        #[allow(non_camel_case_types)]
22800        #[doc(hidden)]
22801        #[derive(PartialEq, Eq, Hash)]
22802        enum __FieldTag {
22803            __mysql_databases,
22804            Unknown(std::string::String),
22805        }
22806        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
22807            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22808            where
22809                D: serde::Deserializer<'de>,
22810            {
22811                struct Visitor;
22812                impl<'de> serde::de::Visitor<'de> for Visitor {
22813                    type Value = __FieldTag;
22814                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
22815                        formatter.write_str("a field name for MysqlRdbms")
22816                    }
22817                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
22818                    where
22819                        E: serde::de::Error,
22820                    {
22821                        use std::result::Result::Ok;
22822                        use std::string::ToString;
22823                        match value {
22824                            "mysqlDatabases" => Ok(__FieldTag::__mysql_databases),
22825                            "mysql_databases" => Ok(__FieldTag::__mysql_databases),
22826                            _ => Ok(__FieldTag::Unknown(value.to_string())),
22827                        }
22828                    }
22829                }
22830                deserializer.deserialize_identifier(Visitor)
22831            }
22832        }
22833        struct Visitor;
22834        impl<'de> serde::de::Visitor<'de> for Visitor {
22835            type Value = MysqlRdbms;
22836            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
22837                formatter.write_str("struct MysqlRdbms")
22838            }
22839            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
22840            where
22841                A: serde::de::MapAccess<'de>,
22842            {
22843                #[allow(unused_imports)]
22844                use serde::de::Error;
22845                use std::option::Option::Some;
22846                let mut fields = std::collections::HashSet::new();
22847                let mut result = Self::Value::new();
22848                while let Some(tag) = map.next_key::<__FieldTag>()? {
22849                    #[allow(clippy::match_single_binding)]
22850                    match tag {
22851                        __FieldTag::__mysql_databases => {
22852                            if !fields.insert(__FieldTag::__mysql_databases) {
22853                                return std::result::Result::Err(A::Error::duplicate_field(
22854                                    "multiple values for mysql_databases",
22855                                ));
22856                            }
22857                            result.mysql_databases = map.next_value::<std::option::Option<std::vec::Vec<crate::model::MysqlDatabase>>>()?.unwrap_or_default();
22858                        }
22859                        __FieldTag::Unknown(key) => {
22860                            let value = map.next_value::<serde_json::Value>()?;
22861                            result._unknown_fields.insert(key, value);
22862                        }
22863                    }
22864                }
22865                std::result::Result::Ok(result)
22866            }
22867        }
22868        deserializer.deserialize_any(Visitor)
22869    }
22870}
22871
22872#[doc(hidden)]
22873impl serde::ser::Serialize for MysqlRdbms {
22874    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22875    where
22876        S: serde::ser::Serializer,
22877    {
22878        use serde::ser::SerializeMap;
22879        #[allow(unused_imports)]
22880        use std::option::Option::Some;
22881        let mut state = serializer.serialize_map(std::option::Option::None)?;
22882        if !self.mysql_databases.is_empty() {
22883            state.serialize_entry("mysqlDatabases", &self.mysql_databases)?;
22884        }
22885        if !self._unknown_fields.is_empty() {
22886            for (key, value) in self._unknown_fields.iter() {
22887                state.serialize_entry(key, &value)?;
22888            }
22889        }
22890        state.end()
22891    }
22892}
22893
22894impl std::fmt::Debug for MysqlRdbms {
22895    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
22896        let mut debug_struct = f.debug_struct("MysqlRdbms");
22897        debug_struct.field("mysql_databases", &self.mysql_databases);
22898        if !self._unknown_fields.is_empty() {
22899            debug_struct.field("_unknown_fields", &self._unknown_fields);
22900        }
22901        debug_struct.finish()
22902    }
22903}
22904
22905/// MySQL source configuration
22906#[derive(Clone, Default, PartialEq)]
22907#[non_exhaustive]
22908pub struct MysqlSourceConfig {
22909    /// MySQL objects to retrieve from the source.
22910    pub include_objects: std::option::Option<crate::model::MysqlRdbms>,
22911
22912    /// MySQL objects to exclude from the stream.
22913    pub exclude_objects: std::option::Option<crate::model::MysqlRdbms>,
22914
22915    /// Maximum number of concurrent CDC tasks. The number should be non negative.
22916    /// If not set (or set to 0), the system's default value will be used.
22917    pub max_concurrent_cdc_tasks: i32,
22918
22919    /// Maximum number of concurrent backfill tasks. The number should be non
22920    /// negative. If not set (or set to 0), the system's default value will be
22921    /// used.
22922    pub max_concurrent_backfill_tasks: i32,
22923
22924    /// The CDC method to use for the stream.
22925    pub cdc_method: std::option::Option<crate::model::mysql_source_config::CdcMethod>,
22926
22927    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22928}
22929
22930impl MysqlSourceConfig {
22931    pub fn new() -> Self {
22932        std::default::Default::default()
22933    }
22934
22935    /// Sets the value of [include_objects][crate::model::MysqlSourceConfig::include_objects].
22936    pub fn set_include_objects<T>(mut self, v: T) -> Self
22937    where
22938        T: std::convert::Into<crate::model::MysqlRdbms>,
22939    {
22940        self.include_objects = std::option::Option::Some(v.into());
22941        self
22942    }
22943
22944    /// Sets or clears the value of [include_objects][crate::model::MysqlSourceConfig::include_objects].
22945    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
22946    where
22947        T: std::convert::Into<crate::model::MysqlRdbms>,
22948    {
22949        self.include_objects = v.map(|x| x.into());
22950        self
22951    }
22952
22953    /// Sets the value of [exclude_objects][crate::model::MysqlSourceConfig::exclude_objects].
22954    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
22955    where
22956        T: std::convert::Into<crate::model::MysqlRdbms>,
22957    {
22958        self.exclude_objects = std::option::Option::Some(v.into());
22959        self
22960    }
22961
22962    /// Sets or clears the value of [exclude_objects][crate::model::MysqlSourceConfig::exclude_objects].
22963    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
22964    where
22965        T: std::convert::Into<crate::model::MysqlRdbms>,
22966    {
22967        self.exclude_objects = v.map(|x| x.into());
22968        self
22969    }
22970
22971    /// Sets the value of [max_concurrent_cdc_tasks][crate::model::MysqlSourceConfig::max_concurrent_cdc_tasks].
22972    pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
22973        self.max_concurrent_cdc_tasks = v.into();
22974        self
22975    }
22976
22977    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::MysqlSourceConfig::max_concurrent_backfill_tasks].
22978    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
22979        self.max_concurrent_backfill_tasks = v.into();
22980        self
22981    }
22982
22983    /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method].
22984    ///
22985    /// Note that all the setters affecting `cdc_method` are mutually
22986    /// exclusive.
22987    pub fn set_cdc_method<
22988        T: std::convert::Into<std::option::Option<crate::model::mysql_source_config::CdcMethod>>,
22989    >(
22990        mut self,
22991        v: T,
22992    ) -> Self {
22993        self.cdc_method = v.into();
22994        self
22995    }
22996
22997    /// The value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
22998    /// if it holds a `BinaryLogPosition`, `None` if the field is not set or
22999    /// holds a different branch.
23000    pub fn binary_log_position(
23001        &self,
23002    ) -> std::option::Option<&std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>>
23003    {
23004        #[allow(unreachable_patterns)]
23005        self.cdc_method.as_ref().and_then(|v| match v {
23006            crate::model::mysql_source_config::CdcMethod::BinaryLogPosition(v) => {
23007                std::option::Option::Some(v)
23008            }
23009            _ => std::option::Option::None,
23010        })
23011    }
23012
23013    /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
23014    /// to hold a `BinaryLogPosition`.
23015    ///
23016    /// Note that all the setters affecting `cdc_method` are
23017    /// mutually exclusive.
23018    pub fn set_binary_log_position<
23019        T: std::convert::Into<std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>>,
23020    >(
23021        mut self,
23022        v: T,
23023    ) -> Self {
23024        self.cdc_method = std::option::Option::Some(
23025            crate::model::mysql_source_config::CdcMethod::BinaryLogPosition(v.into()),
23026        );
23027        self
23028    }
23029
23030    /// The value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
23031    /// if it holds a `Gtid`, `None` if the field is not set or
23032    /// holds a different branch.
23033    pub fn gtid(
23034        &self,
23035    ) -> std::option::Option<&std::boxed::Box<crate::model::mysql_source_config::Gtid>> {
23036        #[allow(unreachable_patterns)]
23037        self.cdc_method.as_ref().and_then(|v| match v {
23038            crate::model::mysql_source_config::CdcMethod::Gtid(v) => std::option::Option::Some(v),
23039            _ => std::option::Option::None,
23040        })
23041    }
23042
23043    /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
23044    /// to hold a `Gtid`.
23045    ///
23046    /// Note that all the setters affecting `cdc_method` are
23047    /// mutually exclusive.
23048    pub fn set_gtid<
23049        T: std::convert::Into<std::boxed::Box<crate::model::mysql_source_config::Gtid>>,
23050    >(
23051        mut self,
23052        v: T,
23053    ) -> Self {
23054        self.cdc_method =
23055            std::option::Option::Some(crate::model::mysql_source_config::CdcMethod::Gtid(v.into()));
23056        self
23057    }
23058}
23059
23060impl wkt::message::Message for MysqlSourceConfig {
23061    fn typename() -> &'static str {
23062        "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig"
23063    }
23064}
23065
23066#[doc(hidden)]
23067impl<'de> serde::de::Deserialize<'de> for MysqlSourceConfig {
23068    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23069    where
23070        D: serde::Deserializer<'de>,
23071    {
23072        #[allow(non_camel_case_types)]
23073        #[doc(hidden)]
23074        #[derive(PartialEq, Eq, Hash)]
23075        enum __FieldTag {
23076            __include_objects,
23077            __exclude_objects,
23078            __max_concurrent_cdc_tasks,
23079            __max_concurrent_backfill_tasks,
23080            __binary_log_position,
23081            __gtid,
23082            Unknown(std::string::String),
23083        }
23084        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
23085            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23086            where
23087                D: serde::Deserializer<'de>,
23088            {
23089                struct Visitor;
23090                impl<'de> serde::de::Visitor<'de> for Visitor {
23091                    type Value = __FieldTag;
23092                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
23093                        formatter.write_str("a field name for MysqlSourceConfig")
23094                    }
23095                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
23096                    where
23097                        E: serde::de::Error,
23098                    {
23099                        use std::result::Result::Ok;
23100                        use std::string::ToString;
23101                        match value {
23102                            "includeObjects" => Ok(__FieldTag::__include_objects),
23103                            "include_objects" => Ok(__FieldTag::__include_objects),
23104                            "excludeObjects" => Ok(__FieldTag::__exclude_objects),
23105                            "exclude_objects" => Ok(__FieldTag::__exclude_objects),
23106                            "maxConcurrentCdcTasks" => Ok(__FieldTag::__max_concurrent_cdc_tasks),
23107                            "max_concurrent_cdc_tasks" => {
23108                                Ok(__FieldTag::__max_concurrent_cdc_tasks)
23109                            }
23110                            "maxConcurrentBackfillTasks" => {
23111                                Ok(__FieldTag::__max_concurrent_backfill_tasks)
23112                            }
23113                            "max_concurrent_backfill_tasks" => {
23114                                Ok(__FieldTag::__max_concurrent_backfill_tasks)
23115                            }
23116                            "binaryLogPosition" => Ok(__FieldTag::__binary_log_position),
23117                            "binary_log_position" => Ok(__FieldTag::__binary_log_position),
23118                            "gtid" => Ok(__FieldTag::__gtid),
23119                            _ => Ok(__FieldTag::Unknown(value.to_string())),
23120                        }
23121                    }
23122                }
23123                deserializer.deserialize_identifier(Visitor)
23124            }
23125        }
23126        struct Visitor;
23127        impl<'de> serde::de::Visitor<'de> for Visitor {
23128            type Value = MysqlSourceConfig;
23129            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
23130                formatter.write_str("struct MysqlSourceConfig")
23131            }
23132            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
23133            where
23134                A: serde::de::MapAccess<'de>,
23135            {
23136                #[allow(unused_imports)]
23137                use serde::de::Error;
23138                use std::option::Option::Some;
23139                let mut fields = std::collections::HashSet::new();
23140                let mut result = Self::Value::new();
23141                while let Some(tag) = map.next_key::<__FieldTag>()? {
23142                    #[allow(clippy::match_single_binding)]
23143                    match tag {
23144                        __FieldTag::__include_objects => {
23145                            if !fields.insert(__FieldTag::__include_objects) {
23146                                return std::result::Result::Err(A::Error::duplicate_field(
23147                                    "multiple values for include_objects",
23148                                ));
23149                            }
23150                            result.include_objects =
23151                                map.next_value::<std::option::Option<crate::model::MysqlRdbms>>()?;
23152                        }
23153                        __FieldTag::__exclude_objects => {
23154                            if !fields.insert(__FieldTag::__exclude_objects) {
23155                                return std::result::Result::Err(A::Error::duplicate_field(
23156                                    "multiple values for exclude_objects",
23157                                ));
23158                            }
23159                            result.exclude_objects =
23160                                map.next_value::<std::option::Option<crate::model::MysqlRdbms>>()?;
23161                        }
23162                        __FieldTag::__max_concurrent_cdc_tasks => {
23163                            if !fields.insert(__FieldTag::__max_concurrent_cdc_tasks) {
23164                                return std::result::Result::Err(A::Error::duplicate_field(
23165                                    "multiple values for max_concurrent_cdc_tasks",
23166                                ));
23167                            }
23168                            struct __With(std::option::Option<i32>);
23169                            impl<'de> serde::de::Deserialize<'de> for __With {
23170                                fn deserialize<D>(
23171                                    deserializer: D,
23172                                ) -> std::result::Result<Self, D::Error>
23173                                where
23174                                    D: serde::de::Deserializer<'de>,
23175                                {
23176                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
23177                                }
23178                            }
23179                            result.max_concurrent_cdc_tasks =
23180                                map.next_value::<__With>()?.0.unwrap_or_default();
23181                        }
23182                        __FieldTag::__max_concurrent_backfill_tasks => {
23183                            if !fields.insert(__FieldTag::__max_concurrent_backfill_tasks) {
23184                                return std::result::Result::Err(A::Error::duplicate_field(
23185                                    "multiple values for max_concurrent_backfill_tasks",
23186                                ));
23187                            }
23188                            struct __With(std::option::Option<i32>);
23189                            impl<'de> serde::de::Deserialize<'de> for __With {
23190                                fn deserialize<D>(
23191                                    deserializer: D,
23192                                ) -> std::result::Result<Self, D::Error>
23193                                where
23194                                    D: serde::de::Deserializer<'de>,
23195                                {
23196                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
23197                                }
23198                            }
23199                            result.max_concurrent_backfill_tasks =
23200                                map.next_value::<__With>()?.0.unwrap_or_default();
23201                        }
23202                        __FieldTag::__binary_log_position => {
23203                            if !fields.insert(__FieldTag::__binary_log_position) {
23204                                return std::result::Result::Err(A::Error::duplicate_field(
23205                                    "multiple values for binary_log_position",
23206                                ));
23207                            }
23208                            if result.cdc_method.is_some() {
23209                                return std::result::Result::Err(A::Error::duplicate_field(
23210                                    "multiple values for `cdc_method`, a oneof with full ID .google.cloud.datastream.v1.MysqlSourceConfig.binary_log_position, latest field was binaryLogPosition",
23211                                ));
23212                            }
23213                            result.cdc_method = std::option::Option::Some(
23214                                crate::model::mysql_source_config::CdcMethod::BinaryLogPosition(
23215                                    map.next_value::<std::option::Option<
23216                                        std::boxed::Box<
23217                                            crate::model::mysql_source_config::BinaryLogPosition,
23218                                        >,
23219                                    >>()?
23220                                    .unwrap_or_default(),
23221                                ),
23222                            );
23223                        }
23224                        __FieldTag::__gtid => {
23225                            if !fields.insert(__FieldTag::__gtid) {
23226                                return std::result::Result::Err(A::Error::duplicate_field(
23227                                    "multiple values for gtid",
23228                                ));
23229                            }
23230                            if result.cdc_method.is_some() {
23231                                return std::result::Result::Err(A::Error::duplicate_field(
23232                                    "multiple values for `cdc_method`, a oneof with full ID .google.cloud.datastream.v1.MysqlSourceConfig.gtid, latest field was gtid",
23233                                ));
23234                            }
23235                            result.cdc_method = std::option::Option::Some(
23236                                crate::model::mysql_source_config::CdcMethod::Gtid(
23237                                    map.next_value::<std::option::Option<
23238                                        std::boxed::Box<crate::model::mysql_source_config::Gtid>,
23239                                    >>()?
23240                                    .unwrap_or_default(),
23241                                ),
23242                            );
23243                        }
23244                        __FieldTag::Unknown(key) => {
23245                            let value = map.next_value::<serde_json::Value>()?;
23246                            result._unknown_fields.insert(key, value);
23247                        }
23248                    }
23249                }
23250                std::result::Result::Ok(result)
23251            }
23252        }
23253        deserializer.deserialize_any(Visitor)
23254    }
23255}
23256
23257#[doc(hidden)]
23258impl serde::ser::Serialize for MysqlSourceConfig {
23259    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23260    where
23261        S: serde::ser::Serializer,
23262    {
23263        use serde::ser::SerializeMap;
23264        #[allow(unused_imports)]
23265        use std::option::Option::Some;
23266        let mut state = serializer.serialize_map(std::option::Option::None)?;
23267        if self.include_objects.is_some() {
23268            state.serialize_entry("includeObjects", &self.include_objects)?;
23269        }
23270        if self.exclude_objects.is_some() {
23271            state.serialize_entry("excludeObjects", &self.exclude_objects)?;
23272        }
23273        if !wkt::internal::is_default(&self.max_concurrent_cdc_tasks) {
23274            struct __With<'a>(&'a i32);
23275            impl<'a> serde::ser::Serialize for __With<'a> {
23276                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23277                where
23278                    S: serde::ser::Serializer,
23279                {
23280                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
23281                }
23282            }
23283            state.serialize_entry(
23284                "maxConcurrentCdcTasks",
23285                &__With(&self.max_concurrent_cdc_tasks),
23286            )?;
23287        }
23288        if !wkt::internal::is_default(&self.max_concurrent_backfill_tasks) {
23289            struct __With<'a>(&'a i32);
23290            impl<'a> serde::ser::Serialize for __With<'a> {
23291                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23292                where
23293                    S: serde::ser::Serializer,
23294                {
23295                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
23296                }
23297            }
23298            state.serialize_entry(
23299                "maxConcurrentBackfillTasks",
23300                &__With(&self.max_concurrent_backfill_tasks),
23301            )?;
23302        }
23303        if let Some(value) = self.binary_log_position() {
23304            state.serialize_entry("binaryLogPosition", value)?;
23305        }
23306        if let Some(value) = self.gtid() {
23307            state.serialize_entry("gtid", value)?;
23308        }
23309        if !self._unknown_fields.is_empty() {
23310            for (key, value) in self._unknown_fields.iter() {
23311                state.serialize_entry(key, &value)?;
23312            }
23313        }
23314        state.end()
23315    }
23316}
23317
23318impl std::fmt::Debug for MysqlSourceConfig {
23319    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23320        let mut debug_struct = f.debug_struct("MysqlSourceConfig");
23321        debug_struct.field("include_objects", &self.include_objects);
23322        debug_struct.field("exclude_objects", &self.exclude_objects);
23323        debug_struct.field("max_concurrent_cdc_tasks", &self.max_concurrent_cdc_tasks);
23324        debug_struct.field(
23325            "max_concurrent_backfill_tasks",
23326            &self.max_concurrent_backfill_tasks,
23327        );
23328        debug_struct.field("cdc_method", &self.cdc_method);
23329        if !self._unknown_fields.is_empty() {
23330            debug_struct.field("_unknown_fields", &self._unknown_fields);
23331        }
23332        debug_struct.finish()
23333    }
23334}
23335
23336/// Defines additional types related to [MysqlSourceConfig].
23337pub mod mysql_source_config {
23338    #[allow(unused_imports)]
23339    use super::*;
23340
23341    /// Use Binary log position based replication.
23342    #[derive(Clone, Default, PartialEq)]
23343    #[non_exhaustive]
23344    pub struct BinaryLogPosition {
23345        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23346    }
23347
23348    impl BinaryLogPosition {
23349        pub fn new() -> Self {
23350            std::default::Default::default()
23351        }
23352    }
23353
23354    impl wkt::message::Message for BinaryLogPosition {
23355        fn typename() -> &'static str {
23356            "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig.BinaryLogPosition"
23357        }
23358    }
23359
23360    #[doc(hidden)]
23361    impl<'de> serde::de::Deserialize<'de> for BinaryLogPosition {
23362        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23363        where
23364            D: serde::Deserializer<'de>,
23365        {
23366            #[allow(non_camel_case_types)]
23367            #[doc(hidden)]
23368            #[derive(PartialEq, Eq, Hash)]
23369            enum __FieldTag {
23370                Unknown(std::string::String),
23371            }
23372            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
23373                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23374                where
23375                    D: serde::Deserializer<'de>,
23376                {
23377                    struct Visitor;
23378                    impl<'de> serde::de::Visitor<'de> for Visitor {
23379                        type Value = __FieldTag;
23380                        fn expecting(
23381                            &self,
23382                            formatter: &mut std::fmt::Formatter,
23383                        ) -> std::fmt::Result {
23384                            formatter.write_str("a field name for BinaryLogPosition")
23385                        }
23386                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
23387                        where
23388                            E: serde::de::Error,
23389                        {
23390                            use std::result::Result::Ok;
23391                            use std::string::ToString;
23392                            Ok(__FieldTag::Unknown(value.to_string()))
23393                        }
23394                    }
23395                    deserializer.deserialize_identifier(Visitor)
23396                }
23397            }
23398            struct Visitor;
23399            impl<'de> serde::de::Visitor<'de> for Visitor {
23400                type Value = BinaryLogPosition;
23401                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
23402                    formatter.write_str("struct BinaryLogPosition")
23403                }
23404                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
23405                where
23406                    A: serde::de::MapAccess<'de>,
23407                {
23408                    #[allow(unused_imports)]
23409                    use serde::de::Error;
23410                    use std::option::Option::Some;
23411                    let mut result = Self::Value::new();
23412                    while let Some(tag) = map.next_key::<__FieldTag>()? {
23413                        #[allow(clippy::match_single_binding)]
23414                        match tag {
23415                            __FieldTag::Unknown(key) => {
23416                                let value = map.next_value::<serde_json::Value>()?;
23417                                result._unknown_fields.insert(key, value);
23418                            }
23419                        }
23420                    }
23421                    std::result::Result::Ok(result)
23422                }
23423            }
23424            deserializer.deserialize_any(Visitor)
23425        }
23426    }
23427
23428    #[doc(hidden)]
23429    impl serde::ser::Serialize for BinaryLogPosition {
23430        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23431        where
23432            S: serde::ser::Serializer,
23433        {
23434            use serde::ser::SerializeMap;
23435            #[allow(unused_imports)]
23436            use std::option::Option::Some;
23437            let mut state = serializer.serialize_map(std::option::Option::None)?;
23438            if !self._unknown_fields.is_empty() {
23439                for (key, value) in self._unknown_fields.iter() {
23440                    state.serialize_entry(key, &value)?;
23441                }
23442            }
23443            state.end()
23444        }
23445    }
23446
23447    impl std::fmt::Debug for BinaryLogPosition {
23448        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23449            let mut debug_struct = f.debug_struct("BinaryLogPosition");
23450            if !self._unknown_fields.is_empty() {
23451                debug_struct.field("_unknown_fields", &self._unknown_fields);
23452            }
23453            debug_struct.finish()
23454        }
23455    }
23456
23457    /// Use GTID based replication.
23458    #[derive(Clone, Default, PartialEq)]
23459    #[non_exhaustive]
23460    pub struct Gtid {
23461        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23462    }
23463
23464    impl Gtid {
23465        pub fn new() -> Self {
23466            std::default::Default::default()
23467        }
23468    }
23469
23470    impl wkt::message::Message for Gtid {
23471        fn typename() -> &'static str {
23472            "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig.Gtid"
23473        }
23474    }
23475
23476    #[doc(hidden)]
23477    impl<'de> serde::de::Deserialize<'de> for Gtid {
23478        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23479        where
23480            D: serde::Deserializer<'de>,
23481        {
23482            #[allow(non_camel_case_types)]
23483            #[doc(hidden)]
23484            #[derive(PartialEq, Eq, Hash)]
23485            enum __FieldTag {
23486                Unknown(std::string::String),
23487            }
23488            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
23489                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23490                where
23491                    D: serde::Deserializer<'de>,
23492                {
23493                    struct Visitor;
23494                    impl<'de> serde::de::Visitor<'de> for Visitor {
23495                        type Value = __FieldTag;
23496                        fn expecting(
23497                            &self,
23498                            formatter: &mut std::fmt::Formatter,
23499                        ) -> std::fmt::Result {
23500                            formatter.write_str("a field name for Gtid")
23501                        }
23502                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
23503                        where
23504                            E: serde::de::Error,
23505                        {
23506                            use std::result::Result::Ok;
23507                            use std::string::ToString;
23508                            Ok(__FieldTag::Unknown(value.to_string()))
23509                        }
23510                    }
23511                    deserializer.deserialize_identifier(Visitor)
23512                }
23513            }
23514            struct Visitor;
23515            impl<'de> serde::de::Visitor<'de> for Visitor {
23516                type Value = Gtid;
23517                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
23518                    formatter.write_str("struct Gtid")
23519                }
23520                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
23521                where
23522                    A: serde::de::MapAccess<'de>,
23523                {
23524                    #[allow(unused_imports)]
23525                    use serde::de::Error;
23526                    use std::option::Option::Some;
23527                    let mut result = Self::Value::new();
23528                    while let Some(tag) = map.next_key::<__FieldTag>()? {
23529                        #[allow(clippy::match_single_binding)]
23530                        match tag {
23531                            __FieldTag::Unknown(key) => {
23532                                let value = map.next_value::<serde_json::Value>()?;
23533                                result._unknown_fields.insert(key, value);
23534                            }
23535                        }
23536                    }
23537                    std::result::Result::Ok(result)
23538                }
23539            }
23540            deserializer.deserialize_any(Visitor)
23541        }
23542    }
23543
23544    #[doc(hidden)]
23545    impl serde::ser::Serialize for Gtid {
23546        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23547        where
23548            S: serde::ser::Serializer,
23549        {
23550            use serde::ser::SerializeMap;
23551            #[allow(unused_imports)]
23552            use std::option::Option::Some;
23553            let mut state = serializer.serialize_map(std::option::Option::None)?;
23554            if !self._unknown_fields.is_empty() {
23555                for (key, value) in self._unknown_fields.iter() {
23556                    state.serialize_entry(key, &value)?;
23557                }
23558            }
23559            state.end()
23560        }
23561    }
23562
23563    impl std::fmt::Debug for Gtid {
23564        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23565            let mut debug_struct = f.debug_struct("Gtid");
23566            if !self._unknown_fields.is_empty() {
23567                debug_struct.field("_unknown_fields", &self._unknown_fields);
23568            }
23569            debug_struct.finish()
23570        }
23571    }
23572
23573    /// The CDC method to use for the stream.
23574    #[derive(Clone, Debug, PartialEq)]
23575    #[non_exhaustive]
23576    pub enum CdcMethod {
23577        /// Use Binary log position based replication.
23578        BinaryLogPosition(std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>),
23579        /// Use GTID based replication.
23580        Gtid(std::boxed::Box<crate::model::mysql_source_config::Gtid>),
23581    }
23582}
23583
23584/// Salesforce source configuration
23585#[derive(Clone, Default, PartialEq)]
23586#[non_exhaustive]
23587pub struct SalesforceSourceConfig {
23588    /// Salesforce objects to retrieve from the source.
23589    pub include_objects: std::option::Option<crate::model::SalesforceOrg>,
23590
23591    /// Salesforce objects to exclude from the stream.
23592    pub exclude_objects: std::option::Option<crate::model::SalesforceOrg>,
23593
23594    /// Required. Salesforce objects polling interval. The interval at which new
23595    /// changes will be polled for each object. The duration must be between 5
23596    /// minutes and 24 hours.
23597    pub polling_interval: std::option::Option<wkt::Duration>,
23598
23599    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23600}
23601
23602impl SalesforceSourceConfig {
23603    pub fn new() -> Self {
23604        std::default::Default::default()
23605    }
23606
23607    /// Sets the value of [include_objects][crate::model::SalesforceSourceConfig::include_objects].
23608    pub fn set_include_objects<T>(mut self, v: T) -> Self
23609    where
23610        T: std::convert::Into<crate::model::SalesforceOrg>,
23611    {
23612        self.include_objects = std::option::Option::Some(v.into());
23613        self
23614    }
23615
23616    /// Sets or clears the value of [include_objects][crate::model::SalesforceSourceConfig::include_objects].
23617    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
23618    where
23619        T: std::convert::Into<crate::model::SalesforceOrg>,
23620    {
23621        self.include_objects = v.map(|x| x.into());
23622        self
23623    }
23624
23625    /// Sets the value of [exclude_objects][crate::model::SalesforceSourceConfig::exclude_objects].
23626    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
23627    where
23628        T: std::convert::Into<crate::model::SalesforceOrg>,
23629    {
23630        self.exclude_objects = std::option::Option::Some(v.into());
23631        self
23632    }
23633
23634    /// Sets or clears the value of [exclude_objects][crate::model::SalesforceSourceConfig::exclude_objects].
23635    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
23636    where
23637        T: std::convert::Into<crate::model::SalesforceOrg>,
23638    {
23639        self.exclude_objects = v.map(|x| x.into());
23640        self
23641    }
23642
23643    /// Sets the value of [polling_interval][crate::model::SalesforceSourceConfig::polling_interval].
23644    pub fn set_polling_interval<T>(mut self, v: T) -> Self
23645    where
23646        T: std::convert::Into<wkt::Duration>,
23647    {
23648        self.polling_interval = std::option::Option::Some(v.into());
23649        self
23650    }
23651
23652    /// Sets or clears the value of [polling_interval][crate::model::SalesforceSourceConfig::polling_interval].
23653    pub fn set_or_clear_polling_interval<T>(mut self, v: std::option::Option<T>) -> Self
23654    where
23655        T: std::convert::Into<wkt::Duration>,
23656    {
23657        self.polling_interval = v.map(|x| x.into());
23658        self
23659    }
23660}
23661
23662impl wkt::message::Message for SalesforceSourceConfig {
23663    fn typename() -> &'static str {
23664        "type.googleapis.com/google.cloud.datastream.v1.SalesforceSourceConfig"
23665    }
23666}
23667
23668#[doc(hidden)]
23669impl<'de> serde::de::Deserialize<'de> for SalesforceSourceConfig {
23670    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23671    where
23672        D: serde::Deserializer<'de>,
23673    {
23674        #[allow(non_camel_case_types)]
23675        #[doc(hidden)]
23676        #[derive(PartialEq, Eq, Hash)]
23677        enum __FieldTag {
23678            __include_objects,
23679            __exclude_objects,
23680            __polling_interval,
23681            Unknown(std::string::String),
23682        }
23683        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
23684            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23685            where
23686                D: serde::Deserializer<'de>,
23687            {
23688                struct Visitor;
23689                impl<'de> serde::de::Visitor<'de> for Visitor {
23690                    type Value = __FieldTag;
23691                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
23692                        formatter.write_str("a field name for SalesforceSourceConfig")
23693                    }
23694                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
23695                    where
23696                        E: serde::de::Error,
23697                    {
23698                        use std::result::Result::Ok;
23699                        use std::string::ToString;
23700                        match value {
23701                            "includeObjects" => Ok(__FieldTag::__include_objects),
23702                            "include_objects" => Ok(__FieldTag::__include_objects),
23703                            "excludeObjects" => Ok(__FieldTag::__exclude_objects),
23704                            "exclude_objects" => Ok(__FieldTag::__exclude_objects),
23705                            "pollingInterval" => Ok(__FieldTag::__polling_interval),
23706                            "polling_interval" => Ok(__FieldTag::__polling_interval),
23707                            _ => Ok(__FieldTag::Unknown(value.to_string())),
23708                        }
23709                    }
23710                }
23711                deserializer.deserialize_identifier(Visitor)
23712            }
23713        }
23714        struct Visitor;
23715        impl<'de> serde::de::Visitor<'de> for Visitor {
23716            type Value = SalesforceSourceConfig;
23717            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
23718                formatter.write_str("struct SalesforceSourceConfig")
23719            }
23720            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
23721            where
23722                A: serde::de::MapAccess<'de>,
23723            {
23724                #[allow(unused_imports)]
23725                use serde::de::Error;
23726                use std::option::Option::Some;
23727                let mut fields = std::collections::HashSet::new();
23728                let mut result = Self::Value::new();
23729                while let Some(tag) = map.next_key::<__FieldTag>()? {
23730                    #[allow(clippy::match_single_binding)]
23731                    match tag {
23732                        __FieldTag::__include_objects => {
23733                            if !fields.insert(__FieldTag::__include_objects) {
23734                                return std::result::Result::Err(A::Error::duplicate_field(
23735                                    "multiple values for include_objects",
23736                                ));
23737                            }
23738                            result.include_objects = map
23739                                .next_value::<std::option::Option<crate::model::SalesforceOrg>>()?;
23740                        }
23741                        __FieldTag::__exclude_objects => {
23742                            if !fields.insert(__FieldTag::__exclude_objects) {
23743                                return std::result::Result::Err(A::Error::duplicate_field(
23744                                    "multiple values for exclude_objects",
23745                                ));
23746                            }
23747                            result.exclude_objects = map
23748                                .next_value::<std::option::Option<crate::model::SalesforceOrg>>()?;
23749                        }
23750                        __FieldTag::__polling_interval => {
23751                            if !fields.insert(__FieldTag::__polling_interval) {
23752                                return std::result::Result::Err(A::Error::duplicate_field(
23753                                    "multiple values for polling_interval",
23754                                ));
23755                            }
23756                            result.polling_interval =
23757                                map.next_value::<std::option::Option<wkt::Duration>>()?;
23758                        }
23759                        __FieldTag::Unknown(key) => {
23760                            let value = map.next_value::<serde_json::Value>()?;
23761                            result._unknown_fields.insert(key, value);
23762                        }
23763                    }
23764                }
23765                std::result::Result::Ok(result)
23766            }
23767        }
23768        deserializer.deserialize_any(Visitor)
23769    }
23770}
23771
23772#[doc(hidden)]
23773impl serde::ser::Serialize for SalesforceSourceConfig {
23774    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23775    where
23776        S: serde::ser::Serializer,
23777    {
23778        use serde::ser::SerializeMap;
23779        #[allow(unused_imports)]
23780        use std::option::Option::Some;
23781        let mut state = serializer.serialize_map(std::option::Option::None)?;
23782        if self.include_objects.is_some() {
23783            state.serialize_entry("includeObjects", &self.include_objects)?;
23784        }
23785        if self.exclude_objects.is_some() {
23786            state.serialize_entry("excludeObjects", &self.exclude_objects)?;
23787        }
23788        if self.polling_interval.is_some() {
23789            state.serialize_entry("pollingInterval", &self.polling_interval)?;
23790        }
23791        if !self._unknown_fields.is_empty() {
23792            for (key, value) in self._unknown_fields.iter() {
23793                state.serialize_entry(key, &value)?;
23794            }
23795        }
23796        state.end()
23797    }
23798}
23799
23800impl std::fmt::Debug for SalesforceSourceConfig {
23801    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23802        let mut debug_struct = f.debug_struct("SalesforceSourceConfig");
23803        debug_struct.field("include_objects", &self.include_objects);
23804        debug_struct.field("exclude_objects", &self.exclude_objects);
23805        debug_struct.field("polling_interval", &self.polling_interval);
23806        if !self._unknown_fields.is_empty() {
23807            debug_struct.field("_unknown_fields", &self._unknown_fields);
23808        }
23809        debug_struct.finish()
23810    }
23811}
23812
23813/// Salesforce organization structure.
23814#[derive(Clone, Default, PartialEq)]
23815#[non_exhaustive]
23816pub struct SalesforceOrg {
23817    /// Salesforce objects in the database server.
23818    pub objects: std::vec::Vec<crate::model::SalesforceObject>,
23819
23820    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23821}
23822
23823impl SalesforceOrg {
23824    pub fn new() -> Self {
23825        std::default::Default::default()
23826    }
23827
23828    /// Sets the value of [objects][crate::model::SalesforceOrg::objects].
23829    pub fn set_objects<T, V>(mut self, v: T) -> Self
23830    where
23831        T: std::iter::IntoIterator<Item = V>,
23832        V: std::convert::Into<crate::model::SalesforceObject>,
23833    {
23834        use std::iter::Iterator;
23835        self.objects = v.into_iter().map(|i| i.into()).collect();
23836        self
23837    }
23838}
23839
23840impl wkt::message::Message for SalesforceOrg {
23841    fn typename() -> &'static str {
23842        "type.googleapis.com/google.cloud.datastream.v1.SalesforceOrg"
23843    }
23844}
23845
23846#[doc(hidden)]
23847impl<'de> serde::de::Deserialize<'de> for SalesforceOrg {
23848    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23849    where
23850        D: serde::Deserializer<'de>,
23851    {
23852        #[allow(non_camel_case_types)]
23853        #[doc(hidden)]
23854        #[derive(PartialEq, Eq, Hash)]
23855        enum __FieldTag {
23856            __objects,
23857            Unknown(std::string::String),
23858        }
23859        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
23860            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23861            where
23862                D: serde::Deserializer<'de>,
23863            {
23864                struct Visitor;
23865                impl<'de> serde::de::Visitor<'de> for Visitor {
23866                    type Value = __FieldTag;
23867                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
23868                        formatter.write_str("a field name for SalesforceOrg")
23869                    }
23870                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
23871                    where
23872                        E: serde::de::Error,
23873                    {
23874                        use std::result::Result::Ok;
23875                        use std::string::ToString;
23876                        match value {
23877                            "objects" => Ok(__FieldTag::__objects),
23878                            _ => Ok(__FieldTag::Unknown(value.to_string())),
23879                        }
23880                    }
23881                }
23882                deserializer.deserialize_identifier(Visitor)
23883            }
23884        }
23885        struct Visitor;
23886        impl<'de> serde::de::Visitor<'de> for Visitor {
23887            type Value = SalesforceOrg;
23888            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
23889                formatter.write_str("struct SalesforceOrg")
23890            }
23891            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
23892            where
23893                A: serde::de::MapAccess<'de>,
23894            {
23895                #[allow(unused_imports)]
23896                use serde::de::Error;
23897                use std::option::Option::Some;
23898                let mut fields = std::collections::HashSet::new();
23899                let mut result = Self::Value::new();
23900                while let Some(tag) = map.next_key::<__FieldTag>()? {
23901                    #[allow(clippy::match_single_binding)]
23902                    match tag {
23903                        __FieldTag::__objects => {
23904                            if !fields.insert(__FieldTag::__objects) {
23905                                return std::result::Result::Err(A::Error::duplicate_field(
23906                                    "multiple values for objects",
23907                                ));
23908                            }
23909                            result.objects =
23910                                map.next_value::<std::option::Option<
23911                                    std::vec::Vec<crate::model::SalesforceObject>,
23912                                >>()?
23913                                .unwrap_or_default();
23914                        }
23915                        __FieldTag::Unknown(key) => {
23916                            let value = map.next_value::<serde_json::Value>()?;
23917                            result._unknown_fields.insert(key, value);
23918                        }
23919                    }
23920                }
23921                std::result::Result::Ok(result)
23922            }
23923        }
23924        deserializer.deserialize_any(Visitor)
23925    }
23926}
23927
23928#[doc(hidden)]
23929impl serde::ser::Serialize for SalesforceOrg {
23930    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23931    where
23932        S: serde::ser::Serializer,
23933    {
23934        use serde::ser::SerializeMap;
23935        #[allow(unused_imports)]
23936        use std::option::Option::Some;
23937        let mut state = serializer.serialize_map(std::option::Option::None)?;
23938        if !self.objects.is_empty() {
23939            state.serialize_entry("objects", &self.objects)?;
23940        }
23941        if !self._unknown_fields.is_empty() {
23942            for (key, value) in self._unknown_fields.iter() {
23943                state.serialize_entry(key, &value)?;
23944            }
23945        }
23946        state.end()
23947    }
23948}
23949
23950impl std::fmt::Debug for SalesforceOrg {
23951    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23952        let mut debug_struct = f.debug_struct("SalesforceOrg");
23953        debug_struct.field("objects", &self.objects);
23954        if !self._unknown_fields.is_empty() {
23955            debug_struct.field("_unknown_fields", &self._unknown_fields);
23956        }
23957        debug_struct.finish()
23958    }
23959}
23960
23961/// Salesforce object.
23962#[derive(Clone, Default, PartialEq)]
23963#[non_exhaustive]
23964pub struct SalesforceObject {
23965    /// Object name.
23966    pub object_name: std::string::String,
23967
23968    /// Salesforce fields.
23969    /// When unspecified as part of include objects,
23970    /// includes everything, when unspecified as part of exclude objects,
23971    /// excludes nothing.
23972    pub fields: std::vec::Vec<crate::model::SalesforceField>,
23973
23974    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23975}
23976
23977impl SalesforceObject {
23978    pub fn new() -> Self {
23979        std::default::Default::default()
23980    }
23981
23982    /// Sets the value of [object_name][crate::model::SalesforceObject::object_name].
23983    pub fn set_object_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23984        self.object_name = v.into();
23985        self
23986    }
23987
23988    /// Sets the value of [fields][crate::model::SalesforceObject::fields].
23989    pub fn set_fields<T, V>(mut self, v: T) -> Self
23990    where
23991        T: std::iter::IntoIterator<Item = V>,
23992        V: std::convert::Into<crate::model::SalesforceField>,
23993    {
23994        use std::iter::Iterator;
23995        self.fields = v.into_iter().map(|i| i.into()).collect();
23996        self
23997    }
23998}
23999
24000impl wkt::message::Message for SalesforceObject {
24001    fn typename() -> &'static str {
24002        "type.googleapis.com/google.cloud.datastream.v1.SalesforceObject"
24003    }
24004}
24005
24006#[doc(hidden)]
24007impl<'de> serde::de::Deserialize<'de> for SalesforceObject {
24008    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24009    where
24010        D: serde::Deserializer<'de>,
24011    {
24012        #[allow(non_camel_case_types)]
24013        #[doc(hidden)]
24014        #[derive(PartialEq, Eq, Hash)]
24015        enum __FieldTag {
24016            __object_name,
24017            __fields,
24018            Unknown(std::string::String),
24019        }
24020        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
24021            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24022            where
24023                D: serde::Deserializer<'de>,
24024            {
24025                struct Visitor;
24026                impl<'de> serde::de::Visitor<'de> for Visitor {
24027                    type Value = __FieldTag;
24028                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
24029                        formatter.write_str("a field name for SalesforceObject")
24030                    }
24031                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
24032                    where
24033                        E: serde::de::Error,
24034                    {
24035                        use std::result::Result::Ok;
24036                        use std::string::ToString;
24037                        match value {
24038                            "objectName" => Ok(__FieldTag::__object_name),
24039                            "object_name" => Ok(__FieldTag::__object_name),
24040                            "fields" => Ok(__FieldTag::__fields),
24041                            _ => Ok(__FieldTag::Unknown(value.to_string())),
24042                        }
24043                    }
24044                }
24045                deserializer.deserialize_identifier(Visitor)
24046            }
24047        }
24048        struct Visitor;
24049        impl<'de> serde::de::Visitor<'de> for Visitor {
24050            type Value = SalesforceObject;
24051            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
24052                formatter.write_str("struct SalesforceObject")
24053            }
24054            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
24055            where
24056                A: serde::de::MapAccess<'de>,
24057            {
24058                #[allow(unused_imports)]
24059                use serde::de::Error;
24060                use std::option::Option::Some;
24061                let mut fields = std::collections::HashSet::new();
24062                let mut result = Self::Value::new();
24063                while let Some(tag) = map.next_key::<__FieldTag>()? {
24064                    #[allow(clippy::match_single_binding)]
24065                    match tag {
24066                        __FieldTag::__object_name => {
24067                            if !fields.insert(__FieldTag::__object_name) {
24068                                return std::result::Result::Err(A::Error::duplicate_field(
24069                                    "multiple values for object_name",
24070                                ));
24071                            }
24072                            result.object_name = map
24073                                .next_value::<std::option::Option<std::string::String>>()?
24074                                .unwrap_or_default();
24075                        }
24076                        __FieldTag::__fields => {
24077                            if !fields.insert(__FieldTag::__fields) {
24078                                return std::result::Result::Err(A::Error::duplicate_field(
24079                                    "multiple values for fields",
24080                                ));
24081                            }
24082                            result.fields =
24083                                map.next_value::<std::option::Option<
24084                                    std::vec::Vec<crate::model::SalesforceField>,
24085                                >>()?
24086                                .unwrap_or_default();
24087                        }
24088                        __FieldTag::Unknown(key) => {
24089                            let value = map.next_value::<serde_json::Value>()?;
24090                            result._unknown_fields.insert(key, value);
24091                        }
24092                    }
24093                }
24094                std::result::Result::Ok(result)
24095            }
24096        }
24097        deserializer.deserialize_any(Visitor)
24098    }
24099}
24100
24101#[doc(hidden)]
24102impl serde::ser::Serialize for SalesforceObject {
24103    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24104    where
24105        S: serde::ser::Serializer,
24106    {
24107        use serde::ser::SerializeMap;
24108        #[allow(unused_imports)]
24109        use std::option::Option::Some;
24110        let mut state = serializer.serialize_map(std::option::Option::None)?;
24111        if !self.object_name.is_empty() {
24112            state.serialize_entry("objectName", &self.object_name)?;
24113        }
24114        if !self.fields.is_empty() {
24115            state.serialize_entry("fields", &self.fields)?;
24116        }
24117        if !self._unknown_fields.is_empty() {
24118            for (key, value) in self._unknown_fields.iter() {
24119                state.serialize_entry(key, &value)?;
24120            }
24121        }
24122        state.end()
24123    }
24124}
24125
24126impl std::fmt::Debug for SalesforceObject {
24127    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
24128        let mut debug_struct = f.debug_struct("SalesforceObject");
24129        debug_struct.field("object_name", &self.object_name);
24130        debug_struct.field("fields", &self.fields);
24131        if !self._unknown_fields.is_empty() {
24132            debug_struct.field("_unknown_fields", &self._unknown_fields);
24133        }
24134        debug_struct.finish()
24135    }
24136}
24137
24138/// Salesforce field.
24139#[derive(Clone, Default, PartialEq)]
24140#[non_exhaustive]
24141pub struct SalesforceField {
24142    /// Field name.
24143    pub name: std::string::String,
24144
24145    /// The data type.
24146    pub data_type: std::string::String,
24147
24148    /// Indicates whether the field can accept nil values.
24149    pub nillable: bool,
24150
24151    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24152}
24153
24154impl SalesforceField {
24155    pub fn new() -> Self {
24156        std::default::Default::default()
24157    }
24158
24159    /// Sets the value of [name][crate::model::SalesforceField::name].
24160    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24161        self.name = v.into();
24162        self
24163    }
24164
24165    /// Sets the value of [data_type][crate::model::SalesforceField::data_type].
24166    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24167        self.data_type = v.into();
24168        self
24169    }
24170
24171    /// Sets the value of [nillable][crate::model::SalesforceField::nillable].
24172    pub fn set_nillable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
24173        self.nillable = v.into();
24174        self
24175    }
24176}
24177
24178impl wkt::message::Message for SalesforceField {
24179    fn typename() -> &'static str {
24180        "type.googleapis.com/google.cloud.datastream.v1.SalesforceField"
24181    }
24182}
24183
24184#[doc(hidden)]
24185impl<'de> serde::de::Deserialize<'de> for SalesforceField {
24186    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24187    where
24188        D: serde::Deserializer<'de>,
24189    {
24190        #[allow(non_camel_case_types)]
24191        #[doc(hidden)]
24192        #[derive(PartialEq, Eq, Hash)]
24193        enum __FieldTag {
24194            __name,
24195            __data_type,
24196            __nillable,
24197            Unknown(std::string::String),
24198        }
24199        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
24200            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24201            where
24202                D: serde::Deserializer<'de>,
24203            {
24204                struct Visitor;
24205                impl<'de> serde::de::Visitor<'de> for Visitor {
24206                    type Value = __FieldTag;
24207                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
24208                        formatter.write_str("a field name for SalesforceField")
24209                    }
24210                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
24211                    where
24212                        E: serde::de::Error,
24213                    {
24214                        use std::result::Result::Ok;
24215                        use std::string::ToString;
24216                        match value {
24217                            "name" => Ok(__FieldTag::__name),
24218                            "dataType" => Ok(__FieldTag::__data_type),
24219                            "data_type" => Ok(__FieldTag::__data_type),
24220                            "nillable" => Ok(__FieldTag::__nillable),
24221                            _ => Ok(__FieldTag::Unknown(value.to_string())),
24222                        }
24223                    }
24224                }
24225                deserializer.deserialize_identifier(Visitor)
24226            }
24227        }
24228        struct Visitor;
24229        impl<'de> serde::de::Visitor<'de> for Visitor {
24230            type Value = SalesforceField;
24231            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
24232                formatter.write_str("struct SalesforceField")
24233            }
24234            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
24235            where
24236                A: serde::de::MapAccess<'de>,
24237            {
24238                #[allow(unused_imports)]
24239                use serde::de::Error;
24240                use std::option::Option::Some;
24241                let mut fields = std::collections::HashSet::new();
24242                let mut result = Self::Value::new();
24243                while let Some(tag) = map.next_key::<__FieldTag>()? {
24244                    #[allow(clippy::match_single_binding)]
24245                    match tag {
24246                        __FieldTag::__name => {
24247                            if !fields.insert(__FieldTag::__name) {
24248                                return std::result::Result::Err(A::Error::duplicate_field(
24249                                    "multiple values for name",
24250                                ));
24251                            }
24252                            result.name = map
24253                                .next_value::<std::option::Option<std::string::String>>()?
24254                                .unwrap_or_default();
24255                        }
24256                        __FieldTag::__data_type => {
24257                            if !fields.insert(__FieldTag::__data_type) {
24258                                return std::result::Result::Err(A::Error::duplicate_field(
24259                                    "multiple values for data_type",
24260                                ));
24261                            }
24262                            result.data_type = map
24263                                .next_value::<std::option::Option<std::string::String>>()?
24264                                .unwrap_or_default();
24265                        }
24266                        __FieldTag::__nillable => {
24267                            if !fields.insert(__FieldTag::__nillable) {
24268                                return std::result::Result::Err(A::Error::duplicate_field(
24269                                    "multiple values for nillable",
24270                                ));
24271                            }
24272                            result.nillable = map
24273                                .next_value::<std::option::Option<bool>>()?
24274                                .unwrap_or_default();
24275                        }
24276                        __FieldTag::Unknown(key) => {
24277                            let value = map.next_value::<serde_json::Value>()?;
24278                            result._unknown_fields.insert(key, value);
24279                        }
24280                    }
24281                }
24282                std::result::Result::Ok(result)
24283            }
24284        }
24285        deserializer.deserialize_any(Visitor)
24286    }
24287}
24288
24289#[doc(hidden)]
24290impl serde::ser::Serialize for SalesforceField {
24291    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24292    where
24293        S: serde::ser::Serializer,
24294    {
24295        use serde::ser::SerializeMap;
24296        #[allow(unused_imports)]
24297        use std::option::Option::Some;
24298        let mut state = serializer.serialize_map(std::option::Option::None)?;
24299        if !self.name.is_empty() {
24300            state.serialize_entry("name", &self.name)?;
24301        }
24302        if !self.data_type.is_empty() {
24303            state.serialize_entry("dataType", &self.data_type)?;
24304        }
24305        if !wkt::internal::is_default(&self.nillable) {
24306            state.serialize_entry("nillable", &self.nillable)?;
24307        }
24308        if !self._unknown_fields.is_empty() {
24309            for (key, value) in self._unknown_fields.iter() {
24310                state.serialize_entry(key, &value)?;
24311            }
24312        }
24313        state.end()
24314    }
24315}
24316
24317impl std::fmt::Debug for SalesforceField {
24318    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
24319        let mut debug_struct = f.debug_struct("SalesforceField");
24320        debug_struct.field("name", &self.name);
24321        debug_struct.field("data_type", &self.data_type);
24322        debug_struct.field("nillable", &self.nillable);
24323        if !self._unknown_fields.is_empty() {
24324            debug_struct.field("_unknown_fields", &self._unknown_fields);
24325        }
24326        debug_struct.finish()
24327    }
24328}
24329
24330/// MongoDB source configuration.
24331#[derive(Clone, Default, PartialEq)]
24332#[non_exhaustive]
24333pub struct MongodbSourceConfig {
24334    /// MongoDB collections to include in the stream.
24335    pub include_objects: std::option::Option<crate::model::MongodbCluster>,
24336
24337    /// MongoDB collections to exclude from the stream.
24338    pub exclude_objects: std::option::Option<crate::model::MongodbCluster>,
24339
24340    /// Optional. Maximum number of concurrent backfill tasks. The number should be
24341    /// non-negative and less than or equal to 50. If not set (or set to 0), the
24342    /// system's default value is used
24343    pub max_concurrent_backfill_tasks: i32,
24344
24345    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24346}
24347
24348impl MongodbSourceConfig {
24349    pub fn new() -> Self {
24350        std::default::Default::default()
24351    }
24352
24353    /// Sets the value of [include_objects][crate::model::MongodbSourceConfig::include_objects].
24354    pub fn set_include_objects<T>(mut self, v: T) -> Self
24355    where
24356        T: std::convert::Into<crate::model::MongodbCluster>,
24357    {
24358        self.include_objects = std::option::Option::Some(v.into());
24359        self
24360    }
24361
24362    /// Sets or clears the value of [include_objects][crate::model::MongodbSourceConfig::include_objects].
24363    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
24364    where
24365        T: std::convert::Into<crate::model::MongodbCluster>,
24366    {
24367        self.include_objects = v.map(|x| x.into());
24368        self
24369    }
24370
24371    /// Sets the value of [exclude_objects][crate::model::MongodbSourceConfig::exclude_objects].
24372    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
24373    where
24374        T: std::convert::Into<crate::model::MongodbCluster>,
24375    {
24376        self.exclude_objects = std::option::Option::Some(v.into());
24377        self
24378    }
24379
24380    /// Sets or clears the value of [exclude_objects][crate::model::MongodbSourceConfig::exclude_objects].
24381    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
24382    where
24383        T: std::convert::Into<crate::model::MongodbCluster>,
24384    {
24385        self.exclude_objects = v.map(|x| x.into());
24386        self
24387    }
24388
24389    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::MongodbSourceConfig::max_concurrent_backfill_tasks].
24390    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
24391        self.max_concurrent_backfill_tasks = v.into();
24392        self
24393    }
24394}
24395
24396impl wkt::message::Message for MongodbSourceConfig {
24397    fn typename() -> &'static str {
24398        "type.googleapis.com/google.cloud.datastream.v1.MongodbSourceConfig"
24399    }
24400}
24401
24402#[doc(hidden)]
24403impl<'de> serde::de::Deserialize<'de> for MongodbSourceConfig {
24404    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24405    where
24406        D: serde::Deserializer<'de>,
24407    {
24408        #[allow(non_camel_case_types)]
24409        #[doc(hidden)]
24410        #[derive(PartialEq, Eq, Hash)]
24411        enum __FieldTag {
24412            __include_objects,
24413            __exclude_objects,
24414            __max_concurrent_backfill_tasks,
24415            Unknown(std::string::String),
24416        }
24417        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
24418            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24419            where
24420                D: serde::Deserializer<'de>,
24421            {
24422                struct Visitor;
24423                impl<'de> serde::de::Visitor<'de> for Visitor {
24424                    type Value = __FieldTag;
24425                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
24426                        formatter.write_str("a field name for MongodbSourceConfig")
24427                    }
24428                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
24429                    where
24430                        E: serde::de::Error,
24431                    {
24432                        use std::result::Result::Ok;
24433                        use std::string::ToString;
24434                        match value {
24435                            "includeObjects" => Ok(__FieldTag::__include_objects),
24436                            "include_objects" => Ok(__FieldTag::__include_objects),
24437                            "excludeObjects" => Ok(__FieldTag::__exclude_objects),
24438                            "exclude_objects" => Ok(__FieldTag::__exclude_objects),
24439                            "maxConcurrentBackfillTasks" => {
24440                                Ok(__FieldTag::__max_concurrent_backfill_tasks)
24441                            }
24442                            "max_concurrent_backfill_tasks" => {
24443                                Ok(__FieldTag::__max_concurrent_backfill_tasks)
24444                            }
24445                            _ => Ok(__FieldTag::Unknown(value.to_string())),
24446                        }
24447                    }
24448                }
24449                deserializer.deserialize_identifier(Visitor)
24450            }
24451        }
24452        struct Visitor;
24453        impl<'de> serde::de::Visitor<'de> for Visitor {
24454            type Value = MongodbSourceConfig;
24455            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
24456                formatter.write_str("struct MongodbSourceConfig")
24457            }
24458            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
24459            where
24460                A: serde::de::MapAccess<'de>,
24461            {
24462                #[allow(unused_imports)]
24463                use serde::de::Error;
24464                use std::option::Option::Some;
24465                let mut fields = std::collections::HashSet::new();
24466                let mut result = Self::Value::new();
24467                while let Some(tag) = map.next_key::<__FieldTag>()? {
24468                    #[allow(clippy::match_single_binding)]
24469                    match tag {
24470                        __FieldTag::__include_objects => {
24471                            if !fields.insert(__FieldTag::__include_objects) {
24472                                return std::result::Result::Err(A::Error::duplicate_field(
24473                                    "multiple values for include_objects",
24474                                ));
24475                            }
24476                            result.include_objects = map
24477                                .next_value::<std::option::Option<crate::model::MongodbCluster>>(
24478                                )?;
24479                        }
24480                        __FieldTag::__exclude_objects => {
24481                            if !fields.insert(__FieldTag::__exclude_objects) {
24482                                return std::result::Result::Err(A::Error::duplicate_field(
24483                                    "multiple values for exclude_objects",
24484                                ));
24485                            }
24486                            result.exclude_objects = map
24487                                .next_value::<std::option::Option<crate::model::MongodbCluster>>(
24488                                )?;
24489                        }
24490                        __FieldTag::__max_concurrent_backfill_tasks => {
24491                            if !fields.insert(__FieldTag::__max_concurrent_backfill_tasks) {
24492                                return std::result::Result::Err(A::Error::duplicate_field(
24493                                    "multiple values for max_concurrent_backfill_tasks",
24494                                ));
24495                            }
24496                            struct __With(std::option::Option<i32>);
24497                            impl<'de> serde::de::Deserialize<'de> for __With {
24498                                fn deserialize<D>(
24499                                    deserializer: D,
24500                                ) -> std::result::Result<Self, D::Error>
24501                                where
24502                                    D: serde::de::Deserializer<'de>,
24503                                {
24504                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
24505                                }
24506                            }
24507                            result.max_concurrent_backfill_tasks =
24508                                map.next_value::<__With>()?.0.unwrap_or_default();
24509                        }
24510                        __FieldTag::Unknown(key) => {
24511                            let value = map.next_value::<serde_json::Value>()?;
24512                            result._unknown_fields.insert(key, value);
24513                        }
24514                    }
24515                }
24516                std::result::Result::Ok(result)
24517            }
24518        }
24519        deserializer.deserialize_any(Visitor)
24520    }
24521}
24522
24523#[doc(hidden)]
24524impl serde::ser::Serialize for MongodbSourceConfig {
24525    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24526    where
24527        S: serde::ser::Serializer,
24528    {
24529        use serde::ser::SerializeMap;
24530        #[allow(unused_imports)]
24531        use std::option::Option::Some;
24532        let mut state = serializer.serialize_map(std::option::Option::None)?;
24533        if self.include_objects.is_some() {
24534            state.serialize_entry("includeObjects", &self.include_objects)?;
24535        }
24536        if self.exclude_objects.is_some() {
24537            state.serialize_entry("excludeObjects", &self.exclude_objects)?;
24538        }
24539        if !wkt::internal::is_default(&self.max_concurrent_backfill_tasks) {
24540            struct __With<'a>(&'a i32);
24541            impl<'a> serde::ser::Serialize for __With<'a> {
24542                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24543                where
24544                    S: serde::ser::Serializer,
24545                {
24546                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
24547                }
24548            }
24549            state.serialize_entry(
24550                "maxConcurrentBackfillTasks",
24551                &__With(&self.max_concurrent_backfill_tasks),
24552            )?;
24553        }
24554        if !self._unknown_fields.is_empty() {
24555            for (key, value) in self._unknown_fields.iter() {
24556                state.serialize_entry(key, &value)?;
24557            }
24558        }
24559        state.end()
24560    }
24561}
24562
24563impl std::fmt::Debug for MongodbSourceConfig {
24564    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
24565        let mut debug_struct = f.debug_struct("MongodbSourceConfig");
24566        debug_struct.field("include_objects", &self.include_objects);
24567        debug_struct.field("exclude_objects", &self.exclude_objects);
24568        debug_struct.field(
24569            "max_concurrent_backfill_tasks",
24570            &self.max_concurrent_backfill_tasks,
24571        );
24572        if !self._unknown_fields.is_empty() {
24573            debug_struct.field("_unknown_fields", &self._unknown_fields);
24574        }
24575        debug_struct.finish()
24576    }
24577}
24578
24579/// MongoDB Cluster structure.
24580#[derive(Clone, Default, PartialEq)]
24581#[non_exhaustive]
24582pub struct MongodbCluster {
24583    /// MongoDB databases in the cluster.
24584    pub databases: std::vec::Vec<crate::model::MongodbDatabase>,
24585
24586    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24587}
24588
24589impl MongodbCluster {
24590    pub fn new() -> Self {
24591        std::default::Default::default()
24592    }
24593
24594    /// Sets the value of [databases][crate::model::MongodbCluster::databases].
24595    pub fn set_databases<T, V>(mut self, v: T) -> Self
24596    where
24597        T: std::iter::IntoIterator<Item = V>,
24598        V: std::convert::Into<crate::model::MongodbDatabase>,
24599    {
24600        use std::iter::Iterator;
24601        self.databases = v.into_iter().map(|i| i.into()).collect();
24602        self
24603    }
24604}
24605
24606impl wkt::message::Message for MongodbCluster {
24607    fn typename() -> &'static str {
24608        "type.googleapis.com/google.cloud.datastream.v1.MongodbCluster"
24609    }
24610}
24611
24612#[doc(hidden)]
24613impl<'de> serde::de::Deserialize<'de> for MongodbCluster {
24614    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24615    where
24616        D: serde::Deserializer<'de>,
24617    {
24618        #[allow(non_camel_case_types)]
24619        #[doc(hidden)]
24620        #[derive(PartialEq, Eq, Hash)]
24621        enum __FieldTag {
24622            __databases,
24623            Unknown(std::string::String),
24624        }
24625        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
24626            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24627            where
24628                D: serde::Deserializer<'de>,
24629            {
24630                struct Visitor;
24631                impl<'de> serde::de::Visitor<'de> for Visitor {
24632                    type Value = __FieldTag;
24633                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
24634                        formatter.write_str("a field name for MongodbCluster")
24635                    }
24636                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
24637                    where
24638                        E: serde::de::Error,
24639                    {
24640                        use std::result::Result::Ok;
24641                        use std::string::ToString;
24642                        match value {
24643                            "databases" => Ok(__FieldTag::__databases),
24644                            _ => Ok(__FieldTag::Unknown(value.to_string())),
24645                        }
24646                    }
24647                }
24648                deserializer.deserialize_identifier(Visitor)
24649            }
24650        }
24651        struct Visitor;
24652        impl<'de> serde::de::Visitor<'de> for Visitor {
24653            type Value = MongodbCluster;
24654            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
24655                formatter.write_str("struct MongodbCluster")
24656            }
24657            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
24658            where
24659                A: serde::de::MapAccess<'de>,
24660            {
24661                #[allow(unused_imports)]
24662                use serde::de::Error;
24663                use std::option::Option::Some;
24664                let mut fields = std::collections::HashSet::new();
24665                let mut result = Self::Value::new();
24666                while let Some(tag) = map.next_key::<__FieldTag>()? {
24667                    #[allow(clippy::match_single_binding)]
24668                    match tag {
24669                        __FieldTag::__databases => {
24670                            if !fields.insert(__FieldTag::__databases) {
24671                                return std::result::Result::Err(A::Error::duplicate_field(
24672                                    "multiple values for databases",
24673                                ));
24674                            }
24675                            result.databases =
24676                                map.next_value::<std::option::Option<
24677                                    std::vec::Vec<crate::model::MongodbDatabase>,
24678                                >>()?
24679                                .unwrap_or_default();
24680                        }
24681                        __FieldTag::Unknown(key) => {
24682                            let value = map.next_value::<serde_json::Value>()?;
24683                            result._unknown_fields.insert(key, value);
24684                        }
24685                    }
24686                }
24687                std::result::Result::Ok(result)
24688            }
24689        }
24690        deserializer.deserialize_any(Visitor)
24691    }
24692}
24693
24694#[doc(hidden)]
24695impl serde::ser::Serialize for MongodbCluster {
24696    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24697    where
24698        S: serde::ser::Serializer,
24699    {
24700        use serde::ser::SerializeMap;
24701        #[allow(unused_imports)]
24702        use std::option::Option::Some;
24703        let mut state = serializer.serialize_map(std::option::Option::None)?;
24704        if !self.databases.is_empty() {
24705            state.serialize_entry("databases", &self.databases)?;
24706        }
24707        if !self._unknown_fields.is_empty() {
24708            for (key, value) in self._unknown_fields.iter() {
24709                state.serialize_entry(key, &value)?;
24710            }
24711        }
24712        state.end()
24713    }
24714}
24715
24716impl std::fmt::Debug for MongodbCluster {
24717    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
24718        let mut debug_struct = f.debug_struct("MongodbCluster");
24719        debug_struct.field("databases", &self.databases);
24720        if !self._unknown_fields.is_empty() {
24721            debug_struct.field("_unknown_fields", &self._unknown_fields);
24722        }
24723        debug_struct.finish()
24724    }
24725}
24726
24727/// MongoDB Database.
24728#[derive(Clone, Default, PartialEq)]
24729#[non_exhaustive]
24730pub struct MongodbDatabase {
24731    /// Database name.
24732    pub database: std::string::String,
24733
24734    /// Collections in the database.
24735    pub collections: std::vec::Vec<crate::model::MongodbCollection>,
24736
24737    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24738}
24739
24740impl MongodbDatabase {
24741    pub fn new() -> Self {
24742        std::default::Default::default()
24743    }
24744
24745    /// Sets the value of [database][crate::model::MongodbDatabase::database].
24746    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24747        self.database = v.into();
24748        self
24749    }
24750
24751    /// Sets the value of [collections][crate::model::MongodbDatabase::collections].
24752    pub fn set_collections<T, V>(mut self, v: T) -> Self
24753    where
24754        T: std::iter::IntoIterator<Item = V>,
24755        V: std::convert::Into<crate::model::MongodbCollection>,
24756    {
24757        use std::iter::Iterator;
24758        self.collections = v.into_iter().map(|i| i.into()).collect();
24759        self
24760    }
24761}
24762
24763impl wkt::message::Message for MongodbDatabase {
24764    fn typename() -> &'static str {
24765        "type.googleapis.com/google.cloud.datastream.v1.MongodbDatabase"
24766    }
24767}
24768
24769#[doc(hidden)]
24770impl<'de> serde::de::Deserialize<'de> for MongodbDatabase {
24771    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24772    where
24773        D: serde::Deserializer<'de>,
24774    {
24775        #[allow(non_camel_case_types)]
24776        #[doc(hidden)]
24777        #[derive(PartialEq, Eq, Hash)]
24778        enum __FieldTag {
24779            __database,
24780            __collections,
24781            Unknown(std::string::String),
24782        }
24783        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
24784            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24785            where
24786                D: serde::Deserializer<'de>,
24787            {
24788                struct Visitor;
24789                impl<'de> serde::de::Visitor<'de> for Visitor {
24790                    type Value = __FieldTag;
24791                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
24792                        formatter.write_str("a field name for MongodbDatabase")
24793                    }
24794                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
24795                    where
24796                        E: serde::de::Error,
24797                    {
24798                        use std::result::Result::Ok;
24799                        use std::string::ToString;
24800                        match value {
24801                            "database" => Ok(__FieldTag::__database),
24802                            "collections" => Ok(__FieldTag::__collections),
24803                            _ => Ok(__FieldTag::Unknown(value.to_string())),
24804                        }
24805                    }
24806                }
24807                deserializer.deserialize_identifier(Visitor)
24808            }
24809        }
24810        struct Visitor;
24811        impl<'de> serde::de::Visitor<'de> for Visitor {
24812            type Value = MongodbDatabase;
24813            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
24814                formatter.write_str("struct MongodbDatabase")
24815            }
24816            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
24817            where
24818                A: serde::de::MapAccess<'de>,
24819            {
24820                #[allow(unused_imports)]
24821                use serde::de::Error;
24822                use std::option::Option::Some;
24823                let mut fields = std::collections::HashSet::new();
24824                let mut result = Self::Value::new();
24825                while let Some(tag) = map.next_key::<__FieldTag>()? {
24826                    #[allow(clippy::match_single_binding)]
24827                    match tag {
24828                        __FieldTag::__database => {
24829                            if !fields.insert(__FieldTag::__database) {
24830                                return std::result::Result::Err(A::Error::duplicate_field(
24831                                    "multiple values for database",
24832                                ));
24833                            }
24834                            result.database = map
24835                                .next_value::<std::option::Option<std::string::String>>()?
24836                                .unwrap_or_default();
24837                        }
24838                        __FieldTag::__collections => {
24839                            if !fields.insert(__FieldTag::__collections) {
24840                                return std::result::Result::Err(A::Error::duplicate_field(
24841                                    "multiple values for collections",
24842                                ));
24843                            }
24844                            result.collections =
24845                                map.next_value::<std::option::Option<
24846                                    std::vec::Vec<crate::model::MongodbCollection>,
24847                                >>()?
24848                                .unwrap_or_default();
24849                        }
24850                        __FieldTag::Unknown(key) => {
24851                            let value = map.next_value::<serde_json::Value>()?;
24852                            result._unknown_fields.insert(key, value);
24853                        }
24854                    }
24855                }
24856                std::result::Result::Ok(result)
24857            }
24858        }
24859        deserializer.deserialize_any(Visitor)
24860    }
24861}
24862
24863#[doc(hidden)]
24864impl serde::ser::Serialize for MongodbDatabase {
24865    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24866    where
24867        S: serde::ser::Serializer,
24868    {
24869        use serde::ser::SerializeMap;
24870        #[allow(unused_imports)]
24871        use std::option::Option::Some;
24872        let mut state = serializer.serialize_map(std::option::Option::None)?;
24873        if !self.database.is_empty() {
24874            state.serialize_entry("database", &self.database)?;
24875        }
24876        if !self.collections.is_empty() {
24877            state.serialize_entry("collections", &self.collections)?;
24878        }
24879        if !self._unknown_fields.is_empty() {
24880            for (key, value) in self._unknown_fields.iter() {
24881                state.serialize_entry(key, &value)?;
24882            }
24883        }
24884        state.end()
24885    }
24886}
24887
24888impl std::fmt::Debug for MongodbDatabase {
24889    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
24890        let mut debug_struct = f.debug_struct("MongodbDatabase");
24891        debug_struct.field("database", &self.database);
24892        debug_struct.field("collections", &self.collections);
24893        if !self._unknown_fields.is_empty() {
24894            debug_struct.field("_unknown_fields", &self._unknown_fields);
24895        }
24896        debug_struct.finish()
24897    }
24898}
24899
24900/// MongoDB Collection.
24901#[derive(Clone, Default, PartialEq)]
24902#[non_exhaustive]
24903pub struct MongodbCollection {
24904    /// Collection name.
24905    pub collection: std::string::String,
24906
24907    /// Fields in the collection.
24908    pub fields: std::vec::Vec<crate::model::MongodbField>,
24909
24910    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24911}
24912
24913impl MongodbCollection {
24914    pub fn new() -> Self {
24915        std::default::Default::default()
24916    }
24917
24918    /// Sets the value of [collection][crate::model::MongodbCollection::collection].
24919    pub fn set_collection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24920        self.collection = v.into();
24921        self
24922    }
24923
24924    /// Sets the value of [fields][crate::model::MongodbCollection::fields].
24925    pub fn set_fields<T, V>(mut self, v: T) -> Self
24926    where
24927        T: std::iter::IntoIterator<Item = V>,
24928        V: std::convert::Into<crate::model::MongodbField>,
24929    {
24930        use std::iter::Iterator;
24931        self.fields = v.into_iter().map(|i| i.into()).collect();
24932        self
24933    }
24934}
24935
24936impl wkt::message::Message for MongodbCollection {
24937    fn typename() -> &'static str {
24938        "type.googleapis.com/google.cloud.datastream.v1.MongodbCollection"
24939    }
24940}
24941
24942#[doc(hidden)]
24943impl<'de> serde::de::Deserialize<'de> for MongodbCollection {
24944    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24945    where
24946        D: serde::Deserializer<'de>,
24947    {
24948        #[allow(non_camel_case_types)]
24949        #[doc(hidden)]
24950        #[derive(PartialEq, Eq, Hash)]
24951        enum __FieldTag {
24952            __collection,
24953            __fields,
24954            Unknown(std::string::String),
24955        }
24956        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
24957            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24958            where
24959                D: serde::Deserializer<'de>,
24960            {
24961                struct Visitor;
24962                impl<'de> serde::de::Visitor<'de> for Visitor {
24963                    type Value = __FieldTag;
24964                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
24965                        formatter.write_str("a field name for MongodbCollection")
24966                    }
24967                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
24968                    where
24969                        E: serde::de::Error,
24970                    {
24971                        use std::result::Result::Ok;
24972                        use std::string::ToString;
24973                        match value {
24974                            "collection" => Ok(__FieldTag::__collection),
24975                            "fields" => Ok(__FieldTag::__fields),
24976                            _ => Ok(__FieldTag::Unknown(value.to_string())),
24977                        }
24978                    }
24979                }
24980                deserializer.deserialize_identifier(Visitor)
24981            }
24982        }
24983        struct Visitor;
24984        impl<'de> serde::de::Visitor<'de> for Visitor {
24985            type Value = MongodbCollection;
24986            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
24987                formatter.write_str("struct MongodbCollection")
24988            }
24989            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
24990            where
24991                A: serde::de::MapAccess<'de>,
24992            {
24993                #[allow(unused_imports)]
24994                use serde::de::Error;
24995                use std::option::Option::Some;
24996                let mut fields = std::collections::HashSet::new();
24997                let mut result = Self::Value::new();
24998                while let Some(tag) = map.next_key::<__FieldTag>()? {
24999                    #[allow(clippy::match_single_binding)]
25000                    match tag {
25001                        __FieldTag::__collection => {
25002                            if !fields.insert(__FieldTag::__collection) {
25003                                return std::result::Result::Err(A::Error::duplicate_field(
25004                                    "multiple values for collection",
25005                                ));
25006                            }
25007                            result.collection = map
25008                                .next_value::<std::option::Option<std::string::String>>()?
25009                                .unwrap_or_default();
25010                        }
25011                        __FieldTag::__fields => {
25012                            if !fields.insert(__FieldTag::__fields) {
25013                                return std::result::Result::Err(A::Error::duplicate_field(
25014                                    "multiple values for fields",
25015                                ));
25016                            }
25017                            result.fields = map.next_value::<std::option::Option<std::vec::Vec<crate::model::MongodbField>>>()?.unwrap_or_default();
25018                        }
25019                        __FieldTag::Unknown(key) => {
25020                            let value = map.next_value::<serde_json::Value>()?;
25021                            result._unknown_fields.insert(key, value);
25022                        }
25023                    }
25024                }
25025                std::result::Result::Ok(result)
25026            }
25027        }
25028        deserializer.deserialize_any(Visitor)
25029    }
25030}
25031
25032#[doc(hidden)]
25033impl serde::ser::Serialize for MongodbCollection {
25034    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25035    where
25036        S: serde::ser::Serializer,
25037    {
25038        use serde::ser::SerializeMap;
25039        #[allow(unused_imports)]
25040        use std::option::Option::Some;
25041        let mut state = serializer.serialize_map(std::option::Option::None)?;
25042        if !self.collection.is_empty() {
25043            state.serialize_entry("collection", &self.collection)?;
25044        }
25045        if !self.fields.is_empty() {
25046            state.serialize_entry("fields", &self.fields)?;
25047        }
25048        if !self._unknown_fields.is_empty() {
25049            for (key, value) in self._unknown_fields.iter() {
25050                state.serialize_entry(key, &value)?;
25051            }
25052        }
25053        state.end()
25054    }
25055}
25056
25057impl std::fmt::Debug for MongodbCollection {
25058    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
25059        let mut debug_struct = f.debug_struct("MongodbCollection");
25060        debug_struct.field("collection", &self.collection);
25061        debug_struct.field("fields", &self.fields);
25062        if !self._unknown_fields.is_empty() {
25063            debug_struct.field("_unknown_fields", &self._unknown_fields);
25064        }
25065        debug_struct.finish()
25066    }
25067}
25068
25069/// MongoDB Field.
25070#[derive(Clone, Default, PartialEq)]
25071#[non_exhaustive]
25072pub struct MongodbField {
25073    /// Field name.
25074    pub field: std::string::String,
25075
25076    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25077}
25078
25079impl MongodbField {
25080    pub fn new() -> Self {
25081        std::default::Default::default()
25082    }
25083
25084    /// Sets the value of [field][crate::model::MongodbField::field].
25085    pub fn set_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25086        self.field = v.into();
25087        self
25088    }
25089}
25090
25091impl wkt::message::Message for MongodbField {
25092    fn typename() -> &'static str {
25093        "type.googleapis.com/google.cloud.datastream.v1.MongodbField"
25094    }
25095}
25096
25097#[doc(hidden)]
25098impl<'de> serde::de::Deserialize<'de> for MongodbField {
25099    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25100    where
25101        D: serde::Deserializer<'de>,
25102    {
25103        #[allow(non_camel_case_types)]
25104        #[doc(hidden)]
25105        #[derive(PartialEq, Eq, Hash)]
25106        enum __FieldTag {
25107            __field,
25108            Unknown(std::string::String),
25109        }
25110        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
25111            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25112            where
25113                D: serde::Deserializer<'de>,
25114            {
25115                struct Visitor;
25116                impl<'de> serde::de::Visitor<'de> for Visitor {
25117                    type Value = __FieldTag;
25118                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
25119                        formatter.write_str("a field name for MongodbField")
25120                    }
25121                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
25122                    where
25123                        E: serde::de::Error,
25124                    {
25125                        use std::result::Result::Ok;
25126                        use std::string::ToString;
25127                        match value {
25128                            "field" => Ok(__FieldTag::__field),
25129                            _ => Ok(__FieldTag::Unknown(value.to_string())),
25130                        }
25131                    }
25132                }
25133                deserializer.deserialize_identifier(Visitor)
25134            }
25135        }
25136        struct Visitor;
25137        impl<'de> serde::de::Visitor<'de> for Visitor {
25138            type Value = MongodbField;
25139            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
25140                formatter.write_str("struct MongodbField")
25141            }
25142            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
25143            where
25144                A: serde::de::MapAccess<'de>,
25145            {
25146                #[allow(unused_imports)]
25147                use serde::de::Error;
25148                use std::option::Option::Some;
25149                let mut fields = std::collections::HashSet::new();
25150                let mut result = Self::Value::new();
25151                while let Some(tag) = map.next_key::<__FieldTag>()? {
25152                    #[allow(clippy::match_single_binding)]
25153                    match tag {
25154                        __FieldTag::__field => {
25155                            if !fields.insert(__FieldTag::__field) {
25156                                return std::result::Result::Err(A::Error::duplicate_field(
25157                                    "multiple values for field",
25158                                ));
25159                            }
25160                            result.field = map
25161                                .next_value::<std::option::Option<std::string::String>>()?
25162                                .unwrap_or_default();
25163                        }
25164                        __FieldTag::Unknown(key) => {
25165                            let value = map.next_value::<serde_json::Value>()?;
25166                            result._unknown_fields.insert(key, value);
25167                        }
25168                    }
25169                }
25170                std::result::Result::Ok(result)
25171            }
25172        }
25173        deserializer.deserialize_any(Visitor)
25174    }
25175}
25176
25177#[doc(hidden)]
25178impl serde::ser::Serialize for MongodbField {
25179    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25180    where
25181        S: serde::ser::Serializer,
25182    {
25183        use serde::ser::SerializeMap;
25184        #[allow(unused_imports)]
25185        use std::option::Option::Some;
25186        let mut state = serializer.serialize_map(std::option::Option::None)?;
25187        if !self.field.is_empty() {
25188            state.serialize_entry("field", &self.field)?;
25189        }
25190        if !self._unknown_fields.is_empty() {
25191            for (key, value) in self._unknown_fields.iter() {
25192                state.serialize_entry(key, &value)?;
25193            }
25194        }
25195        state.end()
25196    }
25197}
25198
25199impl std::fmt::Debug for MongodbField {
25200    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
25201        let mut debug_struct = f.debug_struct("MongodbField");
25202        debug_struct.field("field", &self.field);
25203        if !self._unknown_fields.is_empty() {
25204            debug_struct.field("_unknown_fields", &self._unknown_fields);
25205        }
25206        debug_struct.finish()
25207    }
25208}
25209
25210/// The configuration of the stream source.
25211#[derive(Clone, Default, PartialEq)]
25212#[non_exhaustive]
25213pub struct SourceConfig {
25214    /// Required. Source connection profile resource.
25215    /// Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
25216    pub source_connection_profile: std::string::String,
25217
25218    /// Stream configuration that is specific to the data source type.
25219    pub source_stream_config: std::option::Option<crate::model::source_config::SourceStreamConfig>,
25220
25221    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25222}
25223
25224impl SourceConfig {
25225    pub fn new() -> Self {
25226        std::default::Default::default()
25227    }
25228
25229    /// Sets the value of [source_connection_profile][crate::model::SourceConfig::source_connection_profile].
25230    pub fn set_source_connection_profile<T: std::convert::Into<std::string::String>>(
25231        mut self,
25232        v: T,
25233    ) -> Self {
25234        self.source_connection_profile = v.into();
25235        self
25236    }
25237
25238    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config].
25239    ///
25240    /// Note that all the setters affecting `source_stream_config` are mutually
25241    /// exclusive.
25242    pub fn set_source_stream_config<
25243        T: std::convert::Into<std::option::Option<crate::model::source_config::SourceStreamConfig>>,
25244    >(
25245        mut self,
25246        v: T,
25247    ) -> Self {
25248        self.source_stream_config = v.into();
25249        self
25250    }
25251
25252    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
25253    /// if it holds a `OracleSourceConfig`, `None` if the field is not set or
25254    /// holds a different branch.
25255    pub fn oracle_source_config(
25256        &self,
25257    ) -> std::option::Option<&std::boxed::Box<crate::model::OracleSourceConfig>> {
25258        #[allow(unreachable_patterns)]
25259        self.source_stream_config.as_ref().and_then(|v| match v {
25260            crate::model::source_config::SourceStreamConfig::OracleSourceConfig(v) => {
25261                std::option::Option::Some(v)
25262            }
25263            _ => std::option::Option::None,
25264        })
25265    }
25266
25267    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
25268    /// to hold a `OracleSourceConfig`.
25269    ///
25270    /// Note that all the setters affecting `source_stream_config` are
25271    /// mutually exclusive.
25272    pub fn set_oracle_source_config<
25273        T: std::convert::Into<std::boxed::Box<crate::model::OracleSourceConfig>>,
25274    >(
25275        mut self,
25276        v: T,
25277    ) -> Self {
25278        self.source_stream_config = std::option::Option::Some(
25279            crate::model::source_config::SourceStreamConfig::OracleSourceConfig(v.into()),
25280        );
25281        self
25282    }
25283
25284    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
25285    /// if it holds a `MysqlSourceConfig`, `None` if the field is not set or
25286    /// holds a different branch.
25287    pub fn mysql_source_config(
25288        &self,
25289    ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlSourceConfig>> {
25290        #[allow(unreachable_patterns)]
25291        self.source_stream_config.as_ref().and_then(|v| match v {
25292            crate::model::source_config::SourceStreamConfig::MysqlSourceConfig(v) => {
25293                std::option::Option::Some(v)
25294            }
25295            _ => std::option::Option::None,
25296        })
25297    }
25298
25299    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
25300    /// to hold a `MysqlSourceConfig`.
25301    ///
25302    /// Note that all the setters affecting `source_stream_config` are
25303    /// mutually exclusive.
25304    pub fn set_mysql_source_config<
25305        T: std::convert::Into<std::boxed::Box<crate::model::MysqlSourceConfig>>,
25306    >(
25307        mut self,
25308        v: T,
25309    ) -> Self {
25310        self.source_stream_config = std::option::Option::Some(
25311            crate::model::source_config::SourceStreamConfig::MysqlSourceConfig(v.into()),
25312        );
25313        self
25314    }
25315
25316    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
25317    /// if it holds a `PostgresqlSourceConfig`, `None` if the field is not set or
25318    /// holds a different branch.
25319    pub fn postgresql_source_config(
25320        &self,
25321    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlSourceConfig>> {
25322        #[allow(unreachable_patterns)]
25323        self.source_stream_config.as_ref().and_then(|v| match v {
25324            crate::model::source_config::SourceStreamConfig::PostgresqlSourceConfig(v) => {
25325                std::option::Option::Some(v)
25326            }
25327            _ => std::option::Option::None,
25328        })
25329    }
25330
25331    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
25332    /// to hold a `PostgresqlSourceConfig`.
25333    ///
25334    /// Note that all the setters affecting `source_stream_config` are
25335    /// mutually exclusive.
25336    pub fn set_postgresql_source_config<
25337        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlSourceConfig>>,
25338    >(
25339        mut self,
25340        v: T,
25341    ) -> Self {
25342        self.source_stream_config = std::option::Option::Some(
25343            crate::model::source_config::SourceStreamConfig::PostgresqlSourceConfig(v.into()),
25344        );
25345        self
25346    }
25347
25348    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
25349    /// if it holds a `SqlServerSourceConfig`, `None` if the field is not set or
25350    /// holds a different branch.
25351    pub fn sql_server_source_config(
25352        &self,
25353    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerSourceConfig>> {
25354        #[allow(unreachable_patterns)]
25355        self.source_stream_config.as_ref().and_then(|v| match v {
25356            crate::model::source_config::SourceStreamConfig::SqlServerSourceConfig(v) => {
25357                std::option::Option::Some(v)
25358            }
25359            _ => std::option::Option::None,
25360        })
25361    }
25362
25363    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
25364    /// to hold a `SqlServerSourceConfig`.
25365    ///
25366    /// Note that all the setters affecting `source_stream_config` are
25367    /// mutually exclusive.
25368    pub fn set_sql_server_source_config<
25369        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerSourceConfig>>,
25370    >(
25371        mut self,
25372        v: T,
25373    ) -> Self {
25374        self.source_stream_config = std::option::Option::Some(
25375            crate::model::source_config::SourceStreamConfig::SqlServerSourceConfig(v.into()),
25376        );
25377        self
25378    }
25379
25380    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
25381    /// if it holds a `SalesforceSourceConfig`, `None` if the field is not set or
25382    /// holds a different branch.
25383    pub fn salesforce_source_config(
25384        &self,
25385    ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceSourceConfig>> {
25386        #[allow(unreachable_patterns)]
25387        self.source_stream_config.as_ref().and_then(|v| match v {
25388            crate::model::source_config::SourceStreamConfig::SalesforceSourceConfig(v) => {
25389                std::option::Option::Some(v)
25390            }
25391            _ => std::option::Option::None,
25392        })
25393    }
25394
25395    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
25396    /// to hold a `SalesforceSourceConfig`.
25397    ///
25398    /// Note that all the setters affecting `source_stream_config` are
25399    /// mutually exclusive.
25400    pub fn set_salesforce_source_config<
25401        T: std::convert::Into<std::boxed::Box<crate::model::SalesforceSourceConfig>>,
25402    >(
25403        mut self,
25404        v: T,
25405    ) -> Self {
25406        self.source_stream_config = std::option::Option::Some(
25407            crate::model::source_config::SourceStreamConfig::SalesforceSourceConfig(v.into()),
25408        );
25409        self
25410    }
25411
25412    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
25413    /// if it holds a `MongodbSourceConfig`, `None` if the field is not set or
25414    /// holds a different branch.
25415    pub fn mongodb_source_config(
25416        &self,
25417    ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbSourceConfig>> {
25418        #[allow(unreachable_patterns)]
25419        self.source_stream_config.as_ref().and_then(|v| match v {
25420            crate::model::source_config::SourceStreamConfig::MongodbSourceConfig(v) => {
25421                std::option::Option::Some(v)
25422            }
25423            _ => std::option::Option::None,
25424        })
25425    }
25426
25427    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
25428    /// to hold a `MongodbSourceConfig`.
25429    ///
25430    /// Note that all the setters affecting `source_stream_config` are
25431    /// mutually exclusive.
25432    pub fn set_mongodb_source_config<
25433        T: std::convert::Into<std::boxed::Box<crate::model::MongodbSourceConfig>>,
25434    >(
25435        mut self,
25436        v: T,
25437    ) -> Self {
25438        self.source_stream_config = std::option::Option::Some(
25439            crate::model::source_config::SourceStreamConfig::MongodbSourceConfig(v.into()),
25440        );
25441        self
25442    }
25443}
25444
25445impl wkt::message::Message for SourceConfig {
25446    fn typename() -> &'static str {
25447        "type.googleapis.com/google.cloud.datastream.v1.SourceConfig"
25448    }
25449}
25450
25451#[doc(hidden)]
25452impl<'de> serde::de::Deserialize<'de> for SourceConfig {
25453    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25454    where
25455        D: serde::Deserializer<'de>,
25456    {
25457        #[allow(non_camel_case_types)]
25458        #[doc(hidden)]
25459        #[derive(PartialEq, Eq, Hash)]
25460        enum __FieldTag {
25461            __source_connection_profile,
25462            __oracle_source_config,
25463            __mysql_source_config,
25464            __postgresql_source_config,
25465            __sql_server_source_config,
25466            __salesforce_source_config,
25467            __mongodb_source_config,
25468            Unknown(std::string::String),
25469        }
25470        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
25471            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25472            where
25473                D: serde::Deserializer<'de>,
25474            {
25475                struct Visitor;
25476                impl<'de> serde::de::Visitor<'de> for Visitor {
25477                    type Value = __FieldTag;
25478                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
25479                        formatter.write_str("a field name for SourceConfig")
25480                    }
25481                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
25482                    where
25483                        E: serde::de::Error,
25484                    {
25485                        use std::result::Result::Ok;
25486                        use std::string::ToString;
25487                        match value {
25488                            "sourceConnectionProfile" => {
25489                                Ok(__FieldTag::__source_connection_profile)
25490                            }
25491                            "source_connection_profile" => {
25492                                Ok(__FieldTag::__source_connection_profile)
25493                            }
25494                            "oracleSourceConfig" => Ok(__FieldTag::__oracle_source_config),
25495                            "oracle_source_config" => Ok(__FieldTag::__oracle_source_config),
25496                            "mysqlSourceConfig" => Ok(__FieldTag::__mysql_source_config),
25497                            "mysql_source_config" => Ok(__FieldTag::__mysql_source_config),
25498                            "postgresqlSourceConfig" => Ok(__FieldTag::__postgresql_source_config),
25499                            "postgresql_source_config" => {
25500                                Ok(__FieldTag::__postgresql_source_config)
25501                            }
25502                            "sqlServerSourceConfig" => Ok(__FieldTag::__sql_server_source_config),
25503                            "sql_server_source_config" => {
25504                                Ok(__FieldTag::__sql_server_source_config)
25505                            }
25506                            "salesforceSourceConfig" => Ok(__FieldTag::__salesforce_source_config),
25507                            "salesforce_source_config" => {
25508                                Ok(__FieldTag::__salesforce_source_config)
25509                            }
25510                            "mongodbSourceConfig" => Ok(__FieldTag::__mongodb_source_config),
25511                            "mongodb_source_config" => Ok(__FieldTag::__mongodb_source_config),
25512                            _ => Ok(__FieldTag::Unknown(value.to_string())),
25513                        }
25514                    }
25515                }
25516                deserializer.deserialize_identifier(Visitor)
25517            }
25518        }
25519        struct Visitor;
25520        impl<'de> serde::de::Visitor<'de> for Visitor {
25521            type Value = SourceConfig;
25522            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
25523                formatter.write_str("struct SourceConfig")
25524            }
25525            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
25526            where
25527                A: serde::de::MapAccess<'de>,
25528            {
25529                #[allow(unused_imports)]
25530                use serde::de::Error;
25531                use std::option::Option::Some;
25532                let mut fields = std::collections::HashSet::new();
25533                let mut result = Self::Value::new();
25534                while let Some(tag) = map.next_key::<__FieldTag>()? {
25535                    #[allow(clippy::match_single_binding)]
25536                    match tag {
25537                        __FieldTag::__source_connection_profile => {
25538                            if !fields.insert(__FieldTag::__source_connection_profile) {
25539                                return std::result::Result::Err(A::Error::duplicate_field(
25540                                    "multiple values for source_connection_profile",
25541                                ));
25542                            }
25543                            result.source_connection_profile = map
25544                                .next_value::<std::option::Option<std::string::String>>()?
25545                                .unwrap_or_default();
25546                        }
25547                        __FieldTag::__oracle_source_config => {
25548                            if !fields.insert(__FieldTag::__oracle_source_config) {
25549                                return std::result::Result::Err(A::Error::duplicate_field(
25550                                    "multiple values for oracle_source_config",
25551                                ));
25552                            }
25553                            if result.source_stream_config.is_some() {
25554                                return std::result::Result::Err(A::Error::duplicate_field(
25555                                    "multiple values for `source_stream_config`, a oneof with full ID .google.cloud.datastream.v1.SourceConfig.oracle_source_config, latest field was oracleSourceConfig",
25556                                ));
25557                            }
25558                            result.source_stream_config = std::option::Option::Some(
25559                                crate::model::source_config::SourceStreamConfig::OracleSourceConfig(
25560                                    map.next_value::<std::option::Option<
25561                                        std::boxed::Box<crate::model::OracleSourceConfig>,
25562                                    >>()?
25563                                    .unwrap_or_default(),
25564                                ),
25565                            );
25566                        }
25567                        __FieldTag::__mysql_source_config => {
25568                            if !fields.insert(__FieldTag::__mysql_source_config) {
25569                                return std::result::Result::Err(A::Error::duplicate_field(
25570                                    "multiple values for mysql_source_config",
25571                                ));
25572                            }
25573                            if result.source_stream_config.is_some() {
25574                                return std::result::Result::Err(A::Error::duplicate_field(
25575                                    "multiple values for `source_stream_config`, a oneof with full ID .google.cloud.datastream.v1.SourceConfig.mysql_source_config, latest field was mysqlSourceConfig",
25576                                ));
25577                            }
25578                            result.source_stream_config = std::option::Option::Some(
25579                                crate::model::source_config::SourceStreamConfig::MysqlSourceConfig(
25580                                    map.next_value::<std::option::Option<
25581                                        std::boxed::Box<crate::model::MysqlSourceConfig>,
25582                                    >>()?
25583                                    .unwrap_or_default(),
25584                                ),
25585                            );
25586                        }
25587                        __FieldTag::__postgresql_source_config => {
25588                            if !fields.insert(__FieldTag::__postgresql_source_config) {
25589                                return std::result::Result::Err(A::Error::duplicate_field(
25590                                    "multiple values for postgresql_source_config",
25591                                ));
25592                            }
25593                            if result.source_stream_config.is_some() {
25594                                return std::result::Result::Err(A::Error::duplicate_field(
25595                                    "multiple values for `source_stream_config`, a oneof with full ID .google.cloud.datastream.v1.SourceConfig.postgresql_source_config, latest field was postgresqlSourceConfig",
25596                                ));
25597                            }
25598                            result.source_stream_config = std::option::Option::Some(
25599                                crate::model::source_config::SourceStreamConfig::PostgresqlSourceConfig(
25600                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::PostgresqlSourceConfig>>>()?.unwrap_or_default()
25601                                ),
25602                            );
25603                        }
25604                        __FieldTag::__sql_server_source_config => {
25605                            if !fields.insert(__FieldTag::__sql_server_source_config) {
25606                                return std::result::Result::Err(A::Error::duplicate_field(
25607                                    "multiple values for sql_server_source_config",
25608                                ));
25609                            }
25610                            if result.source_stream_config.is_some() {
25611                                return std::result::Result::Err(A::Error::duplicate_field(
25612                                    "multiple values for `source_stream_config`, a oneof with full ID .google.cloud.datastream.v1.SourceConfig.sql_server_source_config, latest field was sqlServerSourceConfig",
25613                                ));
25614                            }
25615                            result.source_stream_config = std::option::Option::Some(
25616                                crate::model::source_config::SourceStreamConfig::SqlServerSourceConfig(
25617                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::SqlServerSourceConfig>>>()?.unwrap_or_default()
25618                                ),
25619                            );
25620                        }
25621                        __FieldTag::__salesforce_source_config => {
25622                            if !fields.insert(__FieldTag::__salesforce_source_config) {
25623                                return std::result::Result::Err(A::Error::duplicate_field(
25624                                    "multiple values for salesforce_source_config",
25625                                ));
25626                            }
25627                            if result.source_stream_config.is_some() {
25628                                return std::result::Result::Err(A::Error::duplicate_field(
25629                                    "multiple values for `source_stream_config`, a oneof with full ID .google.cloud.datastream.v1.SourceConfig.salesforce_source_config, latest field was salesforceSourceConfig",
25630                                ));
25631                            }
25632                            result.source_stream_config = std::option::Option::Some(
25633                                crate::model::source_config::SourceStreamConfig::SalesforceSourceConfig(
25634                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::SalesforceSourceConfig>>>()?.unwrap_or_default()
25635                                ),
25636                            );
25637                        }
25638                        __FieldTag::__mongodb_source_config => {
25639                            if !fields.insert(__FieldTag::__mongodb_source_config) {
25640                                return std::result::Result::Err(A::Error::duplicate_field(
25641                                    "multiple values for mongodb_source_config",
25642                                ));
25643                            }
25644                            if result.source_stream_config.is_some() {
25645                                return std::result::Result::Err(A::Error::duplicate_field(
25646                                    "multiple values for `source_stream_config`, a oneof with full ID .google.cloud.datastream.v1.SourceConfig.mongodb_source_config, latest field was mongodbSourceConfig",
25647                                ));
25648                            }
25649                            result.source_stream_config = std::option::Option::Some(
25650                                crate::model::source_config::SourceStreamConfig::MongodbSourceConfig(
25651                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::MongodbSourceConfig>>>()?.unwrap_or_default()
25652                                ),
25653                            );
25654                        }
25655                        __FieldTag::Unknown(key) => {
25656                            let value = map.next_value::<serde_json::Value>()?;
25657                            result._unknown_fields.insert(key, value);
25658                        }
25659                    }
25660                }
25661                std::result::Result::Ok(result)
25662            }
25663        }
25664        deserializer.deserialize_any(Visitor)
25665    }
25666}
25667
25668#[doc(hidden)]
25669impl serde::ser::Serialize for SourceConfig {
25670    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25671    where
25672        S: serde::ser::Serializer,
25673    {
25674        use serde::ser::SerializeMap;
25675        #[allow(unused_imports)]
25676        use std::option::Option::Some;
25677        let mut state = serializer.serialize_map(std::option::Option::None)?;
25678        if !self.source_connection_profile.is_empty() {
25679            state.serialize_entry("sourceConnectionProfile", &self.source_connection_profile)?;
25680        }
25681        if let Some(value) = self.oracle_source_config() {
25682            state.serialize_entry("oracleSourceConfig", value)?;
25683        }
25684        if let Some(value) = self.mysql_source_config() {
25685            state.serialize_entry("mysqlSourceConfig", value)?;
25686        }
25687        if let Some(value) = self.postgresql_source_config() {
25688            state.serialize_entry("postgresqlSourceConfig", value)?;
25689        }
25690        if let Some(value) = self.sql_server_source_config() {
25691            state.serialize_entry("sqlServerSourceConfig", value)?;
25692        }
25693        if let Some(value) = self.salesforce_source_config() {
25694            state.serialize_entry("salesforceSourceConfig", value)?;
25695        }
25696        if let Some(value) = self.mongodb_source_config() {
25697            state.serialize_entry("mongodbSourceConfig", value)?;
25698        }
25699        if !self._unknown_fields.is_empty() {
25700            for (key, value) in self._unknown_fields.iter() {
25701                state.serialize_entry(key, &value)?;
25702            }
25703        }
25704        state.end()
25705    }
25706}
25707
25708impl std::fmt::Debug for SourceConfig {
25709    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
25710        let mut debug_struct = f.debug_struct("SourceConfig");
25711        debug_struct.field("source_connection_profile", &self.source_connection_profile);
25712        debug_struct.field("source_stream_config", &self.source_stream_config);
25713        if !self._unknown_fields.is_empty() {
25714            debug_struct.field("_unknown_fields", &self._unknown_fields);
25715        }
25716        debug_struct.finish()
25717    }
25718}
25719
25720/// Defines additional types related to [SourceConfig].
25721pub mod source_config {
25722    #[allow(unused_imports)]
25723    use super::*;
25724
25725    /// Stream configuration that is specific to the data source type.
25726    #[derive(Clone, Debug, PartialEq)]
25727    #[non_exhaustive]
25728    pub enum SourceStreamConfig {
25729        /// Oracle data source configuration.
25730        OracleSourceConfig(std::boxed::Box<crate::model::OracleSourceConfig>),
25731        /// MySQL data source configuration.
25732        MysqlSourceConfig(std::boxed::Box<crate::model::MysqlSourceConfig>),
25733        /// PostgreSQL data source configuration.
25734        PostgresqlSourceConfig(std::boxed::Box<crate::model::PostgresqlSourceConfig>),
25735        /// SQLServer data source configuration.
25736        SqlServerSourceConfig(std::boxed::Box<crate::model::SqlServerSourceConfig>),
25737        /// Salesforce data source configuration.
25738        SalesforceSourceConfig(std::boxed::Box<crate::model::SalesforceSourceConfig>),
25739        /// MongoDB data source configuration.
25740        MongodbSourceConfig(std::boxed::Box<crate::model::MongodbSourceConfig>),
25741    }
25742}
25743
25744/// AVRO file format configuration.
25745#[derive(Clone, Default, PartialEq)]
25746#[non_exhaustive]
25747pub struct AvroFileFormat {
25748    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25749}
25750
25751impl AvroFileFormat {
25752    pub fn new() -> Self {
25753        std::default::Default::default()
25754    }
25755}
25756
25757impl wkt::message::Message for AvroFileFormat {
25758    fn typename() -> &'static str {
25759        "type.googleapis.com/google.cloud.datastream.v1.AvroFileFormat"
25760    }
25761}
25762
25763#[doc(hidden)]
25764impl<'de> serde::de::Deserialize<'de> for AvroFileFormat {
25765    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25766    where
25767        D: serde::Deserializer<'de>,
25768    {
25769        #[allow(non_camel_case_types)]
25770        #[doc(hidden)]
25771        #[derive(PartialEq, Eq, Hash)]
25772        enum __FieldTag {
25773            Unknown(std::string::String),
25774        }
25775        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
25776            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25777            where
25778                D: serde::Deserializer<'de>,
25779            {
25780                struct Visitor;
25781                impl<'de> serde::de::Visitor<'de> for Visitor {
25782                    type Value = __FieldTag;
25783                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
25784                        formatter.write_str("a field name for AvroFileFormat")
25785                    }
25786                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
25787                    where
25788                        E: serde::de::Error,
25789                    {
25790                        use std::result::Result::Ok;
25791                        use std::string::ToString;
25792                        Ok(__FieldTag::Unknown(value.to_string()))
25793                    }
25794                }
25795                deserializer.deserialize_identifier(Visitor)
25796            }
25797        }
25798        struct Visitor;
25799        impl<'de> serde::de::Visitor<'de> for Visitor {
25800            type Value = AvroFileFormat;
25801            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
25802                formatter.write_str("struct AvroFileFormat")
25803            }
25804            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
25805            where
25806                A: serde::de::MapAccess<'de>,
25807            {
25808                #[allow(unused_imports)]
25809                use serde::de::Error;
25810                use std::option::Option::Some;
25811                let mut result = Self::Value::new();
25812                while let Some(tag) = map.next_key::<__FieldTag>()? {
25813                    #[allow(clippy::match_single_binding)]
25814                    match tag {
25815                        __FieldTag::Unknown(key) => {
25816                            let value = map.next_value::<serde_json::Value>()?;
25817                            result._unknown_fields.insert(key, value);
25818                        }
25819                    }
25820                }
25821                std::result::Result::Ok(result)
25822            }
25823        }
25824        deserializer.deserialize_any(Visitor)
25825    }
25826}
25827
25828#[doc(hidden)]
25829impl serde::ser::Serialize for AvroFileFormat {
25830    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25831    where
25832        S: serde::ser::Serializer,
25833    {
25834        use serde::ser::SerializeMap;
25835        #[allow(unused_imports)]
25836        use std::option::Option::Some;
25837        let mut state = serializer.serialize_map(std::option::Option::None)?;
25838        if !self._unknown_fields.is_empty() {
25839            for (key, value) in self._unknown_fields.iter() {
25840                state.serialize_entry(key, &value)?;
25841            }
25842        }
25843        state.end()
25844    }
25845}
25846
25847impl std::fmt::Debug for AvroFileFormat {
25848    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
25849        let mut debug_struct = f.debug_struct("AvroFileFormat");
25850        if !self._unknown_fields.is_empty() {
25851            debug_struct.field("_unknown_fields", &self._unknown_fields);
25852        }
25853        debug_struct.finish()
25854    }
25855}
25856
25857/// JSON file format configuration.
25858#[derive(Clone, Default, PartialEq)]
25859#[non_exhaustive]
25860pub struct JsonFileFormat {
25861    /// The schema file format along JSON data files.
25862    pub schema_file_format: crate::model::json_file_format::SchemaFileFormat,
25863
25864    /// Compression of the loaded JSON file.
25865    pub compression: crate::model::json_file_format::JsonCompression,
25866
25867    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25868}
25869
25870impl JsonFileFormat {
25871    pub fn new() -> Self {
25872        std::default::Default::default()
25873    }
25874
25875    /// Sets the value of [schema_file_format][crate::model::JsonFileFormat::schema_file_format].
25876    pub fn set_schema_file_format<
25877        T: std::convert::Into<crate::model::json_file_format::SchemaFileFormat>,
25878    >(
25879        mut self,
25880        v: T,
25881    ) -> Self {
25882        self.schema_file_format = v.into();
25883        self
25884    }
25885
25886    /// Sets the value of [compression][crate::model::JsonFileFormat::compression].
25887    pub fn set_compression<
25888        T: std::convert::Into<crate::model::json_file_format::JsonCompression>,
25889    >(
25890        mut self,
25891        v: T,
25892    ) -> Self {
25893        self.compression = v.into();
25894        self
25895    }
25896}
25897
25898impl wkt::message::Message for JsonFileFormat {
25899    fn typename() -> &'static str {
25900        "type.googleapis.com/google.cloud.datastream.v1.JsonFileFormat"
25901    }
25902}
25903
25904#[doc(hidden)]
25905impl<'de> serde::de::Deserialize<'de> for JsonFileFormat {
25906    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25907    where
25908        D: serde::Deserializer<'de>,
25909    {
25910        #[allow(non_camel_case_types)]
25911        #[doc(hidden)]
25912        #[derive(PartialEq, Eq, Hash)]
25913        enum __FieldTag {
25914            __schema_file_format,
25915            __compression,
25916            Unknown(std::string::String),
25917        }
25918        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
25919            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25920            where
25921                D: serde::Deserializer<'de>,
25922            {
25923                struct Visitor;
25924                impl<'de> serde::de::Visitor<'de> for Visitor {
25925                    type Value = __FieldTag;
25926                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
25927                        formatter.write_str("a field name for JsonFileFormat")
25928                    }
25929                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
25930                    where
25931                        E: serde::de::Error,
25932                    {
25933                        use std::result::Result::Ok;
25934                        use std::string::ToString;
25935                        match value {
25936                            "schemaFileFormat" => Ok(__FieldTag::__schema_file_format),
25937                            "schema_file_format" => Ok(__FieldTag::__schema_file_format),
25938                            "compression" => Ok(__FieldTag::__compression),
25939                            _ => Ok(__FieldTag::Unknown(value.to_string())),
25940                        }
25941                    }
25942                }
25943                deserializer.deserialize_identifier(Visitor)
25944            }
25945        }
25946        struct Visitor;
25947        impl<'de> serde::de::Visitor<'de> for Visitor {
25948            type Value = JsonFileFormat;
25949            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
25950                formatter.write_str("struct JsonFileFormat")
25951            }
25952            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
25953            where
25954                A: serde::de::MapAccess<'de>,
25955            {
25956                #[allow(unused_imports)]
25957                use serde::de::Error;
25958                use std::option::Option::Some;
25959                let mut fields = std::collections::HashSet::new();
25960                let mut result = Self::Value::new();
25961                while let Some(tag) = map.next_key::<__FieldTag>()? {
25962                    #[allow(clippy::match_single_binding)]
25963                    match tag {
25964                        __FieldTag::__schema_file_format => {
25965                            if !fields.insert(__FieldTag::__schema_file_format) {
25966                                return std::result::Result::Err(A::Error::duplicate_field(
25967                                    "multiple values for schema_file_format",
25968                                ));
25969                            }
25970                            result.schema_file_format = map
25971                                .next_value::<std::option::Option<
25972                                    crate::model::json_file_format::SchemaFileFormat,
25973                                >>()?
25974                                .unwrap_or_default();
25975                        }
25976                        __FieldTag::__compression => {
25977                            if !fields.insert(__FieldTag::__compression) {
25978                                return std::result::Result::Err(A::Error::duplicate_field(
25979                                    "multiple values for compression",
25980                                ));
25981                            }
25982                            result.compression = map
25983                                .next_value::<std::option::Option<
25984                                    crate::model::json_file_format::JsonCompression,
25985                                >>()?
25986                                .unwrap_or_default();
25987                        }
25988                        __FieldTag::Unknown(key) => {
25989                            let value = map.next_value::<serde_json::Value>()?;
25990                            result._unknown_fields.insert(key, value);
25991                        }
25992                    }
25993                }
25994                std::result::Result::Ok(result)
25995            }
25996        }
25997        deserializer.deserialize_any(Visitor)
25998    }
25999}
26000
26001#[doc(hidden)]
26002impl serde::ser::Serialize for JsonFileFormat {
26003    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26004    where
26005        S: serde::ser::Serializer,
26006    {
26007        use serde::ser::SerializeMap;
26008        #[allow(unused_imports)]
26009        use std::option::Option::Some;
26010        let mut state = serializer.serialize_map(std::option::Option::None)?;
26011        if !wkt::internal::is_default(&self.schema_file_format) {
26012            state.serialize_entry("schemaFileFormat", &self.schema_file_format)?;
26013        }
26014        if !wkt::internal::is_default(&self.compression) {
26015            state.serialize_entry("compression", &self.compression)?;
26016        }
26017        if !self._unknown_fields.is_empty() {
26018            for (key, value) in self._unknown_fields.iter() {
26019                state.serialize_entry(key, &value)?;
26020            }
26021        }
26022        state.end()
26023    }
26024}
26025
26026impl std::fmt::Debug for JsonFileFormat {
26027    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
26028        let mut debug_struct = f.debug_struct("JsonFileFormat");
26029        debug_struct.field("schema_file_format", &self.schema_file_format);
26030        debug_struct.field("compression", &self.compression);
26031        if !self._unknown_fields.is_empty() {
26032            debug_struct.field("_unknown_fields", &self._unknown_fields);
26033        }
26034        debug_struct.finish()
26035    }
26036}
26037
26038/// Defines additional types related to [JsonFileFormat].
26039pub mod json_file_format {
26040    #[allow(unused_imports)]
26041    use super::*;
26042
26043    /// Schema file format.
26044    ///
26045    /// # Working with unknown values
26046    ///
26047    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
26048    /// additional enum variants at any time. Adding new variants is not considered
26049    /// a breaking change. Applications should write their code in anticipation of:
26050    ///
26051    /// - New values appearing in future releases of the client library, **and**
26052    /// - New values received dynamically, without application changes.
26053    ///
26054    /// Please consult the [Working with enums] section in the user guide for some
26055    /// guidelines.
26056    ///
26057    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
26058    #[derive(Clone, Debug, PartialEq)]
26059    #[non_exhaustive]
26060    pub enum SchemaFileFormat {
26061        /// Unspecified schema file format.
26062        Unspecified,
26063        /// Do not attach schema file.
26064        NoSchemaFile,
26065        /// Avro schema format.
26066        AvroSchemaFile,
26067        /// If set, the enum was initialized with an unknown value.
26068        ///
26069        /// Applications can examine the value using [SchemaFileFormat::value] or
26070        /// [SchemaFileFormat::name].
26071        UnknownValue(schema_file_format::UnknownValue),
26072    }
26073
26074    #[doc(hidden)]
26075    pub mod schema_file_format {
26076        #[allow(unused_imports)]
26077        use super::*;
26078        #[derive(Clone, Debug, PartialEq)]
26079        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
26080    }
26081
26082    impl SchemaFileFormat {
26083        /// Gets the enum value.
26084        ///
26085        /// Returns `None` if the enum contains an unknown value deserialized from
26086        /// the string representation of enums.
26087        pub fn value(&self) -> std::option::Option<i32> {
26088            match self {
26089                Self::Unspecified => std::option::Option::Some(0),
26090                Self::NoSchemaFile => std::option::Option::Some(1),
26091                Self::AvroSchemaFile => std::option::Option::Some(2),
26092                Self::UnknownValue(u) => u.0.value(),
26093            }
26094        }
26095
26096        /// Gets the enum value as a string.
26097        ///
26098        /// Returns `None` if the enum contains an unknown value deserialized from
26099        /// the integer representation of enums.
26100        pub fn name(&self) -> std::option::Option<&str> {
26101            match self {
26102                Self::Unspecified => std::option::Option::Some("SCHEMA_FILE_FORMAT_UNSPECIFIED"),
26103                Self::NoSchemaFile => std::option::Option::Some("NO_SCHEMA_FILE"),
26104                Self::AvroSchemaFile => std::option::Option::Some("AVRO_SCHEMA_FILE"),
26105                Self::UnknownValue(u) => u.0.name(),
26106            }
26107        }
26108    }
26109
26110    impl std::default::Default for SchemaFileFormat {
26111        fn default() -> Self {
26112            use std::convert::From;
26113            Self::from(0)
26114        }
26115    }
26116
26117    impl std::fmt::Display for SchemaFileFormat {
26118        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
26119            wkt::internal::display_enum(f, self.name(), self.value())
26120        }
26121    }
26122
26123    impl std::convert::From<i32> for SchemaFileFormat {
26124        fn from(value: i32) -> Self {
26125            match value {
26126                0 => Self::Unspecified,
26127                1 => Self::NoSchemaFile,
26128                2 => Self::AvroSchemaFile,
26129                _ => Self::UnknownValue(schema_file_format::UnknownValue(
26130                    wkt::internal::UnknownEnumValue::Integer(value),
26131                )),
26132            }
26133        }
26134    }
26135
26136    impl std::convert::From<&str> for SchemaFileFormat {
26137        fn from(value: &str) -> Self {
26138            use std::string::ToString;
26139            match value {
26140                "SCHEMA_FILE_FORMAT_UNSPECIFIED" => Self::Unspecified,
26141                "NO_SCHEMA_FILE" => Self::NoSchemaFile,
26142                "AVRO_SCHEMA_FILE" => Self::AvroSchemaFile,
26143                _ => Self::UnknownValue(schema_file_format::UnknownValue(
26144                    wkt::internal::UnknownEnumValue::String(value.to_string()),
26145                )),
26146            }
26147        }
26148    }
26149
26150    impl serde::ser::Serialize for SchemaFileFormat {
26151        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26152        where
26153            S: serde::Serializer,
26154        {
26155            match self {
26156                Self::Unspecified => serializer.serialize_i32(0),
26157                Self::NoSchemaFile => serializer.serialize_i32(1),
26158                Self::AvroSchemaFile => serializer.serialize_i32(2),
26159                Self::UnknownValue(u) => u.0.serialize(serializer),
26160            }
26161        }
26162    }
26163
26164    impl<'de> serde::de::Deserialize<'de> for SchemaFileFormat {
26165        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26166        where
26167            D: serde::Deserializer<'de>,
26168        {
26169            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SchemaFileFormat>::new(
26170                ".google.cloud.datastream.v1.JsonFileFormat.SchemaFileFormat",
26171            ))
26172        }
26173    }
26174
26175    /// Json file compression.
26176    ///
26177    /// # Working with unknown values
26178    ///
26179    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
26180    /// additional enum variants at any time. Adding new variants is not considered
26181    /// a breaking change. Applications should write their code in anticipation of:
26182    ///
26183    /// - New values appearing in future releases of the client library, **and**
26184    /// - New values received dynamically, without application changes.
26185    ///
26186    /// Please consult the [Working with enums] section in the user guide for some
26187    /// guidelines.
26188    ///
26189    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
26190    #[derive(Clone, Debug, PartialEq)]
26191    #[non_exhaustive]
26192    pub enum JsonCompression {
26193        /// Unspecified json file compression.
26194        Unspecified,
26195        /// Do not compress JSON file.
26196        NoCompression,
26197        /// Gzip compression.
26198        Gzip,
26199        /// If set, the enum was initialized with an unknown value.
26200        ///
26201        /// Applications can examine the value using [JsonCompression::value] or
26202        /// [JsonCompression::name].
26203        UnknownValue(json_compression::UnknownValue),
26204    }
26205
26206    #[doc(hidden)]
26207    pub mod json_compression {
26208        #[allow(unused_imports)]
26209        use super::*;
26210        #[derive(Clone, Debug, PartialEq)]
26211        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
26212    }
26213
26214    impl JsonCompression {
26215        /// Gets the enum value.
26216        ///
26217        /// Returns `None` if the enum contains an unknown value deserialized from
26218        /// the string representation of enums.
26219        pub fn value(&self) -> std::option::Option<i32> {
26220            match self {
26221                Self::Unspecified => std::option::Option::Some(0),
26222                Self::NoCompression => std::option::Option::Some(1),
26223                Self::Gzip => std::option::Option::Some(2),
26224                Self::UnknownValue(u) => u.0.value(),
26225            }
26226        }
26227
26228        /// Gets the enum value as a string.
26229        ///
26230        /// Returns `None` if the enum contains an unknown value deserialized from
26231        /// the integer representation of enums.
26232        pub fn name(&self) -> std::option::Option<&str> {
26233            match self {
26234                Self::Unspecified => std::option::Option::Some("JSON_COMPRESSION_UNSPECIFIED"),
26235                Self::NoCompression => std::option::Option::Some("NO_COMPRESSION"),
26236                Self::Gzip => std::option::Option::Some("GZIP"),
26237                Self::UnknownValue(u) => u.0.name(),
26238            }
26239        }
26240    }
26241
26242    impl std::default::Default for JsonCompression {
26243        fn default() -> Self {
26244            use std::convert::From;
26245            Self::from(0)
26246        }
26247    }
26248
26249    impl std::fmt::Display for JsonCompression {
26250        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
26251            wkt::internal::display_enum(f, self.name(), self.value())
26252        }
26253    }
26254
26255    impl std::convert::From<i32> for JsonCompression {
26256        fn from(value: i32) -> Self {
26257            match value {
26258                0 => Self::Unspecified,
26259                1 => Self::NoCompression,
26260                2 => Self::Gzip,
26261                _ => Self::UnknownValue(json_compression::UnknownValue(
26262                    wkt::internal::UnknownEnumValue::Integer(value),
26263                )),
26264            }
26265        }
26266    }
26267
26268    impl std::convert::From<&str> for JsonCompression {
26269        fn from(value: &str) -> Self {
26270            use std::string::ToString;
26271            match value {
26272                "JSON_COMPRESSION_UNSPECIFIED" => Self::Unspecified,
26273                "NO_COMPRESSION" => Self::NoCompression,
26274                "GZIP" => Self::Gzip,
26275                _ => Self::UnknownValue(json_compression::UnknownValue(
26276                    wkt::internal::UnknownEnumValue::String(value.to_string()),
26277                )),
26278            }
26279        }
26280    }
26281
26282    impl serde::ser::Serialize for JsonCompression {
26283        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26284        where
26285            S: serde::Serializer,
26286        {
26287            match self {
26288                Self::Unspecified => serializer.serialize_i32(0),
26289                Self::NoCompression => serializer.serialize_i32(1),
26290                Self::Gzip => serializer.serialize_i32(2),
26291                Self::UnknownValue(u) => u.0.serialize(serializer),
26292            }
26293        }
26294    }
26295
26296    impl<'de> serde::de::Deserialize<'de> for JsonCompression {
26297        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26298        where
26299            D: serde::Deserializer<'de>,
26300        {
26301            deserializer.deserialize_any(wkt::internal::EnumVisitor::<JsonCompression>::new(
26302                ".google.cloud.datastream.v1.JsonFileFormat.JsonCompression",
26303            ))
26304        }
26305    }
26306}
26307
26308/// Google Cloud Storage destination configuration
26309#[derive(Clone, Default, PartialEq)]
26310#[non_exhaustive]
26311pub struct GcsDestinationConfig {
26312    /// Path inside the Cloud Storage bucket to write data to.
26313    pub path: std::string::String,
26314
26315    /// The maximum file size to be saved in the bucket.
26316    pub file_rotation_mb: i32,
26317
26318    /// The maximum duration for which new events are added before a file is
26319    /// closed and a new file is created. Values within the range of 15-60 seconds
26320    /// are allowed.
26321    pub file_rotation_interval: std::option::Option<wkt::Duration>,
26322
26323    /// File Format that the data should be written in.
26324    pub file_format: std::option::Option<crate::model::gcs_destination_config::FileFormat>,
26325
26326    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26327}
26328
26329impl GcsDestinationConfig {
26330    pub fn new() -> Self {
26331        std::default::Default::default()
26332    }
26333
26334    /// Sets the value of [path][crate::model::GcsDestinationConfig::path].
26335    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26336        self.path = v.into();
26337        self
26338    }
26339
26340    /// Sets the value of [file_rotation_mb][crate::model::GcsDestinationConfig::file_rotation_mb].
26341    pub fn set_file_rotation_mb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
26342        self.file_rotation_mb = v.into();
26343        self
26344    }
26345
26346    /// Sets the value of [file_rotation_interval][crate::model::GcsDestinationConfig::file_rotation_interval].
26347    pub fn set_file_rotation_interval<T>(mut self, v: T) -> Self
26348    where
26349        T: std::convert::Into<wkt::Duration>,
26350    {
26351        self.file_rotation_interval = std::option::Option::Some(v.into());
26352        self
26353    }
26354
26355    /// Sets or clears the value of [file_rotation_interval][crate::model::GcsDestinationConfig::file_rotation_interval].
26356    pub fn set_or_clear_file_rotation_interval<T>(mut self, v: std::option::Option<T>) -> Self
26357    where
26358        T: std::convert::Into<wkt::Duration>,
26359    {
26360        self.file_rotation_interval = v.map(|x| x.into());
26361        self
26362    }
26363
26364    /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format].
26365    ///
26366    /// Note that all the setters affecting `file_format` are mutually
26367    /// exclusive.
26368    pub fn set_file_format<
26369        T: std::convert::Into<std::option::Option<crate::model::gcs_destination_config::FileFormat>>,
26370    >(
26371        mut self,
26372        v: T,
26373    ) -> Self {
26374        self.file_format = v.into();
26375        self
26376    }
26377
26378    /// The value of [file_format][crate::model::GcsDestinationConfig::file_format]
26379    /// if it holds a `AvroFileFormat`, `None` if the field is not set or
26380    /// holds a different branch.
26381    pub fn avro_file_format(
26382        &self,
26383    ) -> std::option::Option<&std::boxed::Box<crate::model::AvroFileFormat>> {
26384        #[allow(unreachable_patterns)]
26385        self.file_format.as_ref().and_then(|v| match v {
26386            crate::model::gcs_destination_config::FileFormat::AvroFileFormat(v) => {
26387                std::option::Option::Some(v)
26388            }
26389            _ => std::option::Option::None,
26390        })
26391    }
26392
26393    /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format]
26394    /// to hold a `AvroFileFormat`.
26395    ///
26396    /// Note that all the setters affecting `file_format` are
26397    /// mutually exclusive.
26398    pub fn set_avro_file_format<
26399        T: std::convert::Into<std::boxed::Box<crate::model::AvroFileFormat>>,
26400    >(
26401        mut self,
26402        v: T,
26403    ) -> Self {
26404        self.file_format = std::option::Option::Some(
26405            crate::model::gcs_destination_config::FileFormat::AvroFileFormat(v.into()),
26406        );
26407        self
26408    }
26409
26410    /// The value of [file_format][crate::model::GcsDestinationConfig::file_format]
26411    /// if it holds a `JsonFileFormat`, `None` if the field is not set or
26412    /// holds a different branch.
26413    pub fn json_file_format(
26414        &self,
26415    ) -> std::option::Option<&std::boxed::Box<crate::model::JsonFileFormat>> {
26416        #[allow(unreachable_patterns)]
26417        self.file_format.as_ref().and_then(|v| match v {
26418            crate::model::gcs_destination_config::FileFormat::JsonFileFormat(v) => {
26419                std::option::Option::Some(v)
26420            }
26421            _ => std::option::Option::None,
26422        })
26423    }
26424
26425    /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format]
26426    /// to hold a `JsonFileFormat`.
26427    ///
26428    /// Note that all the setters affecting `file_format` are
26429    /// mutually exclusive.
26430    pub fn set_json_file_format<
26431        T: std::convert::Into<std::boxed::Box<crate::model::JsonFileFormat>>,
26432    >(
26433        mut self,
26434        v: T,
26435    ) -> Self {
26436        self.file_format = std::option::Option::Some(
26437            crate::model::gcs_destination_config::FileFormat::JsonFileFormat(v.into()),
26438        );
26439        self
26440    }
26441}
26442
26443impl wkt::message::Message for GcsDestinationConfig {
26444    fn typename() -> &'static str {
26445        "type.googleapis.com/google.cloud.datastream.v1.GcsDestinationConfig"
26446    }
26447}
26448
26449#[doc(hidden)]
26450impl<'de> serde::de::Deserialize<'de> for GcsDestinationConfig {
26451    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26452    where
26453        D: serde::Deserializer<'de>,
26454    {
26455        #[allow(non_camel_case_types)]
26456        #[doc(hidden)]
26457        #[derive(PartialEq, Eq, Hash)]
26458        enum __FieldTag {
26459            __path,
26460            __file_rotation_mb,
26461            __file_rotation_interval,
26462            __avro_file_format,
26463            __json_file_format,
26464            Unknown(std::string::String),
26465        }
26466        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
26467            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26468            where
26469                D: serde::Deserializer<'de>,
26470            {
26471                struct Visitor;
26472                impl<'de> serde::de::Visitor<'de> for Visitor {
26473                    type Value = __FieldTag;
26474                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
26475                        formatter.write_str("a field name for GcsDestinationConfig")
26476                    }
26477                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
26478                    where
26479                        E: serde::de::Error,
26480                    {
26481                        use std::result::Result::Ok;
26482                        use std::string::ToString;
26483                        match value {
26484                            "path" => Ok(__FieldTag::__path),
26485                            "fileRotationMb" => Ok(__FieldTag::__file_rotation_mb),
26486                            "file_rotation_mb" => Ok(__FieldTag::__file_rotation_mb),
26487                            "fileRotationInterval" => Ok(__FieldTag::__file_rotation_interval),
26488                            "file_rotation_interval" => Ok(__FieldTag::__file_rotation_interval),
26489                            "avroFileFormat" => Ok(__FieldTag::__avro_file_format),
26490                            "avro_file_format" => Ok(__FieldTag::__avro_file_format),
26491                            "jsonFileFormat" => Ok(__FieldTag::__json_file_format),
26492                            "json_file_format" => Ok(__FieldTag::__json_file_format),
26493                            _ => Ok(__FieldTag::Unknown(value.to_string())),
26494                        }
26495                    }
26496                }
26497                deserializer.deserialize_identifier(Visitor)
26498            }
26499        }
26500        struct Visitor;
26501        impl<'de> serde::de::Visitor<'de> for Visitor {
26502            type Value = GcsDestinationConfig;
26503            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
26504                formatter.write_str("struct GcsDestinationConfig")
26505            }
26506            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
26507            where
26508                A: serde::de::MapAccess<'de>,
26509            {
26510                #[allow(unused_imports)]
26511                use serde::de::Error;
26512                use std::option::Option::Some;
26513                let mut fields = std::collections::HashSet::new();
26514                let mut result = Self::Value::new();
26515                while let Some(tag) = map.next_key::<__FieldTag>()? {
26516                    #[allow(clippy::match_single_binding)]
26517                    match tag {
26518                        __FieldTag::__path => {
26519                            if !fields.insert(__FieldTag::__path) {
26520                                return std::result::Result::Err(A::Error::duplicate_field(
26521                                    "multiple values for path",
26522                                ));
26523                            }
26524                            result.path = map
26525                                .next_value::<std::option::Option<std::string::String>>()?
26526                                .unwrap_or_default();
26527                        }
26528                        __FieldTag::__file_rotation_mb => {
26529                            if !fields.insert(__FieldTag::__file_rotation_mb) {
26530                                return std::result::Result::Err(A::Error::duplicate_field(
26531                                    "multiple values for file_rotation_mb",
26532                                ));
26533                            }
26534                            struct __With(std::option::Option<i32>);
26535                            impl<'de> serde::de::Deserialize<'de> for __With {
26536                                fn deserialize<D>(
26537                                    deserializer: D,
26538                                ) -> std::result::Result<Self, D::Error>
26539                                where
26540                                    D: serde::de::Deserializer<'de>,
26541                                {
26542                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
26543                                }
26544                            }
26545                            result.file_rotation_mb =
26546                                map.next_value::<__With>()?.0.unwrap_or_default();
26547                        }
26548                        __FieldTag::__file_rotation_interval => {
26549                            if !fields.insert(__FieldTag::__file_rotation_interval) {
26550                                return std::result::Result::Err(A::Error::duplicate_field(
26551                                    "multiple values for file_rotation_interval",
26552                                ));
26553                            }
26554                            result.file_rotation_interval =
26555                                map.next_value::<std::option::Option<wkt::Duration>>()?;
26556                        }
26557                        __FieldTag::__avro_file_format => {
26558                            if !fields.insert(__FieldTag::__avro_file_format) {
26559                                return std::result::Result::Err(A::Error::duplicate_field(
26560                                    "multiple values for avro_file_format",
26561                                ));
26562                            }
26563                            if result.file_format.is_some() {
26564                                return std::result::Result::Err(A::Error::duplicate_field(
26565                                    "multiple values for `file_format`, a oneof with full ID .google.cloud.datastream.v1.GcsDestinationConfig.avro_file_format, latest field was avroFileFormat",
26566                                ));
26567                            }
26568                            result.file_format = std::option::Option::Some(
26569                                crate::model::gcs_destination_config::FileFormat::AvroFileFormat(
26570                                    map.next_value::<std::option::Option<
26571                                        std::boxed::Box<crate::model::AvroFileFormat>,
26572                                    >>()?
26573                                    .unwrap_or_default(),
26574                                ),
26575                            );
26576                        }
26577                        __FieldTag::__json_file_format => {
26578                            if !fields.insert(__FieldTag::__json_file_format) {
26579                                return std::result::Result::Err(A::Error::duplicate_field(
26580                                    "multiple values for json_file_format",
26581                                ));
26582                            }
26583                            if result.file_format.is_some() {
26584                                return std::result::Result::Err(A::Error::duplicate_field(
26585                                    "multiple values for `file_format`, a oneof with full ID .google.cloud.datastream.v1.GcsDestinationConfig.json_file_format, latest field was jsonFileFormat",
26586                                ));
26587                            }
26588                            result.file_format = std::option::Option::Some(
26589                                crate::model::gcs_destination_config::FileFormat::JsonFileFormat(
26590                                    map.next_value::<std::option::Option<
26591                                        std::boxed::Box<crate::model::JsonFileFormat>,
26592                                    >>()?
26593                                    .unwrap_or_default(),
26594                                ),
26595                            );
26596                        }
26597                        __FieldTag::Unknown(key) => {
26598                            let value = map.next_value::<serde_json::Value>()?;
26599                            result._unknown_fields.insert(key, value);
26600                        }
26601                    }
26602                }
26603                std::result::Result::Ok(result)
26604            }
26605        }
26606        deserializer.deserialize_any(Visitor)
26607    }
26608}
26609
26610#[doc(hidden)]
26611impl serde::ser::Serialize for GcsDestinationConfig {
26612    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26613    where
26614        S: serde::ser::Serializer,
26615    {
26616        use serde::ser::SerializeMap;
26617        #[allow(unused_imports)]
26618        use std::option::Option::Some;
26619        let mut state = serializer.serialize_map(std::option::Option::None)?;
26620        if !self.path.is_empty() {
26621            state.serialize_entry("path", &self.path)?;
26622        }
26623        if !wkt::internal::is_default(&self.file_rotation_mb) {
26624            struct __With<'a>(&'a i32);
26625            impl<'a> serde::ser::Serialize for __With<'a> {
26626                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26627                where
26628                    S: serde::ser::Serializer,
26629                {
26630                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
26631                }
26632            }
26633            state.serialize_entry("fileRotationMb", &__With(&self.file_rotation_mb))?;
26634        }
26635        if self.file_rotation_interval.is_some() {
26636            state.serialize_entry("fileRotationInterval", &self.file_rotation_interval)?;
26637        }
26638        if let Some(value) = self.avro_file_format() {
26639            state.serialize_entry("avroFileFormat", value)?;
26640        }
26641        if let Some(value) = self.json_file_format() {
26642            state.serialize_entry("jsonFileFormat", value)?;
26643        }
26644        if !self._unknown_fields.is_empty() {
26645            for (key, value) in self._unknown_fields.iter() {
26646                state.serialize_entry(key, &value)?;
26647            }
26648        }
26649        state.end()
26650    }
26651}
26652
26653impl std::fmt::Debug for GcsDestinationConfig {
26654    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
26655        let mut debug_struct = f.debug_struct("GcsDestinationConfig");
26656        debug_struct.field("path", &self.path);
26657        debug_struct.field("file_rotation_mb", &self.file_rotation_mb);
26658        debug_struct.field("file_rotation_interval", &self.file_rotation_interval);
26659        debug_struct.field("file_format", &self.file_format);
26660        if !self._unknown_fields.is_empty() {
26661            debug_struct.field("_unknown_fields", &self._unknown_fields);
26662        }
26663        debug_struct.finish()
26664    }
26665}
26666
26667/// Defines additional types related to [GcsDestinationConfig].
26668pub mod gcs_destination_config {
26669    #[allow(unused_imports)]
26670    use super::*;
26671
26672    /// File Format that the data should be written in.
26673    #[derive(Clone, Debug, PartialEq)]
26674    #[non_exhaustive]
26675    pub enum FileFormat {
26676        /// AVRO file format configuration.
26677        AvroFileFormat(std::boxed::Box<crate::model::AvroFileFormat>),
26678        /// JSON file format configuration.
26679        JsonFileFormat(std::boxed::Box<crate::model::JsonFileFormat>),
26680    }
26681}
26682
26683/// BigQuery destination configuration
26684#[derive(Clone, Default, PartialEq)]
26685#[non_exhaustive]
26686pub struct BigQueryDestinationConfig {
26687    /// The guaranteed data freshness (in seconds) when querying tables created by
26688    /// the stream. Editing this field will only affect new tables created in the
26689    /// future, but existing tables will not be impacted. Lower values mean that
26690    /// queries will return fresher data, but may result in higher cost.
26691    pub data_freshness: std::option::Option<wkt::Duration>,
26692
26693    /// Optional. Big Lake Managed Tables (BLMT) configuration.
26694    pub blmt_config: std::option::Option<crate::model::big_query_destination_config::BlmtConfig>,
26695
26696    /// Target dataset(s) configuration.
26697    pub dataset_config:
26698        std::option::Option<crate::model::big_query_destination_config::DatasetConfig>,
26699
26700    pub write_mode: std::option::Option<crate::model::big_query_destination_config::WriteMode>,
26701
26702    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26703}
26704
26705impl BigQueryDestinationConfig {
26706    pub fn new() -> Self {
26707        std::default::Default::default()
26708    }
26709
26710    /// Sets the value of [data_freshness][crate::model::BigQueryDestinationConfig::data_freshness].
26711    pub fn set_data_freshness<T>(mut self, v: T) -> Self
26712    where
26713        T: std::convert::Into<wkt::Duration>,
26714    {
26715        self.data_freshness = std::option::Option::Some(v.into());
26716        self
26717    }
26718
26719    /// Sets or clears the value of [data_freshness][crate::model::BigQueryDestinationConfig::data_freshness].
26720    pub fn set_or_clear_data_freshness<T>(mut self, v: std::option::Option<T>) -> Self
26721    where
26722        T: std::convert::Into<wkt::Duration>,
26723    {
26724        self.data_freshness = v.map(|x| x.into());
26725        self
26726    }
26727
26728    /// Sets the value of [blmt_config][crate::model::BigQueryDestinationConfig::blmt_config].
26729    pub fn set_blmt_config<T>(mut self, v: T) -> Self
26730    where
26731        T: std::convert::Into<crate::model::big_query_destination_config::BlmtConfig>,
26732    {
26733        self.blmt_config = std::option::Option::Some(v.into());
26734        self
26735    }
26736
26737    /// Sets or clears the value of [blmt_config][crate::model::BigQueryDestinationConfig::blmt_config].
26738    pub fn set_or_clear_blmt_config<T>(mut self, v: std::option::Option<T>) -> Self
26739    where
26740        T: std::convert::Into<crate::model::big_query_destination_config::BlmtConfig>,
26741    {
26742        self.blmt_config = v.map(|x| x.into());
26743        self
26744    }
26745
26746    /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config].
26747    ///
26748    /// Note that all the setters affecting `dataset_config` are mutually
26749    /// exclusive.
26750    pub fn set_dataset_config<
26751        T: std::convert::Into<
26752                std::option::Option<crate::model::big_query_destination_config::DatasetConfig>,
26753            >,
26754    >(
26755        mut self,
26756        v: T,
26757    ) -> Self {
26758        self.dataset_config = v.into();
26759        self
26760    }
26761
26762    /// The value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
26763    /// if it holds a `SingleTargetDataset`, `None` if the field is not set or
26764    /// holds a different branch.
26765    pub fn single_target_dataset(
26766        &self,
26767    ) -> std::option::Option<
26768        &std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
26769    > {
26770        #[allow(unreachable_patterns)]
26771        self.dataset_config.as_ref().and_then(|v| match v {
26772            crate::model::big_query_destination_config::DatasetConfig::SingleTargetDataset(v) => {
26773                std::option::Option::Some(v)
26774            }
26775            _ => std::option::Option::None,
26776        })
26777    }
26778
26779    /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
26780    /// to hold a `SingleTargetDataset`.
26781    ///
26782    /// Note that all the setters affecting `dataset_config` are
26783    /// mutually exclusive.
26784    pub fn set_single_target_dataset<
26785        T: std::convert::Into<
26786                std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
26787            >,
26788    >(
26789        mut self,
26790        v: T,
26791    ) -> Self {
26792        self.dataset_config = std::option::Option::Some(
26793            crate::model::big_query_destination_config::DatasetConfig::SingleTargetDataset(
26794                v.into(),
26795            ),
26796        );
26797        self
26798    }
26799
26800    /// The value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
26801    /// if it holds a `SourceHierarchyDatasets`, `None` if the field is not set or
26802    /// holds a different branch.
26803    pub fn source_hierarchy_datasets(
26804        &self,
26805    ) -> std::option::Option<
26806        &std::boxed::Box<crate::model::big_query_destination_config::SourceHierarchyDatasets>,
26807    > {
26808        #[allow(unreachable_patterns)]
26809        self.dataset_config.as_ref().and_then(|v| match v {
26810            crate::model::big_query_destination_config::DatasetConfig::SourceHierarchyDatasets(
26811                v,
26812            ) => std::option::Option::Some(v),
26813            _ => std::option::Option::None,
26814        })
26815    }
26816
26817    /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
26818    /// to hold a `SourceHierarchyDatasets`.
26819    ///
26820    /// Note that all the setters affecting `dataset_config` are
26821    /// mutually exclusive.
26822    pub fn set_source_hierarchy_datasets<
26823        T: std::convert::Into<
26824                std::boxed::Box<
26825                    crate::model::big_query_destination_config::SourceHierarchyDatasets,
26826                >,
26827            >,
26828    >(
26829        mut self,
26830        v: T,
26831    ) -> Self {
26832        self.dataset_config = std::option::Option::Some(
26833            crate::model::big_query_destination_config::DatasetConfig::SourceHierarchyDatasets(
26834                v.into(),
26835            ),
26836        );
26837        self
26838    }
26839
26840    /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode].
26841    ///
26842    /// Note that all the setters affecting `write_mode` are mutually
26843    /// exclusive.
26844    pub fn set_write_mode<
26845        T: std::convert::Into<
26846                std::option::Option<crate::model::big_query_destination_config::WriteMode>,
26847            >,
26848    >(
26849        mut self,
26850        v: T,
26851    ) -> Self {
26852        self.write_mode = v.into();
26853        self
26854    }
26855
26856    /// The value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
26857    /// if it holds a `Merge`, `None` if the field is not set or
26858    /// holds a different branch.
26859    pub fn merge(
26860        &self,
26861    ) -> std::option::Option<&std::boxed::Box<crate::model::big_query_destination_config::Merge>>
26862    {
26863        #[allow(unreachable_patterns)]
26864        self.write_mode.as_ref().and_then(|v| match v {
26865            crate::model::big_query_destination_config::WriteMode::Merge(v) => {
26866                std::option::Option::Some(v)
26867            }
26868            _ => std::option::Option::None,
26869        })
26870    }
26871
26872    /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
26873    /// to hold a `Merge`.
26874    ///
26875    /// Note that all the setters affecting `write_mode` are
26876    /// mutually exclusive.
26877    pub fn set_merge<
26878        T: std::convert::Into<std::boxed::Box<crate::model::big_query_destination_config::Merge>>,
26879    >(
26880        mut self,
26881        v: T,
26882    ) -> Self {
26883        self.write_mode = std::option::Option::Some(
26884            crate::model::big_query_destination_config::WriteMode::Merge(v.into()),
26885        );
26886        self
26887    }
26888
26889    /// The value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
26890    /// if it holds a `AppendOnly`, `None` if the field is not set or
26891    /// holds a different branch.
26892    pub fn append_only(
26893        &self,
26894    ) -> std::option::Option<&std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>>
26895    {
26896        #[allow(unreachable_patterns)]
26897        self.write_mode.as_ref().and_then(|v| match v {
26898            crate::model::big_query_destination_config::WriteMode::AppendOnly(v) => {
26899                std::option::Option::Some(v)
26900            }
26901            _ => std::option::Option::None,
26902        })
26903    }
26904
26905    /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
26906    /// to hold a `AppendOnly`.
26907    ///
26908    /// Note that all the setters affecting `write_mode` are
26909    /// mutually exclusive.
26910    pub fn set_append_only<
26911        T: std::convert::Into<std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>>,
26912    >(
26913        mut self,
26914        v: T,
26915    ) -> Self {
26916        self.write_mode = std::option::Option::Some(
26917            crate::model::big_query_destination_config::WriteMode::AppendOnly(v.into()),
26918        );
26919        self
26920    }
26921}
26922
26923impl wkt::message::Message for BigQueryDestinationConfig {
26924    fn typename() -> &'static str {
26925        "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig"
26926    }
26927}
26928
26929#[doc(hidden)]
26930impl<'de> serde::de::Deserialize<'de> for BigQueryDestinationConfig {
26931    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26932    where
26933        D: serde::Deserializer<'de>,
26934    {
26935        #[allow(non_camel_case_types)]
26936        #[doc(hidden)]
26937        #[derive(PartialEq, Eq, Hash)]
26938        enum __FieldTag {
26939            __single_target_dataset,
26940            __source_hierarchy_datasets,
26941            __data_freshness,
26942            __blmt_config,
26943            __merge,
26944            __append_only,
26945            Unknown(std::string::String),
26946        }
26947        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
26948            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26949            where
26950                D: serde::Deserializer<'de>,
26951            {
26952                struct Visitor;
26953                impl<'de> serde::de::Visitor<'de> for Visitor {
26954                    type Value = __FieldTag;
26955                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
26956                        formatter.write_str("a field name for BigQueryDestinationConfig")
26957                    }
26958                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
26959                    where
26960                        E: serde::de::Error,
26961                    {
26962                        use std::result::Result::Ok;
26963                        use std::string::ToString;
26964                        match value {
26965                            "singleTargetDataset" => Ok(__FieldTag::__single_target_dataset),
26966                            "single_target_dataset" => Ok(__FieldTag::__single_target_dataset),
26967                            "sourceHierarchyDatasets" => {
26968                                Ok(__FieldTag::__source_hierarchy_datasets)
26969                            }
26970                            "source_hierarchy_datasets" => {
26971                                Ok(__FieldTag::__source_hierarchy_datasets)
26972                            }
26973                            "dataFreshness" => Ok(__FieldTag::__data_freshness),
26974                            "data_freshness" => Ok(__FieldTag::__data_freshness),
26975                            "blmtConfig" => Ok(__FieldTag::__blmt_config),
26976                            "blmt_config" => Ok(__FieldTag::__blmt_config),
26977                            "merge" => Ok(__FieldTag::__merge),
26978                            "appendOnly" => Ok(__FieldTag::__append_only),
26979                            "append_only" => Ok(__FieldTag::__append_only),
26980                            _ => Ok(__FieldTag::Unknown(value.to_string())),
26981                        }
26982                    }
26983                }
26984                deserializer.deserialize_identifier(Visitor)
26985            }
26986        }
26987        struct Visitor;
26988        impl<'de> serde::de::Visitor<'de> for Visitor {
26989            type Value = BigQueryDestinationConfig;
26990            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
26991                formatter.write_str("struct BigQueryDestinationConfig")
26992            }
26993            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
26994            where
26995                A: serde::de::MapAccess<'de>,
26996            {
26997                #[allow(unused_imports)]
26998                use serde::de::Error;
26999                use std::option::Option::Some;
27000                let mut fields = std::collections::HashSet::new();
27001                let mut result = Self::Value::new();
27002                while let Some(tag) = map.next_key::<__FieldTag>()? {
27003                    #[allow(clippy::match_single_binding)]
27004                    match tag {
27005                        __FieldTag::__single_target_dataset => {
27006                            if !fields.insert(__FieldTag::__single_target_dataset) {
27007                                return std::result::Result::Err(A::Error::duplicate_field(
27008                                    "multiple values for single_target_dataset",
27009                                ));
27010                            }
27011                            if result.dataset_config.is_some() {
27012                                return std::result::Result::Err(A::Error::duplicate_field(
27013                                    "multiple values for `dataset_config`, a oneof with full ID .google.cloud.datastream.v1.BigQueryDestinationConfig.single_target_dataset, latest field was singleTargetDataset",
27014                                ));
27015                            }
27016                            result.dataset_config = std::option::Option::Some(
27017                                crate::model::big_query_destination_config::DatasetConfig::SingleTargetDataset(
27018                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>>>()?.unwrap_or_default()
27019                                ),
27020                            );
27021                        }
27022                        __FieldTag::__source_hierarchy_datasets => {
27023                            if !fields.insert(__FieldTag::__source_hierarchy_datasets) {
27024                                return std::result::Result::Err(A::Error::duplicate_field(
27025                                    "multiple values for source_hierarchy_datasets",
27026                                ));
27027                            }
27028                            if result.dataset_config.is_some() {
27029                                return std::result::Result::Err(A::Error::duplicate_field(
27030                                    "multiple values for `dataset_config`, a oneof with full ID .google.cloud.datastream.v1.BigQueryDestinationConfig.source_hierarchy_datasets, latest field was sourceHierarchyDatasets",
27031                                ));
27032                            }
27033                            result.dataset_config = std::option::Option::Some(
27034                                crate::model::big_query_destination_config::DatasetConfig::SourceHierarchyDatasets(
27035                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::big_query_destination_config::SourceHierarchyDatasets>>>()?.unwrap_or_default()
27036                                ),
27037                            );
27038                        }
27039                        __FieldTag::__data_freshness => {
27040                            if !fields.insert(__FieldTag::__data_freshness) {
27041                                return std::result::Result::Err(A::Error::duplicate_field(
27042                                    "multiple values for data_freshness",
27043                                ));
27044                            }
27045                            result.data_freshness =
27046                                map.next_value::<std::option::Option<wkt::Duration>>()?;
27047                        }
27048                        __FieldTag::__blmt_config => {
27049                            if !fields.insert(__FieldTag::__blmt_config) {
27050                                return std::result::Result::Err(A::Error::duplicate_field(
27051                                    "multiple values for blmt_config",
27052                                ));
27053                            }
27054                            result.blmt_config = map.next_value::<std::option::Option<
27055                                crate::model::big_query_destination_config::BlmtConfig,
27056                            >>()?;
27057                        }
27058                        __FieldTag::__merge => {
27059                            if !fields.insert(__FieldTag::__merge) {
27060                                return std::result::Result::Err(A::Error::duplicate_field(
27061                                    "multiple values for merge",
27062                                ));
27063                            }
27064                            if result.write_mode.is_some() {
27065                                return std::result::Result::Err(A::Error::duplicate_field(
27066                                    "multiple values for `write_mode`, a oneof with full ID .google.cloud.datastream.v1.BigQueryDestinationConfig.merge, latest field was merge",
27067                                ));
27068                            }
27069                            result.write_mode = std::option::Option::Some(
27070                                crate::model::big_query_destination_config::WriteMode::Merge(
27071                                    map.next_value::<std::option::Option<
27072                                        std::boxed::Box<
27073                                            crate::model::big_query_destination_config::Merge,
27074                                        >,
27075                                    >>()?
27076                                    .unwrap_or_default(),
27077                                ),
27078                            );
27079                        }
27080                        __FieldTag::__append_only => {
27081                            if !fields.insert(__FieldTag::__append_only) {
27082                                return std::result::Result::Err(A::Error::duplicate_field(
27083                                    "multiple values for append_only",
27084                                ));
27085                            }
27086                            if result.write_mode.is_some() {
27087                                return std::result::Result::Err(A::Error::duplicate_field(
27088                                    "multiple values for `write_mode`, a oneof with full ID .google.cloud.datastream.v1.BigQueryDestinationConfig.append_only, latest field was appendOnly",
27089                                ));
27090                            }
27091                            result.write_mode = std::option::Option::Some(
27092                                crate::model::big_query_destination_config::WriteMode::AppendOnly(
27093                                    map.next_value::<std::option::Option<
27094                                        std::boxed::Box<
27095                                            crate::model::big_query_destination_config::AppendOnly,
27096                                        >,
27097                                    >>()?
27098                                    .unwrap_or_default(),
27099                                ),
27100                            );
27101                        }
27102                        __FieldTag::Unknown(key) => {
27103                            let value = map.next_value::<serde_json::Value>()?;
27104                            result._unknown_fields.insert(key, value);
27105                        }
27106                    }
27107                }
27108                std::result::Result::Ok(result)
27109            }
27110        }
27111        deserializer.deserialize_any(Visitor)
27112    }
27113}
27114
27115#[doc(hidden)]
27116impl serde::ser::Serialize for BigQueryDestinationConfig {
27117    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27118    where
27119        S: serde::ser::Serializer,
27120    {
27121        use serde::ser::SerializeMap;
27122        #[allow(unused_imports)]
27123        use std::option::Option::Some;
27124        let mut state = serializer.serialize_map(std::option::Option::None)?;
27125        if let Some(value) = self.single_target_dataset() {
27126            state.serialize_entry("singleTargetDataset", value)?;
27127        }
27128        if let Some(value) = self.source_hierarchy_datasets() {
27129            state.serialize_entry("sourceHierarchyDatasets", value)?;
27130        }
27131        if self.data_freshness.is_some() {
27132            state.serialize_entry("dataFreshness", &self.data_freshness)?;
27133        }
27134        if self.blmt_config.is_some() {
27135            state.serialize_entry("blmtConfig", &self.blmt_config)?;
27136        }
27137        if let Some(value) = self.merge() {
27138            state.serialize_entry("merge", value)?;
27139        }
27140        if let Some(value) = self.append_only() {
27141            state.serialize_entry("appendOnly", value)?;
27142        }
27143        if !self._unknown_fields.is_empty() {
27144            for (key, value) in self._unknown_fields.iter() {
27145                state.serialize_entry(key, &value)?;
27146            }
27147        }
27148        state.end()
27149    }
27150}
27151
27152impl std::fmt::Debug for BigQueryDestinationConfig {
27153    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
27154        let mut debug_struct = f.debug_struct("BigQueryDestinationConfig");
27155        debug_struct.field("data_freshness", &self.data_freshness);
27156        debug_struct.field("blmt_config", &self.blmt_config);
27157        debug_struct.field("dataset_config", &self.dataset_config);
27158        debug_struct.field("write_mode", &self.write_mode);
27159        if !self._unknown_fields.is_empty() {
27160            debug_struct.field("_unknown_fields", &self._unknown_fields);
27161        }
27162        debug_struct.finish()
27163    }
27164}
27165
27166/// Defines additional types related to [BigQueryDestinationConfig].
27167pub mod big_query_destination_config {
27168    #[allow(unused_imports)]
27169    use super::*;
27170
27171    /// A single target dataset to which all data will be streamed.
27172    #[derive(Clone, Default, PartialEq)]
27173    #[non_exhaustive]
27174    pub struct SingleTargetDataset {
27175        /// The dataset ID of the target dataset.
27176        /// DatasetIds allowed characters:
27177        /// <https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets#datasetreference>.
27178        pub dataset_id: std::string::String,
27179
27180        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27181    }
27182
27183    impl SingleTargetDataset {
27184        pub fn new() -> Self {
27185            std::default::Default::default()
27186        }
27187
27188        /// Sets the value of [dataset_id][crate::model::big_query_destination_config::SingleTargetDataset::dataset_id].
27189        pub fn set_dataset_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27190            self.dataset_id = v.into();
27191            self
27192        }
27193    }
27194
27195    impl wkt::message::Message for SingleTargetDataset {
27196        fn typename() -> &'static str {
27197            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SingleTargetDataset"
27198        }
27199    }
27200
27201    #[doc(hidden)]
27202    impl<'de> serde::de::Deserialize<'de> for SingleTargetDataset {
27203        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27204        where
27205            D: serde::Deserializer<'de>,
27206        {
27207            #[allow(non_camel_case_types)]
27208            #[doc(hidden)]
27209            #[derive(PartialEq, Eq, Hash)]
27210            enum __FieldTag {
27211                __dataset_id,
27212                Unknown(std::string::String),
27213            }
27214            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
27215                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27216                where
27217                    D: serde::Deserializer<'de>,
27218                {
27219                    struct Visitor;
27220                    impl<'de> serde::de::Visitor<'de> for Visitor {
27221                        type Value = __FieldTag;
27222                        fn expecting(
27223                            &self,
27224                            formatter: &mut std::fmt::Formatter,
27225                        ) -> std::fmt::Result {
27226                            formatter.write_str("a field name for SingleTargetDataset")
27227                        }
27228                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
27229                        where
27230                            E: serde::de::Error,
27231                        {
27232                            use std::result::Result::Ok;
27233                            use std::string::ToString;
27234                            match value {
27235                                "datasetId" => Ok(__FieldTag::__dataset_id),
27236                                "dataset_id" => Ok(__FieldTag::__dataset_id),
27237                                _ => Ok(__FieldTag::Unknown(value.to_string())),
27238                            }
27239                        }
27240                    }
27241                    deserializer.deserialize_identifier(Visitor)
27242                }
27243            }
27244            struct Visitor;
27245            impl<'de> serde::de::Visitor<'de> for Visitor {
27246                type Value = SingleTargetDataset;
27247                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
27248                    formatter.write_str("struct SingleTargetDataset")
27249                }
27250                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
27251                where
27252                    A: serde::de::MapAccess<'de>,
27253                {
27254                    #[allow(unused_imports)]
27255                    use serde::de::Error;
27256                    use std::option::Option::Some;
27257                    let mut fields = std::collections::HashSet::new();
27258                    let mut result = Self::Value::new();
27259                    while let Some(tag) = map.next_key::<__FieldTag>()? {
27260                        #[allow(clippy::match_single_binding)]
27261                        match tag {
27262                            __FieldTag::__dataset_id => {
27263                                if !fields.insert(__FieldTag::__dataset_id) {
27264                                    return std::result::Result::Err(A::Error::duplicate_field(
27265                                        "multiple values for dataset_id",
27266                                    ));
27267                                }
27268                                result.dataset_id = map
27269                                    .next_value::<std::option::Option<std::string::String>>()?
27270                                    .unwrap_or_default();
27271                            }
27272                            __FieldTag::Unknown(key) => {
27273                                let value = map.next_value::<serde_json::Value>()?;
27274                                result._unknown_fields.insert(key, value);
27275                            }
27276                        }
27277                    }
27278                    std::result::Result::Ok(result)
27279                }
27280            }
27281            deserializer.deserialize_any(Visitor)
27282        }
27283    }
27284
27285    #[doc(hidden)]
27286    impl serde::ser::Serialize for SingleTargetDataset {
27287        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27288        where
27289            S: serde::ser::Serializer,
27290        {
27291            use serde::ser::SerializeMap;
27292            #[allow(unused_imports)]
27293            use std::option::Option::Some;
27294            let mut state = serializer.serialize_map(std::option::Option::None)?;
27295            if !self.dataset_id.is_empty() {
27296                state.serialize_entry("datasetId", &self.dataset_id)?;
27297            }
27298            if !self._unknown_fields.is_empty() {
27299                for (key, value) in self._unknown_fields.iter() {
27300                    state.serialize_entry(key, &value)?;
27301                }
27302            }
27303            state.end()
27304        }
27305    }
27306
27307    impl std::fmt::Debug for SingleTargetDataset {
27308        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
27309            let mut debug_struct = f.debug_struct("SingleTargetDataset");
27310            debug_struct.field("dataset_id", &self.dataset_id);
27311            if !self._unknown_fields.is_empty() {
27312                debug_struct.field("_unknown_fields", &self._unknown_fields);
27313            }
27314            debug_struct.finish()
27315        }
27316    }
27317
27318    /// Destination datasets are created so that hierarchy of the destination data
27319    /// objects matches the source hierarchy.
27320    #[derive(Clone, Default, PartialEq)]
27321    #[non_exhaustive]
27322    pub struct SourceHierarchyDatasets {
27323        /// The dataset template to use for dynamic dataset creation.
27324        pub dataset_template: std::option::Option<
27325            crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate,
27326        >,
27327
27328        /// Optional. The project id of the BigQuery dataset. If not specified, the
27329        /// project will be inferred from the stream resource.
27330        pub project_id: std::option::Option<std::string::String>,
27331
27332        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27333    }
27334
27335    impl SourceHierarchyDatasets {
27336        pub fn new() -> Self {
27337            std::default::Default::default()
27338        }
27339
27340        /// Sets the value of [dataset_template][crate::model::big_query_destination_config::SourceHierarchyDatasets::dataset_template].
27341        pub fn set_dataset_template<T>(mut self, v: T) -> Self
27342        where T: std::convert::Into<crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate>
27343        {
27344            self.dataset_template = std::option::Option::Some(v.into());
27345            self
27346        }
27347
27348        /// Sets or clears the value of [dataset_template][crate::model::big_query_destination_config::SourceHierarchyDatasets::dataset_template].
27349        pub fn set_or_clear_dataset_template<T>(mut self, v: std::option::Option<T>) -> Self
27350        where T: std::convert::Into<crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate>
27351        {
27352            self.dataset_template = v.map(|x| x.into());
27353            self
27354        }
27355
27356        /// Sets the value of [project_id][crate::model::big_query_destination_config::SourceHierarchyDatasets::project_id].
27357        pub fn set_project_id<T>(mut self, v: T) -> Self
27358        where
27359            T: std::convert::Into<std::string::String>,
27360        {
27361            self.project_id = std::option::Option::Some(v.into());
27362            self
27363        }
27364
27365        /// Sets or clears the value of [project_id][crate::model::big_query_destination_config::SourceHierarchyDatasets::project_id].
27366        pub fn set_or_clear_project_id<T>(mut self, v: std::option::Option<T>) -> Self
27367        where
27368            T: std::convert::Into<std::string::String>,
27369        {
27370            self.project_id = v.map(|x| x.into());
27371            self
27372        }
27373    }
27374
27375    impl wkt::message::Message for SourceHierarchyDatasets {
27376        fn typename() -> &'static str {
27377            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SourceHierarchyDatasets"
27378        }
27379    }
27380
27381    #[doc(hidden)]
27382    impl<'de> serde::de::Deserialize<'de> for SourceHierarchyDatasets {
27383        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27384        where
27385            D: serde::Deserializer<'de>,
27386        {
27387            #[allow(non_camel_case_types)]
27388            #[doc(hidden)]
27389            #[derive(PartialEq, Eq, Hash)]
27390            enum __FieldTag {
27391                __dataset_template,
27392                __project_id,
27393                Unknown(std::string::String),
27394            }
27395            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
27396                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27397                where
27398                    D: serde::Deserializer<'de>,
27399                {
27400                    struct Visitor;
27401                    impl<'de> serde::de::Visitor<'de> for Visitor {
27402                        type Value = __FieldTag;
27403                        fn expecting(
27404                            &self,
27405                            formatter: &mut std::fmt::Formatter,
27406                        ) -> std::fmt::Result {
27407                            formatter.write_str("a field name for SourceHierarchyDatasets")
27408                        }
27409                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
27410                        where
27411                            E: serde::de::Error,
27412                        {
27413                            use std::result::Result::Ok;
27414                            use std::string::ToString;
27415                            match value {
27416                                "datasetTemplate" => Ok(__FieldTag::__dataset_template),
27417                                "dataset_template" => Ok(__FieldTag::__dataset_template),
27418                                "projectId" => Ok(__FieldTag::__project_id),
27419                                "project_id" => Ok(__FieldTag::__project_id),
27420                                _ => Ok(__FieldTag::Unknown(value.to_string())),
27421                            }
27422                        }
27423                    }
27424                    deserializer.deserialize_identifier(Visitor)
27425                }
27426            }
27427            struct Visitor;
27428            impl<'de> serde::de::Visitor<'de> for Visitor {
27429                type Value = SourceHierarchyDatasets;
27430                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
27431                    formatter.write_str("struct SourceHierarchyDatasets")
27432                }
27433                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
27434                where
27435                    A: serde::de::MapAccess<'de>,
27436                {
27437                    #[allow(unused_imports)]
27438                    use serde::de::Error;
27439                    use std::option::Option::Some;
27440                    let mut fields = std::collections::HashSet::new();
27441                    let mut result = Self::Value::new();
27442                    while let Some(tag) = map.next_key::<__FieldTag>()? {
27443                        #[allow(clippy::match_single_binding)]
27444                        match tag {
27445                            __FieldTag::__dataset_template => {
27446                                if !fields.insert(__FieldTag::__dataset_template) {
27447                                    return std::result::Result::Err(A::Error::duplicate_field(
27448                                        "multiple values for dataset_template",
27449                                    ));
27450                                }
27451                                result.dataset_template = map.next_value::<std::option::Option<crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate>>()?
27452                                    ;
27453                            }
27454                            __FieldTag::__project_id => {
27455                                if !fields.insert(__FieldTag::__project_id) {
27456                                    return std::result::Result::Err(A::Error::duplicate_field(
27457                                        "multiple values for project_id",
27458                                    ));
27459                                }
27460                                result.project_id =
27461                                    map.next_value::<std::option::Option<std::string::String>>()?;
27462                            }
27463                            __FieldTag::Unknown(key) => {
27464                                let value = map.next_value::<serde_json::Value>()?;
27465                                result._unknown_fields.insert(key, value);
27466                            }
27467                        }
27468                    }
27469                    std::result::Result::Ok(result)
27470                }
27471            }
27472            deserializer.deserialize_any(Visitor)
27473        }
27474    }
27475
27476    #[doc(hidden)]
27477    impl serde::ser::Serialize for SourceHierarchyDatasets {
27478        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27479        where
27480            S: serde::ser::Serializer,
27481        {
27482            use serde::ser::SerializeMap;
27483            #[allow(unused_imports)]
27484            use std::option::Option::Some;
27485            let mut state = serializer.serialize_map(std::option::Option::None)?;
27486            if self.dataset_template.is_some() {
27487                state.serialize_entry("datasetTemplate", &self.dataset_template)?;
27488            }
27489            if self.project_id.is_some() {
27490                state.serialize_entry("projectId", &self.project_id)?;
27491            }
27492            if !self._unknown_fields.is_empty() {
27493                for (key, value) in self._unknown_fields.iter() {
27494                    state.serialize_entry(key, &value)?;
27495                }
27496            }
27497            state.end()
27498        }
27499    }
27500
27501    impl std::fmt::Debug for SourceHierarchyDatasets {
27502        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
27503            let mut debug_struct = f.debug_struct("SourceHierarchyDatasets");
27504            debug_struct.field("dataset_template", &self.dataset_template);
27505            debug_struct.field("project_id", &self.project_id);
27506            if !self._unknown_fields.is_empty() {
27507                debug_struct.field("_unknown_fields", &self._unknown_fields);
27508            }
27509            debug_struct.finish()
27510        }
27511    }
27512
27513    /// Defines additional types related to [SourceHierarchyDatasets].
27514    pub mod source_hierarchy_datasets {
27515        #[allow(unused_imports)]
27516        use super::*;
27517
27518        /// Dataset template used for dynamic dataset creation.
27519        #[derive(Clone, Default, PartialEq)]
27520        #[non_exhaustive]
27521        pub struct DatasetTemplate {
27522            /// Required. The geographic location where the dataset should reside. See
27523            /// <https://cloud.google.com/bigquery/docs/locations> for supported
27524            /// locations.
27525            pub location: std::string::String,
27526
27527            /// If supplied, every created dataset will have its name prefixed by the
27528            /// provided value. The prefix and name will be separated by an underscore.
27529            /// i.e. \<prefix\>_<dataset_name>.
27530            pub dataset_id_prefix: std::string::String,
27531
27532            /// Describes the Cloud KMS encryption key that will be used to
27533            /// protect destination BigQuery table. The BigQuery Service Account
27534            /// associated with your project requires access to this encryption key.
27535            /// i.e.
27536            /// projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{cryptoKey}.
27537            /// See <https://cloud.google.com/bigquery/docs/customer-managed-encryption>
27538            /// for more information.
27539            pub kms_key_name: std::string::String,
27540
27541            _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27542        }
27543
27544        impl DatasetTemplate {
27545            pub fn new() -> Self {
27546                std::default::Default::default()
27547            }
27548
27549            /// Sets the value of [location][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::location].
27550            pub fn set_location<T: std::convert::Into<std::string::String>>(
27551                mut self,
27552                v: T,
27553            ) -> Self {
27554                self.location = v.into();
27555                self
27556            }
27557
27558            /// Sets the value of [dataset_id_prefix][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::dataset_id_prefix].
27559            pub fn set_dataset_id_prefix<T: std::convert::Into<std::string::String>>(
27560                mut self,
27561                v: T,
27562            ) -> Self {
27563                self.dataset_id_prefix = v.into();
27564                self
27565            }
27566
27567            /// Sets the value of [kms_key_name][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::kms_key_name].
27568            pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(
27569                mut self,
27570                v: T,
27571            ) -> Self {
27572                self.kms_key_name = v.into();
27573                self
27574            }
27575        }
27576
27577        impl wkt::message::Message for DatasetTemplate {
27578            fn typename() -> &'static str {
27579                "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SourceHierarchyDatasets.DatasetTemplate"
27580            }
27581        }
27582
27583        #[doc(hidden)]
27584        impl<'de> serde::de::Deserialize<'de> for DatasetTemplate {
27585            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27586            where
27587                D: serde::Deserializer<'de>,
27588            {
27589                #[allow(non_camel_case_types)]
27590                #[doc(hidden)]
27591                #[derive(PartialEq, Eq, Hash)]
27592                enum __FieldTag {
27593                    __location,
27594                    __dataset_id_prefix,
27595                    __kms_key_name,
27596                    Unknown(std::string::String),
27597                }
27598                impl<'de> serde::de::Deserialize<'de> for __FieldTag {
27599                    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27600                    where
27601                        D: serde::Deserializer<'de>,
27602                    {
27603                        struct Visitor;
27604                        impl<'de> serde::de::Visitor<'de> for Visitor {
27605                            type Value = __FieldTag;
27606                            fn expecting(
27607                                &self,
27608                                formatter: &mut std::fmt::Formatter,
27609                            ) -> std::fmt::Result {
27610                                formatter.write_str("a field name for DatasetTemplate")
27611                            }
27612                            fn visit_str<E>(
27613                                self,
27614                                value: &str,
27615                            ) -> std::result::Result<Self::Value, E>
27616                            where
27617                                E: serde::de::Error,
27618                            {
27619                                use std::result::Result::Ok;
27620                                use std::string::ToString;
27621                                match value {
27622                                    "location" => Ok(__FieldTag::__location),
27623                                    "datasetIdPrefix" => Ok(__FieldTag::__dataset_id_prefix),
27624                                    "dataset_id_prefix" => Ok(__FieldTag::__dataset_id_prefix),
27625                                    "kmsKeyName" => Ok(__FieldTag::__kms_key_name),
27626                                    "kms_key_name" => Ok(__FieldTag::__kms_key_name),
27627                                    _ => Ok(__FieldTag::Unknown(value.to_string())),
27628                                }
27629                            }
27630                        }
27631                        deserializer.deserialize_identifier(Visitor)
27632                    }
27633                }
27634                struct Visitor;
27635                impl<'de> serde::de::Visitor<'de> for Visitor {
27636                    type Value = DatasetTemplate;
27637                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
27638                        formatter.write_str("struct DatasetTemplate")
27639                    }
27640                    fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
27641                    where
27642                        A: serde::de::MapAccess<'de>,
27643                    {
27644                        #[allow(unused_imports)]
27645                        use serde::de::Error;
27646                        use std::option::Option::Some;
27647                        let mut fields = std::collections::HashSet::new();
27648                        let mut result = Self::Value::new();
27649                        while let Some(tag) = map.next_key::<__FieldTag>()? {
27650                            #[allow(clippy::match_single_binding)]
27651                            match tag {
27652                                __FieldTag::__location => {
27653                                    if !fields.insert(__FieldTag::__location) {
27654                                        return std::result::Result::Err(
27655                                            A::Error::duplicate_field(
27656                                                "multiple values for location",
27657                                            ),
27658                                        );
27659                                    }
27660                                    result.location = map
27661                                        .next_value::<std::option::Option<std::string::String>>()?
27662                                        .unwrap_or_default();
27663                                }
27664                                __FieldTag::__dataset_id_prefix => {
27665                                    if !fields.insert(__FieldTag::__dataset_id_prefix) {
27666                                        return std::result::Result::Err(
27667                                            A::Error::duplicate_field(
27668                                                "multiple values for dataset_id_prefix",
27669                                            ),
27670                                        );
27671                                    }
27672                                    result.dataset_id_prefix = map
27673                                        .next_value::<std::option::Option<std::string::String>>()?
27674                                        .unwrap_or_default();
27675                                }
27676                                __FieldTag::__kms_key_name => {
27677                                    if !fields.insert(__FieldTag::__kms_key_name) {
27678                                        return std::result::Result::Err(
27679                                            A::Error::duplicate_field(
27680                                                "multiple values for kms_key_name",
27681                                            ),
27682                                        );
27683                                    }
27684                                    result.kms_key_name = map
27685                                        .next_value::<std::option::Option<std::string::String>>()?
27686                                        .unwrap_or_default();
27687                                }
27688                                __FieldTag::Unknown(key) => {
27689                                    let value = map.next_value::<serde_json::Value>()?;
27690                                    result._unknown_fields.insert(key, value);
27691                                }
27692                            }
27693                        }
27694                        std::result::Result::Ok(result)
27695                    }
27696                }
27697                deserializer.deserialize_any(Visitor)
27698            }
27699        }
27700
27701        #[doc(hidden)]
27702        impl serde::ser::Serialize for DatasetTemplate {
27703            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27704            where
27705                S: serde::ser::Serializer,
27706            {
27707                use serde::ser::SerializeMap;
27708                #[allow(unused_imports)]
27709                use std::option::Option::Some;
27710                let mut state = serializer.serialize_map(std::option::Option::None)?;
27711                if !self.location.is_empty() {
27712                    state.serialize_entry("location", &self.location)?;
27713                }
27714                if !self.dataset_id_prefix.is_empty() {
27715                    state.serialize_entry("datasetIdPrefix", &self.dataset_id_prefix)?;
27716                }
27717                if !self.kms_key_name.is_empty() {
27718                    state.serialize_entry("kmsKeyName", &self.kms_key_name)?;
27719                }
27720                if !self._unknown_fields.is_empty() {
27721                    for (key, value) in self._unknown_fields.iter() {
27722                        state.serialize_entry(key, &value)?;
27723                    }
27724                }
27725                state.end()
27726            }
27727        }
27728
27729        impl std::fmt::Debug for DatasetTemplate {
27730            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
27731                let mut debug_struct = f.debug_struct("DatasetTemplate");
27732                debug_struct.field("location", &self.location);
27733                debug_struct.field("dataset_id_prefix", &self.dataset_id_prefix);
27734                debug_struct.field("kms_key_name", &self.kms_key_name);
27735                if !self._unknown_fields.is_empty() {
27736                    debug_struct.field("_unknown_fields", &self._unknown_fields);
27737                }
27738                debug_struct.finish()
27739            }
27740        }
27741    }
27742
27743    /// The configuration for BLMT.
27744    #[derive(Clone, Default, PartialEq)]
27745    #[non_exhaustive]
27746    pub struct BlmtConfig {
27747        /// Required. The Cloud Storage bucket name.
27748        pub bucket: std::string::String,
27749
27750        /// The root path inside the Cloud Storage bucket.
27751        pub root_path: std::string::String,
27752
27753        /// Required. The bigquery connection.
27754        /// Format: `{project}.{location}.{name}`
27755        pub connection_name: std::string::String,
27756
27757        /// Required. The file format.
27758        pub file_format: crate::model::big_query_destination_config::blmt_config::FileFormat,
27759
27760        /// Required. The table format.
27761        pub table_format: crate::model::big_query_destination_config::blmt_config::TableFormat,
27762
27763        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27764    }
27765
27766    impl BlmtConfig {
27767        pub fn new() -> Self {
27768            std::default::Default::default()
27769        }
27770
27771        /// Sets the value of [bucket][crate::model::big_query_destination_config::BlmtConfig::bucket].
27772        pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27773            self.bucket = v.into();
27774            self
27775        }
27776
27777        /// Sets the value of [root_path][crate::model::big_query_destination_config::BlmtConfig::root_path].
27778        pub fn set_root_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27779            self.root_path = v.into();
27780            self
27781        }
27782
27783        /// Sets the value of [connection_name][crate::model::big_query_destination_config::BlmtConfig::connection_name].
27784        pub fn set_connection_name<T: std::convert::Into<std::string::String>>(
27785            mut self,
27786            v: T,
27787        ) -> Self {
27788            self.connection_name = v.into();
27789            self
27790        }
27791
27792        /// Sets the value of [file_format][crate::model::big_query_destination_config::BlmtConfig::file_format].
27793        pub fn set_file_format<
27794            T: std::convert::Into<crate::model::big_query_destination_config::blmt_config::FileFormat>,
27795        >(
27796            mut self,
27797            v: T,
27798        ) -> Self {
27799            self.file_format = v.into();
27800            self
27801        }
27802
27803        /// Sets the value of [table_format][crate::model::big_query_destination_config::BlmtConfig::table_format].
27804        pub fn set_table_format<
27805            T: std::convert::Into<
27806                    crate::model::big_query_destination_config::blmt_config::TableFormat,
27807                >,
27808        >(
27809            mut self,
27810            v: T,
27811        ) -> Self {
27812            self.table_format = v.into();
27813            self
27814        }
27815    }
27816
27817    impl wkt::message::Message for BlmtConfig {
27818        fn typename() -> &'static str {
27819            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig"
27820        }
27821    }
27822
27823    #[doc(hidden)]
27824    impl<'de> serde::de::Deserialize<'de> for BlmtConfig {
27825        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27826        where
27827            D: serde::Deserializer<'de>,
27828        {
27829            #[allow(non_camel_case_types)]
27830            #[doc(hidden)]
27831            #[derive(PartialEq, Eq, Hash)]
27832            enum __FieldTag {
27833                __bucket,
27834                __root_path,
27835                __connection_name,
27836                __file_format,
27837                __table_format,
27838                Unknown(std::string::String),
27839            }
27840            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
27841                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27842                where
27843                    D: serde::Deserializer<'de>,
27844                {
27845                    struct Visitor;
27846                    impl<'de> serde::de::Visitor<'de> for Visitor {
27847                        type Value = __FieldTag;
27848                        fn expecting(
27849                            &self,
27850                            formatter: &mut std::fmt::Formatter,
27851                        ) -> std::fmt::Result {
27852                            formatter.write_str("a field name for BlmtConfig")
27853                        }
27854                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
27855                        where
27856                            E: serde::de::Error,
27857                        {
27858                            use std::result::Result::Ok;
27859                            use std::string::ToString;
27860                            match value {
27861                                "bucket" => Ok(__FieldTag::__bucket),
27862                                "rootPath" => Ok(__FieldTag::__root_path),
27863                                "root_path" => Ok(__FieldTag::__root_path),
27864                                "connectionName" => Ok(__FieldTag::__connection_name),
27865                                "connection_name" => Ok(__FieldTag::__connection_name),
27866                                "fileFormat" => Ok(__FieldTag::__file_format),
27867                                "file_format" => Ok(__FieldTag::__file_format),
27868                                "tableFormat" => Ok(__FieldTag::__table_format),
27869                                "table_format" => Ok(__FieldTag::__table_format),
27870                                _ => Ok(__FieldTag::Unknown(value.to_string())),
27871                            }
27872                        }
27873                    }
27874                    deserializer.deserialize_identifier(Visitor)
27875                }
27876            }
27877            struct Visitor;
27878            impl<'de> serde::de::Visitor<'de> for Visitor {
27879                type Value = BlmtConfig;
27880                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
27881                    formatter.write_str("struct BlmtConfig")
27882                }
27883                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
27884                where
27885                    A: serde::de::MapAccess<'de>,
27886                {
27887                    #[allow(unused_imports)]
27888                    use serde::de::Error;
27889                    use std::option::Option::Some;
27890                    let mut fields = std::collections::HashSet::new();
27891                    let mut result = Self::Value::new();
27892                    while let Some(tag) = map.next_key::<__FieldTag>()? {
27893                        #[allow(clippy::match_single_binding)]
27894                        match tag {
27895                            __FieldTag::__bucket => {
27896                                if !fields.insert(__FieldTag::__bucket) {
27897                                    return std::result::Result::Err(A::Error::duplicate_field(
27898                                        "multiple values for bucket",
27899                                    ));
27900                                }
27901                                result.bucket = map
27902                                    .next_value::<std::option::Option<std::string::String>>()?
27903                                    .unwrap_or_default();
27904                            }
27905                            __FieldTag::__root_path => {
27906                                if !fields.insert(__FieldTag::__root_path) {
27907                                    return std::result::Result::Err(A::Error::duplicate_field(
27908                                        "multiple values for root_path",
27909                                    ));
27910                                }
27911                                result.root_path = map
27912                                    .next_value::<std::option::Option<std::string::String>>()?
27913                                    .unwrap_or_default();
27914                            }
27915                            __FieldTag::__connection_name => {
27916                                if !fields.insert(__FieldTag::__connection_name) {
27917                                    return std::result::Result::Err(A::Error::duplicate_field(
27918                                        "multiple values for connection_name",
27919                                    ));
27920                                }
27921                                result.connection_name = map
27922                                    .next_value::<std::option::Option<std::string::String>>()?
27923                                    .unwrap_or_default();
27924                            }
27925                            __FieldTag::__file_format => {
27926                                if !fields.insert(__FieldTag::__file_format) {
27927                                    return std::result::Result::Err(A::Error::duplicate_field(
27928                                        "multiple values for file_format",
27929                                    ));
27930                                }
27931                                result.file_format = map.next_value::<std::option::Option<crate::model::big_query_destination_config::blmt_config::FileFormat>>()?.unwrap_or_default();
27932                            }
27933                            __FieldTag::__table_format => {
27934                                if !fields.insert(__FieldTag::__table_format) {
27935                                    return std::result::Result::Err(A::Error::duplicate_field(
27936                                        "multiple values for table_format",
27937                                    ));
27938                                }
27939                                result.table_format = map.next_value::<std::option::Option<crate::model::big_query_destination_config::blmt_config::TableFormat>>()?.unwrap_or_default();
27940                            }
27941                            __FieldTag::Unknown(key) => {
27942                                let value = map.next_value::<serde_json::Value>()?;
27943                                result._unknown_fields.insert(key, value);
27944                            }
27945                        }
27946                    }
27947                    std::result::Result::Ok(result)
27948                }
27949            }
27950            deserializer.deserialize_any(Visitor)
27951        }
27952    }
27953
27954    #[doc(hidden)]
27955    impl serde::ser::Serialize for BlmtConfig {
27956        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27957        where
27958            S: serde::ser::Serializer,
27959        {
27960            use serde::ser::SerializeMap;
27961            #[allow(unused_imports)]
27962            use std::option::Option::Some;
27963            let mut state = serializer.serialize_map(std::option::Option::None)?;
27964            if !self.bucket.is_empty() {
27965                state.serialize_entry("bucket", &self.bucket)?;
27966            }
27967            if !self.root_path.is_empty() {
27968                state.serialize_entry("rootPath", &self.root_path)?;
27969            }
27970            if !self.connection_name.is_empty() {
27971                state.serialize_entry("connectionName", &self.connection_name)?;
27972            }
27973            if !wkt::internal::is_default(&self.file_format) {
27974                state.serialize_entry("fileFormat", &self.file_format)?;
27975            }
27976            if !wkt::internal::is_default(&self.table_format) {
27977                state.serialize_entry("tableFormat", &self.table_format)?;
27978            }
27979            if !self._unknown_fields.is_empty() {
27980                for (key, value) in self._unknown_fields.iter() {
27981                    state.serialize_entry(key, &value)?;
27982                }
27983            }
27984            state.end()
27985        }
27986    }
27987
27988    impl std::fmt::Debug for BlmtConfig {
27989        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
27990            let mut debug_struct = f.debug_struct("BlmtConfig");
27991            debug_struct.field("bucket", &self.bucket);
27992            debug_struct.field("root_path", &self.root_path);
27993            debug_struct.field("connection_name", &self.connection_name);
27994            debug_struct.field("file_format", &self.file_format);
27995            debug_struct.field("table_format", &self.table_format);
27996            if !self._unknown_fields.is_empty() {
27997                debug_struct.field("_unknown_fields", &self._unknown_fields);
27998            }
27999            debug_struct.finish()
28000        }
28001    }
28002
28003    /// Defines additional types related to [BlmtConfig].
28004    pub mod blmt_config {
28005        #[allow(unused_imports)]
28006        use super::*;
28007
28008        /// Supported file formats for BigLake managed tables.
28009        ///
28010        /// # Working with unknown values
28011        ///
28012        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28013        /// additional enum variants at any time. Adding new variants is not considered
28014        /// a breaking change. Applications should write their code in anticipation of:
28015        ///
28016        /// - New values appearing in future releases of the client library, **and**
28017        /// - New values received dynamically, without application changes.
28018        ///
28019        /// Please consult the [Working with enums] section in the user guide for some
28020        /// guidelines.
28021        ///
28022        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
28023        #[derive(Clone, Debug, PartialEq)]
28024        #[non_exhaustive]
28025        pub enum FileFormat {
28026            /// Default value.
28027            Unspecified,
28028            /// Parquet file format.
28029            Parquet,
28030            /// If set, the enum was initialized with an unknown value.
28031            ///
28032            /// Applications can examine the value using [FileFormat::value] or
28033            /// [FileFormat::name].
28034            UnknownValue(file_format::UnknownValue),
28035        }
28036
28037        #[doc(hidden)]
28038        pub mod file_format {
28039            #[allow(unused_imports)]
28040            use super::*;
28041            #[derive(Clone, Debug, PartialEq)]
28042            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28043        }
28044
28045        impl FileFormat {
28046            /// Gets the enum value.
28047            ///
28048            /// Returns `None` if the enum contains an unknown value deserialized from
28049            /// the string representation of enums.
28050            pub fn value(&self) -> std::option::Option<i32> {
28051                match self {
28052                    Self::Unspecified => std::option::Option::Some(0),
28053                    Self::Parquet => std::option::Option::Some(1),
28054                    Self::UnknownValue(u) => u.0.value(),
28055                }
28056            }
28057
28058            /// Gets the enum value as a string.
28059            ///
28060            /// Returns `None` if the enum contains an unknown value deserialized from
28061            /// the integer representation of enums.
28062            pub fn name(&self) -> std::option::Option<&str> {
28063                match self {
28064                    Self::Unspecified => std::option::Option::Some("FILE_FORMAT_UNSPECIFIED"),
28065                    Self::Parquet => std::option::Option::Some("PARQUET"),
28066                    Self::UnknownValue(u) => u.0.name(),
28067                }
28068            }
28069        }
28070
28071        impl std::default::Default for FileFormat {
28072            fn default() -> Self {
28073                use std::convert::From;
28074                Self::from(0)
28075            }
28076        }
28077
28078        impl std::fmt::Display for FileFormat {
28079            fn fmt(
28080                &self,
28081                f: &mut std::fmt::Formatter<'_>,
28082            ) -> std::result::Result<(), std::fmt::Error> {
28083                wkt::internal::display_enum(f, self.name(), self.value())
28084            }
28085        }
28086
28087        impl std::convert::From<i32> for FileFormat {
28088            fn from(value: i32) -> Self {
28089                match value {
28090                    0 => Self::Unspecified,
28091                    1 => Self::Parquet,
28092                    _ => Self::UnknownValue(file_format::UnknownValue(
28093                        wkt::internal::UnknownEnumValue::Integer(value),
28094                    )),
28095                }
28096            }
28097        }
28098
28099        impl std::convert::From<&str> for FileFormat {
28100            fn from(value: &str) -> Self {
28101                use std::string::ToString;
28102                match value {
28103                    "FILE_FORMAT_UNSPECIFIED" => Self::Unspecified,
28104                    "PARQUET" => Self::Parquet,
28105                    _ => Self::UnknownValue(file_format::UnknownValue(
28106                        wkt::internal::UnknownEnumValue::String(value.to_string()),
28107                    )),
28108                }
28109            }
28110        }
28111
28112        impl serde::ser::Serialize for FileFormat {
28113            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28114            where
28115                S: serde::Serializer,
28116            {
28117                match self {
28118                    Self::Unspecified => serializer.serialize_i32(0),
28119                    Self::Parquet => serializer.serialize_i32(1),
28120                    Self::UnknownValue(u) => u.0.serialize(serializer),
28121                }
28122            }
28123        }
28124
28125        impl<'de> serde::de::Deserialize<'de> for FileFormat {
28126            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28127            where
28128                D: serde::Deserializer<'de>,
28129            {
28130                deserializer.deserialize_any(wkt::internal::EnumVisitor::<FileFormat>::new(
28131                    ".google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig.FileFormat",
28132                ))
28133            }
28134        }
28135
28136        /// Supported table formats for BigLake managed tables.
28137        ///
28138        /// # Working with unknown values
28139        ///
28140        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28141        /// additional enum variants at any time. Adding new variants is not considered
28142        /// a breaking change. Applications should write their code in anticipation of:
28143        ///
28144        /// - New values appearing in future releases of the client library, **and**
28145        /// - New values received dynamically, without application changes.
28146        ///
28147        /// Please consult the [Working with enums] section in the user guide for some
28148        /// guidelines.
28149        ///
28150        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
28151        #[derive(Clone, Debug, PartialEq)]
28152        #[non_exhaustive]
28153        pub enum TableFormat {
28154            /// Default value.
28155            Unspecified,
28156            /// Iceberg table format.
28157            Iceberg,
28158            /// If set, the enum was initialized with an unknown value.
28159            ///
28160            /// Applications can examine the value using [TableFormat::value] or
28161            /// [TableFormat::name].
28162            UnknownValue(table_format::UnknownValue),
28163        }
28164
28165        #[doc(hidden)]
28166        pub mod table_format {
28167            #[allow(unused_imports)]
28168            use super::*;
28169            #[derive(Clone, Debug, PartialEq)]
28170            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28171        }
28172
28173        impl TableFormat {
28174            /// Gets the enum value.
28175            ///
28176            /// Returns `None` if the enum contains an unknown value deserialized from
28177            /// the string representation of enums.
28178            pub fn value(&self) -> std::option::Option<i32> {
28179                match self {
28180                    Self::Unspecified => std::option::Option::Some(0),
28181                    Self::Iceberg => std::option::Option::Some(1),
28182                    Self::UnknownValue(u) => u.0.value(),
28183                }
28184            }
28185
28186            /// Gets the enum value as a string.
28187            ///
28188            /// Returns `None` if the enum contains an unknown value deserialized from
28189            /// the integer representation of enums.
28190            pub fn name(&self) -> std::option::Option<&str> {
28191                match self {
28192                    Self::Unspecified => std::option::Option::Some("TABLE_FORMAT_UNSPECIFIED"),
28193                    Self::Iceberg => std::option::Option::Some("ICEBERG"),
28194                    Self::UnknownValue(u) => u.0.name(),
28195                }
28196            }
28197        }
28198
28199        impl std::default::Default for TableFormat {
28200            fn default() -> Self {
28201                use std::convert::From;
28202                Self::from(0)
28203            }
28204        }
28205
28206        impl std::fmt::Display for TableFormat {
28207            fn fmt(
28208                &self,
28209                f: &mut std::fmt::Formatter<'_>,
28210            ) -> std::result::Result<(), std::fmt::Error> {
28211                wkt::internal::display_enum(f, self.name(), self.value())
28212            }
28213        }
28214
28215        impl std::convert::From<i32> for TableFormat {
28216            fn from(value: i32) -> Self {
28217                match value {
28218                    0 => Self::Unspecified,
28219                    1 => Self::Iceberg,
28220                    _ => Self::UnknownValue(table_format::UnknownValue(
28221                        wkt::internal::UnknownEnumValue::Integer(value),
28222                    )),
28223                }
28224            }
28225        }
28226
28227        impl std::convert::From<&str> for TableFormat {
28228            fn from(value: &str) -> Self {
28229                use std::string::ToString;
28230                match value {
28231                    "TABLE_FORMAT_UNSPECIFIED" => Self::Unspecified,
28232                    "ICEBERG" => Self::Iceberg,
28233                    _ => Self::UnknownValue(table_format::UnknownValue(
28234                        wkt::internal::UnknownEnumValue::String(value.to_string()),
28235                    )),
28236                }
28237            }
28238        }
28239
28240        impl serde::ser::Serialize for TableFormat {
28241            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28242            where
28243                S: serde::Serializer,
28244            {
28245                match self {
28246                    Self::Unspecified => serializer.serialize_i32(0),
28247                    Self::Iceberg => serializer.serialize_i32(1),
28248                    Self::UnknownValue(u) => u.0.serialize(serializer),
28249                }
28250            }
28251        }
28252
28253        impl<'de> serde::de::Deserialize<'de> for TableFormat {
28254            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28255            where
28256                D: serde::Deserializer<'de>,
28257            {
28258                deserializer.deserialize_any(wkt::internal::EnumVisitor::<TableFormat>::new(
28259                    ".google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig.TableFormat",
28260                ))
28261            }
28262        }
28263    }
28264
28265    /// AppendOnly mode defines that all changes to a table will be written to the
28266    /// destination table.
28267    #[derive(Clone, Default, PartialEq)]
28268    #[non_exhaustive]
28269    pub struct AppendOnly {
28270        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28271    }
28272
28273    impl AppendOnly {
28274        pub fn new() -> Self {
28275            std::default::Default::default()
28276        }
28277    }
28278
28279    impl wkt::message::Message for AppendOnly {
28280        fn typename() -> &'static str {
28281            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.AppendOnly"
28282        }
28283    }
28284
28285    #[doc(hidden)]
28286    impl<'de> serde::de::Deserialize<'de> for AppendOnly {
28287        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28288        where
28289            D: serde::Deserializer<'de>,
28290        {
28291            #[allow(non_camel_case_types)]
28292            #[doc(hidden)]
28293            #[derive(PartialEq, Eq, Hash)]
28294            enum __FieldTag {
28295                Unknown(std::string::String),
28296            }
28297            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
28298                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28299                where
28300                    D: serde::Deserializer<'de>,
28301                {
28302                    struct Visitor;
28303                    impl<'de> serde::de::Visitor<'de> for Visitor {
28304                        type Value = __FieldTag;
28305                        fn expecting(
28306                            &self,
28307                            formatter: &mut std::fmt::Formatter,
28308                        ) -> std::fmt::Result {
28309                            formatter.write_str("a field name for AppendOnly")
28310                        }
28311                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
28312                        where
28313                            E: serde::de::Error,
28314                        {
28315                            use std::result::Result::Ok;
28316                            use std::string::ToString;
28317                            Ok(__FieldTag::Unknown(value.to_string()))
28318                        }
28319                    }
28320                    deserializer.deserialize_identifier(Visitor)
28321                }
28322            }
28323            struct Visitor;
28324            impl<'de> serde::de::Visitor<'de> for Visitor {
28325                type Value = AppendOnly;
28326                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
28327                    formatter.write_str("struct AppendOnly")
28328                }
28329                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
28330                where
28331                    A: serde::de::MapAccess<'de>,
28332                {
28333                    #[allow(unused_imports)]
28334                    use serde::de::Error;
28335                    use std::option::Option::Some;
28336                    let mut result = Self::Value::new();
28337                    while let Some(tag) = map.next_key::<__FieldTag>()? {
28338                        #[allow(clippy::match_single_binding)]
28339                        match tag {
28340                            __FieldTag::Unknown(key) => {
28341                                let value = map.next_value::<serde_json::Value>()?;
28342                                result._unknown_fields.insert(key, value);
28343                            }
28344                        }
28345                    }
28346                    std::result::Result::Ok(result)
28347                }
28348            }
28349            deserializer.deserialize_any(Visitor)
28350        }
28351    }
28352
28353    #[doc(hidden)]
28354    impl serde::ser::Serialize for AppendOnly {
28355        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28356        where
28357            S: serde::ser::Serializer,
28358        {
28359            use serde::ser::SerializeMap;
28360            #[allow(unused_imports)]
28361            use std::option::Option::Some;
28362            let mut state = serializer.serialize_map(std::option::Option::None)?;
28363            if !self._unknown_fields.is_empty() {
28364                for (key, value) in self._unknown_fields.iter() {
28365                    state.serialize_entry(key, &value)?;
28366                }
28367            }
28368            state.end()
28369        }
28370    }
28371
28372    impl std::fmt::Debug for AppendOnly {
28373        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
28374            let mut debug_struct = f.debug_struct("AppendOnly");
28375            if !self._unknown_fields.is_empty() {
28376                debug_struct.field("_unknown_fields", &self._unknown_fields);
28377            }
28378            debug_struct.finish()
28379        }
28380    }
28381
28382    /// Merge mode defines that all changes to a table will be merged at the
28383    /// destination table.
28384    #[derive(Clone, Default, PartialEq)]
28385    #[non_exhaustive]
28386    pub struct Merge {
28387        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28388    }
28389
28390    impl Merge {
28391        pub fn new() -> Self {
28392            std::default::Default::default()
28393        }
28394    }
28395
28396    impl wkt::message::Message for Merge {
28397        fn typename() -> &'static str {
28398            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.Merge"
28399        }
28400    }
28401
28402    #[doc(hidden)]
28403    impl<'de> serde::de::Deserialize<'de> for Merge {
28404        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28405        where
28406            D: serde::Deserializer<'de>,
28407        {
28408            #[allow(non_camel_case_types)]
28409            #[doc(hidden)]
28410            #[derive(PartialEq, Eq, Hash)]
28411            enum __FieldTag {
28412                Unknown(std::string::String),
28413            }
28414            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
28415                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28416                where
28417                    D: serde::Deserializer<'de>,
28418                {
28419                    struct Visitor;
28420                    impl<'de> serde::de::Visitor<'de> for Visitor {
28421                        type Value = __FieldTag;
28422                        fn expecting(
28423                            &self,
28424                            formatter: &mut std::fmt::Formatter,
28425                        ) -> std::fmt::Result {
28426                            formatter.write_str("a field name for Merge")
28427                        }
28428                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
28429                        where
28430                            E: serde::de::Error,
28431                        {
28432                            use std::result::Result::Ok;
28433                            use std::string::ToString;
28434                            Ok(__FieldTag::Unknown(value.to_string()))
28435                        }
28436                    }
28437                    deserializer.deserialize_identifier(Visitor)
28438                }
28439            }
28440            struct Visitor;
28441            impl<'de> serde::de::Visitor<'de> for Visitor {
28442                type Value = Merge;
28443                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
28444                    formatter.write_str("struct Merge")
28445                }
28446                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
28447                where
28448                    A: serde::de::MapAccess<'de>,
28449                {
28450                    #[allow(unused_imports)]
28451                    use serde::de::Error;
28452                    use std::option::Option::Some;
28453                    let mut result = Self::Value::new();
28454                    while let Some(tag) = map.next_key::<__FieldTag>()? {
28455                        #[allow(clippy::match_single_binding)]
28456                        match tag {
28457                            __FieldTag::Unknown(key) => {
28458                                let value = map.next_value::<serde_json::Value>()?;
28459                                result._unknown_fields.insert(key, value);
28460                            }
28461                        }
28462                    }
28463                    std::result::Result::Ok(result)
28464                }
28465            }
28466            deserializer.deserialize_any(Visitor)
28467        }
28468    }
28469
28470    #[doc(hidden)]
28471    impl serde::ser::Serialize for Merge {
28472        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28473        where
28474            S: serde::ser::Serializer,
28475        {
28476            use serde::ser::SerializeMap;
28477            #[allow(unused_imports)]
28478            use std::option::Option::Some;
28479            let mut state = serializer.serialize_map(std::option::Option::None)?;
28480            if !self._unknown_fields.is_empty() {
28481                for (key, value) in self._unknown_fields.iter() {
28482                    state.serialize_entry(key, &value)?;
28483                }
28484            }
28485            state.end()
28486        }
28487    }
28488
28489    impl std::fmt::Debug for Merge {
28490        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
28491            let mut debug_struct = f.debug_struct("Merge");
28492            if !self._unknown_fields.is_empty() {
28493                debug_struct.field("_unknown_fields", &self._unknown_fields);
28494            }
28495            debug_struct.finish()
28496        }
28497    }
28498
28499    /// Target dataset(s) configuration.
28500    #[derive(Clone, Debug, PartialEq)]
28501    #[non_exhaustive]
28502    pub enum DatasetConfig {
28503        /// Single destination dataset.
28504        SingleTargetDataset(
28505            std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
28506        ),
28507        /// Source hierarchy datasets.
28508        SourceHierarchyDatasets(
28509            std::boxed::Box<crate::model::big_query_destination_config::SourceHierarchyDatasets>,
28510        ),
28511    }
28512
28513    #[derive(Clone, Debug, PartialEq)]
28514    #[non_exhaustive]
28515    pub enum WriteMode {
28516        /// The standard mode
28517        Merge(std::boxed::Box<crate::model::big_query_destination_config::Merge>),
28518        /// Append only mode
28519        AppendOnly(std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>),
28520    }
28521}
28522
28523/// The configuration of the stream destination.
28524#[derive(Clone, Default, PartialEq)]
28525#[non_exhaustive]
28526pub struct DestinationConfig {
28527    /// Required. Destination connection profile resource.
28528    /// Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
28529    pub destination_connection_profile: std::string::String,
28530
28531    /// Stream configuration that is specific to the data destination type.
28532    pub destination_stream_config:
28533        std::option::Option<crate::model::destination_config::DestinationStreamConfig>,
28534
28535    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28536}
28537
28538impl DestinationConfig {
28539    pub fn new() -> Self {
28540        std::default::Default::default()
28541    }
28542
28543    /// Sets the value of [destination_connection_profile][crate::model::DestinationConfig::destination_connection_profile].
28544    pub fn set_destination_connection_profile<T: std::convert::Into<std::string::String>>(
28545        mut self,
28546        v: T,
28547    ) -> Self {
28548        self.destination_connection_profile = v.into();
28549        self
28550    }
28551
28552    /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config].
28553    ///
28554    /// Note that all the setters affecting `destination_stream_config` are mutually
28555    /// exclusive.
28556    pub fn set_destination_stream_config<
28557        T: std::convert::Into<
28558                std::option::Option<crate::model::destination_config::DestinationStreamConfig>,
28559            >,
28560    >(
28561        mut self,
28562        v: T,
28563    ) -> Self {
28564        self.destination_stream_config = v.into();
28565        self
28566    }
28567
28568    /// The value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
28569    /// if it holds a `GcsDestinationConfig`, `None` if the field is not set or
28570    /// holds a different branch.
28571    pub fn gcs_destination_config(
28572        &self,
28573    ) -> std::option::Option<&std::boxed::Box<crate::model::GcsDestinationConfig>> {
28574        #[allow(unreachable_patterns)]
28575        self.destination_stream_config
28576            .as_ref()
28577            .and_then(|v| match v {
28578                crate::model::destination_config::DestinationStreamConfig::GcsDestinationConfig(
28579                    v,
28580                ) => std::option::Option::Some(v),
28581                _ => std::option::Option::None,
28582            })
28583    }
28584
28585    /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
28586    /// to hold a `GcsDestinationConfig`.
28587    ///
28588    /// Note that all the setters affecting `destination_stream_config` are
28589    /// mutually exclusive.
28590    pub fn set_gcs_destination_config<
28591        T: std::convert::Into<std::boxed::Box<crate::model::GcsDestinationConfig>>,
28592    >(
28593        mut self,
28594        v: T,
28595    ) -> Self {
28596        self.destination_stream_config = std::option::Option::Some(
28597            crate::model::destination_config::DestinationStreamConfig::GcsDestinationConfig(
28598                v.into(),
28599            ),
28600        );
28601        self
28602    }
28603
28604    /// The value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
28605    /// if it holds a `BigqueryDestinationConfig`, `None` if the field is not set or
28606    /// holds a different branch.
28607    pub fn bigquery_destination_config(
28608        &self,
28609    ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryDestinationConfig>> {
28610        #[allow(unreachable_patterns)]
28611        self.destination_stream_config.as_ref().and_then(|v| match v {
28612            crate::model::destination_config::DestinationStreamConfig::BigqueryDestinationConfig(v) => std::option::Option::Some(v),
28613            _ => std::option::Option::None,
28614        })
28615    }
28616
28617    /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
28618    /// to hold a `BigqueryDestinationConfig`.
28619    ///
28620    /// Note that all the setters affecting `destination_stream_config` are
28621    /// mutually exclusive.
28622    pub fn set_bigquery_destination_config<
28623        T: std::convert::Into<std::boxed::Box<crate::model::BigQueryDestinationConfig>>,
28624    >(
28625        mut self,
28626        v: T,
28627    ) -> Self {
28628        self.destination_stream_config = std::option::Option::Some(
28629            crate::model::destination_config::DestinationStreamConfig::BigqueryDestinationConfig(
28630                v.into(),
28631            ),
28632        );
28633        self
28634    }
28635}
28636
28637impl wkt::message::Message for DestinationConfig {
28638    fn typename() -> &'static str {
28639        "type.googleapis.com/google.cloud.datastream.v1.DestinationConfig"
28640    }
28641}
28642
28643#[doc(hidden)]
28644impl<'de> serde::de::Deserialize<'de> for DestinationConfig {
28645    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28646    where
28647        D: serde::Deserializer<'de>,
28648    {
28649        #[allow(non_camel_case_types)]
28650        #[doc(hidden)]
28651        #[derive(PartialEq, Eq, Hash)]
28652        enum __FieldTag {
28653            __destination_connection_profile,
28654            __gcs_destination_config,
28655            __bigquery_destination_config,
28656            Unknown(std::string::String),
28657        }
28658        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
28659            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28660            where
28661                D: serde::Deserializer<'de>,
28662            {
28663                struct Visitor;
28664                impl<'de> serde::de::Visitor<'de> for Visitor {
28665                    type Value = __FieldTag;
28666                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
28667                        formatter.write_str("a field name for DestinationConfig")
28668                    }
28669                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
28670                    where
28671                        E: serde::de::Error,
28672                    {
28673                        use std::result::Result::Ok;
28674                        use std::string::ToString;
28675                        match value {
28676                            "destinationConnectionProfile" => {
28677                                Ok(__FieldTag::__destination_connection_profile)
28678                            }
28679                            "destination_connection_profile" => {
28680                                Ok(__FieldTag::__destination_connection_profile)
28681                            }
28682                            "gcsDestinationConfig" => Ok(__FieldTag::__gcs_destination_config),
28683                            "gcs_destination_config" => Ok(__FieldTag::__gcs_destination_config),
28684                            "bigqueryDestinationConfig" => {
28685                                Ok(__FieldTag::__bigquery_destination_config)
28686                            }
28687                            "bigquery_destination_config" => {
28688                                Ok(__FieldTag::__bigquery_destination_config)
28689                            }
28690                            _ => Ok(__FieldTag::Unknown(value.to_string())),
28691                        }
28692                    }
28693                }
28694                deserializer.deserialize_identifier(Visitor)
28695            }
28696        }
28697        struct Visitor;
28698        impl<'de> serde::de::Visitor<'de> for Visitor {
28699            type Value = DestinationConfig;
28700            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
28701                formatter.write_str("struct DestinationConfig")
28702            }
28703            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
28704            where
28705                A: serde::de::MapAccess<'de>,
28706            {
28707                #[allow(unused_imports)]
28708                use serde::de::Error;
28709                use std::option::Option::Some;
28710                let mut fields = std::collections::HashSet::new();
28711                let mut result = Self::Value::new();
28712                while let Some(tag) = map.next_key::<__FieldTag>()? {
28713                    #[allow(clippy::match_single_binding)]
28714                    match tag {
28715                        __FieldTag::__destination_connection_profile => {
28716                            if !fields.insert(__FieldTag::__destination_connection_profile) {
28717                                return std::result::Result::Err(A::Error::duplicate_field(
28718                                    "multiple values for destination_connection_profile",
28719                                ));
28720                            }
28721                            result.destination_connection_profile = map
28722                                .next_value::<std::option::Option<std::string::String>>()?
28723                                .unwrap_or_default();
28724                        }
28725                        __FieldTag::__gcs_destination_config => {
28726                            if !fields.insert(__FieldTag::__gcs_destination_config) {
28727                                return std::result::Result::Err(A::Error::duplicate_field(
28728                                    "multiple values for gcs_destination_config",
28729                                ));
28730                            }
28731                            if result.destination_stream_config.is_some() {
28732                                return std::result::Result::Err(A::Error::duplicate_field(
28733                                    "multiple values for `destination_stream_config`, a oneof with full ID .google.cloud.datastream.v1.DestinationConfig.gcs_destination_config, latest field was gcsDestinationConfig",
28734                                ));
28735                            }
28736                            result.destination_stream_config = std::option::Option::Some(
28737                                crate::model::destination_config::DestinationStreamConfig::GcsDestinationConfig(
28738                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::GcsDestinationConfig>>>()?.unwrap_or_default()
28739                                ),
28740                            );
28741                        }
28742                        __FieldTag::__bigquery_destination_config => {
28743                            if !fields.insert(__FieldTag::__bigquery_destination_config) {
28744                                return std::result::Result::Err(A::Error::duplicate_field(
28745                                    "multiple values for bigquery_destination_config",
28746                                ));
28747                            }
28748                            if result.destination_stream_config.is_some() {
28749                                return std::result::Result::Err(A::Error::duplicate_field(
28750                                    "multiple values for `destination_stream_config`, a oneof with full ID .google.cloud.datastream.v1.DestinationConfig.bigquery_destination_config, latest field was bigqueryDestinationConfig",
28751                                ));
28752                            }
28753                            result.destination_stream_config = std::option::Option::Some(
28754                                crate::model::destination_config::DestinationStreamConfig::BigqueryDestinationConfig(
28755                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::BigQueryDestinationConfig>>>()?.unwrap_or_default()
28756                                ),
28757                            );
28758                        }
28759                        __FieldTag::Unknown(key) => {
28760                            let value = map.next_value::<serde_json::Value>()?;
28761                            result._unknown_fields.insert(key, value);
28762                        }
28763                    }
28764                }
28765                std::result::Result::Ok(result)
28766            }
28767        }
28768        deserializer.deserialize_any(Visitor)
28769    }
28770}
28771
28772#[doc(hidden)]
28773impl serde::ser::Serialize for DestinationConfig {
28774    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28775    where
28776        S: serde::ser::Serializer,
28777    {
28778        use serde::ser::SerializeMap;
28779        #[allow(unused_imports)]
28780        use std::option::Option::Some;
28781        let mut state = serializer.serialize_map(std::option::Option::None)?;
28782        if !self.destination_connection_profile.is_empty() {
28783            state.serialize_entry(
28784                "destinationConnectionProfile",
28785                &self.destination_connection_profile,
28786            )?;
28787        }
28788        if let Some(value) = self.gcs_destination_config() {
28789            state.serialize_entry("gcsDestinationConfig", value)?;
28790        }
28791        if let Some(value) = self.bigquery_destination_config() {
28792            state.serialize_entry("bigqueryDestinationConfig", value)?;
28793        }
28794        if !self._unknown_fields.is_empty() {
28795            for (key, value) in self._unknown_fields.iter() {
28796                state.serialize_entry(key, &value)?;
28797            }
28798        }
28799        state.end()
28800    }
28801}
28802
28803impl std::fmt::Debug for DestinationConfig {
28804    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
28805        let mut debug_struct = f.debug_struct("DestinationConfig");
28806        debug_struct.field(
28807            "destination_connection_profile",
28808            &self.destination_connection_profile,
28809        );
28810        debug_struct.field("destination_stream_config", &self.destination_stream_config);
28811        if !self._unknown_fields.is_empty() {
28812            debug_struct.field("_unknown_fields", &self._unknown_fields);
28813        }
28814        debug_struct.finish()
28815    }
28816}
28817
28818/// Defines additional types related to [DestinationConfig].
28819pub mod destination_config {
28820    #[allow(unused_imports)]
28821    use super::*;
28822
28823    /// Stream configuration that is specific to the data destination type.
28824    #[derive(Clone, Debug, PartialEq)]
28825    #[non_exhaustive]
28826    pub enum DestinationStreamConfig {
28827        /// A configuration for how data should be loaded to Cloud Storage.
28828        GcsDestinationConfig(std::boxed::Box<crate::model::GcsDestinationConfig>),
28829        /// BigQuery destination configuration.
28830        BigqueryDestinationConfig(std::boxed::Box<crate::model::BigQueryDestinationConfig>),
28831    }
28832}
28833
28834/// A resource representing streaming data from a source to a destination.
28835#[derive(Clone, Default, PartialEq)]
28836#[non_exhaustive]
28837pub struct Stream {
28838    /// Output only. Identifier. The stream's name.
28839    pub name: std::string::String,
28840
28841    /// Output only. The creation time of the stream.
28842    pub create_time: std::option::Option<wkt::Timestamp>,
28843
28844    /// Output only. The last update time of the stream.
28845    pub update_time: std::option::Option<wkt::Timestamp>,
28846
28847    /// Labels.
28848    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
28849
28850    /// Required. Display name.
28851    pub display_name: std::string::String,
28852
28853    /// Required. Source connection profile configuration.
28854    pub source_config: std::option::Option<crate::model::SourceConfig>,
28855
28856    /// Required. Destination connection profile configuration.
28857    pub destination_config: std::option::Option<crate::model::DestinationConfig>,
28858
28859    /// The state of the stream.
28860    pub state: crate::model::stream::State,
28861
28862    /// Output only. Errors on the Stream.
28863    pub errors: std::vec::Vec<crate::model::Error>,
28864
28865    /// Immutable. A reference to a KMS encryption key.
28866    /// If provided, it will be used to encrypt the data.
28867    /// If left blank, data will be encrypted using an internal Stream-specific
28868    /// encryption key provisioned through KMS.
28869    pub customer_managed_encryption_key: std::option::Option<std::string::String>,
28870
28871    /// Output only. If the stream was recovered, the time of the last recovery.
28872    /// Note: This field is currently experimental.
28873    pub last_recovery_time: std::option::Option<wkt::Timestamp>,
28874
28875    /// Output only. Reserved for future use.
28876    pub satisfies_pzs: std::option::Option<bool>,
28877
28878    /// Output only. Reserved for future use.
28879    pub satisfies_pzi: std::option::Option<bool>,
28880
28881    /// Stream backfill strategy.
28882    pub backfill_strategy: std::option::Option<crate::model::stream::BackfillStrategy>,
28883
28884    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28885}
28886
28887impl Stream {
28888    pub fn new() -> Self {
28889        std::default::Default::default()
28890    }
28891
28892    /// Sets the value of [name][crate::model::Stream::name].
28893    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28894        self.name = v.into();
28895        self
28896    }
28897
28898    /// Sets the value of [create_time][crate::model::Stream::create_time].
28899    pub fn set_create_time<T>(mut self, v: T) -> Self
28900    where
28901        T: std::convert::Into<wkt::Timestamp>,
28902    {
28903        self.create_time = std::option::Option::Some(v.into());
28904        self
28905    }
28906
28907    /// Sets or clears the value of [create_time][crate::model::Stream::create_time].
28908    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
28909    where
28910        T: std::convert::Into<wkt::Timestamp>,
28911    {
28912        self.create_time = v.map(|x| x.into());
28913        self
28914    }
28915
28916    /// Sets the value of [update_time][crate::model::Stream::update_time].
28917    pub fn set_update_time<T>(mut self, v: T) -> Self
28918    where
28919        T: std::convert::Into<wkt::Timestamp>,
28920    {
28921        self.update_time = std::option::Option::Some(v.into());
28922        self
28923    }
28924
28925    /// Sets or clears the value of [update_time][crate::model::Stream::update_time].
28926    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
28927    where
28928        T: std::convert::Into<wkt::Timestamp>,
28929    {
28930        self.update_time = v.map(|x| x.into());
28931        self
28932    }
28933
28934    /// Sets the value of [labels][crate::model::Stream::labels].
28935    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
28936    where
28937        T: std::iter::IntoIterator<Item = (K, V)>,
28938        K: std::convert::Into<std::string::String>,
28939        V: std::convert::Into<std::string::String>,
28940    {
28941        use std::iter::Iterator;
28942        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
28943        self
28944    }
28945
28946    /// Sets the value of [display_name][crate::model::Stream::display_name].
28947    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28948        self.display_name = v.into();
28949        self
28950    }
28951
28952    /// Sets the value of [source_config][crate::model::Stream::source_config].
28953    pub fn set_source_config<T>(mut self, v: T) -> Self
28954    where
28955        T: std::convert::Into<crate::model::SourceConfig>,
28956    {
28957        self.source_config = std::option::Option::Some(v.into());
28958        self
28959    }
28960
28961    /// Sets or clears the value of [source_config][crate::model::Stream::source_config].
28962    pub fn set_or_clear_source_config<T>(mut self, v: std::option::Option<T>) -> Self
28963    where
28964        T: std::convert::Into<crate::model::SourceConfig>,
28965    {
28966        self.source_config = v.map(|x| x.into());
28967        self
28968    }
28969
28970    /// Sets the value of [destination_config][crate::model::Stream::destination_config].
28971    pub fn set_destination_config<T>(mut self, v: T) -> Self
28972    where
28973        T: std::convert::Into<crate::model::DestinationConfig>,
28974    {
28975        self.destination_config = std::option::Option::Some(v.into());
28976        self
28977    }
28978
28979    /// Sets or clears the value of [destination_config][crate::model::Stream::destination_config].
28980    pub fn set_or_clear_destination_config<T>(mut self, v: std::option::Option<T>) -> Self
28981    where
28982        T: std::convert::Into<crate::model::DestinationConfig>,
28983    {
28984        self.destination_config = v.map(|x| x.into());
28985        self
28986    }
28987
28988    /// Sets the value of [state][crate::model::Stream::state].
28989    pub fn set_state<T: std::convert::Into<crate::model::stream::State>>(mut self, v: T) -> Self {
28990        self.state = v.into();
28991        self
28992    }
28993
28994    /// Sets the value of [errors][crate::model::Stream::errors].
28995    pub fn set_errors<T, V>(mut self, v: T) -> Self
28996    where
28997        T: std::iter::IntoIterator<Item = V>,
28998        V: std::convert::Into<crate::model::Error>,
28999    {
29000        use std::iter::Iterator;
29001        self.errors = v.into_iter().map(|i| i.into()).collect();
29002        self
29003    }
29004
29005    /// Sets the value of [customer_managed_encryption_key][crate::model::Stream::customer_managed_encryption_key].
29006    pub fn set_customer_managed_encryption_key<T>(mut self, v: T) -> Self
29007    where
29008        T: std::convert::Into<std::string::String>,
29009    {
29010        self.customer_managed_encryption_key = std::option::Option::Some(v.into());
29011        self
29012    }
29013
29014    /// Sets or clears the value of [customer_managed_encryption_key][crate::model::Stream::customer_managed_encryption_key].
29015    pub fn set_or_clear_customer_managed_encryption_key<T>(
29016        mut self,
29017        v: std::option::Option<T>,
29018    ) -> Self
29019    where
29020        T: std::convert::Into<std::string::String>,
29021    {
29022        self.customer_managed_encryption_key = v.map(|x| x.into());
29023        self
29024    }
29025
29026    /// Sets the value of [last_recovery_time][crate::model::Stream::last_recovery_time].
29027    pub fn set_last_recovery_time<T>(mut self, v: T) -> Self
29028    where
29029        T: std::convert::Into<wkt::Timestamp>,
29030    {
29031        self.last_recovery_time = std::option::Option::Some(v.into());
29032        self
29033    }
29034
29035    /// Sets or clears the value of [last_recovery_time][crate::model::Stream::last_recovery_time].
29036    pub fn set_or_clear_last_recovery_time<T>(mut self, v: std::option::Option<T>) -> Self
29037    where
29038        T: std::convert::Into<wkt::Timestamp>,
29039    {
29040        self.last_recovery_time = v.map(|x| x.into());
29041        self
29042    }
29043
29044    /// Sets the value of [satisfies_pzs][crate::model::Stream::satisfies_pzs].
29045    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
29046    where
29047        T: std::convert::Into<bool>,
29048    {
29049        self.satisfies_pzs = std::option::Option::Some(v.into());
29050        self
29051    }
29052
29053    /// Sets or clears the value of [satisfies_pzs][crate::model::Stream::satisfies_pzs].
29054    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
29055    where
29056        T: std::convert::Into<bool>,
29057    {
29058        self.satisfies_pzs = v.map(|x| x.into());
29059        self
29060    }
29061
29062    /// Sets the value of [satisfies_pzi][crate::model::Stream::satisfies_pzi].
29063    pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
29064    where
29065        T: std::convert::Into<bool>,
29066    {
29067        self.satisfies_pzi = std::option::Option::Some(v.into());
29068        self
29069    }
29070
29071    /// Sets or clears the value of [satisfies_pzi][crate::model::Stream::satisfies_pzi].
29072    pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
29073    where
29074        T: std::convert::Into<bool>,
29075    {
29076        self.satisfies_pzi = v.map(|x| x.into());
29077        self
29078    }
29079
29080    /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy].
29081    ///
29082    /// Note that all the setters affecting `backfill_strategy` are mutually
29083    /// exclusive.
29084    pub fn set_backfill_strategy<
29085        T: std::convert::Into<std::option::Option<crate::model::stream::BackfillStrategy>>,
29086    >(
29087        mut self,
29088        v: T,
29089    ) -> Self {
29090        self.backfill_strategy = v.into();
29091        self
29092    }
29093
29094    /// The value of [backfill_strategy][crate::model::Stream::backfill_strategy]
29095    /// if it holds a `BackfillAll`, `None` if the field is not set or
29096    /// holds a different branch.
29097    pub fn backfill_all(
29098        &self,
29099    ) -> std::option::Option<&std::boxed::Box<crate::model::stream::BackfillAllStrategy>> {
29100        #[allow(unreachable_patterns)]
29101        self.backfill_strategy.as_ref().and_then(|v| match v {
29102            crate::model::stream::BackfillStrategy::BackfillAll(v) => std::option::Option::Some(v),
29103            _ => std::option::Option::None,
29104        })
29105    }
29106
29107    /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy]
29108    /// to hold a `BackfillAll`.
29109    ///
29110    /// Note that all the setters affecting `backfill_strategy` are
29111    /// mutually exclusive.
29112    pub fn set_backfill_all<
29113        T: std::convert::Into<std::boxed::Box<crate::model::stream::BackfillAllStrategy>>,
29114    >(
29115        mut self,
29116        v: T,
29117    ) -> Self {
29118        self.backfill_strategy = std::option::Option::Some(
29119            crate::model::stream::BackfillStrategy::BackfillAll(v.into()),
29120        );
29121        self
29122    }
29123
29124    /// The value of [backfill_strategy][crate::model::Stream::backfill_strategy]
29125    /// if it holds a `BackfillNone`, `None` if the field is not set or
29126    /// holds a different branch.
29127    pub fn backfill_none(
29128        &self,
29129    ) -> std::option::Option<&std::boxed::Box<crate::model::stream::BackfillNoneStrategy>> {
29130        #[allow(unreachable_patterns)]
29131        self.backfill_strategy.as_ref().and_then(|v| match v {
29132            crate::model::stream::BackfillStrategy::BackfillNone(v) => std::option::Option::Some(v),
29133            _ => std::option::Option::None,
29134        })
29135    }
29136
29137    /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy]
29138    /// to hold a `BackfillNone`.
29139    ///
29140    /// Note that all the setters affecting `backfill_strategy` are
29141    /// mutually exclusive.
29142    pub fn set_backfill_none<
29143        T: std::convert::Into<std::boxed::Box<crate::model::stream::BackfillNoneStrategy>>,
29144    >(
29145        mut self,
29146        v: T,
29147    ) -> Self {
29148        self.backfill_strategy = std::option::Option::Some(
29149            crate::model::stream::BackfillStrategy::BackfillNone(v.into()),
29150        );
29151        self
29152    }
29153}
29154
29155impl wkt::message::Message for Stream {
29156    fn typename() -> &'static str {
29157        "type.googleapis.com/google.cloud.datastream.v1.Stream"
29158    }
29159}
29160
29161#[doc(hidden)]
29162impl<'de> serde::de::Deserialize<'de> for Stream {
29163    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29164    where
29165        D: serde::Deserializer<'de>,
29166    {
29167        #[allow(non_camel_case_types)]
29168        #[doc(hidden)]
29169        #[derive(PartialEq, Eq, Hash)]
29170        enum __FieldTag {
29171            __name,
29172            __create_time,
29173            __update_time,
29174            __labels,
29175            __display_name,
29176            __source_config,
29177            __destination_config,
29178            __state,
29179            __backfill_all,
29180            __backfill_none,
29181            __errors,
29182            __customer_managed_encryption_key,
29183            __last_recovery_time,
29184            __satisfies_pzs,
29185            __satisfies_pzi,
29186            Unknown(std::string::String),
29187        }
29188        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
29189            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29190            where
29191                D: serde::Deserializer<'de>,
29192            {
29193                struct Visitor;
29194                impl<'de> serde::de::Visitor<'de> for Visitor {
29195                    type Value = __FieldTag;
29196                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
29197                        formatter.write_str("a field name for Stream")
29198                    }
29199                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
29200                    where
29201                        E: serde::de::Error,
29202                    {
29203                        use std::result::Result::Ok;
29204                        use std::string::ToString;
29205                        match value {
29206                            "name" => Ok(__FieldTag::__name),
29207                            "createTime" => Ok(__FieldTag::__create_time),
29208                            "create_time" => Ok(__FieldTag::__create_time),
29209                            "updateTime" => Ok(__FieldTag::__update_time),
29210                            "update_time" => Ok(__FieldTag::__update_time),
29211                            "labels" => Ok(__FieldTag::__labels),
29212                            "displayName" => Ok(__FieldTag::__display_name),
29213                            "display_name" => Ok(__FieldTag::__display_name),
29214                            "sourceConfig" => Ok(__FieldTag::__source_config),
29215                            "source_config" => Ok(__FieldTag::__source_config),
29216                            "destinationConfig" => Ok(__FieldTag::__destination_config),
29217                            "destination_config" => Ok(__FieldTag::__destination_config),
29218                            "state" => Ok(__FieldTag::__state),
29219                            "backfillAll" => Ok(__FieldTag::__backfill_all),
29220                            "backfill_all" => Ok(__FieldTag::__backfill_all),
29221                            "backfillNone" => Ok(__FieldTag::__backfill_none),
29222                            "backfill_none" => Ok(__FieldTag::__backfill_none),
29223                            "errors" => Ok(__FieldTag::__errors),
29224                            "customerManagedEncryptionKey" => {
29225                                Ok(__FieldTag::__customer_managed_encryption_key)
29226                            }
29227                            "customer_managed_encryption_key" => {
29228                                Ok(__FieldTag::__customer_managed_encryption_key)
29229                            }
29230                            "lastRecoveryTime" => Ok(__FieldTag::__last_recovery_time),
29231                            "last_recovery_time" => Ok(__FieldTag::__last_recovery_time),
29232                            "satisfiesPzs" => Ok(__FieldTag::__satisfies_pzs),
29233                            "satisfies_pzs" => Ok(__FieldTag::__satisfies_pzs),
29234                            "satisfiesPzi" => Ok(__FieldTag::__satisfies_pzi),
29235                            "satisfies_pzi" => Ok(__FieldTag::__satisfies_pzi),
29236                            _ => Ok(__FieldTag::Unknown(value.to_string())),
29237                        }
29238                    }
29239                }
29240                deserializer.deserialize_identifier(Visitor)
29241            }
29242        }
29243        struct Visitor;
29244        impl<'de> serde::de::Visitor<'de> for Visitor {
29245            type Value = Stream;
29246            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
29247                formatter.write_str("struct Stream")
29248            }
29249            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
29250            where
29251                A: serde::de::MapAccess<'de>,
29252            {
29253                #[allow(unused_imports)]
29254                use serde::de::Error;
29255                use std::option::Option::Some;
29256                let mut fields = std::collections::HashSet::new();
29257                let mut result = Self::Value::new();
29258                while let Some(tag) = map.next_key::<__FieldTag>()? {
29259                    #[allow(clippy::match_single_binding)]
29260                    match tag {
29261                        __FieldTag::__name => {
29262                            if !fields.insert(__FieldTag::__name) {
29263                                return std::result::Result::Err(A::Error::duplicate_field(
29264                                    "multiple values for name",
29265                                ));
29266                            }
29267                            result.name = map
29268                                .next_value::<std::option::Option<std::string::String>>()?
29269                                .unwrap_or_default();
29270                        }
29271                        __FieldTag::__create_time => {
29272                            if !fields.insert(__FieldTag::__create_time) {
29273                                return std::result::Result::Err(A::Error::duplicate_field(
29274                                    "multiple values for create_time",
29275                                ));
29276                            }
29277                            result.create_time =
29278                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
29279                        }
29280                        __FieldTag::__update_time => {
29281                            if !fields.insert(__FieldTag::__update_time) {
29282                                return std::result::Result::Err(A::Error::duplicate_field(
29283                                    "multiple values for update_time",
29284                                ));
29285                            }
29286                            result.update_time =
29287                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
29288                        }
29289                        __FieldTag::__labels => {
29290                            if !fields.insert(__FieldTag::__labels) {
29291                                return std::result::Result::Err(A::Error::duplicate_field(
29292                                    "multiple values for labels",
29293                                ));
29294                            }
29295                            result.labels = map
29296                                .next_value::<std::option::Option<
29297                                    std::collections::HashMap<
29298                                        std::string::String,
29299                                        std::string::String,
29300                                    >,
29301                                >>()?
29302                                .unwrap_or_default();
29303                        }
29304                        __FieldTag::__display_name => {
29305                            if !fields.insert(__FieldTag::__display_name) {
29306                                return std::result::Result::Err(A::Error::duplicate_field(
29307                                    "multiple values for display_name",
29308                                ));
29309                            }
29310                            result.display_name = map
29311                                .next_value::<std::option::Option<std::string::String>>()?
29312                                .unwrap_or_default();
29313                        }
29314                        __FieldTag::__source_config => {
29315                            if !fields.insert(__FieldTag::__source_config) {
29316                                return std::result::Result::Err(A::Error::duplicate_field(
29317                                    "multiple values for source_config",
29318                                ));
29319                            }
29320                            result.source_config = map
29321                                .next_value::<std::option::Option<crate::model::SourceConfig>>()?;
29322                        }
29323                        __FieldTag::__destination_config => {
29324                            if !fields.insert(__FieldTag::__destination_config) {
29325                                return std::result::Result::Err(A::Error::duplicate_field(
29326                                    "multiple values for destination_config",
29327                                ));
29328                            }
29329                            result.destination_config = map
29330                                .next_value::<std::option::Option<crate::model::DestinationConfig>>(
29331                                )?;
29332                        }
29333                        __FieldTag::__state => {
29334                            if !fields.insert(__FieldTag::__state) {
29335                                return std::result::Result::Err(A::Error::duplicate_field(
29336                                    "multiple values for state",
29337                                ));
29338                            }
29339                            result.state = map
29340                                .next_value::<std::option::Option<crate::model::stream::State>>()?
29341                                .unwrap_or_default();
29342                        }
29343                        __FieldTag::__backfill_all => {
29344                            if !fields.insert(__FieldTag::__backfill_all) {
29345                                return std::result::Result::Err(A::Error::duplicate_field(
29346                                    "multiple values for backfill_all",
29347                                ));
29348                            }
29349                            if result.backfill_strategy.is_some() {
29350                                return std::result::Result::Err(A::Error::duplicate_field(
29351                                    "multiple values for `backfill_strategy`, a oneof with full ID .google.cloud.datastream.v1.Stream.backfill_all, latest field was backfillAll",
29352                                ));
29353                            }
29354                            result.backfill_strategy = std::option::Option::Some(
29355                                crate::model::stream::BackfillStrategy::BackfillAll(
29356                                    map.next_value::<std::option::Option<
29357                                        std::boxed::Box<crate::model::stream::BackfillAllStrategy>,
29358                                    >>()?
29359                                    .unwrap_or_default(),
29360                                ),
29361                            );
29362                        }
29363                        __FieldTag::__backfill_none => {
29364                            if !fields.insert(__FieldTag::__backfill_none) {
29365                                return std::result::Result::Err(A::Error::duplicate_field(
29366                                    "multiple values for backfill_none",
29367                                ));
29368                            }
29369                            if result.backfill_strategy.is_some() {
29370                                return std::result::Result::Err(A::Error::duplicate_field(
29371                                    "multiple values for `backfill_strategy`, a oneof with full ID .google.cloud.datastream.v1.Stream.backfill_none, latest field was backfillNone",
29372                                ));
29373                            }
29374                            result.backfill_strategy = std::option::Option::Some(
29375                                crate::model::stream::BackfillStrategy::BackfillNone(
29376                                    map.next_value::<std::option::Option<
29377                                        std::boxed::Box<crate::model::stream::BackfillNoneStrategy>,
29378                                    >>()?
29379                                    .unwrap_or_default(),
29380                                ),
29381                            );
29382                        }
29383                        __FieldTag::__errors => {
29384                            if !fields.insert(__FieldTag::__errors) {
29385                                return std::result::Result::Err(A::Error::duplicate_field(
29386                                    "multiple values for errors",
29387                                ));
29388                            }
29389                            result.errors = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Error>>>()?.unwrap_or_default();
29390                        }
29391                        __FieldTag::__customer_managed_encryption_key => {
29392                            if !fields.insert(__FieldTag::__customer_managed_encryption_key) {
29393                                return std::result::Result::Err(A::Error::duplicate_field(
29394                                    "multiple values for customer_managed_encryption_key",
29395                                ));
29396                            }
29397                            result.customer_managed_encryption_key =
29398                                map.next_value::<std::option::Option<std::string::String>>()?;
29399                        }
29400                        __FieldTag::__last_recovery_time => {
29401                            if !fields.insert(__FieldTag::__last_recovery_time) {
29402                                return std::result::Result::Err(A::Error::duplicate_field(
29403                                    "multiple values for last_recovery_time",
29404                                ));
29405                            }
29406                            result.last_recovery_time =
29407                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
29408                        }
29409                        __FieldTag::__satisfies_pzs => {
29410                            if !fields.insert(__FieldTag::__satisfies_pzs) {
29411                                return std::result::Result::Err(A::Error::duplicate_field(
29412                                    "multiple values for satisfies_pzs",
29413                                ));
29414                            }
29415                            result.satisfies_pzs = map.next_value::<std::option::Option<bool>>()?;
29416                        }
29417                        __FieldTag::__satisfies_pzi => {
29418                            if !fields.insert(__FieldTag::__satisfies_pzi) {
29419                                return std::result::Result::Err(A::Error::duplicate_field(
29420                                    "multiple values for satisfies_pzi",
29421                                ));
29422                            }
29423                            result.satisfies_pzi = map.next_value::<std::option::Option<bool>>()?;
29424                        }
29425                        __FieldTag::Unknown(key) => {
29426                            let value = map.next_value::<serde_json::Value>()?;
29427                            result._unknown_fields.insert(key, value);
29428                        }
29429                    }
29430                }
29431                std::result::Result::Ok(result)
29432            }
29433        }
29434        deserializer.deserialize_any(Visitor)
29435    }
29436}
29437
29438#[doc(hidden)]
29439impl serde::ser::Serialize for Stream {
29440    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29441    where
29442        S: serde::ser::Serializer,
29443    {
29444        use serde::ser::SerializeMap;
29445        #[allow(unused_imports)]
29446        use std::option::Option::Some;
29447        let mut state = serializer.serialize_map(std::option::Option::None)?;
29448        if !self.name.is_empty() {
29449            state.serialize_entry("name", &self.name)?;
29450        }
29451        if self.create_time.is_some() {
29452            state.serialize_entry("createTime", &self.create_time)?;
29453        }
29454        if self.update_time.is_some() {
29455            state.serialize_entry("updateTime", &self.update_time)?;
29456        }
29457        if !self.labels.is_empty() {
29458            state.serialize_entry("labels", &self.labels)?;
29459        }
29460        if !self.display_name.is_empty() {
29461            state.serialize_entry("displayName", &self.display_name)?;
29462        }
29463        if self.source_config.is_some() {
29464            state.serialize_entry("sourceConfig", &self.source_config)?;
29465        }
29466        if self.destination_config.is_some() {
29467            state.serialize_entry("destinationConfig", &self.destination_config)?;
29468        }
29469        if !wkt::internal::is_default(&self.state) {
29470            state.serialize_entry("state", &self.state)?;
29471        }
29472        if let Some(value) = self.backfill_all() {
29473            state.serialize_entry("backfillAll", value)?;
29474        }
29475        if let Some(value) = self.backfill_none() {
29476            state.serialize_entry("backfillNone", value)?;
29477        }
29478        if !self.errors.is_empty() {
29479            state.serialize_entry("errors", &self.errors)?;
29480        }
29481        if self.customer_managed_encryption_key.is_some() {
29482            state.serialize_entry(
29483                "customerManagedEncryptionKey",
29484                &self.customer_managed_encryption_key,
29485            )?;
29486        }
29487        if self.last_recovery_time.is_some() {
29488            state.serialize_entry("lastRecoveryTime", &self.last_recovery_time)?;
29489        }
29490        if self.satisfies_pzs.is_some() {
29491            state.serialize_entry("satisfiesPzs", &self.satisfies_pzs)?;
29492        }
29493        if self.satisfies_pzi.is_some() {
29494            state.serialize_entry("satisfiesPzi", &self.satisfies_pzi)?;
29495        }
29496        if !self._unknown_fields.is_empty() {
29497            for (key, value) in self._unknown_fields.iter() {
29498                state.serialize_entry(key, &value)?;
29499            }
29500        }
29501        state.end()
29502    }
29503}
29504
29505impl std::fmt::Debug for Stream {
29506    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
29507        let mut debug_struct = f.debug_struct("Stream");
29508        debug_struct.field("name", &self.name);
29509        debug_struct.field("create_time", &self.create_time);
29510        debug_struct.field("update_time", &self.update_time);
29511        debug_struct.field("labels", &self.labels);
29512        debug_struct.field("display_name", &self.display_name);
29513        debug_struct.field("source_config", &self.source_config);
29514        debug_struct.field("destination_config", &self.destination_config);
29515        debug_struct.field("state", &self.state);
29516        debug_struct.field("errors", &self.errors);
29517        debug_struct.field(
29518            "customer_managed_encryption_key",
29519            &self.customer_managed_encryption_key,
29520        );
29521        debug_struct.field("last_recovery_time", &self.last_recovery_time);
29522        debug_struct.field("satisfies_pzs", &self.satisfies_pzs);
29523        debug_struct.field("satisfies_pzi", &self.satisfies_pzi);
29524        debug_struct.field("backfill_strategy", &self.backfill_strategy);
29525        if !self._unknown_fields.is_empty() {
29526            debug_struct.field("_unknown_fields", &self._unknown_fields);
29527        }
29528        debug_struct.finish()
29529    }
29530}
29531
29532/// Defines additional types related to [Stream].
29533pub mod stream {
29534    #[allow(unused_imports)]
29535    use super::*;
29536
29537    /// Backfill strategy to automatically backfill the Stream's objects.
29538    /// Specific objects can be excluded.
29539    #[derive(Clone, Default, PartialEq)]
29540    #[non_exhaustive]
29541    pub struct BackfillAllStrategy {
29542        /// List of objects to exclude.
29543        pub excluded_objects:
29544            std::option::Option<crate::model::stream::backfill_all_strategy::ExcludedObjects>,
29545
29546        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29547    }
29548
29549    impl BackfillAllStrategy {
29550        pub fn new() -> Self {
29551            std::default::Default::default()
29552        }
29553
29554        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects].
29555        ///
29556        /// Note that all the setters affecting `excluded_objects` are mutually
29557        /// exclusive.
29558        pub fn set_excluded_objects<
29559            T: std::convert::Into<
29560                    std::option::Option<
29561                        crate::model::stream::backfill_all_strategy::ExcludedObjects,
29562                    >,
29563                >,
29564        >(
29565            mut self,
29566            v: T,
29567        ) -> Self {
29568            self.excluded_objects = v.into();
29569            self
29570        }
29571
29572        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
29573        /// if it holds a `OracleExcludedObjects`, `None` if the field is not set or
29574        /// holds a different branch.
29575        pub fn oracle_excluded_objects(
29576            &self,
29577        ) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
29578            #[allow(unreachable_patterns)]
29579            self.excluded_objects.as_ref().and_then(|v| match v {
29580                crate::model::stream::backfill_all_strategy::ExcludedObjects::OracleExcludedObjects(v) => std::option::Option::Some(v),
29581                _ => std::option::Option::None,
29582            })
29583        }
29584
29585        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
29586        /// to hold a `OracleExcludedObjects`.
29587        ///
29588        /// Note that all the setters affecting `excluded_objects` are
29589        /// mutually exclusive.
29590        pub fn set_oracle_excluded_objects<
29591            T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>,
29592        >(
29593            mut self,
29594            v: T,
29595        ) -> Self {
29596            self.excluded_objects = std::option::Option::Some(
29597                crate::model::stream::backfill_all_strategy::ExcludedObjects::OracleExcludedObjects(
29598                    v.into(),
29599                ),
29600            );
29601            self
29602        }
29603
29604        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
29605        /// if it holds a `MysqlExcludedObjects`, `None` if the field is not set or
29606        /// holds a different branch.
29607        pub fn mysql_excluded_objects(
29608            &self,
29609        ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
29610            #[allow(unreachable_patterns)]
29611            self.excluded_objects.as_ref().and_then(|v| match v {
29612                crate::model::stream::backfill_all_strategy::ExcludedObjects::MysqlExcludedObjects(v) => std::option::Option::Some(v),
29613                _ => std::option::Option::None,
29614            })
29615        }
29616
29617        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
29618        /// to hold a `MysqlExcludedObjects`.
29619        ///
29620        /// Note that all the setters affecting `excluded_objects` are
29621        /// mutually exclusive.
29622        pub fn set_mysql_excluded_objects<
29623            T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>,
29624        >(
29625            mut self,
29626            v: T,
29627        ) -> Self {
29628            self.excluded_objects = std::option::Option::Some(
29629                crate::model::stream::backfill_all_strategy::ExcludedObjects::MysqlExcludedObjects(
29630                    v.into(),
29631                ),
29632            );
29633            self
29634        }
29635
29636        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
29637        /// if it holds a `PostgresqlExcludedObjects`, `None` if the field is not set or
29638        /// holds a different branch.
29639        pub fn postgresql_excluded_objects(
29640            &self,
29641        ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
29642            #[allow(unreachable_patterns)]
29643            self.excluded_objects.as_ref().and_then(|v| match v {
29644                crate::model::stream::backfill_all_strategy::ExcludedObjects::PostgresqlExcludedObjects(v) => std::option::Option::Some(v),
29645                _ => std::option::Option::None,
29646            })
29647        }
29648
29649        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
29650        /// to hold a `PostgresqlExcludedObjects`.
29651        ///
29652        /// Note that all the setters affecting `excluded_objects` are
29653        /// mutually exclusive.
29654        pub fn set_postgresql_excluded_objects<
29655            T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
29656        >(
29657            mut self,
29658            v: T,
29659        ) -> Self {
29660            self.excluded_objects = std::option::Option::Some(
29661                crate::model::stream::backfill_all_strategy::ExcludedObjects::PostgresqlExcludedObjects(
29662                    v.into()
29663                )
29664            );
29665            self
29666        }
29667
29668        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
29669        /// if it holds a `SqlServerExcludedObjects`, `None` if the field is not set or
29670        /// holds a different branch.
29671        pub fn sql_server_excluded_objects(
29672            &self,
29673        ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
29674            #[allow(unreachable_patterns)]
29675            self.excluded_objects.as_ref().and_then(|v| match v {
29676                crate::model::stream::backfill_all_strategy::ExcludedObjects::SqlServerExcludedObjects(v) => std::option::Option::Some(v),
29677                _ => std::option::Option::None,
29678            })
29679        }
29680
29681        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
29682        /// to hold a `SqlServerExcludedObjects`.
29683        ///
29684        /// Note that all the setters affecting `excluded_objects` are
29685        /// mutually exclusive.
29686        pub fn set_sql_server_excluded_objects<
29687            T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
29688        >(
29689            mut self,
29690            v: T,
29691        ) -> Self {
29692            self.excluded_objects = std::option::Option::Some(
29693                crate::model::stream::backfill_all_strategy::ExcludedObjects::SqlServerExcludedObjects(
29694                    v.into()
29695                )
29696            );
29697            self
29698        }
29699
29700        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
29701        /// if it holds a `SalesforceExcludedObjects`, `None` if the field is not set or
29702        /// holds a different branch.
29703        pub fn salesforce_excluded_objects(
29704            &self,
29705        ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceOrg>> {
29706            #[allow(unreachable_patterns)]
29707            self.excluded_objects.as_ref().and_then(|v| match v {
29708                crate::model::stream::backfill_all_strategy::ExcludedObjects::SalesforceExcludedObjects(v) => std::option::Option::Some(v),
29709                _ => std::option::Option::None,
29710            })
29711        }
29712
29713        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
29714        /// to hold a `SalesforceExcludedObjects`.
29715        ///
29716        /// Note that all the setters affecting `excluded_objects` are
29717        /// mutually exclusive.
29718        pub fn set_salesforce_excluded_objects<
29719            T: std::convert::Into<std::boxed::Box<crate::model::SalesforceOrg>>,
29720        >(
29721            mut self,
29722            v: T,
29723        ) -> Self {
29724            self.excluded_objects = std::option::Option::Some(
29725                crate::model::stream::backfill_all_strategy::ExcludedObjects::SalesforceExcludedObjects(
29726                    v.into()
29727                )
29728            );
29729            self
29730        }
29731
29732        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
29733        /// if it holds a `MongodbExcludedObjects`, `None` if the field is not set or
29734        /// holds a different branch.
29735        pub fn mongodb_excluded_objects(
29736            &self,
29737        ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbCluster>> {
29738            #[allow(unreachable_patterns)]
29739            self.excluded_objects.as_ref().and_then(|v| match v {
29740                crate::model::stream::backfill_all_strategy::ExcludedObjects::MongodbExcludedObjects(v) => std::option::Option::Some(v),
29741                _ => std::option::Option::None,
29742            })
29743        }
29744
29745        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
29746        /// to hold a `MongodbExcludedObjects`.
29747        ///
29748        /// Note that all the setters affecting `excluded_objects` are
29749        /// mutually exclusive.
29750        pub fn set_mongodb_excluded_objects<
29751            T: std::convert::Into<std::boxed::Box<crate::model::MongodbCluster>>,
29752        >(
29753            mut self,
29754            v: T,
29755        ) -> Self {
29756            self.excluded_objects = std::option::Option::Some(
29757                crate::model::stream::backfill_all_strategy::ExcludedObjects::MongodbExcludedObjects(
29758                    v.into()
29759                )
29760            );
29761            self
29762        }
29763    }
29764
29765    impl wkt::message::Message for BackfillAllStrategy {
29766        fn typename() -> &'static str {
29767            "type.googleapis.com/google.cloud.datastream.v1.Stream.BackfillAllStrategy"
29768        }
29769    }
29770
29771    #[doc(hidden)]
29772    impl<'de> serde::de::Deserialize<'de> for BackfillAllStrategy {
29773        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29774        where
29775            D: serde::Deserializer<'de>,
29776        {
29777            #[allow(non_camel_case_types)]
29778            #[doc(hidden)]
29779            #[derive(PartialEq, Eq, Hash)]
29780            enum __FieldTag {
29781                __oracle_excluded_objects,
29782                __mysql_excluded_objects,
29783                __postgresql_excluded_objects,
29784                __sql_server_excluded_objects,
29785                __salesforce_excluded_objects,
29786                __mongodb_excluded_objects,
29787                Unknown(std::string::String),
29788            }
29789            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
29790                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29791                where
29792                    D: serde::Deserializer<'de>,
29793                {
29794                    struct Visitor;
29795                    impl<'de> serde::de::Visitor<'de> for Visitor {
29796                        type Value = __FieldTag;
29797                        fn expecting(
29798                            &self,
29799                            formatter: &mut std::fmt::Formatter,
29800                        ) -> std::fmt::Result {
29801                            formatter.write_str("a field name for BackfillAllStrategy")
29802                        }
29803                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
29804                        where
29805                            E: serde::de::Error,
29806                        {
29807                            use std::result::Result::Ok;
29808                            use std::string::ToString;
29809                            match value {
29810                                "oracleExcludedObjects" => {
29811                                    Ok(__FieldTag::__oracle_excluded_objects)
29812                                }
29813                                "oracle_excluded_objects" => {
29814                                    Ok(__FieldTag::__oracle_excluded_objects)
29815                                }
29816                                "mysqlExcludedObjects" => Ok(__FieldTag::__mysql_excluded_objects),
29817                                "mysql_excluded_objects" => {
29818                                    Ok(__FieldTag::__mysql_excluded_objects)
29819                                }
29820                                "postgresqlExcludedObjects" => {
29821                                    Ok(__FieldTag::__postgresql_excluded_objects)
29822                                }
29823                                "postgresql_excluded_objects" => {
29824                                    Ok(__FieldTag::__postgresql_excluded_objects)
29825                                }
29826                                "sqlServerExcludedObjects" => {
29827                                    Ok(__FieldTag::__sql_server_excluded_objects)
29828                                }
29829                                "sql_server_excluded_objects" => {
29830                                    Ok(__FieldTag::__sql_server_excluded_objects)
29831                                }
29832                                "salesforceExcludedObjects" => {
29833                                    Ok(__FieldTag::__salesforce_excluded_objects)
29834                                }
29835                                "salesforce_excluded_objects" => {
29836                                    Ok(__FieldTag::__salesforce_excluded_objects)
29837                                }
29838                                "mongodbExcludedObjects" => {
29839                                    Ok(__FieldTag::__mongodb_excluded_objects)
29840                                }
29841                                "mongodb_excluded_objects" => {
29842                                    Ok(__FieldTag::__mongodb_excluded_objects)
29843                                }
29844                                _ => Ok(__FieldTag::Unknown(value.to_string())),
29845                            }
29846                        }
29847                    }
29848                    deserializer.deserialize_identifier(Visitor)
29849                }
29850            }
29851            struct Visitor;
29852            impl<'de> serde::de::Visitor<'de> for Visitor {
29853                type Value = BackfillAllStrategy;
29854                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
29855                    formatter.write_str("struct BackfillAllStrategy")
29856                }
29857                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
29858                where
29859                    A: serde::de::MapAccess<'de>,
29860                {
29861                    #[allow(unused_imports)]
29862                    use serde::de::Error;
29863                    use std::option::Option::Some;
29864                    let mut fields = std::collections::HashSet::new();
29865                    let mut result = Self::Value::new();
29866                    while let Some(tag) = map.next_key::<__FieldTag>()? {
29867                        #[allow(clippy::match_single_binding)]
29868                        match tag {
29869                            __FieldTag::__oracle_excluded_objects => {
29870                                if !fields.insert(__FieldTag::__oracle_excluded_objects) {
29871                                    return std::result::Result::Err(A::Error::duplicate_field(
29872                                        "multiple values for oracle_excluded_objects",
29873                                    ));
29874                                }
29875                                if result.excluded_objects.is_some() {
29876                                    return std::result::Result::Err(A::Error::duplicate_field(
29877                                        "multiple values for `excluded_objects`, a oneof with full ID .google.cloud.datastream.v1.Stream.BackfillAllStrategy.oracle_excluded_objects, latest field was oracleExcludedObjects",
29878                                    ));
29879                                }
29880                                result.excluded_objects = std::option::Option::Some(
29881                                    crate::model::stream::backfill_all_strategy::ExcludedObjects::OracleExcludedObjects(
29882                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::OracleRdbms>>>()?.unwrap_or_default()
29883                                    ),
29884                                );
29885                            }
29886                            __FieldTag::__mysql_excluded_objects => {
29887                                if !fields.insert(__FieldTag::__mysql_excluded_objects) {
29888                                    return std::result::Result::Err(A::Error::duplicate_field(
29889                                        "multiple values for mysql_excluded_objects",
29890                                    ));
29891                                }
29892                                if result.excluded_objects.is_some() {
29893                                    return std::result::Result::Err(A::Error::duplicate_field(
29894                                        "multiple values for `excluded_objects`, a oneof with full ID .google.cloud.datastream.v1.Stream.BackfillAllStrategy.mysql_excluded_objects, latest field was mysqlExcludedObjects",
29895                                    ));
29896                                }
29897                                result.excluded_objects = std::option::Option::Some(
29898                                    crate::model::stream::backfill_all_strategy::ExcludedObjects::MysqlExcludedObjects(
29899                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::MysqlRdbms>>>()?.unwrap_or_default()
29900                                    ),
29901                                );
29902                            }
29903                            __FieldTag::__postgresql_excluded_objects => {
29904                                if !fields.insert(__FieldTag::__postgresql_excluded_objects) {
29905                                    return std::result::Result::Err(A::Error::duplicate_field(
29906                                        "multiple values for postgresql_excluded_objects",
29907                                    ));
29908                                }
29909                                if result.excluded_objects.is_some() {
29910                                    return std::result::Result::Err(A::Error::duplicate_field(
29911                                        "multiple values for `excluded_objects`, a oneof with full ID .google.cloud.datastream.v1.Stream.BackfillAllStrategy.postgresql_excluded_objects, latest field was postgresqlExcludedObjects",
29912                                    ));
29913                                }
29914                                result.excluded_objects = std::option::Option::Some(
29915                                    crate::model::stream::backfill_all_strategy::ExcludedObjects::PostgresqlExcludedObjects(
29916                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::PostgresqlRdbms>>>()?.unwrap_or_default()
29917                                    ),
29918                                );
29919                            }
29920                            __FieldTag::__sql_server_excluded_objects => {
29921                                if !fields.insert(__FieldTag::__sql_server_excluded_objects) {
29922                                    return std::result::Result::Err(A::Error::duplicate_field(
29923                                        "multiple values for sql_server_excluded_objects",
29924                                    ));
29925                                }
29926                                if result.excluded_objects.is_some() {
29927                                    return std::result::Result::Err(A::Error::duplicate_field(
29928                                        "multiple values for `excluded_objects`, a oneof with full ID .google.cloud.datastream.v1.Stream.BackfillAllStrategy.sql_server_excluded_objects, latest field was sqlServerExcludedObjects",
29929                                    ));
29930                                }
29931                                result.excluded_objects = std::option::Option::Some(
29932                                    crate::model::stream::backfill_all_strategy::ExcludedObjects::SqlServerExcludedObjects(
29933                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::SqlServerRdbms>>>()?.unwrap_or_default()
29934                                    ),
29935                                );
29936                            }
29937                            __FieldTag::__salesforce_excluded_objects => {
29938                                if !fields.insert(__FieldTag::__salesforce_excluded_objects) {
29939                                    return std::result::Result::Err(A::Error::duplicate_field(
29940                                        "multiple values for salesforce_excluded_objects",
29941                                    ));
29942                                }
29943                                if result.excluded_objects.is_some() {
29944                                    return std::result::Result::Err(A::Error::duplicate_field(
29945                                        "multiple values for `excluded_objects`, a oneof with full ID .google.cloud.datastream.v1.Stream.BackfillAllStrategy.salesforce_excluded_objects, latest field was salesforceExcludedObjects",
29946                                    ));
29947                                }
29948                                result.excluded_objects = std::option::Option::Some(
29949                                    crate::model::stream::backfill_all_strategy::ExcludedObjects::SalesforceExcludedObjects(
29950                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::SalesforceOrg>>>()?.unwrap_or_default()
29951                                    ),
29952                                );
29953                            }
29954                            __FieldTag::__mongodb_excluded_objects => {
29955                                if !fields.insert(__FieldTag::__mongodb_excluded_objects) {
29956                                    return std::result::Result::Err(A::Error::duplicate_field(
29957                                        "multiple values for mongodb_excluded_objects",
29958                                    ));
29959                                }
29960                                if result.excluded_objects.is_some() {
29961                                    return std::result::Result::Err(A::Error::duplicate_field(
29962                                        "multiple values for `excluded_objects`, a oneof with full ID .google.cloud.datastream.v1.Stream.BackfillAllStrategy.mongodb_excluded_objects, latest field was mongodbExcludedObjects",
29963                                    ));
29964                                }
29965                                result.excluded_objects = std::option::Option::Some(
29966                                    crate::model::stream::backfill_all_strategy::ExcludedObjects::MongodbExcludedObjects(
29967                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::MongodbCluster>>>()?.unwrap_or_default()
29968                                    ),
29969                                );
29970                            }
29971                            __FieldTag::Unknown(key) => {
29972                                let value = map.next_value::<serde_json::Value>()?;
29973                                result._unknown_fields.insert(key, value);
29974                            }
29975                        }
29976                    }
29977                    std::result::Result::Ok(result)
29978                }
29979            }
29980            deserializer.deserialize_any(Visitor)
29981        }
29982    }
29983
29984    #[doc(hidden)]
29985    impl serde::ser::Serialize for BackfillAllStrategy {
29986        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29987        where
29988            S: serde::ser::Serializer,
29989        {
29990            use serde::ser::SerializeMap;
29991            #[allow(unused_imports)]
29992            use std::option::Option::Some;
29993            let mut state = serializer.serialize_map(std::option::Option::None)?;
29994            if let Some(value) = self.oracle_excluded_objects() {
29995                state.serialize_entry("oracleExcludedObjects", value)?;
29996            }
29997            if let Some(value) = self.mysql_excluded_objects() {
29998                state.serialize_entry("mysqlExcludedObjects", value)?;
29999            }
30000            if let Some(value) = self.postgresql_excluded_objects() {
30001                state.serialize_entry("postgresqlExcludedObjects", value)?;
30002            }
30003            if let Some(value) = self.sql_server_excluded_objects() {
30004                state.serialize_entry("sqlServerExcludedObjects", value)?;
30005            }
30006            if let Some(value) = self.salesforce_excluded_objects() {
30007                state.serialize_entry("salesforceExcludedObjects", value)?;
30008            }
30009            if let Some(value) = self.mongodb_excluded_objects() {
30010                state.serialize_entry("mongodbExcludedObjects", value)?;
30011            }
30012            if !self._unknown_fields.is_empty() {
30013                for (key, value) in self._unknown_fields.iter() {
30014                    state.serialize_entry(key, &value)?;
30015                }
30016            }
30017            state.end()
30018        }
30019    }
30020
30021    impl std::fmt::Debug for BackfillAllStrategy {
30022        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
30023            let mut debug_struct = f.debug_struct("BackfillAllStrategy");
30024            debug_struct.field("excluded_objects", &self.excluded_objects);
30025            if !self._unknown_fields.is_empty() {
30026                debug_struct.field("_unknown_fields", &self._unknown_fields);
30027            }
30028            debug_struct.finish()
30029        }
30030    }
30031
30032    /// Defines additional types related to [BackfillAllStrategy].
30033    pub mod backfill_all_strategy {
30034        #[allow(unused_imports)]
30035        use super::*;
30036
30037        /// List of objects to exclude.
30038        #[derive(Clone, Debug, PartialEq)]
30039        #[non_exhaustive]
30040        pub enum ExcludedObjects {
30041            /// Oracle data source objects to avoid backfilling.
30042            OracleExcludedObjects(std::boxed::Box<crate::model::OracleRdbms>),
30043            /// MySQL data source objects to avoid backfilling.
30044            MysqlExcludedObjects(std::boxed::Box<crate::model::MysqlRdbms>),
30045            /// PostgreSQL data source objects to avoid backfilling.
30046            PostgresqlExcludedObjects(std::boxed::Box<crate::model::PostgresqlRdbms>),
30047            /// SQLServer data source objects to avoid backfilling
30048            SqlServerExcludedObjects(std::boxed::Box<crate::model::SqlServerRdbms>),
30049            /// Salesforce data source objects to avoid backfilling
30050            SalesforceExcludedObjects(std::boxed::Box<crate::model::SalesforceOrg>),
30051            /// MongoDB data source objects to avoid backfilling
30052            MongodbExcludedObjects(std::boxed::Box<crate::model::MongodbCluster>),
30053        }
30054    }
30055
30056    /// Backfill strategy to disable automatic backfill for the Stream's objects.
30057    #[derive(Clone, Default, PartialEq)]
30058    #[non_exhaustive]
30059    pub struct BackfillNoneStrategy {
30060        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30061    }
30062
30063    impl BackfillNoneStrategy {
30064        pub fn new() -> Self {
30065            std::default::Default::default()
30066        }
30067    }
30068
30069    impl wkt::message::Message for BackfillNoneStrategy {
30070        fn typename() -> &'static str {
30071            "type.googleapis.com/google.cloud.datastream.v1.Stream.BackfillNoneStrategy"
30072        }
30073    }
30074
30075    #[doc(hidden)]
30076    impl<'de> serde::de::Deserialize<'de> for BackfillNoneStrategy {
30077        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30078        where
30079            D: serde::Deserializer<'de>,
30080        {
30081            #[allow(non_camel_case_types)]
30082            #[doc(hidden)]
30083            #[derive(PartialEq, Eq, Hash)]
30084            enum __FieldTag {
30085                Unknown(std::string::String),
30086            }
30087            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
30088                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30089                where
30090                    D: serde::Deserializer<'de>,
30091                {
30092                    struct Visitor;
30093                    impl<'de> serde::de::Visitor<'de> for Visitor {
30094                        type Value = __FieldTag;
30095                        fn expecting(
30096                            &self,
30097                            formatter: &mut std::fmt::Formatter,
30098                        ) -> std::fmt::Result {
30099                            formatter.write_str("a field name for BackfillNoneStrategy")
30100                        }
30101                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
30102                        where
30103                            E: serde::de::Error,
30104                        {
30105                            use std::result::Result::Ok;
30106                            use std::string::ToString;
30107                            Ok(__FieldTag::Unknown(value.to_string()))
30108                        }
30109                    }
30110                    deserializer.deserialize_identifier(Visitor)
30111                }
30112            }
30113            struct Visitor;
30114            impl<'de> serde::de::Visitor<'de> for Visitor {
30115                type Value = BackfillNoneStrategy;
30116                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
30117                    formatter.write_str("struct BackfillNoneStrategy")
30118                }
30119                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
30120                where
30121                    A: serde::de::MapAccess<'de>,
30122                {
30123                    #[allow(unused_imports)]
30124                    use serde::de::Error;
30125                    use std::option::Option::Some;
30126                    let mut result = Self::Value::new();
30127                    while let Some(tag) = map.next_key::<__FieldTag>()? {
30128                        #[allow(clippy::match_single_binding)]
30129                        match tag {
30130                            __FieldTag::Unknown(key) => {
30131                                let value = map.next_value::<serde_json::Value>()?;
30132                                result._unknown_fields.insert(key, value);
30133                            }
30134                        }
30135                    }
30136                    std::result::Result::Ok(result)
30137                }
30138            }
30139            deserializer.deserialize_any(Visitor)
30140        }
30141    }
30142
30143    #[doc(hidden)]
30144    impl serde::ser::Serialize for BackfillNoneStrategy {
30145        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
30146        where
30147            S: serde::ser::Serializer,
30148        {
30149            use serde::ser::SerializeMap;
30150            #[allow(unused_imports)]
30151            use std::option::Option::Some;
30152            let mut state = serializer.serialize_map(std::option::Option::None)?;
30153            if !self._unknown_fields.is_empty() {
30154                for (key, value) in self._unknown_fields.iter() {
30155                    state.serialize_entry(key, &value)?;
30156                }
30157            }
30158            state.end()
30159        }
30160    }
30161
30162    impl std::fmt::Debug for BackfillNoneStrategy {
30163        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
30164            let mut debug_struct = f.debug_struct("BackfillNoneStrategy");
30165            if !self._unknown_fields.is_empty() {
30166                debug_struct.field("_unknown_fields", &self._unknown_fields);
30167            }
30168            debug_struct.finish()
30169        }
30170    }
30171
30172    /// Stream state.
30173    ///
30174    /// # Working with unknown values
30175    ///
30176    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
30177    /// additional enum variants at any time. Adding new variants is not considered
30178    /// a breaking change. Applications should write their code in anticipation of:
30179    ///
30180    /// - New values appearing in future releases of the client library, **and**
30181    /// - New values received dynamically, without application changes.
30182    ///
30183    /// Please consult the [Working with enums] section in the user guide for some
30184    /// guidelines.
30185    ///
30186    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
30187    #[derive(Clone, Debug, PartialEq)]
30188    #[non_exhaustive]
30189    pub enum State {
30190        /// Unspecified stream state.
30191        Unspecified,
30192        /// The stream has been created but has not yet started streaming data.
30193        NotStarted,
30194        /// The stream is running.
30195        Running,
30196        /// The stream is paused.
30197        Paused,
30198        /// The stream is in maintenance mode.
30199        ///
30200        /// Updates are rejected on the resource in this state.
30201        Maintenance,
30202        /// The stream is experiencing an error that is preventing data from being
30203        /// streamed.
30204        Failed,
30205        /// The stream has experienced a terminal failure.
30206        FailedPermanently,
30207        /// The stream is starting, but not yet running.
30208        Starting,
30209        /// The Stream is no longer reading new events, but still writing events in
30210        /// the buffer.
30211        Draining,
30212        /// If set, the enum was initialized with an unknown value.
30213        ///
30214        /// Applications can examine the value using [State::value] or
30215        /// [State::name].
30216        UnknownValue(state::UnknownValue),
30217    }
30218
30219    #[doc(hidden)]
30220    pub mod state {
30221        #[allow(unused_imports)]
30222        use super::*;
30223        #[derive(Clone, Debug, PartialEq)]
30224        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
30225    }
30226
30227    impl State {
30228        /// Gets the enum value.
30229        ///
30230        /// Returns `None` if the enum contains an unknown value deserialized from
30231        /// the string representation of enums.
30232        pub fn value(&self) -> std::option::Option<i32> {
30233            match self {
30234                Self::Unspecified => std::option::Option::Some(0),
30235                Self::NotStarted => std::option::Option::Some(1),
30236                Self::Running => std::option::Option::Some(2),
30237                Self::Paused => std::option::Option::Some(3),
30238                Self::Maintenance => std::option::Option::Some(4),
30239                Self::Failed => std::option::Option::Some(5),
30240                Self::FailedPermanently => std::option::Option::Some(6),
30241                Self::Starting => std::option::Option::Some(7),
30242                Self::Draining => std::option::Option::Some(8),
30243                Self::UnknownValue(u) => u.0.value(),
30244            }
30245        }
30246
30247        /// Gets the enum value as a string.
30248        ///
30249        /// Returns `None` if the enum contains an unknown value deserialized from
30250        /// the integer representation of enums.
30251        pub fn name(&self) -> std::option::Option<&str> {
30252            match self {
30253                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
30254                Self::NotStarted => std::option::Option::Some("NOT_STARTED"),
30255                Self::Running => std::option::Option::Some("RUNNING"),
30256                Self::Paused => std::option::Option::Some("PAUSED"),
30257                Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
30258                Self::Failed => std::option::Option::Some("FAILED"),
30259                Self::FailedPermanently => std::option::Option::Some("FAILED_PERMANENTLY"),
30260                Self::Starting => std::option::Option::Some("STARTING"),
30261                Self::Draining => std::option::Option::Some("DRAINING"),
30262                Self::UnknownValue(u) => u.0.name(),
30263            }
30264        }
30265    }
30266
30267    impl std::default::Default for State {
30268        fn default() -> Self {
30269            use std::convert::From;
30270            Self::from(0)
30271        }
30272    }
30273
30274    impl std::fmt::Display for State {
30275        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
30276            wkt::internal::display_enum(f, self.name(), self.value())
30277        }
30278    }
30279
30280    impl std::convert::From<i32> for State {
30281        fn from(value: i32) -> Self {
30282            match value {
30283                0 => Self::Unspecified,
30284                1 => Self::NotStarted,
30285                2 => Self::Running,
30286                3 => Self::Paused,
30287                4 => Self::Maintenance,
30288                5 => Self::Failed,
30289                6 => Self::FailedPermanently,
30290                7 => Self::Starting,
30291                8 => Self::Draining,
30292                _ => Self::UnknownValue(state::UnknownValue(
30293                    wkt::internal::UnknownEnumValue::Integer(value),
30294                )),
30295            }
30296        }
30297    }
30298
30299    impl std::convert::From<&str> for State {
30300        fn from(value: &str) -> Self {
30301            use std::string::ToString;
30302            match value {
30303                "STATE_UNSPECIFIED" => Self::Unspecified,
30304                "NOT_STARTED" => Self::NotStarted,
30305                "RUNNING" => Self::Running,
30306                "PAUSED" => Self::Paused,
30307                "MAINTENANCE" => Self::Maintenance,
30308                "FAILED" => Self::Failed,
30309                "FAILED_PERMANENTLY" => Self::FailedPermanently,
30310                "STARTING" => Self::Starting,
30311                "DRAINING" => Self::Draining,
30312                _ => Self::UnknownValue(state::UnknownValue(
30313                    wkt::internal::UnknownEnumValue::String(value.to_string()),
30314                )),
30315            }
30316        }
30317    }
30318
30319    impl serde::ser::Serialize for State {
30320        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
30321        where
30322            S: serde::Serializer,
30323        {
30324            match self {
30325                Self::Unspecified => serializer.serialize_i32(0),
30326                Self::NotStarted => serializer.serialize_i32(1),
30327                Self::Running => serializer.serialize_i32(2),
30328                Self::Paused => serializer.serialize_i32(3),
30329                Self::Maintenance => serializer.serialize_i32(4),
30330                Self::Failed => serializer.serialize_i32(5),
30331                Self::FailedPermanently => serializer.serialize_i32(6),
30332                Self::Starting => serializer.serialize_i32(7),
30333                Self::Draining => serializer.serialize_i32(8),
30334                Self::UnknownValue(u) => u.0.serialize(serializer),
30335            }
30336        }
30337    }
30338
30339    impl<'de> serde::de::Deserialize<'de> for State {
30340        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30341        where
30342            D: serde::Deserializer<'de>,
30343        {
30344            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
30345                ".google.cloud.datastream.v1.Stream.State",
30346            ))
30347        }
30348    }
30349
30350    /// Stream backfill strategy.
30351    #[derive(Clone, Debug, PartialEq)]
30352    #[non_exhaustive]
30353    pub enum BackfillStrategy {
30354        /// Automatically backfill objects included in the stream source
30355        /// configuration. Specific objects can be excluded.
30356        BackfillAll(std::boxed::Box<crate::model::stream::BackfillAllStrategy>),
30357        /// Do not automatically backfill any objects.
30358        BackfillNone(std::boxed::Box<crate::model::stream::BackfillNoneStrategy>),
30359    }
30360}
30361
30362/// A specific stream object (e.g a specific DB table).
30363#[derive(Clone, Default, PartialEq)]
30364#[non_exhaustive]
30365pub struct StreamObject {
30366    /// Output only. Identifier. The object resource's name.
30367    pub name: std::string::String,
30368
30369    /// Output only. The creation time of the object.
30370    pub create_time: std::option::Option<wkt::Timestamp>,
30371
30372    /// Output only. The last update time of the object.
30373    pub update_time: std::option::Option<wkt::Timestamp>,
30374
30375    /// Required. Display name.
30376    pub display_name: std::string::String,
30377
30378    /// Output only. Active errors on the object.
30379    pub errors: std::vec::Vec<crate::model::Error>,
30380
30381    /// The latest backfill job that was initiated for the stream object.
30382    pub backfill_job: std::option::Option<crate::model::BackfillJob>,
30383
30384    /// The object identifier in the data source.
30385    pub source_object: std::option::Option<crate::model::SourceObjectIdentifier>,
30386
30387    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30388}
30389
30390impl StreamObject {
30391    pub fn new() -> Self {
30392        std::default::Default::default()
30393    }
30394
30395    /// Sets the value of [name][crate::model::StreamObject::name].
30396    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30397        self.name = v.into();
30398        self
30399    }
30400
30401    /// Sets the value of [create_time][crate::model::StreamObject::create_time].
30402    pub fn set_create_time<T>(mut self, v: T) -> Self
30403    where
30404        T: std::convert::Into<wkt::Timestamp>,
30405    {
30406        self.create_time = std::option::Option::Some(v.into());
30407        self
30408    }
30409
30410    /// Sets or clears the value of [create_time][crate::model::StreamObject::create_time].
30411    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
30412    where
30413        T: std::convert::Into<wkt::Timestamp>,
30414    {
30415        self.create_time = v.map(|x| x.into());
30416        self
30417    }
30418
30419    /// Sets the value of [update_time][crate::model::StreamObject::update_time].
30420    pub fn set_update_time<T>(mut self, v: T) -> Self
30421    where
30422        T: std::convert::Into<wkt::Timestamp>,
30423    {
30424        self.update_time = std::option::Option::Some(v.into());
30425        self
30426    }
30427
30428    /// Sets or clears the value of [update_time][crate::model::StreamObject::update_time].
30429    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
30430    where
30431        T: std::convert::Into<wkt::Timestamp>,
30432    {
30433        self.update_time = v.map(|x| x.into());
30434        self
30435    }
30436
30437    /// Sets the value of [display_name][crate::model::StreamObject::display_name].
30438    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30439        self.display_name = v.into();
30440        self
30441    }
30442
30443    /// Sets the value of [errors][crate::model::StreamObject::errors].
30444    pub fn set_errors<T, V>(mut self, v: T) -> Self
30445    where
30446        T: std::iter::IntoIterator<Item = V>,
30447        V: std::convert::Into<crate::model::Error>,
30448    {
30449        use std::iter::Iterator;
30450        self.errors = v.into_iter().map(|i| i.into()).collect();
30451        self
30452    }
30453
30454    /// Sets the value of [backfill_job][crate::model::StreamObject::backfill_job].
30455    pub fn set_backfill_job<T>(mut self, v: T) -> Self
30456    where
30457        T: std::convert::Into<crate::model::BackfillJob>,
30458    {
30459        self.backfill_job = std::option::Option::Some(v.into());
30460        self
30461    }
30462
30463    /// Sets or clears the value of [backfill_job][crate::model::StreamObject::backfill_job].
30464    pub fn set_or_clear_backfill_job<T>(mut self, v: std::option::Option<T>) -> Self
30465    where
30466        T: std::convert::Into<crate::model::BackfillJob>,
30467    {
30468        self.backfill_job = v.map(|x| x.into());
30469        self
30470    }
30471
30472    /// Sets the value of [source_object][crate::model::StreamObject::source_object].
30473    pub fn set_source_object<T>(mut self, v: T) -> Self
30474    where
30475        T: std::convert::Into<crate::model::SourceObjectIdentifier>,
30476    {
30477        self.source_object = std::option::Option::Some(v.into());
30478        self
30479    }
30480
30481    /// Sets or clears the value of [source_object][crate::model::StreamObject::source_object].
30482    pub fn set_or_clear_source_object<T>(mut self, v: std::option::Option<T>) -> Self
30483    where
30484        T: std::convert::Into<crate::model::SourceObjectIdentifier>,
30485    {
30486        self.source_object = v.map(|x| x.into());
30487        self
30488    }
30489}
30490
30491impl wkt::message::Message for StreamObject {
30492    fn typename() -> &'static str {
30493        "type.googleapis.com/google.cloud.datastream.v1.StreamObject"
30494    }
30495}
30496
30497#[doc(hidden)]
30498impl<'de> serde::de::Deserialize<'de> for StreamObject {
30499    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30500    where
30501        D: serde::Deserializer<'de>,
30502    {
30503        #[allow(non_camel_case_types)]
30504        #[doc(hidden)]
30505        #[derive(PartialEq, Eq, Hash)]
30506        enum __FieldTag {
30507            __name,
30508            __create_time,
30509            __update_time,
30510            __display_name,
30511            __errors,
30512            __backfill_job,
30513            __source_object,
30514            Unknown(std::string::String),
30515        }
30516        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
30517            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30518            where
30519                D: serde::Deserializer<'de>,
30520            {
30521                struct Visitor;
30522                impl<'de> serde::de::Visitor<'de> for Visitor {
30523                    type Value = __FieldTag;
30524                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
30525                        formatter.write_str("a field name for StreamObject")
30526                    }
30527                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
30528                    where
30529                        E: serde::de::Error,
30530                    {
30531                        use std::result::Result::Ok;
30532                        use std::string::ToString;
30533                        match value {
30534                            "name" => Ok(__FieldTag::__name),
30535                            "createTime" => Ok(__FieldTag::__create_time),
30536                            "create_time" => Ok(__FieldTag::__create_time),
30537                            "updateTime" => Ok(__FieldTag::__update_time),
30538                            "update_time" => Ok(__FieldTag::__update_time),
30539                            "displayName" => Ok(__FieldTag::__display_name),
30540                            "display_name" => Ok(__FieldTag::__display_name),
30541                            "errors" => Ok(__FieldTag::__errors),
30542                            "backfillJob" => Ok(__FieldTag::__backfill_job),
30543                            "backfill_job" => Ok(__FieldTag::__backfill_job),
30544                            "sourceObject" => Ok(__FieldTag::__source_object),
30545                            "source_object" => Ok(__FieldTag::__source_object),
30546                            _ => Ok(__FieldTag::Unknown(value.to_string())),
30547                        }
30548                    }
30549                }
30550                deserializer.deserialize_identifier(Visitor)
30551            }
30552        }
30553        struct Visitor;
30554        impl<'de> serde::de::Visitor<'de> for Visitor {
30555            type Value = StreamObject;
30556            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
30557                formatter.write_str("struct StreamObject")
30558            }
30559            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
30560            where
30561                A: serde::de::MapAccess<'de>,
30562            {
30563                #[allow(unused_imports)]
30564                use serde::de::Error;
30565                use std::option::Option::Some;
30566                let mut fields = std::collections::HashSet::new();
30567                let mut result = Self::Value::new();
30568                while let Some(tag) = map.next_key::<__FieldTag>()? {
30569                    #[allow(clippy::match_single_binding)]
30570                    match tag {
30571                        __FieldTag::__name => {
30572                            if !fields.insert(__FieldTag::__name) {
30573                                return std::result::Result::Err(A::Error::duplicate_field(
30574                                    "multiple values for name",
30575                                ));
30576                            }
30577                            result.name = map
30578                                .next_value::<std::option::Option<std::string::String>>()?
30579                                .unwrap_or_default();
30580                        }
30581                        __FieldTag::__create_time => {
30582                            if !fields.insert(__FieldTag::__create_time) {
30583                                return std::result::Result::Err(A::Error::duplicate_field(
30584                                    "multiple values for create_time",
30585                                ));
30586                            }
30587                            result.create_time =
30588                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
30589                        }
30590                        __FieldTag::__update_time => {
30591                            if !fields.insert(__FieldTag::__update_time) {
30592                                return std::result::Result::Err(A::Error::duplicate_field(
30593                                    "multiple values for update_time",
30594                                ));
30595                            }
30596                            result.update_time =
30597                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
30598                        }
30599                        __FieldTag::__display_name => {
30600                            if !fields.insert(__FieldTag::__display_name) {
30601                                return std::result::Result::Err(A::Error::duplicate_field(
30602                                    "multiple values for display_name",
30603                                ));
30604                            }
30605                            result.display_name = map
30606                                .next_value::<std::option::Option<std::string::String>>()?
30607                                .unwrap_or_default();
30608                        }
30609                        __FieldTag::__errors => {
30610                            if !fields.insert(__FieldTag::__errors) {
30611                                return std::result::Result::Err(A::Error::duplicate_field(
30612                                    "multiple values for errors",
30613                                ));
30614                            }
30615                            result.errors = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Error>>>()?.unwrap_or_default();
30616                        }
30617                        __FieldTag::__backfill_job => {
30618                            if !fields.insert(__FieldTag::__backfill_job) {
30619                                return std::result::Result::Err(A::Error::duplicate_field(
30620                                    "multiple values for backfill_job",
30621                                ));
30622                            }
30623                            result.backfill_job =
30624                                map.next_value::<std::option::Option<crate::model::BackfillJob>>()?;
30625                        }
30626                        __FieldTag::__source_object => {
30627                            if !fields.insert(__FieldTag::__source_object) {
30628                                return std::result::Result::Err(A::Error::duplicate_field(
30629                                    "multiple values for source_object",
30630                                ));
30631                            }
30632                            result.source_object = map.next_value::<std::option::Option<crate::model::SourceObjectIdentifier>>()?
30633                                ;
30634                        }
30635                        __FieldTag::Unknown(key) => {
30636                            let value = map.next_value::<serde_json::Value>()?;
30637                            result._unknown_fields.insert(key, value);
30638                        }
30639                    }
30640                }
30641                std::result::Result::Ok(result)
30642            }
30643        }
30644        deserializer.deserialize_any(Visitor)
30645    }
30646}
30647
30648#[doc(hidden)]
30649impl serde::ser::Serialize for StreamObject {
30650    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
30651    where
30652        S: serde::ser::Serializer,
30653    {
30654        use serde::ser::SerializeMap;
30655        #[allow(unused_imports)]
30656        use std::option::Option::Some;
30657        let mut state = serializer.serialize_map(std::option::Option::None)?;
30658        if !self.name.is_empty() {
30659            state.serialize_entry("name", &self.name)?;
30660        }
30661        if self.create_time.is_some() {
30662            state.serialize_entry("createTime", &self.create_time)?;
30663        }
30664        if self.update_time.is_some() {
30665            state.serialize_entry("updateTime", &self.update_time)?;
30666        }
30667        if !self.display_name.is_empty() {
30668            state.serialize_entry("displayName", &self.display_name)?;
30669        }
30670        if !self.errors.is_empty() {
30671            state.serialize_entry("errors", &self.errors)?;
30672        }
30673        if self.backfill_job.is_some() {
30674            state.serialize_entry("backfillJob", &self.backfill_job)?;
30675        }
30676        if self.source_object.is_some() {
30677            state.serialize_entry("sourceObject", &self.source_object)?;
30678        }
30679        if !self._unknown_fields.is_empty() {
30680            for (key, value) in self._unknown_fields.iter() {
30681                state.serialize_entry(key, &value)?;
30682            }
30683        }
30684        state.end()
30685    }
30686}
30687
30688impl std::fmt::Debug for StreamObject {
30689    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
30690        let mut debug_struct = f.debug_struct("StreamObject");
30691        debug_struct.field("name", &self.name);
30692        debug_struct.field("create_time", &self.create_time);
30693        debug_struct.field("update_time", &self.update_time);
30694        debug_struct.field("display_name", &self.display_name);
30695        debug_struct.field("errors", &self.errors);
30696        debug_struct.field("backfill_job", &self.backfill_job);
30697        debug_struct.field("source_object", &self.source_object);
30698        if !self._unknown_fields.is_empty() {
30699            debug_struct.field("_unknown_fields", &self._unknown_fields);
30700        }
30701        debug_struct.finish()
30702    }
30703}
30704
30705/// Represents an identifier of an object in the data source.
30706#[derive(Clone, Default, PartialEq)]
30707#[non_exhaustive]
30708pub struct SourceObjectIdentifier {
30709    /// The identifier for an object in the data source.
30710    pub source_identifier:
30711        std::option::Option<crate::model::source_object_identifier::SourceIdentifier>,
30712
30713    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30714}
30715
30716impl SourceObjectIdentifier {
30717    pub fn new() -> Self {
30718        std::default::Default::default()
30719    }
30720
30721    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier].
30722    ///
30723    /// Note that all the setters affecting `source_identifier` are mutually
30724    /// exclusive.
30725    pub fn set_source_identifier<
30726        T: std::convert::Into<
30727                std::option::Option<crate::model::source_object_identifier::SourceIdentifier>,
30728            >,
30729    >(
30730        mut self,
30731        v: T,
30732    ) -> Self {
30733        self.source_identifier = v.into();
30734        self
30735    }
30736
30737    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
30738    /// if it holds a `OracleIdentifier`, `None` if the field is not set or
30739    /// holds a different branch.
30740    pub fn oracle_identifier(
30741        &self,
30742    ) -> std::option::Option<
30743        &std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
30744    > {
30745        #[allow(unreachable_patterns)]
30746        self.source_identifier.as_ref().and_then(|v| match v {
30747            crate::model::source_object_identifier::SourceIdentifier::OracleIdentifier(v) => {
30748                std::option::Option::Some(v)
30749            }
30750            _ => std::option::Option::None,
30751        })
30752    }
30753
30754    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
30755    /// to hold a `OracleIdentifier`.
30756    ///
30757    /// Note that all the setters affecting `source_identifier` are
30758    /// mutually exclusive.
30759    pub fn set_oracle_identifier<
30760        T: std::convert::Into<
30761                std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
30762            >,
30763    >(
30764        mut self,
30765        v: T,
30766    ) -> Self {
30767        self.source_identifier = std::option::Option::Some(
30768            crate::model::source_object_identifier::SourceIdentifier::OracleIdentifier(v.into()),
30769        );
30770        self
30771    }
30772
30773    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
30774    /// if it holds a `MysqlIdentifier`, `None` if the field is not set or
30775    /// holds a different branch.
30776    pub fn mysql_identifier(
30777        &self,
30778    ) -> std::option::Option<
30779        &std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
30780    > {
30781        #[allow(unreachable_patterns)]
30782        self.source_identifier.as_ref().and_then(|v| match v {
30783            crate::model::source_object_identifier::SourceIdentifier::MysqlIdentifier(v) => {
30784                std::option::Option::Some(v)
30785            }
30786            _ => std::option::Option::None,
30787        })
30788    }
30789
30790    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
30791    /// to hold a `MysqlIdentifier`.
30792    ///
30793    /// Note that all the setters affecting `source_identifier` are
30794    /// mutually exclusive.
30795    pub fn set_mysql_identifier<
30796        T: std::convert::Into<
30797                std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
30798            >,
30799    >(
30800        mut self,
30801        v: T,
30802    ) -> Self {
30803        self.source_identifier = std::option::Option::Some(
30804            crate::model::source_object_identifier::SourceIdentifier::MysqlIdentifier(v.into()),
30805        );
30806        self
30807    }
30808
30809    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
30810    /// if it holds a `PostgresqlIdentifier`, `None` if the field is not set or
30811    /// holds a different branch.
30812    pub fn postgresql_identifier(
30813        &self,
30814    ) -> std::option::Option<
30815        &std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
30816    > {
30817        #[allow(unreachable_patterns)]
30818        self.source_identifier.as_ref().and_then(|v| match v {
30819            crate::model::source_object_identifier::SourceIdentifier::PostgresqlIdentifier(v) => {
30820                std::option::Option::Some(v)
30821            }
30822            _ => std::option::Option::None,
30823        })
30824    }
30825
30826    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
30827    /// to hold a `PostgresqlIdentifier`.
30828    ///
30829    /// Note that all the setters affecting `source_identifier` are
30830    /// mutually exclusive.
30831    pub fn set_postgresql_identifier<
30832        T: std::convert::Into<
30833                std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
30834            >,
30835    >(
30836        mut self,
30837        v: T,
30838    ) -> Self {
30839        self.source_identifier = std::option::Option::Some(
30840            crate::model::source_object_identifier::SourceIdentifier::PostgresqlIdentifier(
30841                v.into(),
30842            ),
30843        );
30844        self
30845    }
30846
30847    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
30848    /// if it holds a `SqlServerIdentifier`, `None` if the field is not set or
30849    /// holds a different branch.
30850    pub fn sql_server_identifier(
30851        &self,
30852    ) -> std::option::Option<
30853        &std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
30854    > {
30855        #[allow(unreachable_patterns)]
30856        self.source_identifier.as_ref().and_then(|v| match v {
30857            crate::model::source_object_identifier::SourceIdentifier::SqlServerIdentifier(v) => {
30858                std::option::Option::Some(v)
30859            }
30860            _ => std::option::Option::None,
30861        })
30862    }
30863
30864    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
30865    /// to hold a `SqlServerIdentifier`.
30866    ///
30867    /// Note that all the setters affecting `source_identifier` are
30868    /// mutually exclusive.
30869    pub fn set_sql_server_identifier<
30870        T: std::convert::Into<
30871                std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
30872            >,
30873    >(
30874        mut self,
30875        v: T,
30876    ) -> Self {
30877        self.source_identifier = std::option::Option::Some(
30878            crate::model::source_object_identifier::SourceIdentifier::SqlServerIdentifier(v.into()),
30879        );
30880        self
30881    }
30882
30883    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
30884    /// if it holds a `SalesforceIdentifier`, `None` if the field is not set or
30885    /// holds a different branch.
30886    pub fn salesforce_identifier(
30887        &self,
30888    ) -> std::option::Option<
30889        &std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>,
30890    > {
30891        #[allow(unreachable_patterns)]
30892        self.source_identifier.as_ref().and_then(|v| match v {
30893            crate::model::source_object_identifier::SourceIdentifier::SalesforceIdentifier(v) => {
30894                std::option::Option::Some(v)
30895            }
30896            _ => std::option::Option::None,
30897        })
30898    }
30899
30900    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
30901    /// to hold a `SalesforceIdentifier`.
30902    ///
30903    /// Note that all the setters affecting `source_identifier` are
30904    /// mutually exclusive.
30905    pub fn set_salesforce_identifier<
30906        T: std::convert::Into<
30907                std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>,
30908            >,
30909    >(
30910        mut self,
30911        v: T,
30912    ) -> Self {
30913        self.source_identifier = std::option::Option::Some(
30914            crate::model::source_object_identifier::SourceIdentifier::SalesforceIdentifier(
30915                v.into(),
30916            ),
30917        );
30918        self
30919    }
30920
30921    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
30922    /// if it holds a `MongodbIdentifier`, `None` if the field is not set or
30923    /// holds a different branch.
30924    pub fn mongodb_identifier(
30925        &self,
30926    ) -> std::option::Option<
30927        &std::boxed::Box<crate::model::source_object_identifier::MongodbObjectIdentifier>,
30928    > {
30929        #[allow(unreachable_patterns)]
30930        self.source_identifier.as_ref().and_then(|v| match v {
30931            crate::model::source_object_identifier::SourceIdentifier::MongodbIdentifier(v) => {
30932                std::option::Option::Some(v)
30933            }
30934            _ => std::option::Option::None,
30935        })
30936    }
30937
30938    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
30939    /// to hold a `MongodbIdentifier`.
30940    ///
30941    /// Note that all the setters affecting `source_identifier` are
30942    /// mutually exclusive.
30943    pub fn set_mongodb_identifier<
30944        T: std::convert::Into<
30945                std::boxed::Box<crate::model::source_object_identifier::MongodbObjectIdentifier>,
30946            >,
30947    >(
30948        mut self,
30949        v: T,
30950    ) -> Self {
30951        self.source_identifier = std::option::Option::Some(
30952            crate::model::source_object_identifier::SourceIdentifier::MongodbIdentifier(v.into()),
30953        );
30954        self
30955    }
30956}
30957
30958impl wkt::message::Message for SourceObjectIdentifier {
30959    fn typename() -> &'static str {
30960        "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier"
30961    }
30962}
30963
30964#[doc(hidden)]
30965impl<'de> serde::de::Deserialize<'de> for SourceObjectIdentifier {
30966    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30967    where
30968        D: serde::Deserializer<'de>,
30969    {
30970        #[allow(non_camel_case_types)]
30971        #[doc(hidden)]
30972        #[derive(PartialEq, Eq, Hash)]
30973        enum __FieldTag {
30974            __oracle_identifier,
30975            __mysql_identifier,
30976            __postgresql_identifier,
30977            __sql_server_identifier,
30978            __salesforce_identifier,
30979            __mongodb_identifier,
30980            Unknown(std::string::String),
30981        }
30982        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
30983            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30984            where
30985                D: serde::Deserializer<'de>,
30986            {
30987                struct Visitor;
30988                impl<'de> serde::de::Visitor<'de> for Visitor {
30989                    type Value = __FieldTag;
30990                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
30991                        formatter.write_str("a field name for SourceObjectIdentifier")
30992                    }
30993                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
30994                    where
30995                        E: serde::de::Error,
30996                    {
30997                        use std::result::Result::Ok;
30998                        use std::string::ToString;
30999                        match value {
31000                            "oracleIdentifier" => Ok(__FieldTag::__oracle_identifier),
31001                            "oracle_identifier" => Ok(__FieldTag::__oracle_identifier),
31002                            "mysqlIdentifier" => Ok(__FieldTag::__mysql_identifier),
31003                            "mysql_identifier" => Ok(__FieldTag::__mysql_identifier),
31004                            "postgresqlIdentifier" => Ok(__FieldTag::__postgresql_identifier),
31005                            "postgresql_identifier" => Ok(__FieldTag::__postgresql_identifier),
31006                            "sqlServerIdentifier" => Ok(__FieldTag::__sql_server_identifier),
31007                            "sql_server_identifier" => Ok(__FieldTag::__sql_server_identifier),
31008                            "salesforceIdentifier" => Ok(__FieldTag::__salesforce_identifier),
31009                            "salesforce_identifier" => Ok(__FieldTag::__salesforce_identifier),
31010                            "mongodbIdentifier" => Ok(__FieldTag::__mongodb_identifier),
31011                            "mongodb_identifier" => Ok(__FieldTag::__mongodb_identifier),
31012                            _ => Ok(__FieldTag::Unknown(value.to_string())),
31013                        }
31014                    }
31015                }
31016                deserializer.deserialize_identifier(Visitor)
31017            }
31018        }
31019        struct Visitor;
31020        impl<'de> serde::de::Visitor<'de> for Visitor {
31021            type Value = SourceObjectIdentifier;
31022            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
31023                formatter.write_str("struct SourceObjectIdentifier")
31024            }
31025            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
31026            where
31027                A: serde::de::MapAccess<'de>,
31028            {
31029                #[allow(unused_imports)]
31030                use serde::de::Error;
31031                use std::option::Option::Some;
31032                let mut fields = std::collections::HashSet::new();
31033                let mut result = Self::Value::new();
31034                while let Some(tag) = map.next_key::<__FieldTag>()? {
31035                    #[allow(clippy::match_single_binding)]
31036                    match tag {
31037                        __FieldTag::__oracle_identifier => {
31038                            if !fields.insert(__FieldTag::__oracle_identifier) {
31039                                return std::result::Result::Err(A::Error::duplicate_field(
31040                                    "multiple values for oracle_identifier",
31041                                ));
31042                            }
31043                            if result.source_identifier.is_some() {
31044                                return std::result::Result::Err(A::Error::duplicate_field(
31045                                    "multiple values for `source_identifier`, a oneof with full ID .google.cloud.datastream.v1.SourceObjectIdentifier.oracle_identifier, latest field was oracleIdentifier",
31046                                ));
31047                            }
31048                            result.source_identifier = std::option::Option::Some(
31049                                crate::model::source_object_identifier::SourceIdentifier::OracleIdentifier(
31050                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>>>()?.unwrap_or_default()
31051                                ),
31052                            );
31053                        }
31054                        __FieldTag::__mysql_identifier => {
31055                            if !fields.insert(__FieldTag::__mysql_identifier) {
31056                                return std::result::Result::Err(A::Error::duplicate_field(
31057                                    "multiple values for mysql_identifier",
31058                                ));
31059                            }
31060                            if result.source_identifier.is_some() {
31061                                return std::result::Result::Err(A::Error::duplicate_field(
31062                                    "multiple values for `source_identifier`, a oneof with full ID .google.cloud.datastream.v1.SourceObjectIdentifier.mysql_identifier, latest field was mysqlIdentifier",
31063                                ));
31064                            }
31065                            result.source_identifier = std::option::Option::Some(
31066                                crate::model::source_object_identifier::SourceIdentifier::MysqlIdentifier(
31067                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>>>()?.unwrap_or_default()
31068                                ),
31069                            );
31070                        }
31071                        __FieldTag::__postgresql_identifier => {
31072                            if !fields.insert(__FieldTag::__postgresql_identifier) {
31073                                return std::result::Result::Err(A::Error::duplicate_field(
31074                                    "multiple values for postgresql_identifier",
31075                                ));
31076                            }
31077                            if result.source_identifier.is_some() {
31078                                return std::result::Result::Err(A::Error::duplicate_field(
31079                                    "multiple values for `source_identifier`, a oneof with full ID .google.cloud.datastream.v1.SourceObjectIdentifier.postgresql_identifier, latest field was postgresqlIdentifier",
31080                                ));
31081                            }
31082                            result.source_identifier = std::option::Option::Some(
31083                                crate::model::source_object_identifier::SourceIdentifier::PostgresqlIdentifier(
31084                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>>>()?.unwrap_or_default()
31085                                ),
31086                            );
31087                        }
31088                        __FieldTag::__sql_server_identifier => {
31089                            if !fields.insert(__FieldTag::__sql_server_identifier) {
31090                                return std::result::Result::Err(A::Error::duplicate_field(
31091                                    "multiple values for sql_server_identifier",
31092                                ));
31093                            }
31094                            if result.source_identifier.is_some() {
31095                                return std::result::Result::Err(A::Error::duplicate_field(
31096                                    "multiple values for `source_identifier`, a oneof with full ID .google.cloud.datastream.v1.SourceObjectIdentifier.sql_server_identifier, latest field was sqlServerIdentifier",
31097                                ));
31098                            }
31099                            result.source_identifier = std::option::Option::Some(
31100                                crate::model::source_object_identifier::SourceIdentifier::SqlServerIdentifier(
31101                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>>>()?.unwrap_or_default()
31102                                ),
31103                            );
31104                        }
31105                        __FieldTag::__salesforce_identifier => {
31106                            if !fields.insert(__FieldTag::__salesforce_identifier) {
31107                                return std::result::Result::Err(A::Error::duplicate_field(
31108                                    "multiple values for salesforce_identifier",
31109                                ));
31110                            }
31111                            if result.source_identifier.is_some() {
31112                                return std::result::Result::Err(A::Error::duplicate_field(
31113                                    "multiple values for `source_identifier`, a oneof with full ID .google.cloud.datastream.v1.SourceObjectIdentifier.salesforce_identifier, latest field was salesforceIdentifier",
31114                                ));
31115                            }
31116                            result.source_identifier = std::option::Option::Some(
31117                                crate::model::source_object_identifier::SourceIdentifier::SalesforceIdentifier(
31118                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>>>()?.unwrap_or_default()
31119                                ),
31120                            );
31121                        }
31122                        __FieldTag::__mongodb_identifier => {
31123                            if !fields.insert(__FieldTag::__mongodb_identifier) {
31124                                return std::result::Result::Err(A::Error::duplicate_field(
31125                                    "multiple values for mongodb_identifier",
31126                                ));
31127                            }
31128                            if result.source_identifier.is_some() {
31129                                return std::result::Result::Err(A::Error::duplicate_field(
31130                                    "multiple values for `source_identifier`, a oneof with full ID .google.cloud.datastream.v1.SourceObjectIdentifier.mongodb_identifier, latest field was mongodbIdentifier",
31131                                ));
31132                            }
31133                            result.source_identifier = std::option::Option::Some(
31134                                crate::model::source_object_identifier::SourceIdentifier::MongodbIdentifier(
31135                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::source_object_identifier::MongodbObjectIdentifier>>>()?.unwrap_or_default()
31136                                ),
31137                            );
31138                        }
31139                        __FieldTag::Unknown(key) => {
31140                            let value = map.next_value::<serde_json::Value>()?;
31141                            result._unknown_fields.insert(key, value);
31142                        }
31143                    }
31144                }
31145                std::result::Result::Ok(result)
31146            }
31147        }
31148        deserializer.deserialize_any(Visitor)
31149    }
31150}
31151
31152#[doc(hidden)]
31153impl serde::ser::Serialize for SourceObjectIdentifier {
31154    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31155    where
31156        S: serde::ser::Serializer,
31157    {
31158        use serde::ser::SerializeMap;
31159        #[allow(unused_imports)]
31160        use std::option::Option::Some;
31161        let mut state = serializer.serialize_map(std::option::Option::None)?;
31162        if let Some(value) = self.oracle_identifier() {
31163            state.serialize_entry("oracleIdentifier", value)?;
31164        }
31165        if let Some(value) = self.mysql_identifier() {
31166            state.serialize_entry("mysqlIdentifier", value)?;
31167        }
31168        if let Some(value) = self.postgresql_identifier() {
31169            state.serialize_entry("postgresqlIdentifier", value)?;
31170        }
31171        if let Some(value) = self.sql_server_identifier() {
31172            state.serialize_entry("sqlServerIdentifier", value)?;
31173        }
31174        if let Some(value) = self.salesforce_identifier() {
31175            state.serialize_entry("salesforceIdentifier", value)?;
31176        }
31177        if let Some(value) = self.mongodb_identifier() {
31178            state.serialize_entry("mongodbIdentifier", value)?;
31179        }
31180        if !self._unknown_fields.is_empty() {
31181            for (key, value) in self._unknown_fields.iter() {
31182                state.serialize_entry(key, &value)?;
31183            }
31184        }
31185        state.end()
31186    }
31187}
31188
31189impl std::fmt::Debug for SourceObjectIdentifier {
31190    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
31191        let mut debug_struct = f.debug_struct("SourceObjectIdentifier");
31192        debug_struct.field("source_identifier", &self.source_identifier);
31193        if !self._unknown_fields.is_empty() {
31194            debug_struct.field("_unknown_fields", &self._unknown_fields);
31195        }
31196        debug_struct.finish()
31197    }
31198}
31199
31200/// Defines additional types related to [SourceObjectIdentifier].
31201pub mod source_object_identifier {
31202    #[allow(unused_imports)]
31203    use super::*;
31204
31205    /// Oracle data source object identifier.
31206    #[derive(Clone, Default, PartialEq)]
31207    #[non_exhaustive]
31208    pub struct OracleObjectIdentifier {
31209        /// Required. The schema name.
31210        pub schema: std::string::String,
31211
31212        /// Required. The table name.
31213        pub table: std::string::String,
31214
31215        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31216    }
31217
31218    impl OracleObjectIdentifier {
31219        pub fn new() -> Self {
31220            std::default::Default::default()
31221        }
31222
31223        /// Sets the value of [schema][crate::model::source_object_identifier::OracleObjectIdentifier::schema].
31224        pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31225            self.schema = v.into();
31226            self
31227        }
31228
31229        /// Sets the value of [table][crate::model::source_object_identifier::OracleObjectIdentifier::table].
31230        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31231            self.table = v.into();
31232            self
31233        }
31234    }
31235
31236    impl wkt::message::Message for OracleObjectIdentifier {
31237        fn typename() -> &'static str {
31238            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.OracleObjectIdentifier"
31239        }
31240    }
31241
31242    #[doc(hidden)]
31243    impl<'de> serde::de::Deserialize<'de> for OracleObjectIdentifier {
31244        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31245        where
31246            D: serde::Deserializer<'de>,
31247        {
31248            #[allow(non_camel_case_types)]
31249            #[doc(hidden)]
31250            #[derive(PartialEq, Eq, Hash)]
31251            enum __FieldTag {
31252                __schema,
31253                __table,
31254                Unknown(std::string::String),
31255            }
31256            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
31257                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31258                where
31259                    D: serde::Deserializer<'de>,
31260                {
31261                    struct Visitor;
31262                    impl<'de> serde::de::Visitor<'de> for Visitor {
31263                        type Value = __FieldTag;
31264                        fn expecting(
31265                            &self,
31266                            formatter: &mut std::fmt::Formatter,
31267                        ) -> std::fmt::Result {
31268                            formatter.write_str("a field name for OracleObjectIdentifier")
31269                        }
31270                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
31271                        where
31272                            E: serde::de::Error,
31273                        {
31274                            use std::result::Result::Ok;
31275                            use std::string::ToString;
31276                            match value {
31277                                "schema" => Ok(__FieldTag::__schema),
31278                                "table" => Ok(__FieldTag::__table),
31279                                _ => Ok(__FieldTag::Unknown(value.to_string())),
31280                            }
31281                        }
31282                    }
31283                    deserializer.deserialize_identifier(Visitor)
31284                }
31285            }
31286            struct Visitor;
31287            impl<'de> serde::de::Visitor<'de> for Visitor {
31288                type Value = OracleObjectIdentifier;
31289                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
31290                    formatter.write_str("struct OracleObjectIdentifier")
31291                }
31292                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
31293                where
31294                    A: serde::de::MapAccess<'de>,
31295                {
31296                    #[allow(unused_imports)]
31297                    use serde::de::Error;
31298                    use std::option::Option::Some;
31299                    let mut fields = std::collections::HashSet::new();
31300                    let mut result = Self::Value::new();
31301                    while let Some(tag) = map.next_key::<__FieldTag>()? {
31302                        #[allow(clippy::match_single_binding)]
31303                        match tag {
31304                            __FieldTag::__schema => {
31305                                if !fields.insert(__FieldTag::__schema) {
31306                                    return std::result::Result::Err(A::Error::duplicate_field(
31307                                        "multiple values for schema",
31308                                    ));
31309                                }
31310                                result.schema = map
31311                                    .next_value::<std::option::Option<std::string::String>>()?
31312                                    .unwrap_or_default();
31313                            }
31314                            __FieldTag::__table => {
31315                                if !fields.insert(__FieldTag::__table) {
31316                                    return std::result::Result::Err(A::Error::duplicate_field(
31317                                        "multiple values for table",
31318                                    ));
31319                                }
31320                                result.table = map
31321                                    .next_value::<std::option::Option<std::string::String>>()?
31322                                    .unwrap_or_default();
31323                            }
31324                            __FieldTag::Unknown(key) => {
31325                                let value = map.next_value::<serde_json::Value>()?;
31326                                result._unknown_fields.insert(key, value);
31327                            }
31328                        }
31329                    }
31330                    std::result::Result::Ok(result)
31331                }
31332            }
31333            deserializer.deserialize_any(Visitor)
31334        }
31335    }
31336
31337    #[doc(hidden)]
31338    impl serde::ser::Serialize for OracleObjectIdentifier {
31339        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31340        where
31341            S: serde::ser::Serializer,
31342        {
31343            use serde::ser::SerializeMap;
31344            #[allow(unused_imports)]
31345            use std::option::Option::Some;
31346            let mut state = serializer.serialize_map(std::option::Option::None)?;
31347            if !self.schema.is_empty() {
31348                state.serialize_entry("schema", &self.schema)?;
31349            }
31350            if !self.table.is_empty() {
31351                state.serialize_entry("table", &self.table)?;
31352            }
31353            if !self._unknown_fields.is_empty() {
31354                for (key, value) in self._unknown_fields.iter() {
31355                    state.serialize_entry(key, &value)?;
31356                }
31357            }
31358            state.end()
31359        }
31360    }
31361
31362    impl std::fmt::Debug for OracleObjectIdentifier {
31363        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
31364            let mut debug_struct = f.debug_struct("OracleObjectIdentifier");
31365            debug_struct.field("schema", &self.schema);
31366            debug_struct.field("table", &self.table);
31367            if !self._unknown_fields.is_empty() {
31368                debug_struct.field("_unknown_fields", &self._unknown_fields);
31369            }
31370            debug_struct.finish()
31371        }
31372    }
31373
31374    /// PostgreSQL data source object identifier.
31375    #[derive(Clone, Default, PartialEq)]
31376    #[non_exhaustive]
31377    pub struct PostgresqlObjectIdentifier {
31378        /// Required. The schema name.
31379        pub schema: std::string::String,
31380
31381        /// Required. The table name.
31382        pub table: std::string::String,
31383
31384        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31385    }
31386
31387    impl PostgresqlObjectIdentifier {
31388        pub fn new() -> Self {
31389            std::default::Default::default()
31390        }
31391
31392        /// Sets the value of [schema][crate::model::source_object_identifier::PostgresqlObjectIdentifier::schema].
31393        pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31394            self.schema = v.into();
31395            self
31396        }
31397
31398        /// Sets the value of [table][crate::model::source_object_identifier::PostgresqlObjectIdentifier::table].
31399        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31400            self.table = v.into();
31401            self
31402        }
31403    }
31404
31405    impl wkt::message::Message for PostgresqlObjectIdentifier {
31406        fn typename() -> &'static str {
31407            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.PostgresqlObjectIdentifier"
31408        }
31409    }
31410
31411    #[doc(hidden)]
31412    impl<'de> serde::de::Deserialize<'de> for PostgresqlObjectIdentifier {
31413        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31414        where
31415            D: serde::Deserializer<'de>,
31416        {
31417            #[allow(non_camel_case_types)]
31418            #[doc(hidden)]
31419            #[derive(PartialEq, Eq, Hash)]
31420            enum __FieldTag {
31421                __schema,
31422                __table,
31423                Unknown(std::string::String),
31424            }
31425            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
31426                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31427                where
31428                    D: serde::Deserializer<'de>,
31429                {
31430                    struct Visitor;
31431                    impl<'de> serde::de::Visitor<'de> for Visitor {
31432                        type Value = __FieldTag;
31433                        fn expecting(
31434                            &self,
31435                            formatter: &mut std::fmt::Formatter,
31436                        ) -> std::fmt::Result {
31437                            formatter.write_str("a field name for PostgresqlObjectIdentifier")
31438                        }
31439                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
31440                        where
31441                            E: serde::de::Error,
31442                        {
31443                            use std::result::Result::Ok;
31444                            use std::string::ToString;
31445                            match value {
31446                                "schema" => Ok(__FieldTag::__schema),
31447                                "table" => Ok(__FieldTag::__table),
31448                                _ => Ok(__FieldTag::Unknown(value.to_string())),
31449                            }
31450                        }
31451                    }
31452                    deserializer.deserialize_identifier(Visitor)
31453                }
31454            }
31455            struct Visitor;
31456            impl<'de> serde::de::Visitor<'de> for Visitor {
31457                type Value = PostgresqlObjectIdentifier;
31458                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
31459                    formatter.write_str("struct PostgresqlObjectIdentifier")
31460                }
31461                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
31462                where
31463                    A: serde::de::MapAccess<'de>,
31464                {
31465                    #[allow(unused_imports)]
31466                    use serde::de::Error;
31467                    use std::option::Option::Some;
31468                    let mut fields = std::collections::HashSet::new();
31469                    let mut result = Self::Value::new();
31470                    while let Some(tag) = map.next_key::<__FieldTag>()? {
31471                        #[allow(clippy::match_single_binding)]
31472                        match tag {
31473                            __FieldTag::__schema => {
31474                                if !fields.insert(__FieldTag::__schema) {
31475                                    return std::result::Result::Err(A::Error::duplicate_field(
31476                                        "multiple values for schema",
31477                                    ));
31478                                }
31479                                result.schema = map
31480                                    .next_value::<std::option::Option<std::string::String>>()?
31481                                    .unwrap_or_default();
31482                            }
31483                            __FieldTag::__table => {
31484                                if !fields.insert(__FieldTag::__table) {
31485                                    return std::result::Result::Err(A::Error::duplicate_field(
31486                                        "multiple values for table",
31487                                    ));
31488                                }
31489                                result.table = map
31490                                    .next_value::<std::option::Option<std::string::String>>()?
31491                                    .unwrap_or_default();
31492                            }
31493                            __FieldTag::Unknown(key) => {
31494                                let value = map.next_value::<serde_json::Value>()?;
31495                                result._unknown_fields.insert(key, value);
31496                            }
31497                        }
31498                    }
31499                    std::result::Result::Ok(result)
31500                }
31501            }
31502            deserializer.deserialize_any(Visitor)
31503        }
31504    }
31505
31506    #[doc(hidden)]
31507    impl serde::ser::Serialize for PostgresqlObjectIdentifier {
31508        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31509        where
31510            S: serde::ser::Serializer,
31511        {
31512            use serde::ser::SerializeMap;
31513            #[allow(unused_imports)]
31514            use std::option::Option::Some;
31515            let mut state = serializer.serialize_map(std::option::Option::None)?;
31516            if !self.schema.is_empty() {
31517                state.serialize_entry("schema", &self.schema)?;
31518            }
31519            if !self.table.is_empty() {
31520                state.serialize_entry("table", &self.table)?;
31521            }
31522            if !self._unknown_fields.is_empty() {
31523                for (key, value) in self._unknown_fields.iter() {
31524                    state.serialize_entry(key, &value)?;
31525                }
31526            }
31527            state.end()
31528        }
31529    }
31530
31531    impl std::fmt::Debug for PostgresqlObjectIdentifier {
31532        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
31533            let mut debug_struct = f.debug_struct("PostgresqlObjectIdentifier");
31534            debug_struct.field("schema", &self.schema);
31535            debug_struct.field("table", &self.table);
31536            if !self._unknown_fields.is_empty() {
31537                debug_struct.field("_unknown_fields", &self._unknown_fields);
31538            }
31539            debug_struct.finish()
31540        }
31541    }
31542
31543    /// Mysql data source object identifier.
31544    #[derive(Clone, Default, PartialEq)]
31545    #[non_exhaustive]
31546    pub struct MysqlObjectIdentifier {
31547        /// Required. The database name.
31548        pub database: std::string::String,
31549
31550        /// Required. The table name.
31551        pub table: std::string::String,
31552
31553        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31554    }
31555
31556    impl MysqlObjectIdentifier {
31557        pub fn new() -> Self {
31558            std::default::Default::default()
31559        }
31560
31561        /// Sets the value of [database][crate::model::source_object_identifier::MysqlObjectIdentifier::database].
31562        pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31563            self.database = v.into();
31564            self
31565        }
31566
31567        /// Sets the value of [table][crate::model::source_object_identifier::MysqlObjectIdentifier::table].
31568        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31569            self.table = v.into();
31570            self
31571        }
31572    }
31573
31574    impl wkt::message::Message for MysqlObjectIdentifier {
31575        fn typename() -> &'static str {
31576            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.MysqlObjectIdentifier"
31577        }
31578    }
31579
31580    #[doc(hidden)]
31581    impl<'de> serde::de::Deserialize<'de> for MysqlObjectIdentifier {
31582        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31583        where
31584            D: serde::Deserializer<'de>,
31585        {
31586            #[allow(non_camel_case_types)]
31587            #[doc(hidden)]
31588            #[derive(PartialEq, Eq, Hash)]
31589            enum __FieldTag {
31590                __database,
31591                __table,
31592                Unknown(std::string::String),
31593            }
31594            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
31595                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31596                where
31597                    D: serde::Deserializer<'de>,
31598                {
31599                    struct Visitor;
31600                    impl<'de> serde::de::Visitor<'de> for Visitor {
31601                        type Value = __FieldTag;
31602                        fn expecting(
31603                            &self,
31604                            formatter: &mut std::fmt::Formatter,
31605                        ) -> std::fmt::Result {
31606                            formatter.write_str("a field name for MysqlObjectIdentifier")
31607                        }
31608                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
31609                        where
31610                            E: serde::de::Error,
31611                        {
31612                            use std::result::Result::Ok;
31613                            use std::string::ToString;
31614                            match value {
31615                                "database" => Ok(__FieldTag::__database),
31616                                "table" => Ok(__FieldTag::__table),
31617                                _ => Ok(__FieldTag::Unknown(value.to_string())),
31618                            }
31619                        }
31620                    }
31621                    deserializer.deserialize_identifier(Visitor)
31622                }
31623            }
31624            struct Visitor;
31625            impl<'de> serde::de::Visitor<'de> for Visitor {
31626                type Value = MysqlObjectIdentifier;
31627                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
31628                    formatter.write_str("struct MysqlObjectIdentifier")
31629                }
31630                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
31631                where
31632                    A: serde::de::MapAccess<'de>,
31633                {
31634                    #[allow(unused_imports)]
31635                    use serde::de::Error;
31636                    use std::option::Option::Some;
31637                    let mut fields = std::collections::HashSet::new();
31638                    let mut result = Self::Value::new();
31639                    while let Some(tag) = map.next_key::<__FieldTag>()? {
31640                        #[allow(clippy::match_single_binding)]
31641                        match tag {
31642                            __FieldTag::__database => {
31643                                if !fields.insert(__FieldTag::__database) {
31644                                    return std::result::Result::Err(A::Error::duplicate_field(
31645                                        "multiple values for database",
31646                                    ));
31647                                }
31648                                result.database = map
31649                                    .next_value::<std::option::Option<std::string::String>>()?
31650                                    .unwrap_or_default();
31651                            }
31652                            __FieldTag::__table => {
31653                                if !fields.insert(__FieldTag::__table) {
31654                                    return std::result::Result::Err(A::Error::duplicate_field(
31655                                        "multiple values for table",
31656                                    ));
31657                                }
31658                                result.table = map
31659                                    .next_value::<std::option::Option<std::string::String>>()?
31660                                    .unwrap_or_default();
31661                            }
31662                            __FieldTag::Unknown(key) => {
31663                                let value = map.next_value::<serde_json::Value>()?;
31664                                result._unknown_fields.insert(key, value);
31665                            }
31666                        }
31667                    }
31668                    std::result::Result::Ok(result)
31669                }
31670            }
31671            deserializer.deserialize_any(Visitor)
31672        }
31673    }
31674
31675    #[doc(hidden)]
31676    impl serde::ser::Serialize for MysqlObjectIdentifier {
31677        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31678        where
31679            S: serde::ser::Serializer,
31680        {
31681            use serde::ser::SerializeMap;
31682            #[allow(unused_imports)]
31683            use std::option::Option::Some;
31684            let mut state = serializer.serialize_map(std::option::Option::None)?;
31685            if !self.database.is_empty() {
31686                state.serialize_entry("database", &self.database)?;
31687            }
31688            if !self.table.is_empty() {
31689                state.serialize_entry("table", &self.table)?;
31690            }
31691            if !self._unknown_fields.is_empty() {
31692                for (key, value) in self._unknown_fields.iter() {
31693                    state.serialize_entry(key, &value)?;
31694                }
31695            }
31696            state.end()
31697        }
31698    }
31699
31700    impl std::fmt::Debug for MysqlObjectIdentifier {
31701        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
31702            let mut debug_struct = f.debug_struct("MysqlObjectIdentifier");
31703            debug_struct.field("database", &self.database);
31704            debug_struct.field("table", &self.table);
31705            if !self._unknown_fields.is_empty() {
31706                debug_struct.field("_unknown_fields", &self._unknown_fields);
31707            }
31708            debug_struct.finish()
31709        }
31710    }
31711
31712    /// SQLServer data source object identifier.
31713    #[derive(Clone, Default, PartialEq)]
31714    #[non_exhaustive]
31715    pub struct SqlServerObjectIdentifier {
31716        /// Required. The schema name.
31717        pub schema: std::string::String,
31718
31719        /// Required. The table name.
31720        pub table: std::string::String,
31721
31722        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31723    }
31724
31725    impl SqlServerObjectIdentifier {
31726        pub fn new() -> Self {
31727            std::default::Default::default()
31728        }
31729
31730        /// Sets the value of [schema][crate::model::source_object_identifier::SqlServerObjectIdentifier::schema].
31731        pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31732            self.schema = v.into();
31733            self
31734        }
31735
31736        /// Sets the value of [table][crate::model::source_object_identifier::SqlServerObjectIdentifier::table].
31737        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31738            self.table = v.into();
31739            self
31740        }
31741    }
31742
31743    impl wkt::message::Message for SqlServerObjectIdentifier {
31744        fn typename() -> &'static str {
31745            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.SqlServerObjectIdentifier"
31746        }
31747    }
31748
31749    #[doc(hidden)]
31750    impl<'de> serde::de::Deserialize<'de> for SqlServerObjectIdentifier {
31751        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31752        where
31753            D: serde::Deserializer<'de>,
31754        {
31755            #[allow(non_camel_case_types)]
31756            #[doc(hidden)]
31757            #[derive(PartialEq, Eq, Hash)]
31758            enum __FieldTag {
31759                __schema,
31760                __table,
31761                Unknown(std::string::String),
31762            }
31763            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
31764                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31765                where
31766                    D: serde::Deserializer<'de>,
31767                {
31768                    struct Visitor;
31769                    impl<'de> serde::de::Visitor<'de> for Visitor {
31770                        type Value = __FieldTag;
31771                        fn expecting(
31772                            &self,
31773                            formatter: &mut std::fmt::Formatter,
31774                        ) -> std::fmt::Result {
31775                            formatter.write_str("a field name for SqlServerObjectIdentifier")
31776                        }
31777                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
31778                        where
31779                            E: serde::de::Error,
31780                        {
31781                            use std::result::Result::Ok;
31782                            use std::string::ToString;
31783                            match value {
31784                                "schema" => Ok(__FieldTag::__schema),
31785                                "table" => Ok(__FieldTag::__table),
31786                                _ => Ok(__FieldTag::Unknown(value.to_string())),
31787                            }
31788                        }
31789                    }
31790                    deserializer.deserialize_identifier(Visitor)
31791                }
31792            }
31793            struct Visitor;
31794            impl<'de> serde::de::Visitor<'de> for Visitor {
31795                type Value = SqlServerObjectIdentifier;
31796                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
31797                    formatter.write_str("struct SqlServerObjectIdentifier")
31798                }
31799                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
31800                where
31801                    A: serde::de::MapAccess<'de>,
31802                {
31803                    #[allow(unused_imports)]
31804                    use serde::de::Error;
31805                    use std::option::Option::Some;
31806                    let mut fields = std::collections::HashSet::new();
31807                    let mut result = Self::Value::new();
31808                    while let Some(tag) = map.next_key::<__FieldTag>()? {
31809                        #[allow(clippy::match_single_binding)]
31810                        match tag {
31811                            __FieldTag::__schema => {
31812                                if !fields.insert(__FieldTag::__schema) {
31813                                    return std::result::Result::Err(A::Error::duplicate_field(
31814                                        "multiple values for schema",
31815                                    ));
31816                                }
31817                                result.schema = map
31818                                    .next_value::<std::option::Option<std::string::String>>()?
31819                                    .unwrap_or_default();
31820                            }
31821                            __FieldTag::__table => {
31822                                if !fields.insert(__FieldTag::__table) {
31823                                    return std::result::Result::Err(A::Error::duplicate_field(
31824                                        "multiple values for table",
31825                                    ));
31826                                }
31827                                result.table = map
31828                                    .next_value::<std::option::Option<std::string::String>>()?
31829                                    .unwrap_or_default();
31830                            }
31831                            __FieldTag::Unknown(key) => {
31832                                let value = map.next_value::<serde_json::Value>()?;
31833                                result._unknown_fields.insert(key, value);
31834                            }
31835                        }
31836                    }
31837                    std::result::Result::Ok(result)
31838                }
31839            }
31840            deserializer.deserialize_any(Visitor)
31841        }
31842    }
31843
31844    #[doc(hidden)]
31845    impl serde::ser::Serialize for SqlServerObjectIdentifier {
31846        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31847        where
31848            S: serde::ser::Serializer,
31849        {
31850            use serde::ser::SerializeMap;
31851            #[allow(unused_imports)]
31852            use std::option::Option::Some;
31853            let mut state = serializer.serialize_map(std::option::Option::None)?;
31854            if !self.schema.is_empty() {
31855                state.serialize_entry("schema", &self.schema)?;
31856            }
31857            if !self.table.is_empty() {
31858                state.serialize_entry("table", &self.table)?;
31859            }
31860            if !self._unknown_fields.is_empty() {
31861                for (key, value) in self._unknown_fields.iter() {
31862                    state.serialize_entry(key, &value)?;
31863                }
31864            }
31865            state.end()
31866        }
31867    }
31868
31869    impl std::fmt::Debug for SqlServerObjectIdentifier {
31870        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
31871            let mut debug_struct = f.debug_struct("SqlServerObjectIdentifier");
31872            debug_struct.field("schema", &self.schema);
31873            debug_struct.field("table", &self.table);
31874            if !self._unknown_fields.is_empty() {
31875                debug_struct.field("_unknown_fields", &self._unknown_fields);
31876            }
31877            debug_struct.finish()
31878        }
31879    }
31880
31881    /// Salesforce data source object identifier.
31882    #[derive(Clone, Default, PartialEq)]
31883    #[non_exhaustive]
31884    pub struct SalesforceObjectIdentifier {
31885        /// Required. The object name.
31886        pub object_name: std::string::String,
31887
31888        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31889    }
31890
31891    impl SalesforceObjectIdentifier {
31892        pub fn new() -> Self {
31893            std::default::Default::default()
31894        }
31895
31896        /// Sets the value of [object_name][crate::model::source_object_identifier::SalesforceObjectIdentifier::object_name].
31897        pub fn set_object_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31898            self.object_name = v.into();
31899            self
31900        }
31901    }
31902
31903    impl wkt::message::Message for SalesforceObjectIdentifier {
31904        fn typename() -> &'static str {
31905            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.SalesforceObjectIdentifier"
31906        }
31907    }
31908
31909    #[doc(hidden)]
31910    impl<'de> serde::de::Deserialize<'de> for SalesforceObjectIdentifier {
31911        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31912        where
31913            D: serde::Deserializer<'de>,
31914        {
31915            #[allow(non_camel_case_types)]
31916            #[doc(hidden)]
31917            #[derive(PartialEq, Eq, Hash)]
31918            enum __FieldTag {
31919                __object_name,
31920                Unknown(std::string::String),
31921            }
31922            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
31923                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31924                where
31925                    D: serde::Deserializer<'de>,
31926                {
31927                    struct Visitor;
31928                    impl<'de> serde::de::Visitor<'de> for Visitor {
31929                        type Value = __FieldTag;
31930                        fn expecting(
31931                            &self,
31932                            formatter: &mut std::fmt::Formatter,
31933                        ) -> std::fmt::Result {
31934                            formatter.write_str("a field name for SalesforceObjectIdentifier")
31935                        }
31936                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
31937                        where
31938                            E: serde::de::Error,
31939                        {
31940                            use std::result::Result::Ok;
31941                            use std::string::ToString;
31942                            match value {
31943                                "objectName" => Ok(__FieldTag::__object_name),
31944                                "object_name" => Ok(__FieldTag::__object_name),
31945                                _ => Ok(__FieldTag::Unknown(value.to_string())),
31946                            }
31947                        }
31948                    }
31949                    deserializer.deserialize_identifier(Visitor)
31950                }
31951            }
31952            struct Visitor;
31953            impl<'de> serde::de::Visitor<'de> for Visitor {
31954                type Value = SalesforceObjectIdentifier;
31955                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
31956                    formatter.write_str("struct SalesforceObjectIdentifier")
31957                }
31958                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
31959                where
31960                    A: serde::de::MapAccess<'de>,
31961                {
31962                    #[allow(unused_imports)]
31963                    use serde::de::Error;
31964                    use std::option::Option::Some;
31965                    let mut fields = std::collections::HashSet::new();
31966                    let mut result = Self::Value::new();
31967                    while let Some(tag) = map.next_key::<__FieldTag>()? {
31968                        #[allow(clippy::match_single_binding)]
31969                        match tag {
31970                            __FieldTag::__object_name => {
31971                                if !fields.insert(__FieldTag::__object_name) {
31972                                    return std::result::Result::Err(A::Error::duplicate_field(
31973                                        "multiple values for object_name",
31974                                    ));
31975                                }
31976                                result.object_name = map
31977                                    .next_value::<std::option::Option<std::string::String>>()?
31978                                    .unwrap_or_default();
31979                            }
31980                            __FieldTag::Unknown(key) => {
31981                                let value = map.next_value::<serde_json::Value>()?;
31982                                result._unknown_fields.insert(key, value);
31983                            }
31984                        }
31985                    }
31986                    std::result::Result::Ok(result)
31987                }
31988            }
31989            deserializer.deserialize_any(Visitor)
31990        }
31991    }
31992
31993    #[doc(hidden)]
31994    impl serde::ser::Serialize for SalesforceObjectIdentifier {
31995        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31996        where
31997            S: serde::ser::Serializer,
31998        {
31999            use serde::ser::SerializeMap;
32000            #[allow(unused_imports)]
32001            use std::option::Option::Some;
32002            let mut state = serializer.serialize_map(std::option::Option::None)?;
32003            if !self.object_name.is_empty() {
32004                state.serialize_entry("objectName", &self.object_name)?;
32005            }
32006            if !self._unknown_fields.is_empty() {
32007                for (key, value) in self._unknown_fields.iter() {
32008                    state.serialize_entry(key, &value)?;
32009                }
32010            }
32011            state.end()
32012        }
32013    }
32014
32015    impl std::fmt::Debug for SalesforceObjectIdentifier {
32016        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
32017            let mut debug_struct = f.debug_struct("SalesforceObjectIdentifier");
32018            debug_struct.field("object_name", &self.object_name);
32019            if !self._unknown_fields.is_empty() {
32020                debug_struct.field("_unknown_fields", &self._unknown_fields);
32021            }
32022            debug_struct.finish()
32023        }
32024    }
32025
32026    /// MongoDB data source object identifier.
32027    #[derive(Clone, Default, PartialEq)]
32028    #[non_exhaustive]
32029    pub struct MongodbObjectIdentifier {
32030        /// Required. The database name.
32031        pub database: std::string::String,
32032
32033        /// Required. The collection name.
32034        pub collection: std::string::String,
32035
32036        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32037    }
32038
32039    impl MongodbObjectIdentifier {
32040        pub fn new() -> Self {
32041            std::default::Default::default()
32042        }
32043
32044        /// Sets the value of [database][crate::model::source_object_identifier::MongodbObjectIdentifier::database].
32045        pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32046            self.database = v.into();
32047            self
32048        }
32049
32050        /// Sets the value of [collection][crate::model::source_object_identifier::MongodbObjectIdentifier::collection].
32051        pub fn set_collection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32052            self.collection = v.into();
32053            self
32054        }
32055    }
32056
32057    impl wkt::message::Message for MongodbObjectIdentifier {
32058        fn typename() -> &'static str {
32059            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.MongodbObjectIdentifier"
32060        }
32061    }
32062
32063    #[doc(hidden)]
32064    impl<'de> serde::de::Deserialize<'de> for MongodbObjectIdentifier {
32065        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32066        where
32067            D: serde::Deserializer<'de>,
32068        {
32069            #[allow(non_camel_case_types)]
32070            #[doc(hidden)]
32071            #[derive(PartialEq, Eq, Hash)]
32072            enum __FieldTag {
32073                __database,
32074                __collection,
32075                Unknown(std::string::String),
32076            }
32077            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
32078                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32079                where
32080                    D: serde::Deserializer<'de>,
32081                {
32082                    struct Visitor;
32083                    impl<'de> serde::de::Visitor<'de> for Visitor {
32084                        type Value = __FieldTag;
32085                        fn expecting(
32086                            &self,
32087                            formatter: &mut std::fmt::Formatter,
32088                        ) -> std::fmt::Result {
32089                            formatter.write_str("a field name for MongodbObjectIdentifier")
32090                        }
32091                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
32092                        where
32093                            E: serde::de::Error,
32094                        {
32095                            use std::result::Result::Ok;
32096                            use std::string::ToString;
32097                            match value {
32098                                "database" => Ok(__FieldTag::__database),
32099                                "collection" => Ok(__FieldTag::__collection),
32100                                _ => Ok(__FieldTag::Unknown(value.to_string())),
32101                            }
32102                        }
32103                    }
32104                    deserializer.deserialize_identifier(Visitor)
32105                }
32106            }
32107            struct Visitor;
32108            impl<'de> serde::de::Visitor<'de> for Visitor {
32109                type Value = MongodbObjectIdentifier;
32110                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
32111                    formatter.write_str("struct MongodbObjectIdentifier")
32112                }
32113                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
32114                where
32115                    A: serde::de::MapAccess<'de>,
32116                {
32117                    #[allow(unused_imports)]
32118                    use serde::de::Error;
32119                    use std::option::Option::Some;
32120                    let mut fields = std::collections::HashSet::new();
32121                    let mut result = Self::Value::new();
32122                    while let Some(tag) = map.next_key::<__FieldTag>()? {
32123                        #[allow(clippy::match_single_binding)]
32124                        match tag {
32125                            __FieldTag::__database => {
32126                                if !fields.insert(__FieldTag::__database) {
32127                                    return std::result::Result::Err(A::Error::duplicate_field(
32128                                        "multiple values for database",
32129                                    ));
32130                                }
32131                                result.database = map
32132                                    .next_value::<std::option::Option<std::string::String>>()?
32133                                    .unwrap_or_default();
32134                            }
32135                            __FieldTag::__collection => {
32136                                if !fields.insert(__FieldTag::__collection) {
32137                                    return std::result::Result::Err(A::Error::duplicate_field(
32138                                        "multiple values for collection",
32139                                    ));
32140                                }
32141                                result.collection = map
32142                                    .next_value::<std::option::Option<std::string::String>>()?
32143                                    .unwrap_or_default();
32144                            }
32145                            __FieldTag::Unknown(key) => {
32146                                let value = map.next_value::<serde_json::Value>()?;
32147                                result._unknown_fields.insert(key, value);
32148                            }
32149                        }
32150                    }
32151                    std::result::Result::Ok(result)
32152                }
32153            }
32154            deserializer.deserialize_any(Visitor)
32155        }
32156    }
32157
32158    #[doc(hidden)]
32159    impl serde::ser::Serialize for MongodbObjectIdentifier {
32160        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32161        where
32162            S: serde::ser::Serializer,
32163        {
32164            use serde::ser::SerializeMap;
32165            #[allow(unused_imports)]
32166            use std::option::Option::Some;
32167            let mut state = serializer.serialize_map(std::option::Option::None)?;
32168            if !self.database.is_empty() {
32169                state.serialize_entry("database", &self.database)?;
32170            }
32171            if !self.collection.is_empty() {
32172                state.serialize_entry("collection", &self.collection)?;
32173            }
32174            if !self._unknown_fields.is_empty() {
32175                for (key, value) in self._unknown_fields.iter() {
32176                    state.serialize_entry(key, &value)?;
32177                }
32178            }
32179            state.end()
32180        }
32181    }
32182
32183    impl std::fmt::Debug for MongodbObjectIdentifier {
32184        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
32185            let mut debug_struct = f.debug_struct("MongodbObjectIdentifier");
32186            debug_struct.field("database", &self.database);
32187            debug_struct.field("collection", &self.collection);
32188            if !self._unknown_fields.is_empty() {
32189                debug_struct.field("_unknown_fields", &self._unknown_fields);
32190            }
32191            debug_struct.finish()
32192        }
32193    }
32194
32195    /// The identifier for an object in the data source.
32196    #[derive(Clone, Debug, PartialEq)]
32197    #[non_exhaustive]
32198    pub enum SourceIdentifier {
32199        /// Oracle data source object identifier.
32200        OracleIdentifier(
32201            std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
32202        ),
32203        /// Mysql data source object identifier.
32204        MysqlIdentifier(
32205            std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
32206        ),
32207        /// PostgreSQL data source object identifier.
32208        PostgresqlIdentifier(
32209            std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
32210        ),
32211        /// SQLServer data source object identifier.
32212        SqlServerIdentifier(
32213            std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
32214        ),
32215        /// Salesforce data source object identifier.
32216        SalesforceIdentifier(
32217            std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>,
32218        ),
32219        /// MongoDB data source object identifier.
32220        MongodbIdentifier(
32221            std::boxed::Box<crate::model::source_object_identifier::MongodbObjectIdentifier>,
32222        ),
32223    }
32224}
32225
32226/// Represents a backfill job on a specific stream object.
32227#[derive(Clone, Default, PartialEq)]
32228#[non_exhaustive]
32229pub struct BackfillJob {
32230    /// Output only. Backfill job state.
32231    pub state: crate::model::backfill_job::State,
32232
32233    /// Backfill job's triggering reason.
32234    pub trigger: crate::model::backfill_job::Trigger,
32235
32236    /// Output only. Backfill job's start time.
32237    pub last_start_time: std::option::Option<wkt::Timestamp>,
32238
32239    /// Output only. Backfill job's end time.
32240    pub last_end_time: std::option::Option<wkt::Timestamp>,
32241
32242    /// Output only. Errors which caused the backfill job to fail.
32243    pub errors: std::vec::Vec<crate::model::Error>,
32244
32245    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32246}
32247
32248impl BackfillJob {
32249    pub fn new() -> Self {
32250        std::default::Default::default()
32251    }
32252
32253    /// Sets the value of [state][crate::model::BackfillJob::state].
32254    pub fn set_state<T: std::convert::Into<crate::model::backfill_job::State>>(
32255        mut self,
32256        v: T,
32257    ) -> Self {
32258        self.state = v.into();
32259        self
32260    }
32261
32262    /// Sets the value of [trigger][crate::model::BackfillJob::trigger].
32263    pub fn set_trigger<T: std::convert::Into<crate::model::backfill_job::Trigger>>(
32264        mut self,
32265        v: T,
32266    ) -> Self {
32267        self.trigger = v.into();
32268        self
32269    }
32270
32271    /// Sets the value of [last_start_time][crate::model::BackfillJob::last_start_time].
32272    pub fn set_last_start_time<T>(mut self, v: T) -> Self
32273    where
32274        T: std::convert::Into<wkt::Timestamp>,
32275    {
32276        self.last_start_time = std::option::Option::Some(v.into());
32277        self
32278    }
32279
32280    /// Sets or clears the value of [last_start_time][crate::model::BackfillJob::last_start_time].
32281    pub fn set_or_clear_last_start_time<T>(mut self, v: std::option::Option<T>) -> Self
32282    where
32283        T: std::convert::Into<wkt::Timestamp>,
32284    {
32285        self.last_start_time = v.map(|x| x.into());
32286        self
32287    }
32288
32289    /// Sets the value of [last_end_time][crate::model::BackfillJob::last_end_time].
32290    pub fn set_last_end_time<T>(mut self, v: T) -> Self
32291    where
32292        T: std::convert::Into<wkt::Timestamp>,
32293    {
32294        self.last_end_time = std::option::Option::Some(v.into());
32295        self
32296    }
32297
32298    /// Sets or clears the value of [last_end_time][crate::model::BackfillJob::last_end_time].
32299    pub fn set_or_clear_last_end_time<T>(mut self, v: std::option::Option<T>) -> Self
32300    where
32301        T: std::convert::Into<wkt::Timestamp>,
32302    {
32303        self.last_end_time = v.map(|x| x.into());
32304        self
32305    }
32306
32307    /// Sets the value of [errors][crate::model::BackfillJob::errors].
32308    pub fn set_errors<T, V>(mut self, v: T) -> Self
32309    where
32310        T: std::iter::IntoIterator<Item = V>,
32311        V: std::convert::Into<crate::model::Error>,
32312    {
32313        use std::iter::Iterator;
32314        self.errors = v.into_iter().map(|i| i.into()).collect();
32315        self
32316    }
32317}
32318
32319impl wkt::message::Message for BackfillJob {
32320    fn typename() -> &'static str {
32321        "type.googleapis.com/google.cloud.datastream.v1.BackfillJob"
32322    }
32323}
32324
32325#[doc(hidden)]
32326impl<'de> serde::de::Deserialize<'de> for BackfillJob {
32327    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32328    where
32329        D: serde::Deserializer<'de>,
32330    {
32331        #[allow(non_camel_case_types)]
32332        #[doc(hidden)]
32333        #[derive(PartialEq, Eq, Hash)]
32334        enum __FieldTag {
32335            __state,
32336            __trigger,
32337            __last_start_time,
32338            __last_end_time,
32339            __errors,
32340            Unknown(std::string::String),
32341        }
32342        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
32343            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32344            where
32345                D: serde::Deserializer<'de>,
32346            {
32347                struct Visitor;
32348                impl<'de> serde::de::Visitor<'de> for Visitor {
32349                    type Value = __FieldTag;
32350                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
32351                        formatter.write_str("a field name for BackfillJob")
32352                    }
32353                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
32354                    where
32355                        E: serde::de::Error,
32356                    {
32357                        use std::result::Result::Ok;
32358                        use std::string::ToString;
32359                        match value {
32360                            "state" => Ok(__FieldTag::__state),
32361                            "trigger" => Ok(__FieldTag::__trigger),
32362                            "lastStartTime" => Ok(__FieldTag::__last_start_time),
32363                            "last_start_time" => Ok(__FieldTag::__last_start_time),
32364                            "lastEndTime" => Ok(__FieldTag::__last_end_time),
32365                            "last_end_time" => Ok(__FieldTag::__last_end_time),
32366                            "errors" => Ok(__FieldTag::__errors),
32367                            _ => Ok(__FieldTag::Unknown(value.to_string())),
32368                        }
32369                    }
32370                }
32371                deserializer.deserialize_identifier(Visitor)
32372            }
32373        }
32374        struct Visitor;
32375        impl<'de> serde::de::Visitor<'de> for Visitor {
32376            type Value = BackfillJob;
32377            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
32378                formatter.write_str("struct BackfillJob")
32379            }
32380            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
32381            where
32382                A: serde::de::MapAccess<'de>,
32383            {
32384                #[allow(unused_imports)]
32385                use serde::de::Error;
32386                use std::option::Option::Some;
32387                let mut fields = std::collections::HashSet::new();
32388                let mut result = Self::Value::new();
32389                while let Some(tag) = map.next_key::<__FieldTag>()? {
32390                    #[allow(clippy::match_single_binding)]
32391                    match tag {
32392                        __FieldTag::__state => {
32393                            if !fields.insert(__FieldTag::__state) {
32394                                return std::result::Result::Err(A::Error::duplicate_field(
32395                                    "multiple values for state",
32396                                ));
32397                            }
32398                            result.state = map.next_value::<std::option::Option<crate::model::backfill_job::State>>()?.unwrap_or_default();
32399                        }
32400                        __FieldTag::__trigger => {
32401                            if !fields.insert(__FieldTag::__trigger) {
32402                                return std::result::Result::Err(A::Error::duplicate_field(
32403                                    "multiple values for trigger",
32404                                ));
32405                            }
32406                            result.trigger = map.next_value::<std::option::Option<crate::model::backfill_job::Trigger>>()?.unwrap_or_default();
32407                        }
32408                        __FieldTag::__last_start_time => {
32409                            if !fields.insert(__FieldTag::__last_start_time) {
32410                                return std::result::Result::Err(A::Error::duplicate_field(
32411                                    "multiple values for last_start_time",
32412                                ));
32413                            }
32414                            result.last_start_time =
32415                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
32416                        }
32417                        __FieldTag::__last_end_time => {
32418                            if !fields.insert(__FieldTag::__last_end_time) {
32419                                return std::result::Result::Err(A::Error::duplicate_field(
32420                                    "multiple values for last_end_time",
32421                                ));
32422                            }
32423                            result.last_end_time =
32424                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
32425                        }
32426                        __FieldTag::__errors => {
32427                            if !fields.insert(__FieldTag::__errors) {
32428                                return std::result::Result::Err(A::Error::duplicate_field(
32429                                    "multiple values for errors",
32430                                ));
32431                            }
32432                            result.errors = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Error>>>()?.unwrap_or_default();
32433                        }
32434                        __FieldTag::Unknown(key) => {
32435                            let value = map.next_value::<serde_json::Value>()?;
32436                            result._unknown_fields.insert(key, value);
32437                        }
32438                    }
32439                }
32440                std::result::Result::Ok(result)
32441            }
32442        }
32443        deserializer.deserialize_any(Visitor)
32444    }
32445}
32446
32447#[doc(hidden)]
32448impl serde::ser::Serialize for BackfillJob {
32449    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32450    where
32451        S: serde::ser::Serializer,
32452    {
32453        use serde::ser::SerializeMap;
32454        #[allow(unused_imports)]
32455        use std::option::Option::Some;
32456        let mut state = serializer.serialize_map(std::option::Option::None)?;
32457        if !wkt::internal::is_default(&self.state) {
32458            state.serialize_entry("state", &self.state)?;
32459        }
32460        if !wkt::internal::is_default(&self.trigger) {
32461            state.serialize_entry("trigger", &self.trigger)?;
32462        }
32463        if self.last_start_time.is_some() {
32464            state.serialize_entry("lastStartTime", &self.last_start_time)?;
32465        }
32466        if self.last_end_time.is_some() {
32467            state.serialize_entry("lastEndTime", &self.last_end_time)?;
32468        }
32469        if !self.errors.is_empty() {
32470            state.serialize_entry("errors", &self.errors)?;
32471        }
32472        if !self._unknown_fields.is_empty() {
32473            for (key, value) in self._unknown_fields.iter() {
32474                state.serialize_entry(key, &value)?;
32475            }
32476        }
32477        state.end()
32478    }
32479}
32480
32481impl std::fmt::Debug for BackfillJob {
32482    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
32483        let mut debug_struct = f.debug_struct("BackfillJob");
32484        debug_struct.field("state", &self.state);
32485        debug_struct.field("trigger", &self.trigger);
32486        debug_struct.field("last_start_time", &self.last_start_time);
32487        debug_struct.field("last_end_time", &self.last_end_time);
32488        debug_struct.field("errors", &self.errors);
32489        if !self._unknown_fields.is_empty() {
32490            debug_struct.field("_unknown_fields", &self._unknown_fields);
32491        }
32492        debug_struct.finish()
32493    }
32494}
32495
32496/// Defines additional types related to [BackfillJob].
32497pub mod backfill_job {
32498    #[allow(unused_imports)]
32499    use super::*;
32500
32501    /// State of the stream object's backfill job.
32502    ///
32503    /// # Working with unknown values
32504    ///
32505    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32506    /// additional enum variants at any time. Adding new variants is not considered
32507    /// a breaking change. Applications should write their code in anticipation of:
32508    ///
32509    /// - New values appearing in future releases of the client library, **and**
32510    /// - New values received dynamically, without application changes.
32511    ///
32512    /// Please consult the [Working with enums] section in the user guide for some
32513    /// guidelines.
32514    ///
32515    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
32516    #[derive(Clone, Debug, PartialEq)]
32517    #[non_exhaustive]
32518    pub enum State {
32519        /// Default value.
32520        Unspecified,
32521        /// Backfill job was never started for the stream object (stream has backfill
32522        /// strategy defined as manual or object was explicitly excluded from
32523        /// automatic backfill).
32524        NotStarted,
32525        /// Backfill job will start pending available resources.
32526        Pending,
32527        /// Backfill job is running.
32528        Active,
32529        /// Backfill job stopped (next job run will start from beginning).
32530        Stopped,
32531        /// Backfill job failed (due to an error).
32532        Failed,
32533        /// Backfill completed successfully.
32534        Completed,
32535        /// Backfill job failed since the table structure is currently unsupported
32536        /// for backfill.
32537        Unsupported,
32538        /// If set, the enum was initialized with an unknown value.
32539        ///
32540        /// Applications can examine the value using [State::value] or
32541        /// [State::name].
32542        UnknownValue(state::UnknownValue),
32543    }
32544
32545    #[doc(hidden)]
32546    pub mod state {
32547        #[allow(unused_imports)]
32548        use super::*;
32549        #[derive(Clone, Debug, PartialEq)]
32550        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32551    }
32552
32553    impl State {
32554        /// Gets the enum value.
32555        ///
32556        /// Returns `None` if the enum contains an unknown value deserialized from
32557        /// the string representation of enums.
32558        pub fn value(&self) -> std::option::Option<i32> {
32559            match self {
32560                Self::Unspecified => std::option::Option::Some(0),
32561                Self::NotStarted => std::option::Option::Some(1),
32562                Self::Pending => std::option::Option::Some(2),
32563                Self::Active => std::option::Option::Some(3),
32564                Self::Stopped => std::option::Option::Some(4),
32565                Self::Failed => std::option::Option::Some(5),
32566                Self::Completed => std::option::Option::Some(6),
32567                Self::Unsupported => std::option::Option::Some(7),
32568                Self::UnknownValue(u) => u.0.value(),
32569            }
32570        }
32571
32572        /// Gets the enum value as a string.
32573        ///
32574        /// Returns `None` if the enum contains an unknown value deserialized from
32575        /// the integer representation of enums.
32576        pub fn name(&self) -> std::option::Option<&str> {
32577            match self {
32578                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
32579                Self::NotStarted => std::option::Option::Some("NOT_STARTED"),
32580                Self::Pending => std::option::Option::Some("PENDING"),
32581                Self::Active => std::option::Option::Some("ACTIVE"),
32582                Self::Stopped => std::option::Option::Some("STOPPED"),
32583                Self::Failed => std::option::Option::Some("FAILED"),
32584                Self::Completed => std::option::Option::Some("COMPLETED"),
32585                Self::Unsupported => std::option::Option::Some("UNSUPPORTED"),
32586                Self::UnknownValue(u) => u.0.name(),
32587            }
32588        }
32589    }
32590
32591    impl std::default::Default for State {
32592        fn default() -> Self {
32593            use std::convert::From;
32594            Self::from(0)
32595        }
32596    }
32597
32598    impl std::fmt::Display for State {
32599        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32600            wkt::internal::display_enum(f, self.name(), self.value())
32601        }
32602    }
32603
32604    impl std::convert::From<i32> for State {
32605        fn from(value: i32) -> Self {
32606            match value {
32607                0 => Self::Unspecified,
32608                1 => Self::NotStarted,
32609                2 => Self::Pending,
32610                3 => Self::Active,
32611                4 => Self::Stopped,
32612                5 => Self::Failed,
32613                6 => Self::Completed,
32614                7 => Self::Unsupported,
32615                _ => Self::UnknownValue(state::UnknownValue(
32616                    wkt::internal::UnknownEnumValue::Integer(value),
32617                )),
32618            }
32619        }
32620    }
32621
32622    impl std::convert::From<&str> for State {
32623        fn from(value: &str) -> Self {
32624            use std::string::ToString;
32625            match value {
32626                "STATE_UNSPECIFIED" => Self::Unspecified,
32627                "NOT_STARTED" => Self::NotStarted,
32628                "PENDING" => Self::Pending,
32629                "ACTIVE" => Self::Active,
32630                "STOPPED" => Self::Stopped,
32631                "FAILED" => Self::Failed,
32632                "COMPLETED" => Self::Completed,
32633                "UNSUPPORTED" => Self::Unsupported,
32634                _ => Self::UnknownValue(state::UnknownValue(
32635                    wkt::internal::UnknownEnumValue::String(value.to_string()),
32636                )),
32637            }
32638        }
32639    }
32640
32641    impl serde::ser::Serialize for State {
32642        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32643        where
32644            S: serde::Serializer,
32645        {
32646            match self {
32647                Self::Unspecified => serializer.serialize_i32(0),
32648                Self::NotStarted => serializer.serialize_i32(1),
32649                Self::Pending => serializer.serialize_i32(2),
32650                Self::Active => serializer.serialize_i32(3),
32651                Self::Stopped => serializer.serialize_i32(4),
32652                Self::Failed => serializer.serialize_i32(5),
32653                Self::Completed => serializer.serialize_i32(6),
32654                Self::Unsupported => serializer.serialize_i32(7),
32655                Self::UnknownValue(u) => u.0.serialize(serializer),
32656            }
32657        }
32658    }
32659
32660    impl<'de> serde::de::Deserialize<'de> for State {
32661        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32662        where
32663            D: serde::Deserializer<'de>,
32664        {
32665            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
32666                ".google.cloud.datastream.v1.BackfillJob.State",
32667            ))
32668        }
32669    }
32670
32671    /// Triggering reason for a backfill job.
32672    ///
32673    /// # Working with unknown values
32674    ///
32675    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32676    /// additional enum variants at any time. Adding new variants is not considered
32677    /// a breaking change. Applications should write their code in anticipation of:
32678    ///
32679    /// - New values appearing in future releases of the client library, **and**
32680    /// - New values received dynamically, without application changes.
32681    ///
32682    /// Please consult the [Working with enums] section in the user guide for some
32683    /// guidelines.
32684    ///
32685    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
32686    #[derive(Clone, Debug, PartialEq)]
32687    #[non_exhaustive]
32688    pub enum Trigger {
32689        /// Default value.
32690        Unspecified,
32691        /// Object backfill job was triggered automatically according to the stream's
32692        /// backfill strategy.
32693        Automatic,
32694        /// Object backfill job was triggered manually using the dedicated API.
32695        Manual,
32696        /// If set, the enum was initialized with an unknown value.
32697        ///
32698        /// Applications can examine the value using [Trigger::value] or
32699        /// [Trigger::name].
32700        UnknownValue(trigger::UnknownValue),
32701    }
32702
32703    #[doc(hidden)]
32704    pub mod trigger {
32705        #[allow(unused_imports)]
32706        use super::*;
32707        #[derive(Clone, Debug, PartialEq)]
32708        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32709    }
32710
32711    impl Trigger {
32712        /// Gets the enum value.
32713        ///
32714        /// Returns `None` if the enum contains an unknown value deserialized from
32715        /// the string representation of enums.
32716        pub fn value(&self) -> std::option::Option<i32> {
32717            match self {
32718                Self::Unspecified => std::option::Option::Some(0),
32719                Self::Automatic => std::option::Option::Some(1),
32720                Self::Manual => std::option::Option::Some(2),
32721                Self::UnknownValue(u) => u.0.value(),
32722            }
32723        }
32724
32725        /// Gets the enum value as a string.
32726        ///
32727        /// Returns `None` if the enum contains an unknown value deserialized from
32728        /// the integer representation of enums.
32729        pub fn name(&self) -> std::option::Option<&str> {
32730            match self {
32731                Self::Unspecified => std::option::Option::Some("TRIGGER_UNSPECIFIED"),
32732                Self::Automatic => std::option::Option::Some("AUTOMATIC"),
32733                Self::Manual => std::option::Option::Some("MANUAL"),
32734                Self::UnknownValue(u) => u.0.name(),
32735            }
32736        }
32737    }
32738
32739    impl std::default::Default for Trigger {
32740        fn default() -> Self {
32741            use std::convert::From;
32742            Self::from(0)
32743        }
32744    }
32745
32746    impl std::fmt::Display for Trigger {
32747        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32748            wkt::internal::display_enum(f, self.name(), self.value())
32749        }
32750    }
32751
32752    impl std::convert::From<i32> for Trigger {
32753        fn from(value: i32) -> Self {
32754            match value {
32755                0 => Self::Unspecified,
32756                1 => Self::Automatic,
32757                2 => Self::Manual,
32758                _ => Self::UnknownValue(trigger::UnknownValue(
32759                    wkt::internal::UnknownEnumValue::Integer(value),
32760                )),
32761            }
32762        }
32763    }
32764
32765    impl std::convert::From<&str> for Trigger {
32766        fn from(value: &str) -> Self {
32767            use std::string::ToString;
32768            match value {
32769                "TRIGGER_UNSPECIFIED" => Self::Unspecified,
32770                "AUTOMATIC" => Self::Automatic,
32771                "MANUAL" => Self::Manual,
32772                _ => Self::UnknownValue(trigger::UnknownValue(
32773                    wkt::internal::UnknownEnumValue::String(value.to_string()),
32774                )),
32775            }
32776        }
32777    }
32778
32779    impl serde::ser::Serialize for Trigger {
32780        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32781        where
32782            S: serde::Serializer,
32783        {
32784            match self {
32785                Self::Unspecified => serializer.serialize_i32(0),
32786                Self::Automatic => serializer.serialize_i32(1),
32787                Self::Manual => serializer.serialize_i32(2),
32788                Self::UnknownValue(u) => u.0.serialize(serializer),
32789            }
32790        }
32791    }
32792
32793    impl<'de> serde::de::Deserialize<'de> for Trigger {
32794        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32795        where
32796            D: serde::Deserializer<'de>,
32797        {
32798            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Trigger>::new(
32799                ".google.cloud.datastream.v1.BackfillJob.Trigger",
32800            ))
32801        }
32802    }
32803}
32804
32805/// Represent a user-facing Error.
32806#[derive(Clone, Default, PartialEq)]
32807#[non_exhaustive]
32808pub struct Error {
32809    /// A title that explains the reason for the error.
32810    pub reason: std::string::String,
32811
32812    /// A unique identifier for this specific error,
32813    /// allowing it to be traced throughout the system in logs and API responses.
32814    pub error_uuid: std::string::String,
32815
32816    /// A message containing more information about the error that occurred.
32817    pub message: std::string::String,
32818
32819    /// The time when the error occurred.
32820    pub error_time: std::option::Option<wkt::Timestamp>,
32821
32822    /// Additional information about the error.
32823    pub details: std::collections::HashMap<std::string::String, std::string::String>,
32824
32825    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32826}
32827
32828impl Error {
32829    pub fn new() -> Self {
32830        std::default::Default::default()
32831    }
32832
32833    /// Sets the value of [reason][crate::model::Error::reason].
32834    pub fn set_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32835        self.reason = v.into();
32836        self
32837    }
32838
32839    /// Sets the value of [error_uuid][crate::model::Error::error_uuid].
32840    pub fn set_error_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32841        self.error_uuid = v.into();
32842        self
32843    }
32844
32845    /// Sets the value of [message][crate::model::Error::message].
32846    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32847        self.message = v.into();
32848        self
32849    }
32850
32851    /// Sets the value of [error_time][crate::model::Error::error_time].
32852    pub fn set_error_time<T>(mut self, v: T) -> Self
32853    where
32854        T: std::convert::Into<wkt::Timestamp>,
32855    {
32856        self.error_time = std::option::Option::Some(v.into());
32857        self
32858    }
32859
32860    /// Sets or clears the value of [error_time][crate::model::Error::error_time].
32861    pub fn set_or_clear_error_time<T>(mut self, v: std::option::Option<T>) -> Self
32862    where
32863        T: std::convert::Into<wkt::Timestamp>,
32864    {
32865        self.error_time = v.map(|x| x.into());
32866        self
32867    }
32868
32869    /// Sets the value of [details][crate::model::Error::details].
32870    pub fn set_details<T, K, V>(mut self, v: T) -> Self
32871    where
32872        T: std::iter::IntoIterator<Item = (K, V)>,
32873        K: std::convert::Into<std::string::String>,
32874        V: std::convert::Into<std::string::String>,
32875    {
32876        use std::iter::Iterator;
32877        self.details = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
32878        self
32879    }
32880}
32881
32882impl wkt::message::Message for Error {
32883    fn typename() -> &'static str {
32884        "type.googleapis.com/google.cloud.datastream.v1.Error"
32885    }
32886}
32887
32888#[doc(hidden)]
32889impl<'de> serde::de::Deserialize<'de> for Error {
32890    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32891    where
32892        D: serde::Deserializer<'de>,
32893    {
32894        #[allow(non_camel_case_types)]
32895        #[doc(hidden)]
32896        #[derive(PartialEq, Eq, Hash)]
32897        enum __FieldTag {
32898            __reason,
32899            __error_uuid,
32900            __message,
32901            __error_time,
32902            __details,
32903            Unknown(std::string::String),
32904        }
32905        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
32906            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32907            where
32908                D: serde::Deserializer<'de>,
32909            {
32910                struct Visitor;
32911                impl<'de> serde::de::Visitor<'de> for Visitor {
32912                    type Value = __FieldTag;
32913                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
32914                        formatter.write_str("a field name for Error")
32915                    }
32916                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
32917                    where
32918                        E: serde::de::Error,
32919                    {
32920                        use std::result::Result::Ok;
32921                        use std::string::ToString;
32922                        match value {
32923                            "reason" => Ok(__FieldTag::__reason),
32924                            "errorUuid" => Ok(__FieldTag::__error_uuid),
32925                            "error_uuid" => Ok(__FieldTag::__error_uuid),
32926                            "message" => Ok(__FieldTag::__message),
32927                            "errorTime" => Ok(__FieldTag::__error_time),
32928                            "error_time" => Ok(__FieldTag::__error_time),
32929                            "details" => Ok(__FieldTag::__details),
32930                            _ => Ok(__FieldTag::Unknown(value.to_string())),
32931                        }
32932                    }
32933                }
32934                deserializer.deserialize_identifier(Visitor)
32935            }
32936        }
32937        struct Visitor;
32938        impl<'de> serde::de::Visitor<'de> for Visitor {
32939            type Value = Error;
32940            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
32941                formatter.write_str("struct Error")
32942            }
32943            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
32944            where
32945                A: serde::de::MapAccess<'de>,
32946            {
32947                #[allow(unused_imports)]
32948                use serde::de::Error;
32949                use std::option::Option::Some;
32950                let mut fields = std::collections::HashSet::new();
32951                let mut result = Self::Value::new();
32952                while let Some(tag) = map.next_key::<__FieldTag>()? {
32953                    #[allow(clippy::match_single_binding)]
32954                    match tag {
32955                        __FieldTag::__reason => {
32956                            if !fields.insert(__FieldTag::__reason) {
32957                                return std::result::Result::Err(A::Error::duplicate_field(
32958                                    "multiple values for reason",
32959                                ));
32960                            }
32961                            result.reason = map
32962                                .next_value::<std::option::Option<std::string::String>>()?
32963                                .unwrap_or_default();
32964                        }
32965                        __FieldTag::__error_uuid => {
32966                            if !fields.insert(__FieldTag::__error_uuid) {
32967                                return std::result::Result::Err(A::Error::duplicate_field(
32968                                    "multiple values for error_uuid",
32969                                ));
32970                            }
32971                            result.error_uuid = map
32972                                .next_value::<std::option::Option<std::string::String>>()?
32973                                .unwrap_or_default();
32974                        }
32975                        __FieldTag::__message => {
32976                            if !fields.insert(__FieldTag::__message) {
32977                                return std::result::Result::Err(A::Error::duplicate_field(
32978                                    "multiple values for message",
32979                                ));
32980                            }
32981                            result.message = map
32982                                .next_value::<std::option::Option<std::string::String>>()?
32983                                .unwrap_or_default();
32984                        }
32985                        __FieldTag::__error_time => {
32986                            if !fields.insert(__FieldTag::__error_time) {
32987                                return std::result::Result::Err(A::Error::duplicate_field(
32988                                    "multiple values for error_time",
32989                                ));
32990                            }
32991                            result.error_time =
32992                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
32993                        }
32994                        __FieldTag::__details => {
32995                            if !fields.insert(__FieldTag::__details) {
32996                                return std::result::Result::Err(A::Error::duplicate_field(
32997                                    "multiple values for details",
32998                                ));
32999                            }
33000                            result.details = map
33001                                .next_value::<std::option::Option<
33002                                    std::collections::HashMap<
33003                                        std::string::String,
33004                                        std::string::String,
33005                                    >,
33006                                >>()?
33007                                .unwrap_or_default();
33008                        }
33009                        __FieldTag::Unknown(key) => {
33010                            let value = map.next_value::<serde_json::Value>()?;
33011                            result._unknown_fields.insert(key, value);
33012                        }
33013                    }
33014                }
33015                std::result::Result::Ok(result)
33016            }
33017        }
33018        deserializer.deserialize_any(Visitor)
33019    }
33020}
33021
33022#[doc(hidden)]
33023impl serde::ser::Serialize for Error {
33024    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33025    where
33026        S: serde::ser::Serializer,
33027    {
33028        use serde::ser::SerializeMap;
33029        #[allow(unused_imports)]
33030        use std::option::Option::Some;
33031        let mut state = serializer.serialize_map(std::option::Option::None)?;
33032        if !self.reason.is_empty() {
33033            state.serialize_entry("reason", &self.reason)?;
33034        }
33035        if !self.error_uuid.is_empty() {
33036            state.serialize_entry("errorUuid", &self.error_uuid)?;
33037        }
33038        if !self.message.is_empty() {
33039            state.serialize_entry("message", &self.message)?;
33040        }
33041        if self.error_time.is_some() {
33042            state.serialize_entry("errorTime", &self.error_time)?;
33043        }
33044        if !self.details.is_empty() {
33045            state.serialize_entry("details", &self.details)?;
33046        }
33047        if !self._unknown_fields.is_empty() {
33048            for (key, value) in self._unknown_fields.iter() {
33049                state.serialize_entry(key, &value)?;
33050            }
33051        }
33052        state.end()
33053    }
33054}
33055
33056impl std::fmt::Debug for Error {
33057    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
33058        let mut debug_struct = f.debug_struct("Error");
33059        debug_struct.field("reason", &self.reason);
33060        debug_struct.field("error_uuid", &self.error_uuid);
33061        debug_struct.field("message", &self.message);
33062        debug_struct.field("error_time", &self.error_time);
33063        debug_struct.field("details", &self.details);
33064        if !self._unknown_fields.is_empty() {
33065            debug_struct.field("_unknown_fields", &self._unknown_fields);
33066        }
33067        debug_struct.finish()
33068    }
33069}
33070
33071/// Contains the current validation results.
33072#[derive(Clone, Default, PartialEq)]
33073#[non_exhaustive]
33074pub struct ValidationResult {
33075    /// A list of validations (includes both executed as well as not executed
33076    /// validations).
33077    pub validations: std::vec::Vec<crate::model::Validation>,
33078
33079    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33080}
33081
33082impl ValidationResult {
33083    pub fn new() -> Self {
33084        std::default::Default::default()
33085    }
33086
33087    /// Sets the value of [validations][crate::model::ValidationResult::validations].
33088    pub fn set_validations<T, V>(mut self, v: T) -> Self
33089    where
33090        T: std::iter::IntoIterator<Item = V>,
33091        V: std::convert::Into<crate::model::Validation>,
33092    {
33093        use std::iter::Iterator;
33094        self.validations = v.into_iter().map(|i| i.into()).collect();
33095        self
33096    }
33097}
33098
33099impl wkt::message::Message for ValidationResult {
33100    fn typename() -> &'static str {
33101        "type.googleapis.com/google.cloud.datastream.v1.ValidationResult"
33102    }
33103}
33104
33105#[doc(hidden)]
33106impl<'de> serde::de::Deserialize<'de> for ValidationResult {
33107    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33108    where
33109        D: serde::Deserializer<'de>,
33110    {
33111        #[allow(non_camel_case_types)]
33112        #[doc(hidden)]
33113        #[derive(PartialEq, Eq, Hash)]
33114        enum __FieldTag {
33115            __validations,
33116            Unknown(std::string::String),
33117        }
33118        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
33119            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33120            where
33121                D: serde::Deserializer<'de>,
33122            {
33123                struct Visitor;
33124                impl<'de> serde::de::Visitor<'de> for Visitor {
33125                    type Value = __FieldTag;
33126                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
33127                        formatter.write_str("a field name for ValidationResult")
33128                    }
33129                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
33130                    where
33131                        E: serde::de::Error,
33132                    {
33133                        use std::result::Result::Ok;
33134                        use std::string::ToString;
33135                        match value {
33136                            "validations" => Ok(__FieldTag::__validations),
33137                            _ => Ok(__FieldTag::Unknown(value.to_string())),
33138                        }
33139                    }
33140                }
33141                deserializer.deserialize_identifier(Visitor)
33142            }
33143        }
33144        struct Visitor;
33145        impl<'de> serde::de::Visitor<'de> for Visitor {
33146            type Value = ValidationResult;
33147            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
33148                formatter.write_str("struct ValidationResult")
33149            }
33150            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
33151            where
33152                A: serde::de::MapAccess<'de>,
33153            {
33154                #[allow(unused_imports)]
33155                use serde::de::Error;
33156                use std::option::Option::Some;
33157                let mut fields = std::collections::HashSet::new();
33158                let mut result = Self::Value::new();
33159                while let Some(tag) = map.next_key::<__FieldTag>()? {
33160                    #[allow(clippy::match_single_binding)]
33161                    match tag {
33162                        __FieldTag::__validations => {
33163                            if !fields.insert(__FieldTag::__validations) {
33164                                return std::result::Result::Err(A::Error::duplicate_field(
33165                                    "multiple values for validations",
33166                                ));
33167                            }
33168                            result.validations = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Validation>>>()?.unwrap_or_default();
33169                        }
33170                        __FieldTag::Unknown(key) => {
33171                            let value = map.next_value::<serde_json::Value>()?;
33172                            result._unknown_fields.insert(key, value);
33173                        }
33174                    }
33175                }
33176                std::result::Result::Ok(result)
33177            }
33178        }
33179        deserializer.deserialize_any(Visitor)
33180    }
33181}
33182
33183#[doc(hidden)]
33184impl serde::ser::Serialize for ValidationResult {
33185    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33186    where
33187        S: serde::ser::Serializer,
33188    {
33189        use serde::ser::SerializeMap;
33190        #[allow(unused_imports)]
33191        use std::option::Option::Some;
33192        let mut state = serializer.serialize_map(std::option::Option::None)?;
33193        if !self.validations.is_empty() {
33194            state.serialize_entry("validations", &self.validations)?;
33195        }
33196        if !self._unknown_fields.is_empty() {
33197            for (key, value) in self._unknown_fields.iter() {
33198                state.serialize_entry(key, &value)?;
33199            }
33200        }
33201        state.end()
33202    }
33203}
33204
33205impl std::fmt::Debug for ValidationResult {
33206    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
33207        let mut debug_struct = f.debug_struct("ValidationResult");
33208        debug_struct.field("validations", &self.validations);
33209        if !self._unknown_fields.is_empty() {
33210            debug_struct.field("_unknown_fields", &self._unknown_fields);
33211        }
33212        debug_struct.finish()
33213    }
33214}
33215
33216/// A validation to perform on a stream.
33217#[derive(Clone, Default, PartialEq)]
33218#[non_exhaustive]
33219pub struct Validation {
33220    /// A short description of the validation.
33221    pub description: std::string::String,
33222
33223    /// Output only. Validation execution status.
33224    pub state: crate::model::validation::State,
33225
33226    /// Messages reflecting the validation results.
33227    pub message: std::vec::Vec<crate::model::ValidationMessage>,
33228
33229    /// A custom code identifying this validation.
33230    pub code: std::string::String,
33231
33232    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33233}
33234
33235impl Validation {
33236    pub fn new() -> Self {
33237        std::default::Default::default()
33238    }
33239
33240    /// Sets the value of [description][crate::model::Validation::description].
33241    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33242        self.description = v.into();
33243        self
33244    }
33245
33246    /// Sets the value of [state][crate::model::Validation::state].
33247    pub fn set_state<T: std::convert::Into<crate::model::validation::State>>(
33248        mut self,
33249        v: T,
33250    ) -> Self {
33251        self.state = v.into();
33252        self
33253    }
33254
33255    /// Sets the value of [message][crate::model::Validation::message].
33256    pub fn set_message<T, V>(mut self, v: T) -> Self
33257    where
33258        T: std::iter::IntoIterator<Item = V>,
33259        V: std::convert::Into<crate::model::ValidationMessage>,
33260    {
33261        use std::iter::Iterator;
33262        self.message = v.into_iter().map(|i| i.into()).collect();
33263        self
33264    }
33265
33266    /// Sets the value of [code][crate::model::Validation::code].
33267    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33268        self.code = v.into();
33269        self
33270    }
33271}
33272
33273impl wkt::message::Message for Validation {
33274    fn typename() -> &'static str {
33275        "type.googleapis.com/google.cloud.datastream.v1.Validation"
33276    }
33277}
33278
33279#[doc(hidden)]
33280impl<'de> serde::de::Deserialize<'de> for Validation {
33281    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33282    where
33283        D: serde::Deserializer<'de>,
33284    {
33285        #[allow(non_camel_case_types)]
33286        #[doc(hidden)]
33287        #[derive(PartialEq, Eq, Hash)]
33288        enum __FieldTag {
33289            __description,
33290            __state,
33291            __message,
33292            __code,
33293            Unknown(std::string::String),
33294        }
33295        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
33296            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33297            where
33298                D: serde::Deserializer<'de>,
33299            {
33300                struct Visitor;
33301                impl<'de> serde::de::Visitor<'de> for Visitor {
33302                    type Value = __FieldTag;
33303                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
33304                        formatter.write_str("a field name for Validation")
33305                    }
33306                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
33307                    where
33308                        E: serde::de::Error,
33309                    {
33310                        use std::result::Result::Ok;
33311                        use std::string::ToString;
33312                        match value {
33313                            "description" => Ok(__FieldTag::__description),
33314                            "state" => Ok(__FieldTag::__state),
33315                            "message" => Ok(__FieldTag::__message),
33316                            "code" => Ok(__FieldTag::__code),
33317                            _ => Ok(__FieldTag::Unknown(value.to_string())),
33318                        }
33319                    }
33320                }
33321                deserializer.deserialize_identifier(Visitor)
33322            }
33323        }
33324        struct Visitor;
33325        impl<'de> serde::de::Visitor<'de> for Visitor {
33326            type Value = Validation;
33327            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
33328                formatter.write_str("struct Validation")
33329            }
33330            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
33331            where
33332                A: serde::de::MapAccess<'de>,
33333            {
33334                #[allow(unused_imports)]
33335                use serde::de::Error;
33336                use std::option::Option::Some;
33337                let mut fields = std::collections::HashSet::new();
33338                let mut result = Self::Value::new();
33339                while let Some(tag) = map.next_key::<__FieldTag>()? {
33340                    #[allow(clippy::match_single_binding)]
33341                    match tag {
33342                        __FieldTag::__description => {
33343                            if !fields.insert(__FieldTag::__description) {
33344                                return std::result::Result::Err(A::Error::duplicate_field(
33345                                    "multiple values for description",
33346                                ));
33347                            }
33348                            result.description = map
33349                                .next_value::<std::option::Option<std::string::String>>()?
33350                                .unwrap_or_default();
33351                        }
33352                        __FieldTag::__state => {
33353                            if !fields.insert(__FieldTag::__state) {
33354                                return std::result::Result::Err(A::Error::duplicate_field(
33355                                    "multiple values for state",
33356                                ));
33357                            }
33358                            result.state = map
33359                                .next_value::<std::option::Option<crate::model::validation::State>>(
33360                                )?
33361                                .unwrap_or_default();
33362                        }
33363                        __FieldTag::__message => {
33364                            if !fields.insert(__FieldTag::__message) {
33365                                return std::result::Result::Err(A::Error::duplicate_field(
33366                                    "multiple values for message",
33367                                ));
33368                            }
33369                            result.message =
33370                                map.next_value::<std::option::Option<
33371                                    std::vec::Vec<crate::model::ValidationMessage>,
33372                                >>()?
33373                                .unwrap_or_default();
33374                        }
33375                        __FieldTag::__code => {
33376                            if !fields.insert(__FieldTag::__code) {
33377                                return std::result::Result::Err(A::Error::duplicate_field(
33378                                    "multiple values for code",
33379                                ));
33380                            }
33381                            result.code = map
33382                                .next_value::<std::option::Option<std::string::String>>()?
33383                                .unwrap_or_default();
33384                        }
33385                        __FieldTag::Unknown(key) => {
33386                            let value = map.next_value::<serde_json::Value>()?;
33387                            result._unknown_fields.insert(key, value);
33388                        }
33389                    }
33390                }
33391                std::result::Result::Ok(result)
33392            }
33393        }
33394        deserializer.deserialize_any(Visitor)
33395    }
33396}
33397
33398#[doc(hidden)]
33399impl serde::ser::Serialize for Validation {
33400    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33401    where
33402        S: serde::ser::Serializer,
33403    {
33404        use serde::ser::SerializeMap;
33405        #[allow(unused_imports)]
33406        use std::option::Option::Some;
33407        let mut state = serializer.serialize_map(std::option::Option::None)?;
33408        if !self.description.is_empty() {
33409            state.serialize_entry("description", &self.description)?;
33410        }
33411        if !wkt::internal::is_default(&self.state) {
33412            state.serialize_entry("state", &self.state)?;
33413        }
33414        if !self.message.is_empty() {
33415            state.serialize_entry("message", &self.message)?;
33416        }
33417        if !self.code.is_empty() {
33418            state.serialize_entry("code", &self.code)?;
33419        }
33420        if !self._unknown_fields.is_empty() {
33421            for (key, value) in self._unknown_fields.iter() {
33422                state.serialize_entry(key, &value)?;
33423            }
33424        }
33425        state.end()
33426    }
33427}
33428
33429impl std::fmt::Debug for Validation {
33430    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
33431        let mut debug_struct = f.debug_struct("Validation");
33432        debug_struct.field("description", &self.description);
33433        debug_struct.field("state", &self.state);
33434        debug_struct.field("message", &self.message);
33435        debug_struct.field("code", &self.code);
33436        if !self._unknown_fields.is_empty() {
33437            debug_struct.field("_unknown_fields", &self._unknown_fields);
33438        }
33439        debug_struct.finish()
33440    }
33441}
33442
33443/// Defines additional types related to [Validation].
33444pub mod validation {
33445    #[allow(unused_imports)]
33446    use super::*;
33447
33448    /// Validation execution state.
33449    ///
33450    /// # Working with unknown values
33451    ///
33452    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33453    /// additional enum variants at any time. Adding new variants is not considered
33454    /// a breaking change. Applications should write their code in anticipation of:
33455    ///
33456    /// - New values appearing in future releases of the client library, **and**
33457    /// - New values received dynamically, without application changes.
33458    ///
33459    /// Please consult the [Working with enums] section in the user guide for some
33460    /// guidelines.
33461    ///
33462    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
33463    #[derive(Clone, Debug, PartialEq)]
33464    #[non_exhaustive]
33465    pub enum State {
33466        /// Unspecified state.
33467        Unspecified,
33468        /// Validation did not execute.
33469        NotExecuted,
33470        /// Validation failed.
33471        Failed,
33472        /// Validation passed.
33473        Passed,
33474        /// Validation executed with warnings.
33475        Warning,
33476        /// If set, the enum was initialized with an unknown value.
33477        ///
33478        /// Applications can examine the value using [State::value] or
33479        /// [State::name].
33480        UnknownValue(state::UnknownValue),
33481    }
33482
33483    #[doc(hidden)]
33484    pub mod state {
33485        #[allow(unused_imports)]
33486        use super::*;
33487        #[derive(Clone, Debug, PartialEq)]
33488        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33489    }
33490
33491    impl State {
33492        /// Gets the enum value.
33493        ///
33494        /// Returns `None` if the enum contains an unknown value deserialized from
33495        /// the string representation of enums.
33496        pub fn value(&self) -> std::option::Option<i32> {
33497            match self {
33498                Self::Unspecified => std::option::Option::Some(0),
33499                Self::NotExecuted => std::option::Option::Some(1),
33500                Self::Failed => std::option::Option::Some(2),
33501                Self::Passed => std::option::Option::Some(3),
33502                Self::Warning => std::option::Option::Some(4),
33503                Self::UnknownValue(u) => u.0.value(),
33504            }
33505        }
33506
33507        /// Gets the enum value as a string.
33508        ///
33509        /// Returns `None` if the enum contains an unknown value deserialized from
33510        /// the integer representation of enums.
33511        pub fn name(&self) -> std::option::Option<&str> {
33512            match self {
33513                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
33514                Self::NotExecuted => std::option::Option::Some("NOT_EXECUTED"),
33515                Self::Failed => std::option::Option::Some("FAILED"),
33516                Self::Passed => std::option::Option::Some("PASSED"),
33517                Self::Warning => std::option::Option::Some("WARNING"),
33518                Self::UnknownValue(u) => u.0.name(),
33519            }
33520        }
33521    }
33522
33523    impl std::default::Default for State {
33524        fn default() -> Self {
33525            use std::convert::From;
33526            Self::from(0)
33527        }
33528    }
33529
33530    impl std::fmt::Display for State {
33531        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33532            wkt::internal::display_enum(f, self.name(), self.value())
33533        }
33534    }
33535
33536    impl std::convert::From<i32> for State {
33537        fn from(value: i32) -> Self {
33538            match value {
33539                0 => Self::Unspecified,
33540                1 => Self::NotExecuted,
33541                2 => Self::Failed,
33542                3 => Self::Passed,
33543                4 => Self::Warning,
33544                _ => Self::UnknownValue(state::UnknownValue(
33545                    wkt::internal::UnknownEnumValue::Integer(value),
33546                )),
33547            }
33548        }
33549    }
33550
33551    impl std::convert::From<&str> for State {
33552        fn from(value: &str) -> Self {
33553            use std::string::ToString;
33554            match value {
33555                "STATE_UNSPECIFIED" => Self::Unspecified,
33556                "NOT_EXECUTED" => Self::NotExecuted,
33557                "FAILED" => Self::Failed,
33558                "PASSED" => Self::Passed,
33559                "WARNING" => Self::Warning,
33560                _ => Self::UnknownValue(state::UnknownValue(
33561                    wkt::internal::UnknownEnumValue::String(value.to_string()),
33562                )),
33563            }
33564        }
33565    }
33566
33567    impl serde::ser::Serialize for State {
33568        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33569        where
33570            S: serde::Serializer,
33571        {
33572            match self {
33573                Self::Unspecified => serializer.serialize_i32(0),
33574                Self::NotExecuted => serializer.serialize_i32(1),
33575                Self::Failed => serializer.serialize_i32(2),
33576                Self::Passed => serializer.serialize_i32(3),
33577                Self::Warning => serializer.serialize_i32(4),
33578                Self::UnknownValue(u) => u.0.serialize(serializer),
33579            }
33580        }
33581    }
33582
33583    impl<'de> serde::de::Deserialize<'de> for State {
33584        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33585        where
33586            D: serde::Deserializer<'de>,
33587        {
33588            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
33589                ".google.cloud.datastream.v1.Validation.State",
33590            ))
33591        }
33592    }
33593}
33594
33595/// Represent user-facing validation result message.
33596#[derive(Clone, Default, PartialEq)]
33597#[non_exhaustive]
33598pub struct ValidationMessage {
33599    /// The result of the validation.
33600    pub message: std::string::String,
33601
33602    /// Message severity level (warning or error).
33603    pub level: crate::model::validation_message::Level,
33604
33605    /// Additional metadata related to the result.
33606    pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
33607
33608    /// A custom code identifying this specific message.
33609    pub code: std::string::String,
33610
33611    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33612}
33613
33614impl ValidationMessage {
33615    pub fn new() -> Self {
33616        std::default::Default::default()
33617    }
33618
33619    /// Sets the value of [message][crate::model::ValidationMessage::message].
33620    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33621        self.message = v.into();
33622        self
33623    }
33624
33625    /// Sets the value of [level][crate::model::ValidationMessage::level].
33626    pub fn set_level<T: std::convert::Into<crate::model::validation_message::Level>>(
33627        mut self,
33628        v: T,
33629    ) -> Self {
33630        self.level = v.into();
33631        self
33632    }
33633
33634    /// Sets the value of [metadata][crate::model::ValidationMessage::metadata].
33635    pub fn set_metadata<T, K, V>(mut self, v: T) -> Self
33636    where
33637        T: std::iter::IntoIterator<Item = (K, V)>,
33638        K: std::convert::Into<std::string::String>,
33639        V: std::convert::Into<std::string::String>,
33640    {
33641        use std::iter::Iterator;
33642        self.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
33643        self
33644    }
33645
33646    /// Sets the value of [code][crate::model::ValidationMessage::code].
33647    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33648        self.code = v.into();
33649        self
33650    }
33651}
33652
33653impl wkt::message::Message for ValidationMessage {
33654    fn typename() -> &'static str {
33655        "type.googleapis.com/google.cloud.datastream.v1.ValidationMessage"
33656    }
33657}
33658
33659#[doc(hidden)]
33660impl<'de> serde::de::Deserialize<'de> for ValidationMessage {
33661    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33662    where
33663        D: serde::Deserializer<'de>,
33664    {
33665        #[allow(non_camel_case_types)]
33666        #[doc(hidden)]
33667        #[derive(PartialEq, Eq, Hash)]
33668        enum __FieldTag {
33669            __message,
33670            __level,
33671            __metadata,
33672            __code,
33673            Unknown(std::string::String),
33674        }
33675        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
33676            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33677            where
33678                D: serde::Deserializer<'de>,
33679            {
33680                struct Visitor;
33681                impl<'de> serde::de::Visitor<'de> for Visitor {
33682                    type Value = __FieldTag;
33683                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
33684                        formatter.write_str("a field name for ValidationMessage")
33685                    }
33686                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
33687                    where
33688                        E: serde::de::Error,
33689                    {
33690                        use std::result::Result::Ok;
33691                        use std::string::ToString;
33692                        match value {
33693                            "message" => Ok(__FieldTag::__message),
33694                            "level" => Ok(__FieldTag::__level),
33695                            "metadata" => Ok(__FieldTag::__metadata),
33696                            "code" => Ok(__FieldTag::__code),
33697                            _ => Ok(__FieldTag::Unknown(value.to_string())),
33698                        }
33699                    }
33700                }
33701                deserializer.deserialize_identifier(Visitor)
33702            }
33703        }
33704        struct Visitor;
33705        impl<'de> serde::de::Visitor<'de> for Visitor {
33706            type Value = ValidationMessage;
33707            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
33708                formatter.write_str("struct ValidationMessage")
33709            }
33710            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
33711            where
33712                A: serde::de::MapAccess<'de>,
33713            {
33714                #[allow(unused_imports)]
33715                use serde::de::Error;
33716                use std::option::Option::Some;
33717                let mut fields = std::collections::HashSet::new();
33718                let mut result = Self::Value::new();
33719                while let Some(tag) = map.next_key::<__FieldTag>()? {
33720                    #[allow(clippy::match_single_binding)]
33721                    match tag {
33722                        __FieldTag::__message => {
33723                            if !fields.insert(__FieldTag::__message) {
33724                                return std::result::Result::Err(A::Error::duplicate_field(
33725                                    "multiple values for message",
33726                                ));
33727                            }
33728                            result.message = map
33729                                .next_value::<std::option::Option<std::string::String>>()?
33730                                .unwrap_or_default();
33731                        }
33732                        __FieldTag::__level => {
33733                            if !fields.insert(__FieldTag::__level) {
33734                                return std::result::Result::Err(A::Error::duplicate_field(
33735                                    "multiple values for level",
33736                                ));
33737                            }
33738                            result.level = map.next_value::<std::option::Option<crate::model::validation_message::Level>>()?.unwrap_or_default();
33739                        }
33740                        __FieldTag::__metadata => {
33741                            if !fields.insert(__FieldTag::__metadata) {
33742                                return std::result::Result::Err(A::Error::duplicate_field(
33743                                    "multiple values for metadata",
33744                                ));
33745                            }
33746                            result.metadata = map
33747                                .next_value::<std::option::Option<
33748                                    std::collections::HashMap<
33749                                        std::string::String,
33750                                        std::string::String,
33751                                    >,
33752                                >>()?
33753                                .unwrap_or_default();
33754                        }
33755                        __FieldTag::__code => {
33756                            if !fields.insert(__FieldTag::__code) {
33757                                return std::result::Result::Err(A::Error::duplicate_field(
33758                                    "multiple values for code",
33759                                ));
33760                            }
33761                            result.code = map
33762                                .next_value::<std::option::Option<std::string::String>>()?
33763                                .unwrap_or_default();
33764                        }
33765                        __FieldTag::Unknown(key) => {
33766                            let value = map.next_value::<serde_json::Value>()?;
33767                            result._unknown_fields.insert(key, value);
33768                        }
33769                    }
33770                }
33771                std::result::Result::Ok(result)
33772            }
33773        }
33774        deserializer.deserialize_any(Visitor)
33775    }
33776}
33777
33778#[doc(hidden)]
33779impl serde::ser::Serialize for ValidationMessage {
33780    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33781    where
33782        S: serde::ser::Serializer,
33783    {
33784        use serde::ser::SerializeMap;
33785        #[allow(unused_imports)]
33786        use std::option::Option::Some;
33787        let mut state = serializer.serialize_map(std::option::Option::None)?;
33788        if !self.message.is_empty() {
33789            state.serialize_entry("message", &self.message)?;
33790        }
33791        if !wkt::internal::is_default(&self.level) {
33792            state.serialize_entry("level", &self.level)?;
33793        }
33794        if !self.metadata.is_empty() {
33795            state.serialize_entry("metadata", &self.metadata)?;
33796        }
33797        if !self.code.is_empty() {
33798            state.serialize_entry("code", &self.code)?;
33799        }
33800        if !self._unknown_fields.is_empty() {
33801            for (key, value) in self._unknown_fields.iter() {
33802                state.serialize_entry(key, &value)?;
33803            }
33804        }
33805        state.end()
33806    }
33807}
33808
33809impl std::fmt::Debug for ValidationMessage {
33810    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
33811        let mut debug_struct = f.debug_struct("ValidationMessage");
33812        debug_struct.field("message", &self.message);
33813        debug_struct.field("level", &self.level);
33814        debug_struct.field("metadata", &self.metadata);
33815        debug_struct.field("code", &self.code);
33816        if !self._unknown_fields.is_empty() {
33817            debug_struct.field("_unknown_fields", &self._unknown_fields);
33818        }
33819        debug_struct.finish()
33820    }
33821}
33822
33823/// Defines additional types related to [ValidationMessage].
33824pub mod validation_message {
33825    #[allow(unused_imports)]
33826    use super::*;
33827
33828    /// Validation message level.
33829    ///
33830    /// # Working with unknown values
33831    ///
33832    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33833    /// additional enum variants at any time. Adding new variants is not considered
33834    /// a breaking change. Applications should write their code in anticipation of:
33835    ///
33836    /// - New values appearing in future releases of the client library, **and**
33837    /// - New values received dynamically, without application changes.
33838    ///
33839    /// Please consult the [Working with enums] section in the user guide for some
33840    /// guidelines.
33841    ///
33842    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
33843    #[derive(Clone, Debug, PartialEq)]
33844    #[non_exhaustive]
33845    pub enum Level {
33846        /// Unspecified level.
33847        Unspecified,
33848        /// Potentially cause issues with the Stream.
33849        Warning,
33850        /// Definitely cause issues with the Stream.
33851        Error,
33852        /// If set, the enum was initialized with an unknown value.
33853        ///
33854        /// Applications can examine the value using [Level::value] or
33855        /// [Level::name].
33856        UnknownValue(level::UnknownValue),
33857    }
33858
33859    #[doc(hidden)]
33860    pub mod level {
33861        #[allow(unused_imports)]
33862        use super::*;
33863        #[derive(Clone, Debug, PartialEq)]
33864        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33865    }
33866
33867    impl Level {
33868        /// Gets the enum value.
33869        ///
33870        /// Returns `None` if the enum contains an unknown value deserialized from
33871        /// the string representation of enums.
33872        pub fn value(&self) -> std::option::Option<i32> {
33873            match self {
33874                Self::Unspecified => std::option::Option::Some(0),
33875                Self::Warning => std::option::Option::Some(1),
33876                Self::Error => std::option::Option::Some(2),
33877                Self::UnknownValue(u) => u.0.value(),
33878            }
33879        }
33880
33881        /// Gets the enum value as a string.
33882        ///
33883        /// Returns `None` if the enum contains an unknown value deserialized from
33884        /// the integer representation of enums.
33885        pub fn name(&self) -> std::option::Option<&str> {
33886            match self {
33887                Self::Unspecified => std::option::Option::Some("LEVEL_UNSPECIFIED"),
33888                Self::Warning => std::option::Option::Some("WARNING"),
33889                Self::Error => std::option::Option::Some("ERROR"),
33890                Self::UnknownValue(u) => u.0.name(),
33891            }
33892        }
33893    }
33894
33895    impl std::default::Default for Level {
33896        fn default() -> Self {
33897            use std::convert::From;
33898            Self::from(0)
33899        }
33900    }
33901
33902    impl std::fmt::Display for Level {
33903        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33904            wkt::internal::display_enum(f, self.name(), self.value())
33905        }
33906    }
33907
33908    impl std::convert::From<i32> for Level {
33909        fn from(value: i32) -> Self {
33910            match value {
33911                0 => Self::Unspecified,
33912                1 => Self::Warning,
33913                2 => Self::Error,
33914                _ => Self::UnknownValue(level::UnknownValue(
33915                    wkt::internal::UnknownEnumValue::Integer(value),
33916                )),
33917            }
33918        }
33919    }
33920
33921    impl std::convert::From<&str> for Level {
33922        fn from(value: &str) -> Self {
33923            use std::string::ToString;
33924            match value {
33925                "LEVEL_UNSPECIFIED" => Self::Unspecified,
33926                "WARNING" => Self::Warning,
33927                "ERROR" => Self::Error,
33928                _ => Self::UnknownValue(level::UnknownValue(
33929                    wkt::internal::UnknownEnumValue::String(value.to_string()),
33930                )),
33931            }
33932        }
33933    }
33934
33935    impl serde::ser::Serialize for Level {
33936        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33937        where
33938            S: serde::Serializer,
33939        {
33940            match self {
33941                Self::Unspecified => serializer.serialize_i32(0),
33942                Self::Warning => serializer.serialize_i32(1),
33943                Self::Error => serializer.serialize_i32(2),
33944                Self::UnknownValue(u) => u.0.serialize(serializer),
33945            }
33946        }
33947    }
33948
33949    impl<'de> serde::de::Deserialize<'de> for Level {
33950        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33951        where
33952            D: serde::Deserializer<'de>,
33953        {
33954            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Level>::new(
33955                ".google.cloud.datastream.v1.ValidationMessage.Level",
33956            ))
33957        }
33958    }
33959}
33960
33961/// The strategy that the stream uses for CDC replication.
33962#[derive(Clone, Default, PartialEq)]
33963#[non_exhaustive]
33964pub struct CdcStrategy {
33965    /// The position to start reading from when starting, resuming, or recovering
33966    /// the stream.
33967    /// If not set, the system's default value will be used.
33968    pub start_position: std::option::Option<crate::model::cdc_strategy::StartPosition>,
33969
33970    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33971}
33972
33973impl CdcStrategy {
33974    pub fn new() -> Self {
33975        std::default::Default::default()
33976    }
33977
33978    /// Sets the value of [start_position][crate::model::CdcStrategy::start_position].
33979    ///
33980    /// Note that all the setters affecting `start_position` are mutually
33981    /// exclusive.
33982    pub fn set_start_position<
33983        T: std::convert::Into<std::option::Option<crate::model::cdc_strategy::StartPosition>>,
33984    >(
33985        mut self,
33986        v: T,
33987    ) -> Self {
33988        self.start_position = v.into();
33989        self
33990    }
33991
33992    /// The value of [start_position][crate::model::CdcStrategy::start_position]
33993    /// if it holds a `MostRecentStartPosition`, `None` if the field is not set or
33994    /// holds a different branch.
33995    pub fn most_recent_start_position(
33996        &self,
33997    ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>>
33998    {
33999        #[allow(unreachable_patterns)]
34000        self.start_position.as_ref().and_then(|v| match v {
34001            crate::model::cdc_strategy::StartPosition::MostRecentStartPosition(v) => {
34002                std::option::Option::Some(v)
34003            }
34004            _ => std::option::Option::None,
34005        })
34006    }
34007
34008    /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
34009    /// to hold a `MostRecentStartPosition`.
34010    ///
34011    /// Note that all the setters affecting `start_position` are
34012    /// mutually exclusive.
34013    pub fn set_most_recent_start_position<
34014        T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>>,
34015    >(
34016        mut self,
34017        v: T,
34018    ) -> Self {
34019        self.start_position = std::option::Option::Some(
34020            crate::model::cdc_strategy::StartPosition::MostRecentStartPosition(v.into()),
34021        );
34022        self
34023    }
34024
34025    /// The value of [start_position][crate::model::CdcStrategy::start_position]
34026    /// if it holds a `NextAvailableStartPosition`, `None` if the field is not set or
34027    /// holds a different branch.
34028    pub fn next_available_start_position(
34029        &self,
34030    ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>>
34031    {
34032        #[allow(unreachable_patterns)]
34033        self.start_position.as_ref().and_then(|v| match v {
34034            crate::model::cdc_strategy::StartPosition::NextAvailableStartPosition(v) => {
34035                std::option::Option::Some(v)
34036            }
34037            _ => std::option::Option::None,
34038        })
34039    }
34040
34041    /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
34042    /// to hold a `NextAvailableStartPosition`.
34043    ///
34044    /// Note that all the setters affecting `start_position` are
34045    /// mutually exclusive.
34046    pub fn set_next_available_start_position<
34047        T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>>,
34048    >(
34049        mut self,
34050        v: T,
34051    ) -> Self {
34052        self.start_position = std::option::Option::Some(
34053            crate::model::cdc_strategy::StartPosition::NextAvailableStartPosition(v.into()),
34054        );
34055        self
34056    }
34057
34058    /// The value of [start_position][crate::model::CdcStrategy::start_position]
34059    /// if it holds a `SpecificStartPosition`, `None` if the field is not set or
34060    /// holds a different branch.
34061    pub fn specific_start_position(
34062        &self,
34063    ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>>
34064    {
34065        #[allow(unreachable_patterns)]
34066        self.start_position.as_ref().and_then(|v| match v {
34067            crate::model::cdc_strategy::StartPosition::SpecificStartPosition(v) => {
34068                std::option::Option::Some(v)
34069            }
34070            _ => std::option::Option::None,
34071        })
34072    }
34073
34074    /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
34075    /// to hold a `SpecificStartPosition`.
34076    ///
34077    /// Note that all the setters affecting `start_position` are
34078    /// mutually exclusive.
34079    pub fn set_specific_start_position<
34080        T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>>,
34081    >(
34082        mut self,
34083        v: T,
34084    ) -> Self {
34085        self.start_position = std::option::Option::Some(
34086            crate::model::cdc_strategy::StartPosition::SpecificStartPosition(v.into()),
34087        );
34088        self
34089    }
34090}
34091
34092impl wkt::message::Message for CdcStrategy {
34093    fn typename() -> &'static str {
34094        "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy"
34095    }
34096}
34097
34098#[doc(hidden)]
34099impl<'de> serde::de::Deserialize<'de> for CdcStrategy {
34100    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34101    where
34102        D: serde::Deserializer<'de>,
34103    {
34104        #[allow(non_camel_case_types)]
34105        #[doc(hidden)]
34106        #[derive(PartialEq, Eq, Hash)]
34107        enum __FieldTag {
34108            __most_recent_start_position,
34109            __next_available_start_position,
34110            __specific_start_position,
34111            Unknown(std::string::String),
34112        }
34113        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
34114            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34115            where
34116                D: serde::Deserializer<'de>,
34117            {
34118                struct Visitor;
34119                impl<'de> serde::de::Visitor<'de> for Visitor {
34120                    type Value = __FieldTag;
34121                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
34122                        formatter.write_str("a field name for CdcStrategy")
34123                    }
34124                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
34125                    where
34126                        E: serde::de::Error,
34127                    {
34128                        use std::result::Result::Ok;
34129                        use std::string::ToString;
34130                        match value {
34131                            "mostRecentStartPosition" => {
34132                                Ok(__FieldTag::__most_recent_start_position)
34133                            }
34134                            "most_recent_start_position" => {
34135                                Ok(__FieldTag::__most_recent_start_position)
34136                            }
34137                            "nextAvailableStartPosition" => {
34138                                Ok(__FieldTag::__next_available_start_position)
34139                            }
34140                            "next_available_start_position" => {
34141                                Ok(__FieldTag::__next_available_start_position)
34142                            }
34143                            "specificStartPosition" => Ok(__FieldTag::__specific_start_position),
34144                            "specific_start_position" => Ok(__FieldTag::__specific_start_position),
34145                            _ => Ok(__FieldTag::Unknown(value.to_string())),
34146                        }
34147                    }
34148                }
34149                deserializer.deserialize_identifier(Visitor)
34150            }
34151        }
34152        struct Visitor;
34153        impl<'de> serde::de::Visitor<'de> for Visitor {
34154            type Value = CdcStrategy;
34155            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
34156                formatter.write_str("struct CdcStrategy")
34157            }
34158            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
34159            where
34160                A: serde::de::MapAccess<'de>,
34161            {
34162                #[allow(unused_imports)]
34163                use serde::de::Error;
34164                use std::option::Option::Some;
34165                let mut fields = std::collections::HashSet::new();
34166                let mut result = Self::Value::new();
34167                while let Some(tag) = map.next_key::<__FieldTag>()? {
34168                    #[allow(clippy::match_single_binding)]
34169                    match tag {
34170                        __FieldTag::__most_recent_start_position => {
34171                            if !fields.insert(__FieldTag::__most_recent_start_position) {
34172                                return std::result::Result::Err(A::Error::duplicate_field(
34173                                    "multiple values for most_recent_start_position",
34174                                ));
34175                            }
34176                            if result.start_position.is_some() {
34177                                return std::result::Result::Err(A::Error::duplicate_field(
34178                                    "multiple values for `start_position`, a oneof with full ID .google.cloud.datastream.v1.CdcStrategy.most_recent_start_position, latest field was mostRecentStartPosition",
34179                                ));
34180                            }
34181                            result.start_position = std::option::Option::Some(
34182                                crate::model::cdc_strategy::StartPosition::MostRecentStartPosition(
34183                                    map.next_value::<std::option::Option<
34184                                        std::boxed::Box<
34185                                            crate::model::cdc_strategy::MostRecentStartPosition,
34186                                        >,
34187                                    >>()?
34188                                    .unwrap_or_default(),
34189                                ),
34190                            );
34191                        }
34192                        __FieldTag::__next_available_start_position => {
34193                            if !fields.insert(__FieldTag::__next_available_start_position) {
34194                                return std::result::Result::Err(A::Error::duplicate_field(
34195                                    "multiple values for next_available_start_position",
34196                                ));
34197                            }
34198                            if result.start_position.is_some() {
34199                                return std::result::Result::Err(A::Error::duplicate_field(
34200                                    "multiple values for `start_position`, a oneof with full ID .google.cloud.datastream.v1.CdcStrategy.next_available_start_position, latest field was nextAvailableStartPosition",
34201                                ));
34202                            }
34203                            result.start_position = std::option::Option::Some(
34204                                crate::model::cdc_strategy::StartPosition::NextAvailableStartPosition(
34205                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>>>()?.unwrap_or_default()
34206                                ),
34207                            );
34208                        }
34209                        __FieldTag::__specific_start_position => {
34210                            if !fields.insert(__FieldTag::__specific_start_position) {
34211                                return std::result::Result::Err(A::Error::duplicate_field(
34212                                    "multiple values for specific_start_position",
34213                                ));
34214                            }
34215                            if result.start_position.is_some() {
34216                                return std::result::Result::Err(A::Error::duplicate_field(
34217                                    "multiple values for `start_position`, a oneof with full ID .google.cloud.datastream.v1.CdcStrategy.specific_start_position, latest field was specificStartPosition",
34218                                ));
34219                            }
34220                            result.start_position = std::option::Option::Some(
34221                                crate::model::cdc_strategy::StartPosition::SpecificStartPosition(
34222                                    map.next_value::<std::option::Option<
34223                                        std::boxed::Box<
34224                                            crate::model::cdc_strategy::SpecificStartPosition,
34225                                        >,
34226                                    >>()?
34227                                    .unwrap_or_default(),
34228                                ),
34229                            );
34230                        }
34231                        __FieldTag::Unknown(key) => {
34232                            let value = map.next_value::<serde_json::Value>()?;
34233                            result._unknown_fields.insert(key, value);
34234                        }
34235                    }
34236                }
34237                std::result::Result::Ok(result)
34238            }
34239        }
34240        deserializer.deserialize_any(Visitor)
34241    }
34242}
34243
34244#[doc(hidden)]
34245impl serde::ser::Serialize for CdcStrategy {
34246    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34247    where
34248        S: serde::ser::Serializer,
34249    {
34250        use serde::ser::SerializeMap;
34251        #[allow(unused_imports)]
34252        use std::option::Option::Some;
34253        let mut state = serializer.serialize_map(std::option::Option::None)?;
34254        if let Some(value) = self.most_recent_start_position() {
34255            state.serialize_entry("mostRecentStartPosition", value)?;
34256        }
34257        if let Some(value) = self.next_available_start_position() {
34258            state.serialize_entry("nextAvailableStartPosition", value)?;
34259        }
34260        if let Some(value) = self.specific_start_position() {
34261            state.serialize_entry("specificStartPosition", value)?;
34262        }
34263        if !self._unknown_fields.is_empty() {
34264            for (key, value) in self._unknown_fields.iter() {
34265                state.serialize_entry(key, &value)?;
34266            }
34267        }
34268        state.end()
34269    }
34270}
34271
34272impl std::fmt::Debug for CdcStrategy {
34273    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
34274        let mut debug_struct = f.debug_struct("CdcStrategy");
34275        debug_struct.field("start_position", &self.start_position);
34276        if !self._unknown_fields.is_empty() {
34277            debug_struct.field("_unknown_fields", &self._unknown_fields);
34278        }
34279        debug_struct.finish()
34280    }
34281}
34282
34283/// Defines additional types related to [CdcStrategy].
34284pub mod cdc_strategy {
34285    #[allow(unused_imports)]
34286    use super::*;
34287
34288    /// CDC strategy to start replicating from the most recent position in the
34289    /// source.
34290    #[derive(Clone, Default, PartialEq)]
34291    #[non_exhaustive]
34292    pub struct MostRecentStartPosition {
34293        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
34294    }
34295
34296    impl MostRecentStartPosition {
34297        pub fn new() -> Self {
34298            std::default::Default::default()
34299        }
34300    }
34301
34302    impl wkt::message::Message for MostRecentStartPosition {
34303        fn typename() -> &'static str {
34304            "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.MostRecentStartPosition"
34305        }
34306    }
34307
34308    #[doc(hidden)]
34309    impl<'de> serde::de::Deserialize<'de> for MostRecentStartPosition {
34310        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34311        where
34312            D: serde::Deserializer<'de>,
34313        {
34314            #[allow(non_camel_case_types)]
34315            #[doc(hidden)]
34316            #[derive(PartialEq, Eq, Hash)]
34317            enum __FieldTag {
34318                Unknown(std::string::String),
34319            }
34320            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
34321                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34322                where
34323                    D: serde::Deserializer<'de>,
34324                {
34325                    struct Visitor;
34326                    impl<'de> serde::de::Visitor<'de> for Visitor {
34327                        type Value = __FieldTag;
34328                        fn expecting(
34329                            &self,
34330                            formatter: &mut std::fmt::Formatter,
34331                        ) -> std::fmt::Result {
34332                            formatter.write_str("a field name for MostRecentStartPosition")
34333                        }
34334                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
34335                        where
34336                            E: serde::de::Error,
34337                        {
34338                            use std::result::Result::Ok;
34339                            use std::string::ToString;
34340                            Ok(__FieldTag::Unknown(value.to_string()))
34341                        }
34342                    }
34343                    deserializer.deserialize_identifier(Visitor)
34344                }
34345            }
34346            struct Visitor;
34347            impl<'de> serde::de::Visitor<'de> for Visitor {
34348                type Value = MostRecentStartPosition;
34349                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
34350                    formatter.write_str("struct MostRecentStartPosition")
34351                }
34352                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
34353                where
34354                    A: serde::de::MapAccess<'de>,
34355                {
34356                    #[allow(unused_imports)]
34357                    use serde::de::Error;
34358                    use std::option::Option::Some;
34359                    let mut result = Self::Value::new();
34360                    while let Some(tag) = map.next_key::<__FieldTag>()? {
34361                        #[allow(clippy::match_single_binding)]
34362                        match tag {
34363                            __FieldTag::Unknown(key) => {
34364                                let value = map.next_value::<serde_json::Value>()?;
34365                                result._unknown_fields.insert(key, value);
34366                            }
34367                        }
34368                    }
34369                    std::result::Result::Ok(result)
34370                }
34371            }
34372            deserializer.deserialize_any(Visitor)
34373        }
34374    }
34375
34376    #[doc(hidden)]
34377    impl serde::ser::Serialize for MostRecentStartPosition {
34378        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34379        where
34380            S: serde::ser::Serializer,
34381        {
34382            use serde::ser::SerializeMap;
34383            #[allow(unused_imports)]
34384            use std::option::Option::Some;
34385            let mut state = serializer.serialize_map(std::option::Option::None)?;
34386            if !self._unknown_fields.is_empty() {
34387                for (key, value) in self._unknown_fields.iter() {
34388                    state.serialize_entry(key, &value)?;
34389                }
34390            }
34391            state.end()
34392        }
34393    }
34394
34395    impl std::fmt::Debug for MostRecentStartPosition {
34396        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
34397            let mut debug_struct = f.debug_struct("MostRecentStartPosition");
34398            if !self._unknown_fields.is_empty() {
34399                debug_struct.field("_unknown_fields", &self._unknown_fields);
34400            }
34401            debug_struct.finish()
34402        }
34403    }
34404
34405    /// CDC strategy to resume replication from the next available position in the
34406    /// source.
34407    #[derive(Clone, Default, PartialEq)]
34408    #[non_exhaustive]
34409    pub struct NextAvailableStartPosition {
34410        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
34411    }
34412
34413    impl NextAvailableStartPosition {
34414        pub fn new() -> Self {
34415            std::default::Default::default()
34416        }
34417    }
34418
34419    impl wkt::message::Message for NextAvailableStartPosition {
34420        fn typename() -> &'static str {
34421            "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.NextAvailableStartPosition"
34422        }
34423    }
34424
34425    #[doc(hidden)]
34426    impl<'de> serde::de::Deserialize<'de> for NextAvailableStartPosition {
34427        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34428        where
34429            D: serde::Deserializer<'de>,
34430        {
34431            #[allow(non_camel_case_types)]
34432            #[doc(hidden)]
34433            #[derive(PartialEq, Eq, Hash)]
34434            enum __FieldTag {
34435                Unknown(std::string::String),
34436            }
34437            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
34438                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34439                where
34440                    D: serde::Deserializer<'de>,
34441                {
34442                    struct Visitor;
34443                    impl<'de> serde::de::Visitor<'de> for Visitor {
34444                        type Value = __FieldTag;
34445                        fn expecting(
34446                            &self,
34447                            formatter: &mut std::fmt::Formatter,
34448                        ) -> std::fmt::Result {
34449                            formatter.write_str("a field name for NextAvailableStartPosition")
34450                        }
34451                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
34452                        where
34453                            E: serde::de::Error,
34454                        {
34455                            use std::result::Result::Ok;
34456                            use std::string::ToString;
34457                            Ok(__FieldTag::Unknown(value.to_string()))
34458                        }
34459                    }
34460                    deserializer.deserialize_identifier(Visitor)
34461                }
34462            }
34463            struct Visitor;
34464            impl<'de> serde::de::Visitor<'de> for Visitor {
34465                type Value = NextAvailableStartPosition;
34466                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
34467                    formatter.write_str("struct NextAvailableStartPosition")
34468                }
34469                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
34470                where
34471                    A: serde::de::MapAccess<'de>,
34472                {
34473                    #[allow(unused_imports)]
34474                    use serde::de::Error;
34475                    use std::option::Option::Some;
34476                    let mut result = Self::Value::new();
34477                    while let Some(tag) = map.next_key::<__FieldTag>()? {
34478                        #[allow(clippy::match_single_binding)]
34479                        match tag {
34480                            __FieldTag::Unknown(key) => {
34481                                let value = map.next_value::<serde_json::Value>()?;
34482                                result._unknown_fields.insert(key, value);
34483                            }
34484                        }
34485                    }
34486                    std::result::Result::Ok(result)
34487                }
34488            }
34489            deserializer.deserialize_any(Visitor)
34490        }
34491    }
34492
34493    #[doc(hidden)]
34494    impl serde::ser::Serialize for NextAvailableStartPosition {
34495        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34496        where
34497            S: serde::ser::Serializer,
34498        {
34499            use serde::ser::SerializeMap;
34500            #[allow(unused_imports)]
34501            use std::option::Option::Some;
34502            let mut state = serializer.serialize_map(std::option::Option::None)?;
34503            if !self._unknown_fields.is_empty() {
34504                for (key, value) in self._unknown_fields.iter() {
34505                    state.serialize_entry(key, &value)?;
34506                }
34507            }
34508            state.end()
34509        }
34510    }
34511
34512    impl std::fmt::Debug for NextAvailableStartPosition {
34513        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
34514            let mut debug_struct = f.debug_struct("NextAvailableStartPosition");
34515            if !self._unknown_fields.is_empty() {
34516                debug_struct.field("_unknown_fields", &self._unknown_fields);
34517            }
34518            debug_struct.finish()
34519        }
34520    }
34521
34522    /// CDC strategy to start replicating from a specific position in the source.
34523    #[derive(Clone, Default, PartialEq)]
34524    #[non_exhaustive]
34525    pub struct SpecificStartPosition {
34526        pub position:
34527            std::option::Option<crate::model::cdc_strategy::specific_start_position::Position>,
34528
34529        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
34530    }
34531
34532    impl SpecificStartPosition {
34533        pub fn new() -> Self {
34534            std::default::Default::default()
34535        }
34536
34537        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position].
34538        ///
34539        /// Note that all the setters affecting `position` are mutually
34540        /// exclusive.
34541        pub fn set_position<
34542            T: std::convert::Into<
34543                    std::option::Option<
34544                        crate::model::cdc_strategy::specific_start_position::Position,
34545                    >,
34546                >,
34547        >(
34548            mut self,
34549            v: T,
34550        ) -> Self {
34551            self.position = v.into();
34552            self
34553        }
34554
34555        /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
34556        /// if it holds a `MysqlLogPosition`, `None` if the field is not set or
34557        /// holds a different branch.
34558        pub fn mysql_log_position(
34559            &self,
34560        ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlLogPosition>> {
34561            #[allow(unreachable_patterns)]
34562            self.position.as_ref().and_then(|v| match v {
34563                crate::model::cdc_strategy::specific_start_position::Position::MysqlLogPosition(
34564                    v,
34565                ) => std::option::Option::Some(v),
34566                _ => std::option::Option::None,
34567            })
34568        }
34569
34570        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
34571        /// to hold a `MysqlLogPosition`.
34572        ///
34573        /// Note that all the setters affecting `position` are
34574        /// mutually exclusive.
34575        pub fn set_mysql_log_position<
34576            T: std::convert::Into<std::boxed::Box<crate::model::MysqlLogPosition>>,
34577        >(
34578            mut self,
34579            v: T,
34580        ) -> Self {
34581            self.position = std::option::Option::Some(
34582                crate::model::cdc_strategy::specific_start_position::Position::MysqlLogPosition(
34583                    v.into(),
34584                ),
34585            );
34586            self
34587        }
34588
34589        /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
34590        /// if it holds a `OracleScnPosition`, `None` if the field is not set or
34591        /// holds a different branch.
34592        pub fn oracle_scn_position(
34593            &self,
34594        ) -> std::option::Option<&std::boxed::Box<crate::model::OracleScnPosition>> {
34595            #[allow(unreachable_patterns)]
34596            self.position.as_ref().and_then(|v| match v {
34597                crate::model::cdc_strategy::specific_start_position::Position::OracleScnPosition(v) => std::option::Option::Some(v),
34598                _ => std::option::Option::None,
34599            })
34600        }
34601
34602        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
34603        /// to hold a `OracleScnPosition`.
34604        ///
34605        /// Note that all the setters affecting `position` are
34606        /// mutually exclusive.
34607        pub fn set_oracle_scn_position<
34608            T: std::convert::Into<std::boxed::Box<crate::model::OracleScnPosition>>,
34609        >(
34610            mut self,
34611            v: T,
34612        ) -> Self {
34613            self.position = std::option::Option::Some(
34614                crate::model::cdc_strategy::specific_start_position::Position::OracleScnPosition(
34615                    v.into(),
34616                ),
34617            );
34618            self
34619        }
34620
34621        /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
34622        /// if it holds a `SqlServerLsnPosition`, `None` if the field is not set or
34623        /// holds a different branch.
34624        pub fn sql_server_lsn_position(
34625            &self,
34626        ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerLsnPosition>> {
34627            #[allow(unreachable_patterns)]
34628            self.position.as_ref().and_then(|v| match v {
34629                crate::model::cdc_strategy::specific_start_position::Position::SqlServerLsnPosition(v) => std::option::Option::Some(v),
34630                _ => std::option::Option::None,
34631            })
34632        }
34633
34634        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
34635        /// to hold a `SqlServerLsnPosition`.
34636        ///
34637        /// Note that all the setters affecting `position` are
34638        /// mutually exclusive.
34639        pub fn set_sql_server_lsn_position<
34640            T: std::convert::Into<std::boxed::Box<crate::model::SqlServerLsnPosition>>,
34641        >(
34642            mut self,
34643            v: T,
34644        ) -> Self {
34645            self.position = std::option::Option::Some(
34646                crate::model::cdc_strategy::specific_start_position::Position::SqlServerLsnPosition(
34647                    v.into(),
34648                ),
34649            );
34650            self
34651        }
34652
34653        /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
34654        /// if it holds a `MysqlGtidPosition`, `None` if the field is not set or
34655        /// holds a different branch.
34656        pub fn mysql_gtid_position(
34657            &self,
34658        ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlGtidPosition>> {
34659            #[allow(unreachable_patterns)]
34660            self.position.as_ref().and_then(|v| match v {
34661                crate::model::cdc_strategy::specific_start_position::Position::MysqlGtidPosition(v) => std::option::Option::Some(v),
34662                _ => std::option::Option::None,
34663            })
34664        }
34665
34666        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
34667        /// to hold a `MysqlGtidPosition`.
34668        ///
34669        /// Note that all the setters affecting `position` are
34670        /// mutually exclusive.
34671        pub fn set_mysql_gtid_position<
34672            T: std::convert::Into<std::boxed::Box<crate::model::MysqlGtidPosition>>,
34673        >(
34674            mut self,
34675            v: T,
34676        ) -> Self {
34677            self.position = std::option::Option::Some(
34678                crate::model::cdc_strategy::specific_start_position::Position::MysqlGtidPosition(
34679                    v.into(),
34680                ),
34681            );
34682            self
34683        }
34684    }
34685
34686    impl wkt::message::Message for SpecificStartPosition {
34687        fn typename() -> &'static str {
34688            "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.SpecificStartPosition"
34689        }
34690    }
34691
34692    #[doc(hidden)]
34693    impl<'de> serde::de::Deserialize<'de> for SpecificStartPosition {
34694        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34695        where
34696            D: serde::Deserializer<'de>,
34697        {
34698            #[allow(non_camel_case_types)]
34699            #[doc(hidden)]
34700            #[derive(PartialEq, Eq, Hash)]
34701            enum __FieldTag {
34702                __mysql_log_position,
34703                __oracle_scn_position,
34704                __sql_server_lsn_position,
34705                __mysql_gtid_position,
34706                Unknown(std::string::String),
34707            }
34708            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
34709                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34710                where
34711                    D: serde::Deserializer<'de>,
34712                {
34713                    struct Visitor;
34714                    impl<'de> serde::de::Visitor<'de> for Visitor {
34715                        type Value = __FieldTag;
34716                        fn expecting(
34717                            &self,
34718                            formatter: &mut std::fmt::Formatter,
34719                        ) -> std::fmt::Result {
34720                            formatter.write_str("a field name for SpecificStartPosition")
34721                        }
34722                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
34723                        where
34724                            E: serde::de::Error,
34725                        {
34726                            use std::result::Result::Ok;
34727                            use std::string::ToString;
34728                            match value {
34729                                "mysqlLogPosition" => Ok(__FieldTag::__mysql_log_position),
34730                                "mysql_log_position" => Ok(__FieldTag::__mysql_log_position),
34731                                "oracleScnPosition" => Ok(__FieldTag::__oracle_scn_position),
34732                                "oracle_scn_position" => Ok(__FieldTag::__oracle_scn_position),
34733                                "sqlServerLsnPosition" => Ok(__FieldTag::__sql_server_lsn_position),
34734                                "sql_server_lsn_position" => {
34735                                    Ok(__FieldTag::__sql_server_lsn_position)
34736                                }
34737                                "mysqlGtidPosition" => Ok(__FieldTag::__mysql_gtid_position),
34738                                "mysql_gtid_position" => Ok(__FieldTag::__mysql_gtid_position),
34739                                _ => Ok(__FieldTag::Unknown(value.to_string())),
34740                            }
34741                        }
34742                    }
34743                    deserializer.deserialize_identifier(Visitor)
34744                }
34745            }
34746            struct Visitor;
34747            impl<'de> serde::de::Visitor<'de> for Visitor {
34748                type Value = SpecificStartPosition;
34749                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
34750                    formatter.write_str("struct SpecificStartPosition")
34751                }
34752                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
34753                where
34754                    A: serde::de::MapAccess<'de>,
34755                {
34756                    #[allow(unused_imports)]
34757                    use serde::de::Error;
34758                    use std::option::Option::Some;
34759                    let mut fields = std::collections::HashSet::new();
34760                    let mut result = Self::Value::new();
34761                    while let Some(tag) = map.next_key::<__FieldTag>()? {
34762                        #[allow(clippy::match_single_binding)]
34763                        match tag {
34764                            __FieldTag::__mysql_log_position => {
34765                                if !fields.insert(__FieldTag::__mysql_log_position) {
34766                                    return std::result::Result::Err(A::Error::duplicate_field(
34767                                        "multiple values for mysql_log_position",
34768                                    ));
34769                                }
34770                                if result.position.is_some() {
34771                                    return std::result::Result::Err(A::Error::duplicate_field(
34772                                        "multiple values for `position`, a oneof with full ID .google.cloud.datastream.v1.CdcStrategy.SpecificStartPosition.mysql_log_position, latest field was mysqlLogPosition",
34773                                    ));
34774                                }
34775                                result.position = std::option::Option::Some(
34776                                    crate::model::cdc_strategy::specific_start_position::Position::MysqlLogPosition(
34777                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::MysqlLogPosition>>>()?.unwrap_or_default()
34778                                    ),
34779                                );
34780                            }
34781                            __FieldTag::__oracle_scn_position => {
34782                                if !fields.insert(__FieldTag::__oracle_scn_position) {
34783                                    return std::result::Result::Err(A::Error::duplicate_field(
34784                                        "multiple values for oracle_scn_position",
34785                                    ));
34786                                }
34787                                if result.position.is_some() {
34788                                    return std::result::Result::Err(A::Error::duplicate_field(
34789                                        "multiple values for `position`, a oneof with full ID .google.cloud.datastream.v1.CdcStrategy.SpecificStartPosition.oracle_scn_position, latest field was oracleScnPosition",
34790                                    ));
34791                                }
34792                                result.position = std::option::Option::Some(
34793                                    crate::model::cdc_strategy::specific_start_position::Position::OracleScnPosition(
34794                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::OracleScnPosition>>>()?.unwrap_or_default()
34795                                    ),
34796                                );
34797                            }
34798                            __FieldTag::__sql_server_lsn_position => {
34799                                if !fields.insert(__FieldTag::__sql_server_lsn_position) {
34800                                    return std::result::Result::Err(A::Error::duplicate_field(
34801                                        "multiple values for sql_server_lsn_position",
34802                                    ));
34803                                }
34804                                if result.position.is_some() {
34805                                    return std::result::Result::Err(A::Error::duplicate_field(
34806                                        "multiple values for `position`, a oneof with full ID .google.cloud.datastream.v1.CdcStrategy.SpecificStartPosition.sql_server_lsn_position, latest field was sqlServerLsnPosition",
34807                                    ));
34808                                }
34809                                result.position = std::option::Option::Some(
34810                                    crate::model::cdc_strategy::specific_start_position::Position::SqlServerLsnPosition(
34811                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::SqlServerLsnPosition>>>()?.unwrap_or_default()
34812                                    ),
34813                                );
34814                            }
34815                            __FieldTag::__mysql_gtid_position => {
34816                                if !fields.insert(__FieldTag::__mysql_gtid_position) {
34817                                    return std::result::Result::Err(A::Error::duplicate_field(
34818                                        "multiple values for mysql_gtid_position",
34819                                    ));
34820                                }
34821                                if result.position.is_some() {
34822                                    return std::result::Result::Err(A::Error::duplicate_field(
34823                                        "multiple values for `position`, a oneof with full ID .google.cloud.datastream.v1.CdcStrategy.SpecificStartPosition.mysql_gtid_position, latest field was mysqlGtidPosition",
34824                                    ));
34825                                }
34826                                result.position = std::option::Option::Some(
34827                                    crate::model::cdc_strategy::specific_start_position::Position::MysqlGtidPosition(
34828                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::MysqlGtidPosition>>>()?.unwrap_or_default()
34829                                    ),
34830                                );
34831                            }
34832                            __FieldTag::Unknown(key) => {
34833                                let value = map.next_value::<serde_json::Value>()?;
34834                                result._unknown_fields.insert(key, value);
34835                            }
34836                        }
34837                    }
34838                    std::result::Result::Ok(result)
34839                }
34840            }
34841            deserializer.deserialize_any(Visitor)
34842        }
34843    }
34844
34845    #[doc(hidden)]
34846    impl serde::ser::Serialize for SpecificStartPosition {
34847        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34848        where
34849            S: serde::ser::Serializer,
34850        {
34851            use serde::ser::SerializeMap;
34852            #[allow(unused_imports)]
34853            use std::option::Option::Some;
34854            let mut state = serializer.serialize_map(std::option::Option::None)?;
34855            if let Some(value) = self.mysql_log_position() {
34856                state.serialize_entry("mysqlLogPosition", value)?;
34857            }
34858            if let Some(value) = self.oracle_scn_position() {
34859                state.serialize_entry("oracleScnPosition", value)?;
34860            }
34861            if let Some(value) = self.sql_server_lsn_position() {
34862                state.serialize_entry("sqlServerLsnPosition", value)?;
34863            }
34864            if let Some(value) = self.mysql_gtid_position() {
34865                state.serialize_entry("mysqlGtidPosition", value)?;
34866            }
34867            if !self._unknown_fields.is_empty() {
34868                for (key, value) in self._unknown_fields.iter() {
34869                    state.serialize_entry(key, &value)?;
34870                }
34871            }
34872            state.end()
34873        }
34874    }
34875
34876    impl std::fmt::Debug for SpecificStartPosition {
34877        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
34878            let mut debug_struct = f.debug_struct("SpecificStartPosition");
34879            debug_struct.field("position", &self.position);
34880            if !self._unknown_fields.is_empty() {
34881                debug_struct.field("_unknown_fields", &self._unknown_fields);
34882            }
34883            debug_struct.finish()
34884        }
34885    }
34886
34887    /// Defines additional types related to [SpecificStartPosition].
34888    pub mod specific_start_position {
34889        #[allow(unused_imports)]
34890        use super::*;
34891
34892        #[derive(Clone, Debug, PartialEq)]
34893        #[non_exhaustive]
34894        pub enum Position {
34895            /// MySQL specific log position to start replicating from.
34896            MysqlLogPosition(std::boxed::Box<crate::model::MysqlLogPosition>),
34897            /// Oracle SCN to start replicating from.
34898            OracleScnPosition(std::boxed::Box<crate::model::OracleScnPosition>),
34899            /// SqlServer LSN to start replicating from.
34900            SqlServerLsnPosition(std::boxed::Box<crate::model::SqlServerLsnPosition>),
34901            /// MySQL GTID set to start replicating from.
34902            MysqlGtidPosition(std::boxed::Box<crate::model::MysqlGtidPosition>),
34903        }
34904    }
34905
34906    /// The position to start reading from when starting, resuming, or recovering
34907    /// the stream.
34908    /// If not set, the system's default value will be used.
34909    #[derive(Clone, Debug, PartialEq)]
34910    #[non_exhaustive]
34911    pub enum StartPosition {
34912        /// Optional. Start replicating from the most recent position in the source.
34913        MostRecentStartPosition(
34914            std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>,
34915        ),
34916        /// Optional. Resume replication from the next available position in the
34917        /// source.
34918        NextAvailableStartPosition(
34919            std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>,
34920        ),
34921        /// Optional. Start replicating from a specific position in the source.
34922        SpecificStartPosition(std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>),
34923    }
34924}
34925
34926/// SQL Server LSN position
34927#[derive(Clone, Default, PartialEq)]
34928#[non_exhaustive]
34929pub struct SqlServerLsnPosition {
34930    /// Required. Log sequence number (LSN) from where Logs will be read
34931    pub lsn: std::string::String,
34932
34933    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
34934}
34935
34936impl SqlServerLsnPosition {
34937    pub fn new() -> Self {
34938        std::default::Default::default()
34939    }
34940
34941    /// Sets the value of [lsn][crate::model::SqlServerLsnPosition::lsn].
34942    pub fn set_lsn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
34943        self.lsn = v.into();
34944        self
34945    }
34946}
34947
34948impl wkt::message::Message for SqlServerLsnPosition {
34949    fn typename() -> &'static str {
34950        "type.googleapis.com/google.cloud.datastream.v1.SqlServerLsnPosition"
34951    }
34952}
34953
34954#[doc(hidden)]
34955impl<'de> serde::de::Deserialize<'de> for SqlServerLsnPosition {
34956    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34957    where
34958        D: serde::Deserializer<'de>,
34959    {
34960        #[allow(non_camel_case_types)]
34961        #[doc(hidden)]
34962        #[derive(PartialEq, Eq, Hash)]
34963        enum __FieldTag {
34964            __lsn,
34965            Unknown(std::string::String),
34966        }
34967        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
34968            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34969            where
34970                D: serde::Deserializer<'de>,
34971            {
34972                struct Visitor;
34973                impl<'de> serde::de::Visitor<'de> for Visitor {
34974                    type Value = __FieldTag;
34975                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
34976                        formatter.write_str("a field name for SqlServerLsnPosition")
34977                    }
34978                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
34979                    where
34980                        E: serde::de::Error,
34981                    {
34982                        use std::result::Result::Ok;
34983                        use std::string::ToString;
34984                        match value {
34985                            "lsn" => Ok(__FieldTag::__lsn),
34986                            _ => Ok(__FieldTag::Unknown(value.to_string())),
34987                        }
34988                    }
34989                }
34990                deserializer.deserialize_identifier(Visitor)
34991            }
34992        }
34993        struct Visitor;
34994        impl<'de> serde::de::Visitor<'de> for Visitor {
34995            type Value = SqlServerLsnPosition;
34996            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
34997                formatter.write_str("struct SqlServerLsnPosition")
34998            }
34999            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
35000            where
35001                A: serde::de::MapAccess<'de>,
35002            {
35003                #[allow(unused_imports)]
35004                use serde::de::Error;
35005                use std::option::Option::Some;
35006                let mut fields = std::collections::HashSet::new();
35007                let mut result = Self::Value::new();
35008                while let Some(tag) = map.next_key::<__FieldTag>()? {
35009                    #[allow(clippy::match_single_binding)]
35010                    match tag {
35011                        __FieldTag::__lsn => {
35012                            if !fields.insert(__FieldTag::__lsn) {
35013                                return std::result::Result::Err(A::Error::duplicate_field(
35014                                    "multiple values for lsn",
35015                                ));
35016                            }
35017                            result.lsn = map
35018                                .next_value::<std::option::Option<std::string::String>>()?
35019                                .unwrap_or_default();
35020                        }
35021                        __FieldTag::Unknown(key) => {
35022                            let value = map.next_value::<serde_json::Value>()?;
35023                            result._unknown_fields.insert(key, value);
35024                        }
35025                    }
35026                }
35027                std::result::Result::Ok(result)
35028            }
35029        }
35030        deserializer.deserialize_any(Visitor)
35031    }
35032}
35033
35034#[doc(hidden)]
35035impl serde::ser::Serialize for SqlServerLsnPosition {
35036    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35037    where
35038        S: serde::ser::Serializer,
35039    {
35040        use serde::ser::SerializeMap;
35041        #[allow(unused_imports)]
35042        use std::option::Option::Some;
35043        let mut state = serializer.serialize_map(std::option::Option::None)?;
35044        if !self.lsn.is_empty() {
35045            state.serialize_entry("lsn", &self.lsn)?;
35046        }
35047        if !self._unknown_fields.is_empty() {
35048            for (key, value) in self._unknown_fields.iter() {
35049                state.serialize_entry(key, &value)?;
35050            }
35051        }
35052        state.end()
35053    }
35054}
35055
35056impl std::fmt::Debug for SqlServerLsnPosition {
35057    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
35058        let mut debug_struct = f.debug_struct("SqlServerLsnPosition");
35059        debug_struct.field("lsn", &self.lsn);
35060        if !self._unknown_fields.is_empty() {
35061            debug_struct.field("_unknown_fields", &self._unknown_fields);
35062        }
35063        debug_struct.finish()
35064    }
35065}
35066
35067/// Oracle SCN position
35068#[derive(Clone, Default, PartialEq)]
35069#[non_exhaustive]
35070pub struct OracleScnPosition {
35071    /// Required. SCN number from where Logs will be read
35072    pub scn: i64,
35073
35074    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
35075}
35076
35077impl OracleScnPosition {
35078    pub fn new() -> Self {
35079        std::default::Default::default()
35080    }
35081
35082    /// Sets the value of [scn][crate::model::OracleScnPosition::scn].
35083    pub fn set_scn<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
35084        self.scn = v.into();
35085        self
35086    }
35087}
35088
35089impl wkt::message::Message for OracleScnPosition {
35090    fn typename() -> &'static str {
35091        "type.googleapis.com/google.cloud.datastream.v1.OracleScnPosition"
35092    }
35093}
35094
35095#[doc(hidden)]
35096impl<'de> serde::de::Deserialize<'de> for OracleScnPosition {
35097    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35098    where
35099        D: serde::Deserializer<'de>,
35100    {
35101        #[allow(non_camel_case_types)]
35102        #[doc(hidden)]
35103        #[derive(PartialEq, Eq, Hash)]
35104        enum __FieldTag {
35105            __scn,
35106            Unknown(std::string::String),
35107        }
35108        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
35109            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35110            where
35111                D: serde::Deserializer<'de>,
35112            {
35113                struct Visitor;
35114                impl<'de> serde::de::Visitor<'de> for Visitor {
35115                    type Value = __FieldTag;
35116                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
35117                        formatter.write_str("a field name for OracleScnPosition")
35118                    }
35119                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
35120                    where
35121                        E: serde::de::Error,
35122                    {
35123                        use std::result::Result::Ok;
35124                        use std::string::ToString;
35125                        match value {
35126                            "scn" => Ok(__FieldTag::__scn),
35127                            _ => Ok(__FieldTag::Unknown(value.to_string())),
35128                        }
35129                    }
35130                }
35131                deserializer.deserialize_identifier(Visitor)
35132            }
35133        }
35134        struct Visitor;
35135        impl<'de> serde::de::Visitor<'de> for Visitor {
35136            type Value = OracleScnPosition;
35137            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
35138                formatter.write_str("struct OracleScnPosition")
35139            }
35140            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
35141            where
35142                A: serde::de::MapAccess<'de>,
35143            {
35144                #[allow(unused_imports)]
35145                use serde::de::Error;
35146                use std::option::Option::Some;
35147                let mut fields = std::collections::HashSet::new();
35148                let mut result = Self::Value::new();
35149                while let Some(tag) = map.next_key::<__FieldTag>()? {
35150                    #[allow(clippy::match_single_binding)]
35151                    match tag {
35152                        __FieldTag::__scn => {
35153                            if !fields.insert(__FieldTag::__scn) {
35154                                return std::result::Result::Err(A::Error::duplicate_field(
35155                                    "multiple values for scn",
35156                                ));
35157                            }
35158                            struct __With(std::option::Option<i64>);
35159                            impl<'de> serde::de::Deserialize<'de> for __With {
35160                                fn deserialize<D>(
35161                                    deserializer: D,
35162                                ) -> std::result::Result<Self, D::Error>
35163                                where
35164                                    D: serde::de::Deserializer<'de>,
35165                                {
35166                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
35167                                }
35168                            }
35169                            result.scn = map.next_value::<__With>()?.0.unwrap_or_default();
35170                        }
35171                        __FieldTag::Unknown(key) => {
35172                            let value = map.next_value::<serde_json::Value>()?;
35173                            result._unknown_fields.insert(key, value);
35174                        }
35175                    }
35176                }
35177                std::result::Result::Ok(result)
35178            }
35179        }
35180        deserializer.deserialize_any(Visitor)
35181    }
35182}
35183
35184#[doc(hidden)]
35185impl serde::ser::Serialize for OracleScnPosition {
35186    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35187    where
35188        S: serde::ser::Serializer,
35189    {
35190        use serde::ser::SerializeMap;
35191        #[allow(unused_imports)]
35192        use std::option::Option::Some;
35193        let mut state = serializer.serialize_map(std::option::Option::None)?;
35194        if !wkt::internal::is_default(&self.scn) {
35195            struct __With<'a>(&'a i64);
35196            impl<'a> serde::ser::Serialize for __With<'a> {
35197                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35198                where
35199                    S: serde::ser::Serializer,
35200                {
35201                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
35202                }
35203            }
35204            state.serialize_entry("scn", &__With(&self.scn))?;
35205        }
35206        if !self._unknown_fields.is_empty() {
35207            for (key, value) in self._unknown_fields.iter() {
35208                state.serialize_entry(key, &value)?;
35209            }
35210        }
35211        state.end()
35212    }
35213}
35214
35215impl std::fmt::Debug for OracleScnPosition {
35216    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
35217        let mut debug_struct = f.debug_struct("OracleScnPosition");
35218        debug_struct.field("scn", &self.scn);
35219        if !self._unknown_fields.is_empty() {
35220            debug_struct.field("_unknown_fields", &self._unknown_fields);
35221        }
35222        debug_struct.finish()
35223    }
35224}
35225
35226/// MySQL log position
35227#[derive(Clone, Default, PartialEq)]
35228#[non_exhaustive]
35229pub struct MysqlLogPosition {
35230    /// Required. The binary log file name.
35231    pub log_file: std::string::String,
35232
35233    /// Optional. The position within the binary log file. Default is head of file.
35234    pub log_position: std::option::Option<i32>,
35235
35236    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
35237}
35238
35239impl MysqlLogPosition {
35240    pub fn new() -> Self {
35241        std::default::Default::default()
35242    }
35243
35244    /// Sets the value of [log_file][crate::model::MysqlLogPosition::log_file].
35245    pub fn set_log_file<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
35246        self.log_file = v.into();
35247        self
35248    }
35249
35250    /// Sets the value of [log_position][crate::model::MysqlLogPosition::log_position].
35251    pub fn set_log_position<T>(mut self, v: T) -> Self
35252    where
35253        T: std::convert::Into<i32>,
35254    {
35255        self.log_position = std::option::Option::Some(v.into());
35256        self
35257    }
35258
35259    /// Sets or clears the value of [log_position][crate::model::MysqlLogPosition::log_position].
35260    pub fn set_or_clear_log_position<T>(mut self, v: std::option::Option<T>) -> Self
35261    where
35262        T: std::convert::Into<i32>,
35263    {
35264        self.log_position = v.map(|x| x.into());
35265        self
35266    }
35267}
35268
35269impl wkt::message::Message for MysqlLogPosition {
35270    fn typename() -> &'static str {
35271        "type.googleapis.com/google.cloud.datastream.v1.MysqlLogPosition"
35272    }
35273}
35274
35275#[doc(hidden)]
35276impl<'de> serde::de::Deserialize<'de> for MysqlLogPosition {
35277    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35278    where
35279        D: serde::Deserializer<'de>,
35280    {
35281        #[allow(non_camel_case_types)]
35282        #[doc(hidden)]
35283        #[derive(PartialEq, Eq, Hash)]
35284        enum __FieldTag {
35285            __log_file,
35286            __log_position,
35287            Unknown(std::string::String),
35288        }
35289        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
35290            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35291            where
35292                D: serde::Deserializer<'de>,
35293            {
35294                struct Visitor;
35295                impl<'de> serde::de::Visitor<'de> for Visitor {
35296                    type Value = __FieldTag;
35297                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
35298                        formatter.write_str("a field name for MysqlLogPosition")
35299                    }
35300                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
35301                    where
35302                        E: serde::de::Error,
35303                    {
35304                        use std::result::Result::Ok;
35305                        use std::string::ToString;
35306                        match value {
35307                            "logFile" => Ok(__FieldTag::__log_file),
35308                            "log_file" => Ok(__FieldTag::__log_file),
35309                            "logPosition" => Ok(__FieldTag::__log_position),
35310                            "log_position" => Ok(__FieldTag::__log_position),
35311                            _ => Ok(__FieldTag::Unknown(value.to_string())),
35312                        }
35313                    }
35314                }
35315                deserializer.deserialize_identifier(Visitor)
35316            }
35317        }
35318        struct Visitor;
35319        impl<'de> serde::de::Visitor<'de> for Visitor {
35320            type Value = MysqlLogPosition;
35321            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
35322                formatter.write_str("struct MysqlLogPosition")
35323            }
35324            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
35325            where
35326                A: serde::de::MapAccess<'de>,
35327            {
35328                #[allow(unused_imports)]
35329                use serde::de::Error;
35330                use std::option::Option::Some;
35331                let mut fields = std::collections::HashSet::new();
35332                let mut result = Self::Value::new();
35333                while let Some(tag) = map.next_key::<__FieldTag>()? {
35334                    #[allow(clippy::match_single_binding)]
35335                    match tag {
35336                        __FieldTag::__log_file => {
35337                            if !fields.insert(__FieldTag::__log_file) {
35338                                return std::result::Result::Err(A::Error::duplicate_field(
35339                                    "multiple values for log_file",
35340                                ));
35341                            }
35342                            result.log_file = map
35343                                .next_value::<std::option::Option<std::string::String>>()?
35344                                .unwrap_or_default();
35345                        }
35346                        __FieldTag::__log_position => {
35347                            if !fields.insert(__FieldTag::__log_position) {
35348                                return std::result::Result::Err(A::Error::duplicate_field(
35349                                    "multiple values for log_position",
35350                                ));
35351                            }
35352                            struct __With(std::option::Option<i32>);
35353                            impl<'de> serde::de::Deserialize<'de> for __With {
35354                                fn deserialize<D>(
35355                                    deserializer: D,
35356                                ) -> std::result::Result<Self, D::Error>
35357                                where
35358                                    D: serde::de::Deserializer<'de>,
35359                                {
35360                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
35361                                }
35362                            }
35363                            result.log_position = map.next_value::<__With>()?.0;
35364                        }
35365                        __FieldTag::Unknown(key) => {
35366                            let value = map.next_value::<serde_json::Value>()?;
35367                            result._unknown_fields.insert(key, value);
35368                        }
35369                    }
35370                }
35371                std::result::Result::Ok(result)
35372            }
35373        }
35374        deserializer.deserialize_any(Visitor)
35375    }
35376}
35377
35378#[doc(hidden)]
35379impl serde::ser::Serialize for MysqlLogPosition {
35380    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35381    where
35382        S: serde::ser::Serializer,
35383    {
35384        use serde::ser::SerializeMap;
35385        #[allow(unused_imports)]
35386        use std::option::Option::Some;
35387        let mut state = serializer.serialize_map(std::option::Option::None)?;
35388        if !self.log_file.is_empty() {
35389            state.serialize_entry("logFile", &self.log_file)?;
35390        }
35391        if self.log_position.is_some() {
35392            struct __With<'a>(&'a std::option::Option<i32>);
35393            impl<'a> serde::ser::Serialize for __With<'a> {
35394                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35395                where
35396                    S: serde::ser::Serializer,
35397                {
35398                    serde_with::As::<std::option::Option<wkt::internal::I32>>::serialize(
35399                        self.0, serializer,
35400                    )
35401                }
35402            }
35403            state.serialize_entry("logPosition", &__With(&self.log_position))?;
35404        }
35405        if !self._unknown_fields.is_empty() {
35406            for (key, value) in self._unknown_fields.iter() {
35407                state.serialize_entry(key, &value)?;
35408            }
35409        }
35410        state.end()
35411    }
35412}
35413
35414impl std::fmt::Debug for MysqlLogPosition {
35415    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
35416        let mut debug_struct = f.debug_struct("MysqlLogPosition");
35417        debug_struct.field("log_file", &self.log_file);
35418        debug_struct.field("log_position", &self.log_position);
35419        if !self._unknown_fields.is_empty() {
35420            debug_struct.field("_unknown_fields", &self._unknown_fields);
35421        }
35422        debug_struct.finish()
35423    }
35424}
35425
35426/// MySQL GTID position
35427#[derive(Clone, Default, PartialEq)]
35428#[non_exhaustive]
35429pub struct MysqlGtidPosition {
35430    /// Required. The gtid set to start replication from.
35431    pub gtid_set: std::string::String,
35432
35433    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
35434}
35435
35436impl MysqlGtidPosition {
35437    pub fn new() -> Self {
35438        std::default::Default::default()
35439    }
35440
35441    /// Sets the value of [gtid_set][crate::model::MysqlGtidPosition::gtid_set].
35442    pub fn set_gtid_set<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
35443        self.gtid_set = v.into();
35444        self
35445    }
35446}
35447
35448impl wkt::message::Message for MysqlGtidPosition {
35449    fn typename() -> &'static str {
35450        "type.googleapis.com/google.cloud.datastream.v1.MysqlGtidPosition"
35451    }
35452}
35453
35454#[doc(hidden)]
35455impl<'de> serde::de::Deserialize<'de> for MysqlGtidPosition {
35456    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35457    where
35458        D: serde::Deserializer<'de>,
35459    {
35460        #[allow(non_camel_case_types)]
35461        #[doc(hidden)]
35462        #[derive(PartialEq, Eq, Hash)]
35463        enum __FieldTag {
35464            __gtid_set,
35465            Unknown(std::string::String),
35466        }
35467        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
35468            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35469            where
35470                D: serde::Deserializer<'de>,
35471            {
35472                struct Visitor;
35473                impl<'de> serde::de::Visitor<'de> for Visitor {
35474                    type Value = __FieldTag;
35475                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
35476                        formatter.write_str("a field name for MysqlGtidPosition")
35477                    }
35478                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
35479                    where
35480                        E: serde::de::Error,
35481                    {
35482                        use std::result::Result::Ok;
35483                        use std::string::ToString;
35484                        match value {
35485                            "gtidSet" => Ok(__FieldTag::__gtid_set),
35486                            "gtid_set" => Ok(__FieldTag::__gtid_set),
35487                            _ => Ok(__FieldTag::Unknown(value.to_string())),
35488                        }
35489                    }
35490                }
35491                deserializer.deserialize_identifier(Visitor)
35492            }
35493        }
35494        struct Visitor;
35495        impl<'de> serde::de::Visitor<'de> for Visitor {
35496            type Value = MysqlGtidPosition;
35497            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
35498                formatter.write_str("struct MysqlGtidPosition")
35499            }
35500            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
35501            where
35502                A: serde::de::MapAccess<'de>,
35503            {
35504                #[allow(unused_imports)]
35505                use serde::de::Error;
35506                use std::option::Option::Some;
35507                let mut fields = std::collections::HashSet::new();
35508                let mut result = Self::Value::new();
35509                while let Some(tag) = map.next_key::<__FieldTag>()? {
35510                    #[allow(clippy::match_single_binding)]
35511                    match tag {
35512                        __FieldTag::__gtid_set => {
35513                            if !fields.insert(__FieldTag::__gtid_set) {
35514                                return std::result::Result::Err(A::Error::duplicate_field(
35515                                    "multiple values for gtid_set",
35516                                ));
35517                            }
35518                            result.gtid_set = map
35519                                .next_value::<std::option::Option<std::string::String>>()?
35520                                .unwrap_or_default();
35521                        }
35522                        __FieldTag::Unknown(key) => {
35523                            let value = map.next_value::<serde_json::Value>()?;
35524                            result._unknown_fields.insert(key, value);
35525                        }
35526                    }
35527                }
35528                std::result::Result::Ok(result)
35529            }
35530        }
35531        deserializer.deserialize_any(Visitor)
35532    }
35533}
35534
35535#[doc(hidden)]
35536impl serde::ser::Serialize for MysqlGtidPosition {
35537    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35538    where
35539        S: serde::ser::Serializer,
35540    {
35541        use serde::ser::SerializeMap;
35542        #[allow(unused_imports)]
35543        use std::option::Option::Some;
35544        let mut state = serializer.serialize_map(std::option::Option::None)?;
35545        if !self.gtid_set.is_empty() {
35546            state.serialize_entry("gtidSet", &self.gtid_set)?;
35547        }
35548        if !self._unknown_fields.is_empty() {
35549            for (key, value) in self._unknown_fields.iter() {
35550                state.serialize_entry(key, &value)?;
35551            }
35552        }
35553        state.end()
35554    }
35555}
35556
35557impl std::fmt::Debug for MysqlGtidPosition {
35558    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
35559        let mut debug_struct = f.debug_struct("MysqlGtidPosition");
35560        debug_struct.field("gtid_set", &self.gtid_set);
35561        if !self._unknown_fields.is_empty() {
35562            debug_struct.field("_unknown_fields", &self._unknown_fields);
35563        }
35564        debug_struct.finish()
35565    }
35566}