Skip to main content

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 gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_location;
25extern crate google_cloud_longrunning;
26extern crate google_cloud_lro;
27extern crate serde;
28extern crate serde_json;
29extern crate serde_with;
30extern crate std;
31extern crate tracing;
32extern crate wkt;
33
34mod debug;
35mod deserialize;
36mod serialize;
37
38/// Request message for 'discover' ConnectionProfile request.
39#[derive(Clone, Default, PartialEq)]
40#[non_exhaustive]
41pub struct DiscoverConnectionProfileRequest {
42    /// Required. The parent resource of the connection profile type. Must be in
43    /// the format `projects/*/locations/*`.
44    pub parent: std::string::String,
45
46    /// The connection profile on which to run discover.
47    pub target: std::option::Option<crate::model::discover_connection_profile_request::Target>,
48
49    /// The depth of the retrieved hierarchy of data objects.
50    pub hierarchy:
51        std::option::Option<crate::model::discover_connection_profile_request::Hierarchy>,
52
53    /// The data object to populate with child data objects and metadata.
54    pub data_object:
55        std::option::Option<crate::model::discover_connection_profile_request::DataObject>,
56
57    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
58}
59
60impl DiscoverConnectionProfileRequest {
61    pub fn new() -> Self {
62        std::default::Default::default()
63    }
64
65    /// Sets the value of [parent][crate::model::DiscoverConnectionProfileRequest::parent].
66    ///
67    /// # Example
68    /// ```ignore,no_run
69    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
70    /// let x = DiscoverConnectionProfileRequest::new().set_parent("example");
71    /// ```
72    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
73        self.parent = v.into();
74        self
75    }
76
77    /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target].
78    ///
79    /// Note that all the setters affecting `target` are mutually
80    /// exclusive.
81    ///
82    /// # Example
83    /// ```ignore,no_run
84    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
85    /// use google_cloud_datastream_v1::model::discover_connection_profile_request::Target;
86    /// let x = DiscoverConnectionProfileRequest::new().set_target(Some(Target::ConnectionProfileName("example".to_string())));
87    /// ```
88    pub fn set_target<
89        T: std::convert::Into<
90                std::option::Option<crate::model::discover_connection_profile_request::Target>,
91            >,
92    >(
93        mut self,
94        v: T,
95    ) -> Self {
96        self.target = v.into();
97        self
98    }
99
100    /// The value of [target][crate::model::DiscoverConnectionProfileRequest::target]
101    /// if it holds a `ConnectionProfile`, `None` if the field is not set or
102    /// holds a different branch.
103    pub fn connection_profile(
104        &self,
105    ) -> std::option::Option<&std::boxed::Box<crate::model::ConnectionProfile>> {
106        #[allow(unreachable_patterns)]
107        self.target.as_ref().and_then(|v| match v {
108            crate::model::discover_connection_profile_request::Target::ConnectionProfile(v) => {
109                std::option::Option::Some(v)
110            }
111            _ => std::option::Option::None,
112        })
113    }
114
115    /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target]
116    /// to hold a `ConnectionProfile`.
117    ///
118    /// Note that all the setters affecting `target` are
119    /// mutually exclusive.
120    ///
121    /// # Example
122    /// ```ignore,no_run
123    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
124    /// use google_cloud_datastream_v1::model::ConnectionProfile;
125    /// let x = DiscoverConnectionProfileRequest::new().set_connection_profile(ConnectionProfile::default()/* use setters */);
126    /// assert!(x.connection_profile().is_some());
127    /// assert!(x.connection_profile_name().is_none());
128    /// ```
129    pub fn set_connection_profile<
130        T: std::convert::Into<std::boxed::Box<crate::model::ConnectionProfile>>,
131    >(
132        mut self,
133        v: T,
134    ) -> Self {
135        self.target = std::option::Option::Some(
136            crate::model::discover_connection_profile_request::Target::ConnectionProfile(v.into()),
137        );
138        self
139    }
140
141    /// The value of [target][crate::model::DiscoverConnectionProfileRequest::target]
142    /// if it holds a `ConnectionProfileName`, `None` if the field is not set or
143    /// holds a different branch.
144    pub fn connection_profile_name(&self) -> std::option::Option<&std::string::String> {
145        #[allow(unreachable_patterns)]
146        self.target.as_ref().and_then(|v| match v {
147            crate::model::discover_connection_profile_request::Target::ConnectionProfileName(v) => {
148                std::option::Option::Some(v)
149            }
150            _ => std::option::Option::None,
151        })
152    }
153
154    /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target]
155    /// to hold a `ConnectionProfileName`.
156    ///
157    /// Note that all the setters affecting `target` are
158    /// mutually exclusive.
159    ///
160    /// # Example
161    /// ```ignore,no_run
162    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
163    /// let x = DiscoverConnectionProfileRequest::new().set_connection_profile_name("example");
164    /// assert!(x.connection_profile_name().is_some());
165    /// assert!(x.connection_profile().is_none());
166    /// ```
167    pub fn set_connection_profile_name<T: std::convert::Into<std::string::String>>(
168        mut self,
169        v: T,
170    ) -> Self {
171        self.target = std::option::Option::Some(
172            crate::model::discover_connection_profile_request::Target::ConnectionProfileName(
173                v.into(),
174            ),
175        );
176        self
177    }
178
179    /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy].
180    ///
181    /// Note that all the setters affecting `hierarchy` are mutually
182    /// exclusive.
183    ///
184    /// # Example
185    /// ```ignore,no_run
186    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
187    /// use google_cloud_datastream_v1::model::discover_connection_profile_request::Hierarchy;
188    /// let x = DiscoverConnectionProfileRequest::new().set_hierarchy(Some(Hierarchy::FullHierarchy(true)));
189    /// ```
190    pub fn set_hierarchy<
191        T: std::convert::Into<
192                std::option::Option<crate::model::discover_connection_profile_request::Hierarchy>,
193            >,
194    >(
195        mut self,
196        v: T,
197    ) -> Self {
198        self.hierarchy = v.into();
199        self
200    }
201
202    /// The value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
203    /// if it holds a `FullHierarchy`, `None` if the field is not set or
204    /// holds a different branch.
205    pub fn full_hierarchy(&self) -> std::option::Option<&bool> {
206        #[allow(unreachable_patterns)]
207        self.hierarchy.as_ref().and_then(|v| match v {
208            crate::model::discover_connection_profile_request::Hierarchy::FullHierarchy(v) => {
209                std::option::Option::Some(v)
210            }
211            _ => std::option::Option::None,
212        })
213    }
214
215    /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
216    /// to hold a `FullHierarchy`.
217    ///
218    /// Note that all the setters affecting `hierarchy` are
219    /// mutually exclusive.
220    ///
221    /// # Example
222    /// ```ignore,no_run
223    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
224    /// let x = DiscoverConnectionProfileRequest::new().set_full_hierarchy(true);
225    /// assert!(x.full_hierarchy().is_some());
226    /// assert!(x.hierarchy_depth().is_none());
227    /// ```
228    pub fn set_full_hierarchy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
229        self.hierarchy = std::option::Option::Some(
230            crate::model::discover_connection_profile_request::Hierarchy::FullHierarchy(v.into()),
231        );
232        self
233    }
234
235    /// The value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
236    /// if it holds a `HierarchyDepth`, `None` if the field is not set or
237    /// holds a different branch.
238    pub fn hierarchy_depth(&self) -> std::option::Option<&i32> {
239        #[allow(unreachable_patterns)]
240        self.hierarchy.as_ref().and_then(|v| match v {
241            crate::model::discover_connection_profile_request::Hierarchy::HierarchyDepth(v) => {
242                std::option::Option::Some(v)
243            }
244            _ => std::option::Option::None,
245        })
246    }
247
248    /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
249    /// to hold a `HierarchyDepth`.
250    ///
251    /// Note that all the setters affecting `hierarchy` are
252    /// mutually exclusive.
253    ///
254    /// # Example
255    /// ```ignore,no_run
256    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
257    /// let x = DiscoverConnectionProfileRequest::new().set_hierarchy_depth(42);
258    /// assert!(x.hierarchy_depth().is_some());
259    /// assert!(x.full_hierarchy().is_none());
260    /// ```
261    pub fn set_hierarchy_depth<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
262        self.hierarchy = std::option::Option::Some(
263            crate::model::discover_connection_profile_request::Hierarchy::HierarchyDepth(v.into()),
264        );
265        self
266    }
267
268    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object].
269    ///
270    /// Note that all the setters affecting `data_object` are mutually
271    /// exclusive.
272    ///
273    /// # Example
274    /// ```ignore,no_run
275    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
276    /// use google_cloud_datastream_v1::model::OracleRdbms;
277    /// let x = DiscoverConnectionProfileRequest::new().set_data_object(Some(
278    ///     google_cloud_datastream_v1::model::discover_connection_profile_request::DataObject::OracleRdbms(OracleRdbms::default().into())));
279    /// ```
280    pub fn set_data_object<
281        T: std::convert::Into<
282                std::option::Option<crate::model::discover_connection_profile_request::DataObject>,
283            >,
284    >(
285        mut self,
286        v: T,
287    ) -> Self {
288        self.data_object = v.into();
289        self
290    }
291
292    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
293    /// if it holds a `OracleRdbms`, `None` if the field is not set or
294    /// holds a different branch.
295    pub fn oracle_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
296        #[allow(unreachable_patterns)]
297        self.data_object.as_ref().and_then(|v| match v {
298            crate::model::discover_connection_profile_request::DataObject::OracleRdbms(v) => {
299                std::option::Option::Some(v)
300            }
301            _ => std::option::Option::None,
302        })
303    }
304
305    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
306    /// to hold a `OracleRdbms`.
307    ///
308    /// Note that all the setters affecting `data_object` are
309    /// mutually exclusive.
310    ///
311    /// # Example
312    /// ```ignore,no_run
313    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
314    /// use google_cloud_datastream_v1::model::OracleRdbms;
315    /// let x = DiscoverConnectionProfileRequest::new().set_oracle_rdbms(OracleRdbms::default()/* use setters */);
316    /// assert!(x.oracle_rdbms().is_some());
317    /// assert!(x.mysql_rdbms().is_none());
318    /// assert!(x.postgresql_rdbms().is_none());
319    /// assert!(x.sql_server_rdbms().is_none());
320    /// assert!(x.salesforce_org().is_none());
321    /// assert!(x.mongodb_cluster().is_none());
322    /// ```
323    pub fn set_oracle_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>>(
324        mut self,
325        v: T,
326    ) -> Self {
327        self.data_object = std::option::Option::Some(
328            crate::model::discover_connection_profile_request::DataObject::OracleRdbms(v.into()),
329        );
330        self
331    }
332
333    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
334    /// if it holds a `MysqlRdbms`, `None` if the field is not set or
335    /// holds a different branch.
336    pub fn mysql_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
337        #[allow(unreachable_patterns)]
338        self.data_object.as_ref().and_then(|v| match v {
339            crate::model::discover_connection_profile_request::DataObject::MysqlRdbms(v) => {
340                std::option::Option::Some(v)
341            }
342            _ => std::option::Option::None,
343        })
344    }
345
346    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
347    /// to hold a `MysqlRdbms`.
348    ///
349    /// Note that all the setters affecting `data_object` are
350    /// mutually exclusive.
351    ///
352    /// # Example
353    /// ```ignore,no_run
354    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
355    /// use google_cloud_datastream_v1::model::MysqlRdbms;
356    /// let x = DiscoverConnectionProfileRequest::new().set_mysql_rdbms(MysqlRdbms::default()/* use setters */);
357    /// assert!(x.mysql_rdbms().is_some());
358    /// assert!(x.oracle_rdbms().is_none());
359    /// assert!(x.postgresql_rdbms().is_none());
360    /// assert!(x.sql_server_rdbms().is_none());
361    /// assert!(x.salesforce_org().is_none());
362    /// assert!(x.mongodb_cluster().is_none());
363    /// ```
364    pub fn set_mysql_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>>(
365        mut self,
366        v: T,
367    ) -> Self {
368        self.data_object = std::option::Option::Some(
369            crate::model::discover_connection_profile_request::DataObject::MysqlRdbms(v.into()),
370        );
371        self
372    }
373
374    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
375    /// if it holds a `PostgresqlRdbms`, `None` if the field is not set or
376    /// holds a different branch.
377    pub fn postgresql_rdbms(
378        &self,
379    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
380        #[allow(unreachable_patterns)]
381        self.data_object.as_ref().and_then(|v| match v {
382            crate::model::discover_connection_profile_request::DataObject::PostgresqlRdbms(v) => {
383                std::option::Option::Some(v)
384            }
385            _ => std::option::Option::None,
386        })
387    }
388
389    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
390    /// to hold a `PostgresqlRdbms`.
391    ///
392    /// Note that all the setters affecting `data_object` are
393    /// mutually exclusive.
394    ///
395    /// # Example
396    /// ```ignore,no_run
397    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
398    /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
399    /// let x = DiscoverConnectionProfileRequest::new().set_postgresql_rdbms(PostgresqlRdbms::default()/* use setters */);
400    /// assert!(x.postgresql_rdbms().is_some());
401    /// assert!(x.oracle_rdbms().is_none());
402    /// assert!(x.mysql_rdbms().is_none());
403    /// assert!(x.sql_server_rdbms().is_none());
404    /// assert!(x.salesforce_org().is_none());
405    /// assert!(x.mongodb_cluster().is_none());
406    /// ```
407    pub fn set_postgresql_rdbms<
408        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
409    >(
410        mut self,
411        v: T,
412    ) -> Self {
413        self.data_object = std::option::Option::Some(
414            crate::model::discover_connection_profile_request::DataObject::PostgresqlRdbms(
415                v.into(),
416            ),
417        );
418        self
419    }
420
421    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
422    /// if it holds a `SqlServerRdbms`, `None` if the field is not set or
423    /// holds a different branch.
424    pub fn sql_server_rdbms(
425        &self,
426    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
427        #[allow(unreachable_patterns)]
428        self.data_object.as_ref().and_then(|v| match v {
429            crate::model::discover_connection_profile_request::DataObject::SqlServerRdbms(v) => {
430                std::option::Option::Some(v)
431            }
432            _ => std::option::Option::None,
433        })
434    }
435
436    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
437    /// to hold a `SqlServerRdbms`.
438    ///
439    /// Note that all the setters affecting `data_object` are
440    /// mutually exclusive.
441    ///
442    /// # Example
443    /// ```ignore,no_run
444    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
445    /// use google_cloud_datastream_v1::model::SqlServerRdbms;
446    /// let x = DiscoverConnectionProfileRequest::new().set_sql_server_rdbms(SqlServerRdbms::default()/* use setters */);
447    /// assert!(x.sql_server_rdbms().is_some());
448    /// assert!(x.oracle_rdbms().is_none());
449    /// assert!(x.mysql_rdbms().is_none());
450    /// assert!(x.postgresql_rdbms().is_none());
451    /// assert!(x.salesforce_org().is_none());
452    /// assert!(x.mongodb_cluster().is_none());
453    /// ```
454    pub fn set_sql_server_rdbms<
455        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
456    >(
457        mut self,
458        v: T,
459    ) -> Self {
460        self.data_object = std::option::Option::Some(
461            crate::model::discover_connection_profile_request::DataObject::SqlServerRdbms(v.into()),
462        );
463        self
464    }
465
466    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
467    /// if it holds a `SalesforceOrg`, `None` if the field is not set or
468    /// holds a different branch.
469    pub fn salesforce_org(
470        &self,
471    ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceOrg>> {
472        #[allow(unreachable_patterns)]
473        self.data_object.as_ref().and_then(|v| match v {
474            crate::model::discover_connection_profile_request::DataObject::SalesforceOrg(v) => {
475                std::option::Option::Some(v)
476            }
477            _ => std::option::Option::None,
478        })
479    }
480
481    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
482    /// to hold a `SalesforceOrg`.
483    ///
484    /// Note that all the setters affecting `data_object` are
485    /// mutually exclusive.
486    ///
487    /// # Example
488    /// ```ignore,no_run
489    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
490    /// use google_cloud_datastream_v1::model::SalesforceOrg;
491    /// let x = DiscoverConnectionProfileRequest::new().set_salesforce_org(SalesforceOrg::default()/* use setters */);
492    /// assert!(x.salesforce_org().is_some());
493    /// assert!(x.oracle_rdbms().is_none());
494    /// assert!(x.mysql_rdbms().is_none());
495    /// assert!(x.postgresql_rdbms().is_none());
496    /// assert!(x.sql_server_rdbms().is_none());
497    /// assert!(x.mongodb_cluster().is_none());
498    /// ```
499    pub fn set_salesforce_org<
500        T: std::convert::Into<std::boxed::Box<crate::model::SalesforceOrg>>,
501    >(
502        mut self,
503        v: T,
504    ) -> Self {
505        self.data_object = std::option::Option::Some(
506            crate::model::discover_connection_profile_request::DataObject::SalesforceOrg(v.into()),
507        );
508        self
509    }
510
511    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
512    /// if it holds a `MongodbCluster`, `None` if the field is not set or
513    /// holds a different branch.
514    pub fn mongodb_cluster(
515        &self,
516    ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbCluster>> {
517        #[allow(unreachable_patterns)]
518        self.data_object.as_ref().and_then(|v| match v {
519            crate::model::discover_connection_profile_request::DataObject::MongodbCluster(v) => {
520                std::option::Option::Some(v)
521            }
522            _ => std::option::Option::None,
523        })
524    }
525
526    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
527    /// to hold a `MongodbCluster`.
528    ///
529    /// Note that all the setters affecting `data_object` are
530    /// mutually exclusive.
531    ///
532    /// # Example
533    /// ```ignore,no_run
534    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
535    /// use google_cloud_datastream_v1::model::MongodbCluster;
536    /// let x = DiscoverConnectionProfileRequest::new().set_mongodb_cluster(MongodbCluster::default()/* use setters */);
537    /// assert!(x.mongodb_cluster().is_some());
538    /// assert!(x.oracle_rdbms().is_none());
539    /// assert!(x.mysql_rdbms().is_none());
540    /// assert!(x.postgresql_rdbms().is_none());
541    /// assert!(x.sql_server_rdbms().is_none());
542    /// assert!(x.salesforce_org().is_none());
543    /// ```
544    pub fn set_mongodb_cluster<
545        T: std::convert::Into<std::boxed::Box<crate::model::MongodbCluster>>,
546    >(
547        mut self,
548        v: T,
549    ) -> Self {
550        self.data_object = std::option::Option::Some(
551            crate::model::discover_connection_profile_request::DataObject::MongodbCluster(v.into()),
552        );
553        self
554    }
555}
556
557impl wkt::message::Message for DiscoverConnectionProfileRequest {
558    fn typename() -> &'static str {
559        "type.googleapis.com/google.cloud.datastream.v1.DiscoverConnectionProfileRequest"
560    }
561}
562
563/// Defines additional types related to [DiscoverConnectionProfileRequest].
564pub mod discover_connection_profile_request {
565    #[allow(unused_imports)]
566    use super::*;
567
568    /// The connection profile on which to run discover.
569    #[derive(Clone, Debug, PartialEq)]
570    #[non_exhaustive]
571    pub enum Target {
572        /// An ad-hoc connection profile configuration.
573        ConnectionProfile(std::boxed::Box<crate::model::ConnectionProfile>),
574        /// A reference to an existing connection profile.
575        ConnectionProfileName(std::string::String),
576    }
577
578    /// The depth of the retrieved hierarchy of data objects.
579    #[derive(Clone, Debug, PartialEq)]
580    #[non_exhaustive]
581    pub enum Hierarchy {
582        /// Whether to retrieve the full hierarchy of data objects (TRUE) or only the
583        /// current level (FALSE).
584        FullHierarchy(bool),
585        /// The number of hierarchy levels below the current level to be retrieved.
586        HierarchyDepth(i32),
587    }
588
589    /// The data object to populate with child data objects and metadata.
590    #[derive(Clone, Debug, PartialEq)]
591    #[non_exhaustive]
592    pub enum DataObject {
593        /// Oracle RDBMS to enrich with child data objects and metadata.
594        OracleRdbms(std::boxed::Box<crate::model::OracleRdbms>),
595        /// MySQL RDBMS to enrich with child data objects and metadata.
596        MysqlRdbms(std::boxed::Box<crate::model::MysqlRdbms>),
597        /// PostgreSQL RDBMS to enrich with child data objects and metadata.
598        PostgresqlRdbms(std::boxed::Box<crate::model::PostgresqlRdbms>),
599        /// SQLServer RDBMS to enrich with child data objects and metadata.
600        SqlServerRdbms(std::boxed::Box<crate::model::SqlServerRdbms>),
601        /// Salesforce organization to enrich with child data objects and metadata.
602        SalesforceOrg(std::boxed::Box<crate::model::SalesforceOrg>),
603        /// MongoDB cluster to enrich with child data objects and metadata.
604        MongodbCluster(std::boxed::Box<crate::model::MongodbCluster>),
605    }
606}
607
608/// Response from a discover request.
609#[derive(Clone, Default, PartialEq)]
610#[non_exhaustive]
611pub struct DiscoverConnectionProfileResponse {
612    /// The data object that has been enriched by the discover API call.
613    pub data_object:
614        std::option::Option<crate::model::discover_connection_profile_response::DataObject>,
615
616    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
617}
618
619impl DiscoverConnectionProfileResponse {
620    pub fn new() -> Self {
621        std::default::Default::default()
622    }
623
624    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object].
625    ///
626    /// Note that all the setters affecting `data_object` are mutually
627    /// exclusive.
628    ///
629    /// # Example
630    /// ```ignore,no_run
631    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
632    /// use google_cloud_datastream_v1::model::OracleRdbms;
633    /// let x = DiscoverConnectionProfileResponse::new().set_data_object(Some(
634    ///     google_cloud_datastream_v1::model::discover_connection_profile_response::DataObject::OracleRdbms(OracleRdbms::default().into())));
635    /// ```
636    pub fn set_data_object<
637        T: std::convert::Into<
638                std::option::Option<crate::model::discover_connection_profile_response::DataObject>,
639            >,
640    >(
641        mut self,
642        v: T,
643    ) -> Self {
644        self.data_object = v.into();
645        self
646    }
647
648    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
649    /// if it holds a `OracleRdbms`, `None` if the field is not set or
650    /// holds a different branch.
651    pub fn oracle_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
652        #[allow(unreachable_patterns)]
653        self.data_object.as_ref().and_then(|v| match v {
654            crate::model::discover_connection_profile_response::DataObject::OracleRdbms(v) => {
655                std::option::Option::Some(v)
656            }
657            _ => std::option::Option::None,
658        })
659    }
660
661    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
662    /// to hold a `OracleRdbms`.
663    ///
664    /// Note that all the setters affecting `data_object` are
665    /// mutually exclusive.
666    ///
667    /// # Example
668    /// ```ignore,no_run
669    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
670    /// use google_cloud_datastream_v1::model::OracleRdbms;
671    /// let x = DiscoverConnectionProfileResponse::new().set_oracle_rdbms(OracleRdbms::default()/* use setters */);
672    /// assert!(x.oracle_rdbms().is_some());
673    /// assert!(x.mysql_rdbms().is_none());
674    /// assert!(x.postgresql_rdbms().is_none());
675    /// assert!(x.sql_server_rdbms().is_none());
676    /// assert!(x.salesforce_org().is_none());
677    /// assert!(x.mongodb_cluster().is_none());
678    /// ```
679    pub fn set_oracle_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>>(
680        mut self,
681        v: T,
682    ) -> Self {
683        self.data_object = std::option::Option::Some(
684            crate::model::discover_connection_profile_response::DataObject::OracleRdbms(v.into()),
685        );
686        self
687    }
688
689    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
690    /// if it holds a `MysqlRdbms`, `None` if the field is not set or
691    /// holds a different branch.
692    pub fn mysql_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
693        #[allow(unreachable_patterns)]
694        self.data_object.as_ref().and_then(|v| match v {
695            crate::model::discover_connection_profile_response::DataObject::MysqlRdbms(v) => {
696                std::option::Option::Some(v)
697            }
698            _ => std::option::Option::None,
699        })
700    }
701
702    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
703    /// to hold a `MysqlRdbms`.
704    ///
705    /// Note that all the setters affecting `data_object` are
706    /// mutually exclusive.
707    ///
708    /// # Example
709    /// ```ignore,no_run
710    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
711    /// use google_cloud_datastream_v1::model::MysqlRdbms;
712    /// let x = DiscoverConnectionProfileResponse::new().set_mysql_rdbms(MysqlRdbms::default()/* use setters */);
713    /// assert!(x.mysql_rdbms().is_some());
714    /// assert!(x.oracle_rdbms().is_none());
715    /// assert!(x.postgresql_rdbms().is_none());
716    /// assert!(x.sql_server_rdbms().is_none());
717    /// assert!(x.salesforce_org().is_none());
718    /// assert!(x.mongodb_cluster().is_none());
719    /// ```
720    pub fn set_mysql_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>>(
721        mut self,
722        v: T,
723    ) -> Self {
724        self.data_object = std::option::Option::Some(
725            crate::model::discover_connection_profile_response::DataObject::MysqlRdbms(v.into()),
726        );
727        self
728    }
729
730    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
731    /// if it holds a `PostgresqlRdbms`, `None` if the field is not set or
732    /// holds a different branch.
733    pub fn postgresql_rdbms(
734        &self,
735    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
736        #[allow(unreachable_patterns)]
737        self.data_object.as_ref().and_then(|v| match v {
738            crate::model::discover_connection_profile_response::DataObject::PostgresqlRdbms(v) => {
739                std::option::Option::Some(v)
740            }
741            _ => std::option::Option::None,
742        })
743    }
744
745    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
746    /// to hold a `PostgresqlRdbms`.
747    ///
748    /// Note that all the setters affecting `data_object` are
749    /// mutually exclusive.
750    ///
751    /// # Example
752    /// ```ignore,no_run
753    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
754    /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
755    /// let x = DiscoverConnectionProfileResponse::new().set_postgresql_rdbms(PostgresqlRdbms::default()/* use setters */);
756    /// assert!(x.postgresql_rdbms().is_some());
757    /// assert!(x.oracle_rdbms().is_none());
758    /// assert!(x.mysql_rdbms().is_none());
759    /// assert!(x.sql_server_rdbms().is_none());
760    /// assert!(x.salesforce_org().is_none());
761    /// assert!(x.mongodb_cluster().is_none());
762    /// ```
763    pub fn set_postgresql_rdbms<
764        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
765    >(
766        mut self,
767        v: T,
768    ) -> Self {
769        self.data_object = std::option::Option::Some(
770            crate::model::discover_connection_profile_response::DataObject::PostgresqlRdbms(
771                v.into(),
772            ),
773        );
774        self
775    }
776
777    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
778    /// if it holds a `SqlServerRdbms`, `None` if the field is not set or
779    /// holds a different branch.
780    pub fn sql_server_rdbms(
781        &self,
782    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
783        #[allow(unreachable_patterns)]
784        self.data_object.as_ref().and_then(|v| match v {
785            crate::model::discover_connection_profile_response::DataObject::SqlServerRdbms(v) => {
786                std::option::Option::Some(v)
787            }
788            _ => std::option::Option::None,
789        })
790    }
791
792    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
793    /// to hold a `SqlServerRdbms`.
794    ///
795    /// Note that all the setters affecting `data_object` are
796    /// mutually exclusive.
797    ///
798    /// # Example
799    /// ```ignore,no_run
800    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
801    /// use google_cloud_datastream_v1::model::SqlServerRdbms;
802    /// let x = DiscoverConnectionProfileResponse::new().set_sql_server_rdbms(SqlServerRdbms::default()/* use setters */);
803    /// assert!(x.sql_server_rdbms().is_some());
804    /// assert!(x.oracle_rdbms().is_none());
805    /// assert!(x.mysql_rdbms().is_none());
806    /// assert!(x.postgresql_rdbms().is_none());
807    /// assert!(x.salesforce_org().is_none());
808    /// assert!(x.mongodb_cluster().is_none());
809    /// ```
810    pub fn set_sql_server_rdbms<
811        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
812    >(
813        mut self,
814        v: T,
815    ) -> Self {
816        self.data_object = std::option::Option::Some(
817            crate::model::discover_connection_profile_response::DataObject::SqlServerRdbms(
818                v.into(),
819            ),
820        );
821        self
822    }
823
824    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
825    /// if it holds a `SalesforceOrg`, `None` if the field is not set or
826    /// holds a different branch.
827    pub fn salesforce_org(
828        &self,
829    ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceOrg>> {
830        #[allow(unreachable_patterns)]
831        self.data_object.as_ref().and_then(|v| match v {
832            crate::model::discover_connection_profile_response::DataObject::SalesforceOrg(v) => {
833                std::option::Option::Some(v)
834            }
835            _ => std::option::Option::None,
836        })
837    }
838
839    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
840    /// to hold a `SalesforceOrg`.
841    ///
842    /// Note that all the setters affecting `data_object` are
843    /// mutually exclusive.
844    ///
845    /// # Example
846    /// ```ignore,no_run
847    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
848    /// use google_cloud_datastream_v1::model::SalesforceOrg;
849    /// let x = DiscoverConnectionProfileResponse::new().set_salesforce_org(SalesforceOrg::default()/* use setters */);
850    /// assert!(x.salesforce_org().is_some());
851    /// assert!(x.oracle_rdbms().is_none());
852    /// assert!(x.mysql_rdbms().is_none());
853    /// assert!(x.postgresql_rdbms().is_none());
854    /// assert!(x.sql_server_rdbms().is_none());
855    /// assert!(x.mongodb_cluster().is_none());
856    /// ```
857    pub fn set_salesforce_org<
858        T: std::convert::Into<std::boxed::Box<crate::model::SalesforceOrg>>,
859    >(
860        mut self,
861        v: T,
862    ) -> Self {
863        self.data_object = std::option::Option::Some(
864            crate::model::discover_connection_profile_response::DataObject::SalesforceOrg(v.into()),
865        );
866        self
867    }
868
869    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
870    /// if it holds a `MongodbCluster`, `None` if the field is not set or
871    /// holds a different branch.
872    pub fn mongodb_cluster(
873        &self,
874    ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbCluster>> {
875        #[allow(unreachable_patterns)]
876        self.data_object.as_ref().and_then(|v| match v {
877            crate::model::discover_connection_profile_response::DataObject::MongodbCluster(v) => {
878                std::option::Option::Some(v)
879            }
880            _ => std::option::Option::None,
881        })
882    }
883
884    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
885    /// to hold a `MongodbCluster`.
886    ///
887    /// Note that all the setters affecting `data_object` are
888    /// mutually exclusive.
889    ///
890    /// # Example
891    /// ```ignore,no_run
892    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
893    /// use google_cloud_datastream_v1::model::MongodbCluster;
894    /// let x = DiscoverConnectionProfileResponse::new().set_mongodb_cluster(MongodbCluster::default()/* use setters */);
895    /// assert!(x.mongodb_cluster().is_some());
896    /// assert!(x.oracle_rdbms().is_none());
897    /// assert!(x.mysql_rdbms().is_none());
898    /// assert!(x.postgresql_rdbms().is_none());
899    /// assert!(x.sql_server_rdbms().is_none());
900    /// assert!(x.salesforce_org().is_none());
901    /// ```
902    pub fn set_mongodb_cluster<
903        T: std::convert::Into<std::boxed::Box<crate::model::MongodbCluster>>,
904    >(
905        mut self,
906        v: T,
907    ) -> Self {
908        self.data_object = std::option::Option::Some(
909            crate::model::discover_connection_profile_response::DataObject::MongodbCluster(
910                v.into(),
911            ),
912        );
913        self
914    }
915}
916
917impl wkt::message::Message for DiscoverConnectionProfileResponse {
918    fn typename() -> &'static str {
919        "type.googleapis.com/google.cloud.datastream.v1.DiscoverConnectionProfileResponse"
920    }
921}
922
923/// Defines additional types related to [DiscoverConnectionProfileResponse].
924pub mod discover_connection_profile_response {
925    #[allow(unused_imports)]
926    use super::*;
927
928    /// The data object that has been enriched by the discover API call.
929    #[derive(Clone, Debug, PartialEq)]
930    #[non_exhaustive]
931    pub enum DataObject {
932        /// Enriched Oracle RDBMS object.
933        OracleRdbms(std::boxed::Box<crate::model::OracleRdbms>),
934        /// Enriched MySQL RDBMS object.
935        MysqlRdbms(std::boxed::Box<crate::model::MysqlRdbms>),
936        /// Enriched PostgreSQL RDBMS object.
937        PostgresqlRdbms(std::boxed::Box<crate::model::PostgresqlRdbms>),
938        /// Enriched SQLServer RDBMS object.
939        SqlServerRdbms(std::boxed::Box<crate::model::SqlServerRdbms>),
940        /// Enriched Salesforce organization.
941        SalesforceOrg(std::boxed::Box<crate::model::SalesforceOrg>),
942        /// Enriched MongoDB cluster.
943        MongodbCluster(std::boxed::Box<crate::model::MongodbCluster>),
944    }
945}
946
947/// Request message for 'FetchStaticIps' request.
948#[derive(Clone, Default, PartialEq)]
949#[non_exhaustive]
950pub struct FetchStaticIpsRequest {
951    /// Required. The resource name for the location for which static IPs should be
952    /// returned. Must be in the format `projects/*/locations/*`.
953    pub name: std::string::String,
954
955    /// Maximum number of Ips to return, will likely not be specified.
956    pub page_size: i32,
957
958    /// A page token, received from a previous `ListStaticIps` call.
959    /// will likely not be specified.
960    pub page_token: std::string::String,
961
962    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
963}
964
965impl FetchStaticIpsRequest {
966    pub fn new() -> Self {
967        std::default::Default::default()
968    }
969
970    /// Sets the value of [name][crate::model::FetchStaticIpsRequest::name].
971    ///
972    /// # Example
973    /// ```ignore,no_run
974    /// # use google_cloud_datastream_v1::model::FetchStaticIpsRequest;
975    /// let x = FetchStaticIpsRequest::new().set_name("example");
976    /// ```
977    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
978        self.name = v.into();
979        self
980    }
981
982    /// Sets the value of [page_size][crate::model::FetchStaticIpsRequest::page_size].
983    ///
984    /// # Example
985    /// ```ignore,no_run
986    /// # use google_cloud_datastream_v1::model::FetchStaticIpsRequest;
987    /// let x = FetchStaticIpsRequest::new().set_page_size(42);
988    /// ```
989    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
990        self.page_size = v.into();
991        self
992    }
993
994    /// Sets the value of [page_token][crate::model::FetchStaticIpsRequest::page_token].
995    ///
996    /// # Example
997    /// ```ignore,no_run
998    /// # use google_cloud_datastream_v1::model::FetchStaticIpsRequest;
999    /// let x = FetchStaticIpsRequest::new().set_page_token("example");
1000    /// ```
1001    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1002        self.page_token = v.into();
1003        self
1004    }
1005}
1006
1007impl wkt::message::Message for FetchStaticIpsRequest {
1008    fn typename() -> &'static str {
1009        "type.googleapis.com/google.cloud.datastream.v1.FetchStaticIpsRequest"
1010    }
1011}
1012
1013/// Response message for a 'FetchStaticIps' response.
1014#[derive(Clone, Default, PartialEq)]
1015#[non_exhaustive]
1016pub struct FetchStaticIpsResponse {
1017    /// list of static ips by account
1018    pub static_ips: std::vec::Vec<std::string::String>,
1019
1020    /// A token that can be sent as `page_token` to retrieve the next page.
1021    /// If this field is omitted, there are no subsequent pages.
1022    pub next_page_token: std::string::String,
1023
1024    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1025}
1026
1027impl FetchStaticIpsResponse {
1028    pub fn new() -> Self {
1029        std::default::Default::default()
1030    }
1031
1032    /// Sets the value of [static_ips][crate::model::FetchStaticIpsResponse::static_ips].
1033    ///
1034    /// # Example
1035    /// ```ignore,no_run
1036    /// # use google_cloud_datastream_v1::model::FetchStaticIpsResponse;
1037    /// let x = FetchStaticIpsResponse::new().set_static_ips(["a", "b", "c"]);
1038    /// ```
1039    pub fn set_static_ips<T, V>(mut self, v: T) -> Self
1040    where
1041        T: std::iter::IntoIterator<Item = V>,
1042        V: std::convert::Into<std::string::String>,
1043    {
1044        use std::iter::Iterator;
1045        self.static_ips = v.into_iter().map(|i| i.into()).collect();
1046        self
1047    }
1048
1049    /// Sets the value of [next_page_token][crate::model::FetchStaticIpsResponse::next_page_token].
1050    ///
1051    /// # Example
1052    /// ```ignore,no_run
1053    /// # use google_cloud_datastream_v1::model::FetchStaticIpsResponse;
1054    /// let x = FetchStaticIpsResponse::new().set_next_page_token("example");
1055    /// ```
1056    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1057        self.next_page_token = v.into();
1058        self
1059    }
1060}
1061
1062impl wkt::message::Message for FetchStaticIpsResponse {
1063    fn typename() -> &'static str {
1064        "type.googleapis.com/google.cloud.datastream.v1.FetchStaticIpsResponse"
1065    }
1066}
1067
1068/// Request message for listing connection profiles.
1069#[derive(Clone, Default, PartialEq)]
1070#[non_exhaustive]
1071pub struct ListConnectionProfilesRequest {
1072    /// Required. The parent that owns the collection of connection profiles.
1073    pub parent: std::string::String,
1074
1075    /// Maximum number of connection profiles to return.
1076    /// If unspecified, at most 50 connection profiles will be returned.
1077    /// The maximum value is 1000; values above 1000 will be coerced to 1000.
1078    pub page_size: i32,
1079
1080    /// Page token received from a previous `ListConnectionProfiles` call.
1081    /// Provide this to retrieve the subsequent page.
1082    ///
1083    /// When paginating, all other parameters provided to `ListConnectionProfiles`
1084    /// must match the call that provided the page token.
1085    pub page_token: std::string::String,
1086
1087    /// Filter request.
1088    pub filter: std::string::String,
1089
1090    /// Order by fields for the result.
1091    pub order_by: std::string::String,
1092
1093    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1094}
1095
1096impl ListConnectionProfilesRequest {
1097    pub fn new() -> Self {
1098        std::default::Default::default()
1099    }
1100
1101    /// Sets the value of [parent][crate::model::ListConnectionProfilesRequest::parent].
1102    ///
1103    /// # Example
1104    /// ```ignore,no_run
1105    /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1106    /// let x = ListConnectionProfilesRequest::new().set_parent("example");
1107    /// ```
1108    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1109        self.parent = v.into();
1110        self
1111    }
1112
1113    /// Sets the value of [page_size][crate::model::ListConnectionProfilesRequest::page_size].
1114    ///
1115    /// # Example
1116    /// ```ignore,no_run
1117    /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1118    /// let x = ListConnectionProfilesRequest::new().set_page_size(42);
1119    /// ```
1120    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1121        self.page_size = v.into();
1122        self
1123    }
1124
1125    /// Sets the value of [page_token][crate::model::ListConnectionProfilesRequest::page_token].
1126    ///
1127    /// # Example
1128    /// ```ignore,no_run
1129    /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1130    /// let x = ListConnectionProfilesRequest::new().set_page_token("example");
1131    /// ```
1132    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1133        self.page_token = v.into();
1134        self
1135    }
1136
1137    /// Sets the value of [filter][crate::model::ListConnectionProfilesRequest::filter].
1138    ///
1139    /// # Example
1140    /// ```ignore,no_run
1141    /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1142    /// let x = ListConnectionProfilesRequest::new().set_filter("example");
1143    /// ```
1144    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1145        self.filter = v.into();
1146        self
1147    }
1148
1149    /// Sets the value of [order_by][crate::model::ListConnectionProfilesRequest::order_by].
1150    ///
1151    /// # Example
1152    /// ```ignore,no_run
1153    /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1154    /// let x = ListConnectionProfilesRequest::new().set_order_by("example");
1155    /// ```
1156    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1157        self.order_by = v.into();
1158        self
1159    }
1160}
1161
1162impl wkt::message::Message for ListConnectionProfilesRequest {
1163    fn typename() -> &'static str {
1164        "type.googleapis.com/google.cloud.datastream.v1.ListConnectionProfilesRequest"
1165    }
1166}
1167
1168/// Response message for listing connection profiles.
1169#[derive(Clone, Default, PartialEq)]
1170#[non_exhaustive]
1171pub struct ListConnectionProfilesResponse {
1172    /// List of connection profiles.
1173    pub connection_profiles: std::vec::Vec<crate::model::ConnectionProfile>,
1174
1175    /// A token, which can be sent as `page_token` to retrieve the next page.
1176    /// If this field is omitted, there are no subsequent pages.
1177    pub next_page_token: std::string::String,
1178
1179    /// Locations that could not be reached.
1180    pub unreachable: std::vec::Vec<std::string::String>,
1181
1182    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1183}
1184
1185impl ListConnectionProfilesResponse {
1186    pub fn new() -> Self {
1187        std::default::Default::default()
1188    }
1189
1190    /// Sets the value of [connection_profiles][crate::model::ListConnectionProfilesResponse::connection_profiles].
1191    ///
1192    /// # Example
1193    /// ```ignore,no_run
1194    /// # use google_cloud_datastream_v1::model::ListConnectionProfilesResponse;
1195    /// use google_cloud_datastream_v1::model::ConnectionProfile;
1196    /// let x = ListConnectionProfilesResponse::new()
1197    ///     .set_connection_profiles([
1198    ///         ConnectionProfile::default()/* use setters */,
1199    ///         ConnectionProfile::default()/* use (different) setters */,
1200    ///     ]);
1201    /// ```
1202    pub fn set_connection_profiles<T, V>(mut self, v: T) -> Self
1203    where
1204        T: std::iter::IntoIterator<Item = V>,
1205        V: std::convert::Into<crate::model::ConnectionProfile>,
1206    {
1207        use std::iter::Iterator;
1208        self.connection_profiles = v.into_iter().map(|i| i.into()).collect();
1209        self
1210    }
1211
1212    /// Sets the value of [next_page_token][crate::model::ListConnectionProfilesResponse::next_page_token].
1213    ///
1214    /// # Example
1215    /// ```ignore,no_run
1216    /// # use google_cloud_datastream_v1::model::ListConnectionProfilesResponse;
1217    /// let x = ListConnectionProfilesResponse::new().set_next_page_token("example");
1218    /// ```
1219    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1220        self.next_page_token = v.into();
1221        self
1222    }
1223
1224    /// Sets the value of [unreachable][crate::model::ListConnectionProfilesResponse::unreachable].
1225    ///
1226    /// # Example
1227    /// ```ignore,no_run
1228    /// # use google_cloud_datastream_v1::model::ListConnectionProfilesResponse;
1229    /// let x = ListConnectionProfilesResponse::new().set_unreachable(["a", "b", "c"]);
1230    /// ```
1231    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1232    where
1233        T: std::iter::IntoIterator<Item = V>,
1234        V: std::convert::Into<std::string::String>,
1235    {
1236        use std::iter::Iterator;
1237        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1238        self
1239    }
1240}
1241
1242impl wkt::message::Message for ListConnectionProfilesResponse {
1243    fn typename() -> &'static str {
1244        "type.googleapis.com/google.cloud.datastream.v1.ListConnectionProfilesResponse"
1245    }
1246}
1247
1248#[doc(hidden)]
1249impl google_cloud_gax::paginator::internal::PageableResponse for ListConnectionProfilesResponse {
1250    type PageItem = crate::model::ConnectionProfile;
1251
1252    fn items(self) -> std::vec::Vec<Self::PageItem> {
1253        self.connection_profiles
1254    }
1255
1256    fn next_page_token(&self) -> std::string::String {
1257        use std::clone::Clone;
1258        self.next_page_token.clone()
1259    }
1260}
1261
1262/// Request message for getting a connection profile.
1263#[derive(Clone, Default, PartialEq)]
1264#[non_exhaustive]
1265pub struct GetConnectionProfileRequest {
1266    /// Required. The name of the connection profile resource to get.
1267    pub name: std::string::String,
1268
1269    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1270}
1271
1272impl GetConnectionProfileRequest {
1273    pub fn new() -> Self {
1274        std::default::Default::default()
1275    }
1276
1277    /// Sets the value of [name][crate::model::GetConnectionProfileRequest::name].
1278    ///
1279    /// # Example
1280    /// ```ignore,no_run
1281    /// # use google_cloud_datastream_v1::model::GetConnectionProfileRequest;
1282    /// let x = GetConnectionProfileRequest::new().set_name("example");
1283    /// ```
1284    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1285        self.name = v.into();
1286        self
1287    }
1288}
1289
1290impl wkt::message::Message for GetConnectionProfileRequest {
1291    fn typename() -> &'static str {
1292        "type.googleapis.com/google.cloud.datastream.v1.GetConnectionProfileRequest"
1293    }
1294}
1295
1296/// Request message for creating a connection profile.
1297#[derive(Clone, Default, PartialEq)]
1298#[non_exhaustive]
1299pub struct CreateConnectionProfileRequest {
1300    /// Required. The parent that owns the collection of ConnectionProfiles.
1301    pub parent: std::string::String,
1302
1303    /// Required. The connection profile identifier.
1304    pub connection_profile_id: std::string::String,
1305
1306    /// Required. The connection profile resource to create.
1307    pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
1308
1309    /// Optional. A request ID to identify requests. Specify a unique request ID
1310    /// so that if you must retry your request, the server will know to ignore
1311    /// the request if it has already been completed. The server will guarantee
1312    /// that for at least 60 minutes since the first request.
1313    ///
1314    /// For example, consider a situation where you make an initial request and the
1315    /// request times out. If you make the request again with the same request ID,
1316    /// the server can check if original operation with the same request ID was
1317    /// received, and if so, will ignore the second request. This prevents clients
1318    /// from accidentally creating duplicate commitments.
1319    ///
1320    /// The request ID must be a valid UUID with the exception that zero UUID is
1321    /// not supported (00000000-0000-0000-0000-000000000000).
1322    pub request_id: std::string::String,
1323
1324    /// Optional. Only validate the connection profile, but don't create any
1325    /// resources. The default is false.
1326    pub validate_only: bool,
1327
1328    /// Optional. Create the connection profile without validating it.
1329    pub force: bool,
1330
1331    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1332}
1333
1334impl CreateConnectionProfileRequest {
1335    pub fn new() -> Self {
1336        std::default::Default::default()
1337    }
1338
1339    /// Sets the value of [parent][crate::model::CreateConnectionProfileRequest::parent].
1340    ///
1341    /// # Example
1342    /// ```ignore,no_run
1343    /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1344    /// let x = CreateConnectionProfileRequest::new().set_parent("example");
1345    /// ```
1346    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1347        self.parent = v.into();
1348        self
1349    }
1350
1351    /// Sets the value of [connection_profile_id][crate::model::CreateConnectionProfileRequest::connection_profile_id].
1352    ///
1353    /// # Example
1354    /// ```ignore,no_run
1355    /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1356    /// let x = CreateConnectionProfileRequest::new().set_connection_profile_id("example");
1357    /// ```
1358    pub fn set_connection_profile_id<T: std::convert::Into<std::string::String>>(
1359        mut self,
1360        v: T,
1361    ) -> Self {
1362        self.connection_profile_id = v.into();
1363        self
1364    }
1365
1366    /// Sets the value of [connection_profile][crate::model::CreateConnectionProfileRequest::connection_profile].
1367    ///
1368    /// # Example
1369    /// ```ignore,no_run
1370    /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1371    /// use google_cloud_datastream_v1::model::ConnectionProfile;
1372    /// let x = CreateConnectionProfileRequest::new().set_connection_profile(ConnectionProfile::default()/* use setters */);
1373    /// ```
1374    pub fn set_connection_profile<T>(mut self, v: T) -> Self
1375    where
1376        T: std::convert::Into<crate::model::ConnectionProfile>,
1377    {
1378        self.connection_profile = std::option::Option::Some(v.into());
1379        self
1380    }
1381
1382    /// Sets or clears the value of [connection_profile][crate::model::CreateConnectionProfileRequest::connection_profile].
1383    ///
1384    /// # Example
1385    /// ```ignore,no_run
1386    /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1387    /// use google_cloud_datastream_v1::model::ConnectionProfile;
1388    /// let x = CreateConnectionProfileRequest::new().set_or_clear_connection_profile(Some(ConnectionProfile::default()/* use setters */));
1389    /// let x = CreateConnectionProfileRequest::new().set_or_clear_connection_profile(None::<ConnectionProfile>);
1390    /// ```
1391    pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
1392    where
1393        T: std::convert::Into<crate::model::ConnectionProfile>,
1394    {
1395        self.connection_profile = v.map(|x| x.into());
1396        self
1397    }
1398
1399    /// Sets the value of [request_id][crate::model::CreateConnectionProfileRequest::request_id].
1400    ///
1401    /// # Example
1402    /// ```ignore,no_run
1403    /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1404    /// let x = CreateConnectionProfileRequest::new().set_request_id("example");
1405    /// ```
1406    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1407        self.request_id = v.into();
1408        self
1409    }
1410
1411    /// Sets the value of [validate_only][crate::model::CreateConnectionProfileRequest::validate_only].
1412    ///
1413    /// # Example
1414    /// ```ignore,no_run
1415    /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1416    /// let x = CreateConnectionProfileRequest::new().set_validate_only(true);
1417    /// ```
1418    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1419        self.validate_only = v.into();
1420        self
1421    }
1422
1423    /// Sets the value of [force][crate::model::CreateConnectionProfileRequest::force].
1424    ///
1425    /// # Example
1426    /// ```ignore,no_run
1427    /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1428    /// let x = CreateConnectionProfileRequest::new().set_force(true);
1429    /// ```
1430    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1431        self.force = v.into();
1432        self
1433    }
1434}
1435
1436impl wkt::message::Message for CreateConnectionProfileRequest {
1437    fn typename() -> &'static str {
1438        "type.googleapis.com/google.cloud.datastream.v1.CreateConnectionProfileRequest"
1439    }
1440}
1441
1442/// Connection profile update message.
1443#[derive(Clone, Default, PartialEq)]
1444#[non_exhaustive]
1445pub struct UpdateConnectionProfileRequest {
1446    /// Optional. Field mask is used to specify the fields to be overwritten in the
1447    /// ConnectionProfile resource by the update.
1448    /// The fields specified in the update_mask are relative to the resource, not
1449    /// the full request. A field will be overwritten if it is in the mask. If the
1450    /// user does not provide a mask then all fields will be overwritten.
1451    pub update_mask: std::option::Option<wkt::FieldMask>,
1452
1453    /// Required. The connection profile to update.
1454    pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
1455
1456    /// Optional. A request ID to identify requests. Specify a unique request ID
1457    /// so that if you must retry your request, the server will know to ignore
1458    /// the request if it has already been completed. The server will guarantee
1459    /// that for at least 60 minutes since the first request.
1460    ///
1461    /// For example, consider a situation where you make an initial request and the
1462    /// request times out. If you make the request again with the same request ID,
1463    /// the server can check if original operation with the same request ID was
1464    /// received, and if so, will ignore the second request. This prevents clients
1465    /// from accidentally creating duplicate commitments.
1466    ///
1467    /// The request ID must be a valid UUID with the exception that zero UUID is
1468    /// not supported (00000000-0000-0000-0000-000000000000).
1469    pub request_id: std::string::String,
1470
1471    /// Optional. Only validate the connection profile, but don't update any
1472    /// resources. The default is false.
1473    pub validate_only: bool,
1474
1475    /// Optional. Update the connection profile without validating it.
1476    pub force: bool,
1477
1478    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1479}
1480
1481impl UpdateConnectionProfileRequest {
1482    pub fn new() -> Self {
1483        std::default::Default::default()
1484    }
1485
1486    /// Sets the value of [update_mask][crate::model::UpdateConnectionProfileRequest::update_mask].
1487    ///
1488    /// # Example
1489    /// ```ignore,no_run
1490    /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1491    /// use wkt::FieldMask;
1492    /// let x = UpdateConnectionProfileRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1493    /// ```
1494    pub fn set_update_mask<T>(mut self, v: T) -> Self
1495    where
1496        T: std::convert::Into<wkt::FieldMask>,
1497    {
1498        self.update_mask = std::option::Option::Some(v.into());
1499        self
1500    }
1501
1502    /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionProfileRequest::update_mask].
1503    ///
1504    /// # Example
1505    /// ```ignore,no_run
1506    /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1507    /// use wkt::FieldMask;
1508    /// let x = UpdateConnectionProfileRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1509    /// let x = UpdateConnectionProfileRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1510    /// ```
1511    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1512    where
1513        T: std::convert::Into<wkt::FieldMask>,
1514    {
1515        self.update_mask = v.map(|x| x.into());
1516        self
1517    }
1518
1519    /// Sets the value of [connection_profile][crate::model::UpdateConnectionProfileRequest::connection_profile].
1520    ///
1521    /// # Example
1522    /// ```ignore,no_run
1523    /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1524    /// use google_cloud_datastream_v1::model::ConnectionProfile;
1525    /// let x = UpdateConnectionProfileRequest::new().set_connection_profile(ConnectionProfile::default()/* use setters */);
1526    /// ```
1527    pub fn set_connection_profile<T>(mut self, v: T) -> Self
1528    where
1529        T: std::convert::Into<crate::model::ConnectionProfile>,
1530    {
1531        self.connection_profile = std::option::Option::Some(v.into());
1532        self
1533    }
1534
1535    /// Sets or clears the value of [connection_profile][crate::model::UpdateConnectionProfileRequest::connection_profile].
1536    ///
1537    /// # Example
1538    /// ```ignore,no_run
1539    /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1540    /// use google_cloud_datastream_v1::model::ConnectionProfile;
1541    /// let x = UpdateConnectionProfileRequest::new().set_or_clear_connection_profile(Some(ConnectionProfile::default()/* use setters */));
1542    /// let x = UpdateConnectionProfileRequest::new().set_or_clear_connection_profile(None::<ConnectionProfile>);
1543    /// ```
1544    pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
1545    where
1546        T: std::convert::Into<crate::model::ConnectionProfile>,
1547    {
1548        self.connection_profile = v.map(|x| x.into());
1549        self
1550    }
1551
1552    /// Sets the value of [request_id][crate::model::UpdateConnectionProfileRequest::request_id].
1553    ///
1554    /// # Example
1555    /// ```ignore,no_run
1556    /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1557    /// let x = UpdateConnectionProfileRequest::new().set_request_id("example");
1558    /// ```
1559    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1560        self.request_id = v.into();
1561        self
1562    }
1563
1564    /// Sets the value of [validate_only][crate::model::UpdateConnectionProfileRequest::validate_only].
1565    ///
1566    /// # Example
1567    /// ```ignore,no_run
1568    /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1569    /// let x = UpdateConnectionProfileRequest::new().set_validate_only(true);
1570    /// ```
1571    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1572        self.validate_only = v.into();
1573        self
1574    }
1575
1576    /// Sets the value of [force][crate::model::UpdateConnectionProfileRequest::force].
1577    ///
1578    /// # Example
1579    /// ```ignore,no_run
1580    /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1581    /// let x = UpdateConnectionProfileRequest::new().set_force(true);
1582    /// ```
1583    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1584        self.force = v.into();
1585        self
1586    }
1587}
1588
1589impl wkt::message::Message for UpdateConnectionProfileRequest {
1590    fn typename() -> &'static str {
1591        "type.googleapis.com/google.cloud.datastream.v1.UpdateConnectionProfileRequest"
1592    }
1593}
1594
1595/// Request message for deleting a connection profile.
1596#[derive(Clone, Default, PartialEq)]
1597#[non_exhaustive]
1598pub struct DeleteConnectionProfileRequest {
1599    /// Required. The name of the connection profile resource to delete.
1600    pub name: std::string::String,
1601
1602    /// Optional. A request ID to identify requests. Specify a unique request ID
1603    /// so that if you must retry your request, the server will know to ignore
1604    /// the request if it has already been completed. The server will guarantee
1605    /// that for at least 60 minutes after the first request.
1606    ///
1607    /// For example, consider a situation where you make an initial request and the
1608    /// request times out. If you make the request again with the same request ID,
1609    /// the server can check if original operation with the same request ID was
1610    /// received, and if so, will ignore the second request. This prevents clients
1611    /// from accidentally creating duplicate commitments.
1612    ///
1613    /// The request ID must be a valid UUID with the exception that zero UUID is
1614    /// not supported (00000000-0000-0000-0000-000000000000).
1615    pub request_id: std::string::String,
1616
1617    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1618}
1619
1620impl DeleteConnectionProfileRequest {
1621    pub fn new() -> Self {
1622        std::default::Default::default()
1623    }
1624
1625    /// Sets the value of [name][crate::model::DeleteConnectionProfileRequest::name].
1626    ///
1627    /// # Example
1628    /// ```ignore,no_run
1629    /// # use google_cloud_datastream_v1::model::DeleteConnectionProfileRequest;
1630    /// let x = DeleteConnectionProfileRequest::new().set_name("example");
1631    /// ```
1632    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1633        self.name = v.into();
1634        self
1635    }
1636
1637    /// Sets the value of [request_id][crate::model::DeleteConnectionProfileRequest::request_id].
1638    ///
1639    /// # Example
1640    /// ```ignore,no_run
1641    /// # use google_cloud_datastream_v1::model::DeleteConnectionProfileRequest;
1642    /// let x = DeleteConnectionProfileRequest::new().set_request_id("example");
1643    /// ```
1644    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1645        self.request_id = v.into();
1646        self
1647    }
1648}
1649
1650impl wkt::message::Message for DeleteConnectionProfileRequest {
1651    fn typename() -> &'static str {
1652        "type.googleapis.com/google.cloud.datastream.v1.DeleteConnectionProfileRequest"
1653    }
1654}
1655
1656/// Request message for listing streams.
1657#[derive(Clone, Default, PartialEq)]
1658#[non_exhaustive]
1659pub struct ListStreamsRequest {
1660    /// Required. The parent that owns the collection of streams.
1661    pub parent: std::string::String,
1662
1663    /// Maximum number of streams to return.
1664    /// If unspecified, at most 50 streams will  be returned. The maximum
1665    /// value is 1000; values above 1000 will be coerced to 1000.
1666    pub page_size: i32,
1667
1668    /// Page token received from a previous `ListStreams` call.
1669    /// Provide this to retrieve the subsequent page.
1670    ///
1671    /// When paginating, all other parameters provided to `ListStreams`
1672    /// must match the call that provided the page token.
1673    pub page_token: std::string::String,
1674
1675    /// Filter request.
1676    pub filter: std::string::String,
1677
1678    /// Order by fields for the result.
1679    pub order_by: std::string::String,
1680
1681    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1682}
1683
1684impl ListStreamsRequest {
1685    pub fn new() -> Self {
1686        std::default::Default::default()
1687    }
1688
1689    /// Sets the value of [parent][crate::model::ListStreamsRequest::parent].
1690    ///
1691    /// # Example
1692    /// ```ignore,no_run
1693    /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1694    /// let x = ListStreamsRequest::new().set_parent("example");
1695    /// ```
1696    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1697        self.parent = v.into();
1698        self
1699    }
1700
1701    /// Sets the value of [page_size][crate::model::ListStreamsRequest::page_size].
1702    ///
1703    /// # Example
1704    /// ```ignore,no_run
1705    /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1706    /// let x = ListStreamsRequest::new().set_page_size(42);
1707    /// ```
1708    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1709        self.page_size = v.into();
1710        self
1711    }
1712
1713    /// Sets the value of [page_token][crate::model::ListStreamsRequest::page_token].
1714    ///
1715    /// # Example
1716    /// ```ignore,no_run
1717    /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1718    /// let x = ListStreamsRequest::new().set_page_token("example");
1719    /// ```
1720    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1721        self.page_token = v.into();
1722        self
1723    }
1724
1725    /// Sets the value of [filter][crate::model::ListStreamsRequest::filter].
1726    ///
1727    /// # Example
1728    /// ```ignore,no_run
1729    /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1730    /// let x = ListStreamsRequest::new().set_filter("example");
1731    /// ```
1732    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1733        self.filter = v.into();
1734        self
1735    }
1736
1737    /// Sets the value of [order_by][crate::model::ListStreamsRequest::order_by].
1738    ///
1739    /// # Example
1740    /// ```ignore,no_run
1741    /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1742    /// let x = ListStreamsRequest::new().set_order_by("example");
1743    /// ```
1744    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1745        self.order_by = v.into();
1746        self
1747    }
1748}
1749
1750impl wkt::message::Message for ListStreamsRequest {
1751    fn typename() -> &'static str {
1752        "type.googleapis.com/google.cloud.datastream.v1.ListStreamsRequest"
1753    }
1754}
1755
1756/// Response message for listing streams.
1757#[derive(Clone, Default, PartialEq)]
1758#[non_exhaustive]
1759pub struct ListStreamsResponse {
1760    /// List of streams
1761    pub streams: std::vec::Vec<crate::model::Stream>,
1762
1763    /// A token, which can be sent as `page_token` to retrieve the next page.
1764    /// If this field is omitted, there are no subsequent pages.
1765    pub next_page_token: std::string::String,
1766
1767    /// Locations that could not be reached.
1768    pub unreachable: std::vec::Vec<std::string::String>,
1769
1770    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1771}
1772
1773impl ListStreamsResponse {
1774    pub fn new() -> Self {
1775        std::default::Default::default()
1776    }
1777
1778    /// Sets the value of [streams][crate::model::ListStreamsResponse::streams].
1779    ///
1780    /// # Example
1781    /// ```ignore,no_run
1782    /// # use google_cloud_datastream_v1::model::ListStreamsResponse;
1783    /// use google_cloud_datastream_v1::model::Stream;
1784    /// let x = ListStreamsResponse::new()
1785    ///     .set_streams([
1786    ///         Stream::default()/* use setters */,
1787    ///         Stream::default()/* use (different) setters */,
1788    ///     ]);
1789    /// ```
1790    pub fn set_streams<T, V>(mut self, v: T) -> Self
1791    where
1792        T: std::iter::IntoIterator<Item = V>,
1793        V: std::convert::Into<crate::model::Stream>,
1794    {
1795        use std::iter::Iterator;
1796        self.streams = v.into_iter().map(|i| i.into()).collect();
1797        self
1798    }
1799
1800    /// Sets the value of [next_page_token][crate::model::ListStreamsResponse::next_page_token].
1801    ///
1802    /// # Example
1803    /// ```ignore,no_run
1804    /// # use google_cloud_datastream_v1::model::ListStreamsResponse;
1805    /// let x = ListStreamsResponse::new().set_next_page_token("example");
1806    /// ```
1807    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1808        self.next_page_token = v.into();
1809        self
1810    }
1811
1812    /// Sets the value of [unreachable][crate::model::ListStreamsResponse::unreachable].
1813    ///
1814    /// # Example
1815    /// ```ignore,no_run
1816    /// # use google_cloud_datastream_v1::model::ListStreamsResponse;
1817    /// let x = ListStreamsResponse::new().set_unreachable(["a", "b", "c"]);
1818    /// ```
1819    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1820    where
1821        T: std::iter::IntoIterator<Item = V>,
1822        V: std::convert::Into<std::string::String>,
1823    {
1824        use std::iter::Iterator;
1825        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1826        self
1827    }
1828}
1829
1830impl wkt::message::Message for ListStreamsResponse {
1831    fn typename() -> &'static str {
1832        "type.googleapis.com/google.cloud.datastream.v1.ListStreamsResponse"
1833    }
1834}
1835
1836#[doc(hidden)]
1837impl google_cloud_gax::paginator::internal::PageableResponse for ListStreamsResponse {
1838    type PageItem = crate::model::Stream;
1839
1840    fn items(self) -> std::vec::Vec<Self::PageItem> {
1841        self.streams
1842    }
1843
1844    fn next_page_token(&self) -> std::string::String {
1845        use std::clone::Clone;
1846        self.next_page_token.clone()
1847    }
1848}
1849
1850/// Request message for getting a stream.
1851#[derive(Clone, Default, PartialEq)]
1852#[non_exhaustive]
1853pub struct GetStreamRequest {
1854    /// Required. The name of the stream resource to get.
1855    pub name: std::string::String,
1856
1857    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1858}
1859
1860impl GetStreamRequest {
1861    pub fn new() -> Self {
1862        std::default::Default::default()
1863    }
1864
1865    /// Sets the value of [name][crate::model::GetStreamRequest::name].
1866    ///
1867    /// # Example
1868    /// ```ignore,no_run
1869    /// # use google_cloud_datastream_v1::model::GetStreamRequest;
1870    /// let x = GetStreamRequest::new().set_name("example");
1871    /// ```
1872    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1873        self.name = v.into();
1874        self
1875    }
1876}
1877
1878impl wkt::message::Message for GetStreamRequest {
1879    fn typename() -> &'static str {
1880        "type.googleapis.com/google.cloud.datastream.v1.GetStreamRequest"
1881    }
1882}
1883
1884/// Request message for creating a stream.
1885#[derive(Clone, Default, PartialEq)]
1886#[non_exhaustive]
1887pub struct CreateStreamRequest {
1888    /// Required. The parent that owns the collection of streams.
1889    pub parent: std::string::String,
1890
1891    /// Required. The stream identifier.
1892    pub stream_id: std::string::String,
1893
1894    /// Required. The stream resource to create.
1895    pub stream: std::option::Option<crate::model::Stream>,
1896
1897    /// Optional. A request ID to identify requests. Specify a unique request ID
1898    /// so that if you must retry your request, the server will know to ignore
1899    /// the request if it has already been completed. The server will guarantee
1900    /// that for at least 60 minutes since the first request.
1901    ///
1902    /// For example, consider a situation where you make an initial request and the
1903    /// request times out. If you make the request again with the same request ID,
1904    /// the server can check if original operation with the same request ID was
1905    /// received, and if so, will ignore the second request. This prevents clients
1906    /// from accidentally creating duplicate commitments.
1907    ///
1908    /// The request ID must be a valid UUID with the exception that zero UUID is
1909    /// not supported (00000000-0000-0000-0000-000000000000).
1910    pub request_id: std::string::String,
1911
1912    /// Optional. Only validate the stream, but don't create any resources.
1913    /// The default is false.
1914    pub validate_only: bool,
1915
1916    /// Optional. Create the stream without validating it.
1917    pub force: bool,
1918
1919    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1920}
1921
1922impl CreateStreamRequest {
1923    pub fn new() -> Self {
1924        std::default::Default::default()
1925    }
1926
1927    /// Sets the value of [parent][crate::model::CreateStreamRequest::parent].
1928    ///
1929    /// # Example
1930    /// ```ignore,no_run
1931    /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
1932    /// let x = CreateStreamRequest::new().set_parent("example");
1933    /// ```
1934    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1935        self.parent = v.into();
1936        self
1937    }
1938
1939    /// Sets the value of [stream_id][crate::model::CreateStreamRequest::stream_id].
1940    ///
1941    /// # Example
1942    /// ```ignore,no_run
1943    /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
1944    /// let x = CreateStreamRequest::new().set_stream_id("example");
1945    /// ```
1946    pub fn set_stream_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1947        self.stream_id = v.into();
1948        self
1949    }
1950
1951    /// Sets the value of [stream][crate::model::CreateStreamRequest::stream].
1952    ///
1953    /// # Example
1954    /// ```ignore,no_run
1955    /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
1956    /// use google_cloud_datastream_v1::model::Stream;
1957    /// let x = CreateStreamRequest::new().set_stream(Stream::default()/* use setters */);
1958    /// ```
1959    pub fn set_stream<T>(mut self, v: T) -> Self
1960    where
1961        T: std::convert::Into<crate::model::Stream>,
1962    {
1963        self.stream = std::option::Option::Some(v.into());
1964        self
1965    }
1966
1967    /// Sets or clears the value of [stream][crate::model::CreateStreamRequest::stream].
1968    ///
1969    /// # Example
1970    /// ```ignore,no_run
1971    /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
1972    /// use google_cloud_datastream_v1::model::Stream;
1973    /// let x = CreateStreamRequest::new().set_or_clear_stream(Some(Stream::default()/* use setters */));
1974    /// let x = CreateStreamRequest::new().set_or_clear_stream(None::<Stream>);
1975    /// ```
1976    pub fn set_or_clear_stream<T>(mut self, v: std::option::Option<T>) -> Self
1977    where
1978        T: std::convert::Into<crate::model::Stream>,
1979    {
1980        self.stream = v.map(|x| x.into());
1981        self
1982    }
1983
1984    /// Sets the value of [request_id][crate::model::CreateStreamRequest::request_id].
1985    ///
1986    /// # Example
1987    /// ```ignore,no_run
1988    /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
1989    /// let x = CreateStreamRequest::new().set_request_id("example");
1990    /// ```
1991    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1992        self.request_id = v.into();
1993        self
1994    }
1995
1996    /// Sets the value of [validate_only][crate::model::CreateStreamRequest::validate_only].
1997    ///
1998    /// # Example
1999    /// ```ignore,no_run
2000    /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
2001    /// let x = CreateStreamRequest::new().set_validate_only(true);
2002    /// ```
2003    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2004        self.validate_only = v.into();
2005        self
2006    }
2007
2008    /// Sets the value of [force][crate::model::CreateStreamRequest::force].
2009    ///
2010    /// # Example
2011    /// ```ignore,no_run
2012    /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
2013    /// let x = CreateStreamRequest::new().set_force(true);
2014    /// ```
2015    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2016        self.force = v.into();
2017        self
2018    }
2019}
2020
2021impl wkt::message::Message for CreateStreamRequest {
2022    fn typename() -> &'static str {
2023        "type.googleapis.com/google.cloud.datastream.v1.CreateStreamRequest"
2024    }
2025}
2026
2027/// Request message for updating a stream.
2028#[derive(Clone, Default, PartialEq)]
2029#[non_exhaustive]
2030pub struct UpdateStreamRequest {
2031    /// Optional. Field mask is used to specify the fields to be overwritten in the
2032    /// stream resource by the update.
2033    /// The fields specified in the update_mask are relative to the resource, not
2034    /// the full request. A field will be overwritten if it is in the mask. If the
2035    /// user does not provide a mask then all fields will be overwritten.
2036    pub update_mask: std::option::Option<wkt::FieldMask>,
2037
2038    /// Required. The stream resource to update.
2039    pub stream: std::option::Option<crate::model::Stream>,
2040
2041    /// Optional. A request ID to identify requests. Specify a unique request ID
2042    /// so that if you must retry your request, the server will know to ignore
2043    /// the request if it has already been completed. The server will guarantee
2044    /// that for at least 60 minutes since the first request.
2045    ///
2046    /// For example, consider a situation where you make an initial request and the
2047    /// request times out. If you make the request again with the same request ID,
2048    /// the server can check if original operation with the same request ID was
2049    /// received, and if so, will ignore the second request. This prevents clients
2050    /// from accidentally creating duplicate commitments.
2051    ///
2052    /// The request ID must be a valid UUID with the exception that zero UUID is
2053    /// not supported (00000000-0000-0000-0000-000000000000).
2054    pub request_id: std::string::String,
2055
2056    /// Optional. Only validate the stream with the changes, without actually
2057    /// updating it. The default is false.
2058    pub validate_only: bool,
2059
2060    /// Optional. Update the stream without validating it.
2061    pub force: bool,
2062
2063    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2064}
2065
2066impl UpdateStreamRequest {
2067    pub fn new() -> Self {
2068        std::default::Default::default()
2069    }
2070
2071    /// Sets the value of [update_mask][crate::model::UpdateStreamRequest::update_mask].
2072    ///
2073    /// # Example
2074    /// ```ignore,no_run
2075    /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2076    /// use wkt::FieldMask;
2077    /// let x = UpdateStreamRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2078    /// ```
2079    pub fn set_update_mask<T>(mut self, v: T) -> Self
2080    where
2081        T: std::convert::Into<wkt::FieldMask>,
2082    {
2083        self.update_mask = std::option::Option::Some(v.into());
2084        self
2085    }
2086
2087    /// Sets or clears the value of [update_mask][crate::model::UpdateStreamRequest::update_mask].
2088    ///
2089    /// # Example
2090    /// ```ignore,no_run
2091    /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2092    /// use wkt::FieldMask;
2093    /// let x = UpdateStreamRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2094    /// let x = UpdateStreamRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2095    /// ```
2096    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2097    where
2098        T: std::convert::Into<wkt::FieldMask>,
2099    {
2100        self.update_mask = v.map(|x| x.into());
2101        self
2102    }
2103
2104    /// Sets the value of [stream][crate::model::UpdateStreamRequest::stream].
2105    ///
2106    /// # Example
2107    /// ```ignore,no_run
2108    /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2109    /// use google_cloud_datastream_v1::model::Stream;
2110    /// let x = UpdateStreamRequest::new().set_stream(Stream::default()/* use setters */);
2111    /// ```
2112    pub fn set_stream<T>(mut self, v: T) -> Self
2113    where
2114        T: std::convert::Into<crate::model::Stream>,
2115    {
2116        self.stream = std::option::Option::Some(v.into());
2117        self
2118    }
2119
2120    /// Sets or clears the value of [stream][crate::model::UpdateStreamRequest::stream].
2121    ///
2122    /// # Example
2123    /// ```ignore,no_run
2124    /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2125    /// use google_cloud_datastream_v1::model::Stream;
2126    /// let x = UpdateStreamRequest::new().set_or_clear_stream(Some(Stream::default()/* use setters */));
2127    /// let x = UpdateStreamRequest::new().set_or_clear_stream(None::<Stream>);
2128    /// ```
2129    pub fn set_or_clear_stream<T>(mut self, v: std::option::Option<T>) -> Self
2130    where
2131        T: std::convert::Into<crate::model::Stream>,
2132    {
2133        self.stream = v.map(|x| x.into());
2134        self
2135    }
2136
2137    /// Sets the value of [request_id][crate::model::UpdateStreamRequest::request_id].
2138    ///
2139    /// # Example
2140    /// ```ignore,no_run
2141    /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2142    /// let x = UpdateStreamRequest::new().set_request_id("example");
2143    /// ```
2144    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2145        self.request_id = v.into();
2146        self
2147    }
2148
2149    /// Sets the value of [validate_only][crate::model::UpdateStreamRequest::validate_only].
2150    ///
2151    /// # Example
2152    /// ```ignore,no_run
2153    /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2154    /// let x = UpdateStreamRequest::new().set_validate_only(true);
2155    /// ```
2156    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2157        self.validate_only = v.into();
2158        self
2159    }
2160
2161    /// Sets the value of [force][crate::model::UpdateStreamRequest::force].
2162    ///
2163    /// # Example
2164    /// ```ignore,no_run
2165    /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2166    /// let x = UpdateStreamRequest::new().set_force(true);
2167    /// ```
2168    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2169        self.force = v.into();
2170        self
2171    }
2172}
2173
2174impl wkt::message::Message for UpdateStreamRequest {
2175    fn typename() -> &'static str {
2176        "type.googleapis.com/google.cloud.datastream.v1.UpdateStreamRequest"
2177    }
2178}
2179
2180/// Request message for deleting a stream.
2181#[derive(Clone, Default, PartialEq)]
2182#[non_exhaustive]
2183pub struct DeleteStreamRequest {
2184    /// Required. The name of the stream resource to delete.
2185    pub name: std::string::String,
2186
2187    /// Optional. A request ID to identify requests. Specify a unique request ID
2188    /// so that if you must retry your request, the server will know to ignore
2189    /// the request if it has already been completed. The server will guarantee
2190    /// that for at least 60 minutes after the first request.
2191    ///
2192    /// For example, consider a situation where you make an initial request and the
2193    /// request times out. If you make the request again with the same request ID,
2194    /// the server can check if original operation with the same request ID was
2195    /// received, and if so, will ignore the second request. This prevents clients
2196    /// from accidentally creating duplicate commitments.
2197    ///
2198    /// The request ID must be a valid UUID with the exception that zero UUID is
2199    /// not supported (00000000-0000-0000-0000-000000000000).
2200    pub request_id: std::string::String,
2201
2202    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2203}
2204
2205impl DeleteStreamRequest {
2206    pub fn new() -> Self {
2207        std::default::Default::default()
2208    }
2209
2210    /// Sets the value of [name][crate::model::DeleteStreamRequest::name].
2211    ///
2212    /// # Example
2213    /// ```ignore,no_run
2214    /// # use google_cloud_datastream_v1::model::DeleteStreamRequest;
2215    /// let x = DeleteStreamRequest::new().set_name("example");
2216    /// ```
2217    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2218        self.name = v.into();
2219        self
2220    }
2221
2222    /// Sets the value of [request_id][crate::model::DeleteStreamRequest::request_id].
2223    ///
2224    /// # Example
2225    /// ```ignore,no_run
2226    /// # use google_cloud_datastream_v1::model::DeleteStreamRequest;
2227    /// let x = DeleteStreamRequest::new().set_request_id("example");
2228    /// ```
2229    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2230        self.request_id = v.into();
2231        self
2232    }
2233}
2234
2235impl wkt::message::Message for DeleteStreamRequest {
2236    fn typename() -> &'static str {
2237        "type.googleapis.com/google.cloud.datastream.v1.DeleteStreamRequest"
2238    }
2239}
2240
2241/// Request message for running a stream.
2242#[derive(Clone, Default, PartialEq)]
2243#[non_exhaustive]
2244pub struct RunStreamRequest {
2245    /// Required. Name of the stream resource to start, in the format:
2246    /// projects/{project_id}/locations/{location}/streams/{stream_name}
2247    pub name: std::string::String,
2248
2249    /// Optional. The CDC strategy of the stream. If not set, the system's default
2250    /// value will be used.
2251    pub cdc_strategy: std::option::Option<crate::model::CdcStrategy>,
2252
2253    /// Optional. Update the stream without validating it.
2254    pub force: bool,
2255
2256    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2257}
2258
2259impl RunStreamRequest {
2260    pub fn new() -> Self {
2261        std::default::Default::default()
2262    }
2263
2264    /// Sets the value of [name][crate::model::RunStreamRequest::name].
2265    ///
2266    /// # Example
2267    /// ```ignore,no_run
2268    /// # use google_cloud_datastream_v1::model::RunStreamRequest;
2269    /// let x = RunStreamRequest::new().set_name("example");
2270    /// ```
2271    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2272        self.name = v.into();
2273        self
2274    }
2275
2276    /// Sets the value of [cdc_strategy][crate::model::RunStreamRequest::cdc_strategy].
2277    ///
2278    /// # Example
2279    /// ```ignore,no_run
2280    /// # use google_cloud_datastream_v1::model::RunStreamRequest;
2281    /// use google_cloud_datastream_v1::model::CdcStrategy;
2282    /// let x = RunStreamRequest::new().set_cdc_strategy(CdcStrategy::default()/* use setters */);
2283    /// ```
2284    pub fn set_cdc_strategy<T>(mut self, v: T) -> Self
2285    where
2286        T: std::convert::Into<crate::model::CdcStrategy>,
2287    {
2288        self.cdc_strategy = std::option::Option::Some(v.into());
2289        self
2290    }
2291
2292    /// Sets or clears the value of [cdc_strategy][crate::model::RunStreamRequest::cdc_strategy].
2293    ///
2294    /// # Example
2295    /// ```ignore,no_run
2296    /// # use google_cloud_datastream_v1::model::RunStreamRequest;
2297    /// use google_cloud_datastream_v1::model::CdcStrategy;
2298    /// let x = RunStreamRequest::new().set_or_clear_cdc_strategy(Some(CdcStrategy::default()/* use setters */));
2299    /// let x = RunStreamRequest::new().set_or_clear_cdc_strategy(None::<CdcStrategy>);
2300    /// ```
2301    pub fn set_or_clear_cdc_strategy<T>(mut self, v: std::option::Option<T>) -> Self
2302    where
2303        T: std::convert::Into<crate::model::CdcStrategy>,
2304    {
2305        self.cdc_strategy = v.map(|x| x.into());
2306        self
2307    }
2308
2309    /// Sets the value of [force][crate::model::RunStreamRequest::force].
2310    ///
2311    /// # Example
2312    /// ```ignore,no_run
2313    /// # use google_cloud_datastream_v1::model::RunStreamRequest;
2314    /// let x = RunStreamRequest::new().set_force(true);
2315    /// ```
2316    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2317        self.force = v.into();
2318        self
2319    }
2320}
2321
2322impl wkt::message::Message for RunStreamRequest {
2323    fn typename() -> &'static str {
2324        "type.googleapis.com/google.cloud.datastream.v1.RunStreamRequest"
2325    }
2326}
2327
2328/// Request for fetching a specific stream object.
2329#[derive(Clone, Default, PartialEq)]
2330#[non_exhaustive]
2331pub struct GetStreamObjectRequest {
2332    /// Required. The name of the stream object resource to get.
2333    pub name: std::string::String,
2334
2335    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2336}
2337
2338impl GetStreamObjectRequest {
2339    pub fn new() -> Self {
2340        std::default::Default::default()
2341    }
2342
2343    /// Sets the value of [name][crate::model::GetStreamObjectRequest::name].
2344    ///
2345    /// # Example
2346    /// ```ignore,no_run
2347    /// # use google_cloud_datastream_v1::model::GetStreamObjectRequest;
2348    /// let x = GetStreamObjectRequest::new().set_name("example");
2349    /// ```
2350    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2351        self.name = v.into();
2352        self
2353    }
2354}
2355
2356impl wkt::message::Message for GetStreamObjectRequest {
2357    fn typename() -> &'static str {
2358        "type.googleapis.com/google.cloud.datastream.v1.GetStreamObjectRequest"
2359    }
2360}
2361
2362/// Request for looking up a specific stream object by its source object
2363/// identifier.
2364#[derive(Clone, Default, PartialEq)]
2365#[non_exhaustive]
2366pub struct LookupStreamObjectRequest {
2367    /// Required. The parent stream that owns the collection of objects.
2368    pub parent: std::string::String,
2369
2370    /// Required. The source object identifier which maps to the stream object.
2371    pub source_object_identifier: std::option::Option<crate::model::SourceObjectIdentifier>,
2372
2373    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2374}
2375
2376impl LookupStreamObjectRequest {
2377    pub fn new() -> Self {
2378        std::default::Default::default()
2379    }
2380
2381    /// Sets the value of [parent][crate::model::LookupStreamObjectRequest::parent].
2382    ///
2383    /// # Example
2384    /// ```ignore,no_run
2385    /// # use google_cloud_datastream_v1::model::LookupStreamObjectRequest;
2386    /// let x = LookupStreamObjectRequest::new().set_parent("example");
2387    /// ```
2388    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2389        self.parent = v.into();
2390        self
2391    }
2392
2393    /// Sets the value of [source_object_identifier][crate::model::LookupStreamObjectRequest::source_object_identifier].
2394    ///
2395    /// # Example
2396    /// ```ignore,no_run
2397    /// # use google_cloud_datastream_v1::model::LookupStreamObjectRequest;
2398    /// use google_cloud_datastream_v1::model::SourceObjectIdentifier;
2399    /// let x = LookupStreamObjectRequest::new().set_source_object_identifier(SourceObjectIdentifier::default()/* use setters */);
2400    /// ```
2401    pub fn set_source_object_identifier<T>(mut self, v: T) -> Self
2402    where
2403        T: std::convert::Into<crate::model::SourceObjectIdentifier>,
2404    {
2405        self.source_object_identifier = std::option::Option::Some(v.into());
2406        self
2407    }
2408
2409    /// Sets or clears the value of [source_object_identifier][crate::model::LookupStreamObjectRequest::source_object_identifier].
2410    ///
2411    /// # Example
2412    /// ```ignore,no_run
2413    /// # use google_cloud_datastream_v1::model::LookupStreamObjectRequest;
2414    /// use google_cloud_datastream_v1::model::SourceObjectIdentifier;
2415    /// let x = LookupStreamObjectRequest::new().set_or_clear_source_object_identifier(Some(SourceObjectIdentifier::default()/* use setters */));
2416    /// let x = LookupStreamObjectRequest::new().set_or_clear_source_object_identifier(None::<SourceObjectIdentifier>);
2417    /// ```
2418    pub fn set_or_clear_source_object_identifier<T>(mut self, v: std::option::Option<T>) -> Self
2419    where
2420        T: std::convert::Into<crate::model::SourceObjectIdentifier>,
2421    {
2422        self.source_object_identifier = v.map(|x| x.into());
2423        self
2424    }
2425}
2426
2427impl wkt::message::Message for LookupStreamObjectRequest {
2428    fn typename() -> &'static str {
2429        "type.googleapis.com/google.cloud.datastream.v1.LookupStreamObjectRequest"
2430    }
2431}
2432
2433/// Request for manually initiating a backfill job for a specific stream object.
2434#[derive(Clone, Default, PartialEq)]
2435#[non_exhaustive]
2436pub struct StartBackfillJobRequest {
2437    /// Required. The name of the stream object resource to start a backfill job
2438    /// for.
2439    pub object: std::string::String,
2440
2441    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2442}
2443
2444impl StartBackfillJobRequest {
2445    pub fn new() -> Self {
2446        std::default::Default::default()
2447    }
2448
2449    /// Sets the value of [object][crate::model::StartBackfillJobRequest::object].
2450    ///
2451    /// # Example
2452    /// ```ignore,no_run
2453    /// # use google_cloud_datastream_v1::model::StartBackfillJobRequest;
2454    /// let x = StartBackfillJobRequest::new().set_object("example");
2455    /// ```
2456    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2457        self.object = v.into();
2458        self
2459    }
2460}
2461
2462impl wkt::message::Message for StartBackfillJobRequest {
2463    fn typename() -> &'static str {
2464        "type.googleapis.com/google.cloud.datastream.v1.StartBackfillJobRequest"
2465    }
2466}
2467
2468/// Response for manually initiating a backfill job for a specific stream object.
2469#[derive(Clone, Default, PartialEq)]
2470#[non_exhaustive]
2471pub struct StartBackfillJobResponse {
2472    /// The stream object resource a backfill job was started for.
2473    pub object: std::option::Option<crate::model::StreamObject>,
2474
2475    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2476}
2477
2478impl StartBackfillJobResponse {
2479    pub fn new() -> Self {
2480        std::default::Default::default()
2481    }
2482
2483    /// Sets the value of [object][crate::model::StartBackfillJobResponse::object].
2484    ///
2485    /// # Example
2486    /// ```ignore,no_run
2487    /// # use google_cloud_datastream_v1::model::StartBackfillJobResponse;
2488    /// use google_cloud_datastream_v1::model::StreamObject;
2489    /// let x = StartBackfillJobResponse::new().set_object(StreamObject::default()/* use setters */);
2490    /// ```
2491    pub fn set_object<T>(mut self, v: T) -> Self
2492    where
2493        T: std::convert::Into<crate::model::StreamObject>,
2494    {
2495        self.object = std::option::Option::Some(v.into());
2496        self
2497    }
2498
2499    /// Sets or clears the value of [object][crate::model::StartBackfillJobResponse::object].
2500    ///
2501    /// # Example
2502    /// ```ignore,no_run
2503    /// # use google_cloud_datastream_v1::model::StartBackfillJobResponse;
2504    /// use google_cloud_datastream_v1::model::StreamObject;
2505    /// let x = StartBackfillJobResponse::new().set_or_clear_object(Some(StreamObject::default()/* use setters */));
2506    /// let x = StartBackfillJobResponse::new().set_or_clear_object(None::<StreamObject>);
2507    /// ```
2508    pub fn set_or_clear_object<T>(mut self, v: std::option::Option<T>) -> Self
2509    where
2510        T: std::convert::Into<crate::model::StreamObject>,
2511    {
2512        self.object = v.map(|x| x.into());
2513        self
2514    }
2515}
2516
2517impl wkt::message::Message for StartBackfillJobResponse {
2518    fn typename() -> &'static str {
2519        "type.googleapis.com/google.cloud.datastream.v1.StartBackfillJobResponse"
2520    }
2521}
2522
2523/// Request for manually stopping a running backfill job for a specific stream
2524/// object.
2525#[derive(Clone, Default, PartialEq)]
2526#[non_exhaustive]
2527pub struct StopBackfillJobRequest {
2528    /// Required. The name of the stream object resource to stop the backfill job
2529    /// for.
2530    pub object: std::string::String,
2531
2532    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2533}
2534
2535impl StopBackfillJobRequest {
2536    pub fn new() -> Self {
2537        std::default::Default::default()
2538    }
2539
2540    /// Sets the value of [object][crate::model::StopBackfillJobRequest::object].
2541    ///
2542    /// # Example
2543    /// ```ignore,no_run
2544    /// # use google_cloud_datastream_v1::model::StopBackfillJobRequest;
2545    /// let x = StopBackfillJobRequest::new().set_object("example");
2546    /// ```
2547    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2548        self.object = v.into();
2549        self
2550    }
2551}
2552
2553impl wkt::message::Message for StopBackfillJobRequest {
2554    fn typename() -> &'static str {
2555        "type.googleapis.com/google.cloud.datastream.v1.StopBackfillJobRequest"
2556    }
2557}
2558
2559/// Response for manually stop a backfill job for a specific stream object.
2560#[derive(Clone, Default, PartialEq)]
2561#[non_exhaustive]
2562pub struct StopBackfillJobResponse {
2563    /// The stream object resource the backfill job was stopped for.
2564    pub object: std::option::Option<crate::model::StreamObject>,
2565
2566    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2567}
2568
2569impl StopBackfillJobResponse {
2570    pub fn new() -> Self {
2571        std::default::Default::default()
2572    }
2573
2574    /// Sets the value of [object][crate::model::StopBackfillJobResponse::object].
2575    ///
2576    /// # Example
2577    /// ```ignore,no_run
2578    /// # use google_cloud_datastream_v1::model::StopBackfillJobResponse;
2579    /// use google_cloud_datastream_v1::model::StreamObject;
2580    /// let x = StopBackfillJobResponse::new().set_object(StreamObject::default()/* use setters */);
2581    /// ```
2582    pub fn set_object<T>(mut self, v: T) -> Self
2583    where
2584        T: std::convert::Into<crate::model::StreamObject>,
2585    {
2586        self.object = std::option::Option::Some(v.into());
2587        self
2588    }
2589
2590    /// Sets or clears the value of [object][crate::model::StopBackfillJobResponse::object].
2591    ///
2592    /// # Example
2593    /// ```ignore,no_run
2594    /// # use google_cloud_datastream_v1::model::StopBackfillJobResponse;
2595    /// use google_cloud_datastream_v1::model::StreamObject;
2596    /// let x = StopBackfillJobResponse::new().set_or_clear_object(Some(StreamObject::default()/* use setters */));
2597    /// let x = StopBackfillJobResponse::new().set_or_clear_object(None::<StreamObject>);
2598    /// ```
2599    pub fn set_or_clear_object<T>(mut self, v: std::option::Option<T>) -> Self
2600    where
2601        T: std::convert::Into<crate::model::StreamObject>,
2602    {
2603        self.object = v.map(|x| x.into());
2604        self
2605    }
2606}
2607
2608impl wkt::message::Message for StopBackfillJobResponse {
2609    fn typename() -> &'static str {
2610        "type.googleapis.com/google.cloud.datastream.v1.StopBackfillJobResponse"
2611    }
2612}
2613
2614/// Request for listing all objects for a specific stream.
2615#[derive(Clone, Default, PartialEq)]
2616#[non_exhaustive]
2617pub struct ListStreamObjectsRequest {
2618    /// Required. The parent stream that owns the collection of objects.
2619    pub parent: std::string::String,
2620
2621    /// Maximum number of objects to return. Default is 50.
2622    /// The maximum value is 1000; values above 1000 will be coerced to 1000.
2623    pub page_size: i32,
2624
2625    /// Page token received from a previous `ListStreamObjectsRequest` call.
2626    /// Provide this to retrieve the subsequent page.
2627    ///
2628    /// When paginating, all other parameters provided to
2629    /// `ListStreamObjectsRequest` must match the call that provided the page
2630    /// token.
2631    pub page_token: std::string::String,
2632
2633    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2634}
2635
2636impl ListStreamObjectsRequest {
2637    pub fn new() -> Self {
2638        std::default::Default::default()
2639    }
2640
2641    /// Sets the value of [parent][crate::model::ListStreamObjectsRequest::parent].
2642    ///
2643    /// # Example
2644    /// ```ignore,no_run
2645    /// # use google_cloud_datastream_v1::model::ListStreamObjectsRequest;
2646    /// let x = ListStreamObjectsRequest::new().set_parent("example");
2647    /// ```
2648    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2649        self.parent = v.into();
2650        self
2651    }
2652
2653    /// Sets the value of [page_size][crate::model::ListStreamObjectsRequest::page_size].
2654    ///
2655    /// # Example
2656    /// ```ignore,no_run
2657    /// # use google_cloud_datastream_v1::model::ListStreamObjectsRequest;
2658    /// let x = ListStreamObjectsRequest::new().set_page_size(42);
2659    /// ```
2660    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2661        self.page_size = v.into();
2662        self
2663    }
2664
2665    /// Sets the value of [page_token][crate::model::ListStreamObjectsRequest::page_token].
2666    ///
2667    /// # Example
2668    /// ```ignore,no_run
2669    /// # use google_cloud_datastream_v1::model::ListStreamObjectsRequest;
2670    /// let x = ListStreamObjectsRequest::new().set_page_token("example");
2671    /// ```
2672    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2673        self.page_token = v.into();
2674        self
2675    }
2676}
2677
2678impl wkt::message::Message for ListStreamObjectsRequest {
2679    fn typename() -> &'static str {
2680        "type.googleapis.com/google.cloud.datastream.v1.ListStreamObjectsRequest"
2681    }
2682}
2683
2684/// Response containing the objects for a stream.
2685#[derive(Clone, Default, PartialEq)]
2686#[non_exhaustive]
2687pub struct ListStreamObjectsResponse {
2688    /// List of stream objects.
2689    pub stream_objects: std::vec::Vec<crate::model::StreamObject>,
2690
2691    /// A token, which can be sent as `page_token` to retrieve the next page.
2692    pub next_page_token: std::string::String,
2693
2694    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2695}
2696
2697impl ListStreamObjectsResponse {
2698    pub fn new() -> Self {
2699        std::default::Default::default()
2700    }
2701
2702    /// Sets the value of [stream_objects][crate::model::ListStreamObjectsResponse::stream_objects].
2703    ///
2704    /// # Example
2705    /// ```ignore,no_run
2706    /// # use google_cloud_datastream_v1::model::ListStreamObjectsResponse;
2707    /// use google_cloud_datastream_v1::model::StreamObject;
2708    /// let x = ListStreamObjectsResponse::new()
2709    ///     .set_stream_objects([
2710    ///         StreamObject::default()/* use setters */,
2711    ///         StreamObject::default()/* use (different) setters */,
2712    ///     ]);
2713    /// ```
2714    pub fn set_stream_objects<T, V>(mut self, v: T) -> Self
2715    where
2716        T: std::iter::IntoIterator<Item = V>,
2717        V: std::convert::Into<crate::model::StreamObject>,
2718    {
2719        use std::iter::Iterator;
2720        self.stream_objects = v.into_iter().map(|i| i.into()).collect();
2721        self
2722    }
2723
2724    /// Sets the value of [next_page_token][crate::model::ListStreamObjectsResponse::next_page_token].
2725    ///
2726    /// # Example
2727    /// ```ignore,no_run
2728    /// # use google_cloud_datastream_v1::model::ListStreamObjectsResponse;
2729    /// let x = ListStreamObjectsResponse::new().set_next_page_token("example");
2730    /// ```
2731    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2732        self.next_page_token = v.into();
2733        self
2734    }
2735}
2736
2737impl wkt::message::Message for ListStreamObjectsResponse {
2738    fn typename() -> &'static str {
2739        "type.googleapis.com/google.cloud.datastream.v1.ListStreamObjectsResponse"
2740    }
2741}
2742
2743#[doc(hidden)]
2744impl google_cloud_gax::paginator::internal::PageableResponse for ListStreamObjectsResponse {
2745    type PageItem = crate::model::StreamObject;
2746
2747    fn items(self) -> std::vec::Vec<Self::PageItem> {
2748        self.stream_objects
2749    }
2750
2751    fn next_page_token(&self) -> std::string::String {
2752        use std::clone::Clone;
2753        self.next_page_token.clone()
2754    }
2755}
2756
2757/// Represents the metadata of the long-running operation.
2758#[derive(Clone, Default, PartialEq)]
2759#[non_exhaustive]
2760pub struct OperationMetadata {
2761    /// Output only. The time the operation was created.
2762    pub create_time: std::option::Option<wkt::Timestamp>,
2763
2764    /// Output only. The time the operation finished running.
2765    pub end_time: std::option::Option<wkt::Timestamp>,
2766
2767    /// Output only. Server-defined resource path for the target of the operation.
2768    pub target: std::string::String,
2769
2770    /// Output only. Name of the verb executed by the operation.
2771    pub verb: std::string::String,
2772
2773    /// Output only. Human-readable status of the operation, if any.
2774    pub status_message: std::string::String,
2775
2776    /// Output only. Identifies whether the user has requested cancellation
2777    /// of the operation. Operations that have successfully been cancelled
2778    /// have
2779    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
2780    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
2781    /// corresponding to `Code.CANCELLED`.
2782    ///
2783    /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
2784    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
2785    pub requested_cancellation: bool,
2786
2787    /// Output only. API version used to start the operation.
2788    pub api_version: std::string::String,
2789
2790    /// Output only. Results of executed validations if there are any.
2791    pub validation_result: std::option::Option<crate::model::ValidationResult>,
2792
2793    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2794}
2795
2796impl OperationMetadata {
2797    pub fn new() -> Self {
2798        std::default::Default::default()
2799    }
2800
2801    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
2802    ///
2803    /// # Example
2804    /// ```ignore,no_run
2805    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2806    /// use wkt::Timestamp;
2807    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
2808    /// ```
2809    pub fn set_create_time<T>(mut self, v: T) -> Self
2810    where
2811        T: std::convert::Into<wkt::Timestamp>,
2812    {
2813        self.create_time = std::option::Option::Some(v.into());
2814        self
2815    }
2816
2817    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
2818    ///
2819    /// # Example
2820    /// ```ignore,no_run
2821    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2822    /// use wkt::Timestamp;
2823    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2824    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
2825    /// ```
2826    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2827    where
2828        T: std::convert::Into<wkt::Timestamp>,
2829    {
2830        self.create_time = v.map(|x| x.into());
2831        self
2832    }
2833
2834    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
2835    ///
2836    /// # Example
2837    /// ```ignore,no_run
2838    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2839    /// use wkt::Timestamp;
2840    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
2841    /// ```
2842    pub fn set_end_time<T>(mut self, v: T) -> Self
2843    where
2844        T: std::convert::Into<wkt::Timestamp>,
2845    {
2846        self.end_time = std::option::Option::Some(v.into());
2847        self
2848    }
2849
2850    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
2851    ///
2852    /// # Example
2853    /// ```ignore,no_run
2854    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2855    /// use wkt::Timestamp;
2856    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
2857    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
2858    /// ```
2859    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2860    where
2861        T: std::convert::Into<wkt::Timestamp>,
2862    {
2863        self.end_time = v.map(|x| x.into());
2864        self
2865    }
2866
2867    /// Sets the value of [target][crate::model::OperationMetadata::target].
2868    ///
2869    /// # Example
2870    /// ```ignore,no_run
2871    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2872    /// let x = OperationMetadata::new().set_target("example");
2873    /// ```
2874    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2875        self.target = v.into();
2876        self
2877    }
2878
2879    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
2880    ///
2881    /// # Example
2882    /// ```ignore,no_run
2883    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2884    /// let x = OperationMetadata::new().set_verb("example");
2885    /// ```
2886    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2887        self.verb = v.into();
2888        self
2889    }
2890
2891    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
2892    ///
2893    /// # Example
2894    /// ```ignore,no_run
2895    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2896    /// let x = OperationMetadata::new().set_status_message("example");
2897    /// ```
2898    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2899        self.status_message = v.into();
2900        self
2901    }
2902
2903    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
2904    ///
2905    /// # Example
2906    /// ```ignore,no_run
2907    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2908    /// let x = OperationMetadata::new().set_requested_cancellation(true);
2909    /// ```
2910    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2911        self.requested_cancellation = v.into();
2912        self
2913    }
2914
2915    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
2916    ///
2917    /// # Example
2918    /// ```ignore,no_run
2919    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2920    /// let x = OperationMetadata::new().set_api_version("example");
2921    /// ```
2922    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2923        self.api_version = v.into();
2924        self
2925    }
2926
2927    /// Sets the value of [validation_result][crate::model::OperationMetadata::validation_result].
2928    ///
2929    /// # Example
2930    /// ```ignore,no_run
2931    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2932    /// use google_cloud_datastream_v1::model::ValidationResult;
2933    /// let x = OperationMetadata::new().set_validation_result(ValidationResult::default()/* use setters */);
2934    /// ```
2935    pub fn set_validation_result<T>(mut self, v: T) -> Self
2936    where
2937        T: std::convert::Into<crate::model::ValidationResult>,
2938    {
2939        self.validation_result = std::option::Option::Some(v.into());
2940        self
2941    }
2942
2943    /// Sets or clears the value of [validation_result][crate::model::OperationMetadata::validation_result].
2944    ///
2945    /// # Example
2946    /// ```ignore,no_run
2947    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2948    /// use google_cloud_datastream_v1::model::ValidationResult;
2949    /// let x = OperationMetadata::new().set_or_clear_validation_result(Some(ValidationResult::default()/* use setters */));
2950    /// let x = OperationMetadata::new().set_or_clear_validation_result(None::<ValidationResult>);
2951    /// ```
2952    pub fn set_or_clear_validation_result<T>(mut self, v: std::option::Option<T>) -> Self
2953    where
2954        T: std::convert::Into<crate::model::ValidationResult>,
2955    {
2956        self.validation_result = v.map(|x| x.into());
2957        self
2958    }
2959}
2960
2961impl wkt::message::Message for OperationMetadata {
2962    fn typename() -> &'static str {
2963        "type.googleapis.com/google.cloud.datastream.v1.OperationMetadata"
2964    }
2965}
2966
2967/// Request for creating a private connection.
2968#[derive(Clone, Default, PartialEq)]
2969#[non_exhaustive]
2970pub struct CreatePrivateConnectionRequest {
2971    /// Required. The parent that owns the collection of PrivateConnections.
2972    pub parent: std::string::String,
2973
2974    /// Required. The private connectivity identifier.
2975    pub private_connection_id: std::string::String,
2976
2977    /// Required. The Private Connectivity resource to create.
2978    pub private_connection: std::option::Option<crate::model::PrivateConnection>,
2979
2980    /// Optional. A request ID to identify requests. Specify a unique request ID
2981    /// so that if you must retry your request, the server will know to ignore
2982    /// the request if it has already been completed. The server will guarantee
2983    /// that for at least 60 minutes since the first request.
2984    ///
2985    /// For example, consider a situation where you make an initial request and the
2986    /// request times out. If you make the request again with the same request ID,
2987    /// the server can check if original operation with the same request ID was
2988    /// received, and if so, will ignore the second request. This prevents clients
2989    /// from accidentally creating duplicate commitments.
2990    ///
2991    /// The request ID must be a valid UUID with the exception that zero UUID is
2992    /// not supported (00000000-0000-0000-0000-000000000000).
2993    pub request_id: std::string::String,
2994
2995    /// Optional. If set to true, will skip validations.
2996    pub force: bool,
2997
2998    /// Optional. When supplied with PSC Interface config, will get/create the
2999    /// tenant project required for the customer to allow list and won't actually
3000    /// create the private connection.
3001    pub validate_only: bool,
3002
3003    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3004}
3005
3006impl CreatePrivateConnectionRequest {
3007    pub fn new() -> Self {
3008        std::default::Default::default()
3009    }
3010
3011    /// Sets the value of [parent][crate::model::CreatePrivateConnectionRequest::parent].
3012    ///
3013    /// # Example
3014    /// ```ignore,no_run
3015    /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3016    /// let x = CreatePrivateConnectionRequest::new().set_parent("example");
3017    /// ```
3018    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3019        self.parent = v.into();
3020        self
3021    }
3022
3023    /// Sets the value of [private_connection_id][crate::model::CreatePrivateConnectionRequest::private_connection_id].
3024    ///
3025    /// # Example
3026    /// ```ignore,no_run
3027    /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3028    /// let x = CreatePrivateConnectionRequest::new().set_private_connection_id("example");
3029    /// ```
3030    pub fn set_private_connection_id<T: std::convert::Into<std::string::String>>(
3031        mut self,
3032        v: T,
3033    ) -> Self {
3034        self.private_connection_id = v.into();
3035        self
3036    }
3037
3038    /// Sets the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
3039    ///
3040    /// # Example
3041    /// ```ignore,no_run
3042    /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3043    /// use google_cloud_datastream_v1::model::PrivateConnection;
3044    /// let x = CreatePrivateConnectionRequest::new().set_private_connection(PrivateConnection::default()/* use setters */);
3045    /// ```
3046    pub fn set_private_connection<T>(mut self, v: T) -> Self
3047    where
3048        T: std::convert::Into<crate::model::PrivateConnection>,
3049    {
3050        self.private_connection = std::option::Option::Some(v.into());
3051        self
3052    }
3053
3054    /// Sets or clears the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
3055    ///
3056    /// # Example
3057    /// ```ignore,no_run
3058    /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3059    /// use google_cloud_datastream_v1::model::PrivateConnection;
3060    /// let x = CreatePrivateConnectionRequest::new().set_or_clear_private_connection(Some(PrivateConnection::default()/* use setters */));
3061    /// let x = CreatePrivateConnectionRequest::new().set_or_clear_private_connection(None::<PrivateConnection>);
3062    /// ```
3063    pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
3064    where
3065        T: std::convert::Into<crate::model::PrivateConnection>,
3066    {
3067        self.private_connection = v.map(|x| x.into());
3068        self
3069    }
3070
3071    /// Sets the value of [request_id][crate::model::CreatePrivateConnectionRequest::request_id].
3072    ///
3073    /// # Example
3074    /// ```ignore,no_run
3075    /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3076    /// let x = CreatePrivateConnectionRequest::new().set_request_id("example");
3077    /// ```
3078    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3079        self.request_id = v.into();
3080        self
3081    }
3082
3083    /// Sets the value of [force][crate::model::CreatePrivateConnectionRequest::force].
3084    ///
3085    /// # Example
3086    /// ```ignore,no_run
3087    /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3088    /// let x = CreatePrivateConnectionRequest::new().set_force(true);
3089    /// ```
3090    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3091        self.force = v.into();
3092        self
3093    }
3094
3095    /// Sets the value of [validate_only][crate::model::CreatePrivateConnectionRequest::validate_only].
3096    ///
3097    /// # Example
3098    /// ```ignore,no_run
3099    /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3100    /// let x = CreatePrivateConnectionRequest::new().set_validate_only(true);
3101    /// ```
3102    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3103        self.validate_only = v.into();
3104        self
3105    }
3106}
3107
3108impl wkt::message::Message for CreatePrivateConnectionRequest {
3109    fn typename() -> &'static str {
3110        "type.googleapis.com/google.cloud.datastream.v1.CreatePrivateConnectionRequest"
3111    }
3112}
3113
3114/// Request for listing private connections.
3115#[derive(Clone, Default, PartialEq)]
3116#[non_exhaustive]
3117pub struct ListPrivateConnectionsRequest {
3118    /// Required. The parent that owns the collection of private connectivity
3119    /// configurations.
3120    pub parent: std::string::String,
3121
3122    /// Maximum number of private connectivity configurations to return.
3123    /// If unspecified, at most 50 private connectivity configurations that will be
3124    /// returned. The maximum value is 1000; values above 1000 will be coerced to
3125    /// 1000.
3126    pub page_size: i32,
3127
3128    /// Page token received from a previous `ListPrivateConnections` call.
3129    /// Provide this to retrieve the subsequent page.
3130    ///
3131    /// When paginating, all other parameters provided to
3132    /// `ListPrivateConnections` must match the call that provided the page
3133    /// token.
3134    pub page_token: std::string::String,
3135
3136    /// Filter request.
3137    pub filter: std::string::String,
3138
3139    /// Order by fields for the result.
3140    pub order_by: std::string::String,
3141
3142    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3143}
3144
3145impl ListPrivateConnectionsRequest {
3146    pub fn new() -> Self {
3147        std::default::Default::default()
3148    }
3149
3150    /// Sets the value of [parent][crate::model::ListPrivateConnectionsRequest::parent].
3151    ///
3152    /// # Example
3153    /// ```ignore,no_run
3154    /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3155    /// let x = ListPrivateConnectionsRequest::new().set_parent("example");
3156    /// ```
3157    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3158        self.parent = v.into();
3159        self
3160    }
3161
3162    /// Sets the value of [page_size][crate::model::ListPrivateConnectionsRequest::page_size].
3163    ///
3164    /// # Example
3165    /// ```ignore,no_run
3166    /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3167    /// let x = ListPrivateConnectionsRequest::new().set_page_size(42);
3168    /// ```
3169    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3170        self.page_size = v.into();
3171        self
3172    }
3173
3174    /// Sets the value of [page_token][crate::model::ListPrivateConnectionsRequest::page_token].
3175    ///
3176    /// # Example
3177    /// ```ignore,no_run
3178    /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3179    /// let x = ListPrivateConnectionsRequest::new().set_page_token("example");
3180    /// ```
3181    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3182        self.page_token = v.into();
3183        self
3184    }
3185
3186    /// Sets the value of [filter][crate::model::ListPrivateConnectionsRequest::filter].
3187    ///
3188    /// # Example
3189    /// ```ignore,no_run
3190    /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3191    /// let x = ListPrivateConnectionsRequest::new().set_filter("example");
3192    /// ```
3193    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3194        self.filter = v.into();
3195        self
3196    }
3197
3198    /// Sets the value of [order_by][crate::model::ListPrivateConnectionsRequest::order_by].
3199    ///
3200    /// # Example
3201    /// ```ignore,no_run
3202    /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3203    /// let x = ListPrivateConnectionsRequest::new().set_order_by("example");
3204    /// ```
3205    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3206        self.order_by = v.into();
3207        self
3208    }
3209}
3210
3211impl wkt::message::Message for ListPrivateConnectionsRequest {
3212    fn typename() -> &'static str {
3213        "type.googleapis.com/google.cloud.datastream.v1.ListPrivateConnectionsRequest"
3214    }
3215}
3216
3217/// Response containing a list of private connection configurations.
3218#[derive(Clone, Default, PartialEq)]
3219#[non_exhaustive]
3220pub struct ListPrivateConnectionsResponse {
3221    /// List of private connectivity configurations.
3222    pub private_connections: std::vec::Vec<crate::model::PrivateConnection>,
3223
3224    /// A token, which can be sent as `page_token` to retrieve the next page.
3225    /// If this field is omitted, there are no subsequent pages.
3226    pub next_page_token: std::string::String,
3227
3228    /// Locations that could not be reached.
3229    pub unreachable: std::vec::Vec<std::string::String>,
3230
3231    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3232}
3233
3234impl ListPrivateConnectionsResponse {
3235    pub fn new() -> Self {
3236        std::default::Default::default()
3237    }
3238
3239    /// Sets the value of [private_connections][crate::model::ListPrivateConnectionsResponse::private_connections].
3240    ///
3241    /// # Example
3242    /// ```ignore,no_run
3243    /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsResponse;
3244    /// use google_cloud_datastream_v1::model::PrivateConnection;
3245    /// let x = ListPrivateConnectionsResponse::new()
3246    ///     .set_private_connections([
3247    ///         PrivateConnection::default()/* use setters */,
3248    ///         PrivateConnection::default()/* use (different) setters */,
3249    ///     ]);
3250    /// ```
3251    pub fn set_private_connections<T, V>(mut self, v: T) -> Self
3252    where
3253        T: std::iter::IntoIterator<Item = V>,
3254        V: std::convert::Into<crate::model::PrivateConnection>,
3255    {
3256        use std::iter::Iterator;
3257        self.private_connections = v.into_iter().map(|i| i.into()).collect();
3258        self
3259    }
3260
3261    /// Sets the value of [next_page_token][crate::model::ListPrivateConnectionsResponse::next_page_token].
3262    ///
3263    /// # Example
3264    /// ```ignore,no_run
3265    /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsResponse;
3266    /// let x = ListPrivateConnectionsResponse::new().set_next_page_token("example");
3267    /// ```
3268    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3269        self.next_page_token = v.into();
3270        self
3271    }
3272
3273    /// Sets the value of [unreachable][crate::model::ListPrivateConnectionsResponse::unreachable].
3274    ///
3275    /// # Example
3276    /// ```ignore,no_run
3277    /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsResponse;
3278    /// let x = ListPrivateConnectionsResponse::new().set_unreachable(["a", "b", "c"]);
3279    /// ```
3280    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3281    where
3282        T: std::iter::IntoIterator<Item = V>,
3283        V: std::convert::Into<std::string::String>,
3284    {
3285        use std::iter::Iterator;
3286        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3287        self
3288    }
3289}
3290
3291impl wkt::message::Message for ListPrivateConnectionsResponse {
3292    fn typename() -> &'static str {
3293        "type.googleapis.com/google.cloud.datastream.v1.ListPrivateConnectionsResponse"
3294    }
3295}
3296
3297#[doc(hidden)]
3298impl google_cloud_gax::paginator::internal::PageableResponse for ListPrivateConnectionsResponse {
3299    type PageItem = crate::model::PrivateConnection;
3300
3301    fn items(self) -> std::vec::Vec<Self::PageItem> {
3302        self.private_connections
3303    }
3304
3305    fn next_page_token(&self) -> std::string::String {
3306        use std::clone::Clone;
3307        self.next_page_token.clone()
3308    }
3309}
3310
3311/// Request to delete a private connection.
3312#[derive(Clone, Default, PartialEq)]
3313#[non_exhaustive]
3314pub struct DeletePrivateConnectionRequest {
3315    /// Required. The name of the private connectivity configuration to delete.
3316    pub name: std::string::String,
3317
3318    /// Optional. A request ID to identify requests. Specify a unique request ID
3319    /// so that if you must retry your request, the server will know to ignore
3320    /// the request if it has already been completed. The server will guarantee
3321    /// that for at least 60 minutes after the first request.
3322    ///
3323    /// For example, consider a situation where you make an initial request and the
3324    /// request times out. If you make the request again with the same request ID,
3325    /// the server can check if original operation with the same request ID was
3326    /// received, and if so, will ignore the second request. This prevents clients
3327    /// from accidentally creating duplicate commitments.
3328    ///
3329    /// The request ID must be a valid UUID with the exception that zero UUID is
3330    /// not supported (00000000-0000-0000-0000-000000000000).
3331    pub request_id: std::string::String,
3332
3333    /// Optional. If set to true, any child routes that belong to this
3334    /// PrivateConnection will also be deleted.
3335    pub force: bool,
3336
3337    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3338}
3339
3340impl DeletePrivateConnectionRequest {
3341    pub fn new() -> Self {
3342        std::default::Default::default()
3343    }
3344
3345    /// Sets the value of [name][crate::model::DeletePrivateConnectionRequest::name].
3346    ///
3347    /// # Example
3348    /// ```ignore,no_run
3349    /// # use google_cloud_datastream_v1::model::DeletePrivateConnectionRequest;
3350    /// let x = DeletePrivateConnectionRequest::new().set_name("example");
3351    /// ```
3352    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3353        self.name = v.into();
3354        self
3355    }
3356
3357    /// Sets the value of [request_id][crate::model::DeletePrivateConnectionRequest::request_id].
3358    ///
3359    /// # Example
3360    /// ```ignore,no_run
3361    /// # use google_cloud_datastream_v1::model::DeletePrivateConnectionRequest;
3362    /// let x = DeletePrivateConnectionRequest::new().set_request_id("example");
3363    /// ```
3364    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3365        self.request_id = v.into();
3366        self
3367    }
3368
3369    /// Sets the value of [force][crate::model::DeletePrivateConnectionRequest::force].
3370    ///
3371    /// # Example
3372    /// ```ignore,no_run
3373    /// # use google_cloud_datastream_v1::model::DeletePrivateConnectionRequest;
3374    /// let x = DeletePrivateConnectionRequest::new().set_force(true);
3375    /// ```
3376    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3377        self.force = v.into();
3378        self
3379    }
3380}
3381
3382impl wkt::message::Message for DeletePrivateConnectionRequest {
3383    fn typename() -> &'static str {
3384        "type.googleapis.com/google.cloud.datastream.v1.DeletePrivateConnectionRequest"
3385    }
3386}
3387
3388/// Request to get a private connection configuration.
3389#[derive(Clone, Default, PartialEq)]
3390#[non_exhaustive]
3391pub struct GetPrivateConnectionRequest {
3392    /// Required. The name of the  private connectivity configuration to get.
3393    pub name: std::string::String,
3394
3395    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3396}
3397
3398impl GetPrivateConnectionRequest {
3399    pub fn new() -> Self {
3400        std::default::Default::default()
3401    }
3402
3403    /// Sets the value of [name][crate::model::GetPrivateConnectionRequest::name].
3404    ///
3405    /// # Example
3406    /// ```ignore,no_run
3407    /// # use google_cloud_datastream_v1::model::GetPrivateConnectionRequest;
3408    /// let x = GetPrivateConnectionRequest::new().set_name("example");
3409    /// ```
3410    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3411        self.name = v.into();
3412        self
3413    }
3414}
3415
3416impl wkt::message::Message for GetPrivateConnectionRequest {
3417    fn typename() -> &'static str {
3418        "type.googleapis.com/google.cloud.datastream.v1.GetPrivateConnectionRequest"
3419    }
3420}
3421
3422/// Route creation request.
3423#[derive(Clone, Default, PartialEq)]
3424#[non_exhaustive]
3425pub struct CreateRouteRequest {
3426    /// Required. The parent that owns the collection of Routes.
3427    pub parent: std::string::String,
3428
3429    /// Required. The Route identifier.
3430    pub route_id: std::string::String,
3431
3432    /// Required. The Route resource to create.
3433    pub route: std::option::Option<crate::model::Route>,
3434
3435    /// Optional. A request ID to identify requests. Specify a unique request ID
3436    /// so that if you must retry your request, the server will know to ignore
3437    /// the request if it has already been completed. The server will guarantee
3438    /// that for at least 60 minutes since the first request.
3439    ///
3440    /// For example, consider a situation where you make an initial request and the
3441    /// request times out. If you make the request again with the same request ID,
3442    /// the server can check if original operation with the same request ID was
3443    /// received, and if so, will ignore the second request. This prevents clients
3444    /// from accidentally creating duplicate commitments.
3445    ///
3446    /// The request ID must be a valid UUID with the exception that zero UUID is
3447    /// not supported (00000000-0000-0000-0000-000000000000).
3448    pub request_id: std::string::String,
3449
3450    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3451}
3452
3453impl CreateRouteRequest {
3454    pub fn new() -> Self {
3455        std::default::Default::default()
3456    }
3457
3458    /// Sets the value of [parent][crate::model::CreateRouteRequest::parent].
3459    ///
3460    /// # Example
3461    /// ```ignore,no_run
3462    /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3463    /// let x = CreateRouteRequest::new().set_parent("example");
3464    /// ```
3465    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3466        self.parent = v.into();
3467        self
3468    }
3469
3470    /// Sets the value of [route_id][crate::model::CreateRouteRequest::route_id].
3471    ///
3472    /// # Example
3473    /// ```ignore,no_run
3474    /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3475    /// let x = CreateRouteRequest::new().set_route_id("example");
3476    /// ```
3477    pub fn set_route_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3478        self.route_id = v.into();
3479        self
3480    }
3481
3482    /// Sets the value of [route][crate::model::CreateRouteRequest::route].
3483    ///
3484    /// # Example
3485    /// ```ignore,no_run
3486    /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3487    /// use google_cloud_datastream_v1::model::Route;
3488    /// let x = CreateRouteRequest::new().set_route(Route::default()/* use setters */);
3489    /// ```
3490    pub fn set_route<T>(mut self, v: T) -> Self
3491    where
3492        T: std::convert::Into<crate::model::Route>,
3493    {
3494        self.route = std::option::Option::Some(v.into());
3495        self
3496    }
3497
3498    /// Sets or clears the value of [route][crate::model::CreateRouteRequest::route].
3499    ///
3500    /// # Example
3501    /// ```ignore,no_run
3502    /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3503    /// use google_cloud_datastream_v1::model::Route;
3504    /// let x = CreateRouteRequest::new().set_or_clear_route(Some(Route::default()/* use setters */));
3505    /// let x = CreateRouteRequest::new().set_or_clear_route(None::<Route>);
3506    /// ```
3507    pub fn set_or_clear_route<T>(mut self, v: std::option::Option<T>) -> Self
3508    where
3509        T: std::convert::Into<crate::model::Route>,
3510    {
3511        self.route = v.map(|x| x.into());
3512        self
3513    }
3514
3515    /// Sets the value of [request_id][crate::model::CreateRouteRequest::request_id].
3516    ///
3517    /// # Example
3518    /// ```ignore,no_run
3519    /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3520    /// let x = CreateRouteRequest::new().set_request_id("example");
3521    /// ```
3522    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3523        self.request_id = v.into();
3524        self
3525    }
3526}
3527
3528impl wkt::message::Message for CreateRouteRequest {
3529    fn typename() -> &'static str {
3530        "type.googleapis.com/google.cloud.datastream.v1.CreateRouteRequest"
3531    }
3532}
3533
3534/// Route list request.
3535#[derive(Clone, Default, PartialEq)]
3536#[non_exhaustive]
3537pub struct ListRoutesRequest {
3538    /// Required. The parent that owns the collection of Routess.
3539    pub parent: std::string::String,
3540
3541    /// Maximum number of Routes to return. The service may return
3542    /// fewer than this value. If unspecified, at most 50 Routes
3543    /// will be returned. The maximum value is 1000; values above 1000 will be
3544    /// coerced to 1000.
3545    pub page_size: i32,
3546
3547    /// Page token received from a previous `ListRoutes` call.
3548    /// Provide this to retrieve the subsequent page.
3549    ///
3550    /// When paginating, all other parameters provided to
3551    /// `ListRoutes` must match the call that provided the page
3552    /// token.
3553    pub page_token: std::string::String,
3554
3555    /// Filter request.
3556    pub filter: std::string::String,
3557
3558    /// Order by fields for the result.
3559    pub order_by: std::string::String,
3560
3561    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3562}
3563
3564impl ListRoutesRequest {
3565    pub fn new() -> Self {
3566        std::default::Default::default()
3567    }
3568
3569    /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
3570    ///
3571    /// # Example
3572    /// ```ignore,no_run
3573    /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3574    /// let x = ListRoutesRequest::new().set_parent("example");
3575    /// ```
3576    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3577        self.parent = v.into();
3578        self
3579    }
3580
3581    /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
3582    ///
3583    /// # Example
3584    /// ```ignore,no_run
3585    /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3586    /// let x = ListRoutesRequest::new().set_page_size(42);
3587    /// ```
3588    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3589        self.page_size = v.into();
3590        self
3591    }
3592
3593    /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
3594    ///
3595    /// # Example
3596    /// ```ignore,no_run
3597    /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3598    /// let x = ListRoutesRequest::new().set_page_token("example");
3599    /// ```
3600    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3601        self.page_token = v.into();
3602        self
3603    }
3604
3605    /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
3606    ///
3607    /// # Example
3608    /// ```ignore,no_run
3609    /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3610    /// let x = ListRoutesRequest::new().set_filter("example");
3611    /// ```
3612    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3613        self.filter = v.into();
3614        self
3615    }
3616
3617    /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
3618    ///
3619    /// # Example
3620    /// ```ignore,no_run
3621    /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3622    /// let x = ListRoutesRequest::new().set_order_by("example");
3623    /// ```
3624    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3625        self.order_by = v.into();
3626        self
3627    }
3628}
3629
3630impl wkt::message::Message for ListRoutesRequest {
3631    fn typename() -> &'static str {
3632        "type.googleapis.com/google.cloud.datastream.v1.ListRoutesRequest"
3633    }
3634}
3635
3636/// Route list response.
3637#[derive(Clone, Default, PartialEq)]
3638#[non_exhaustive]
3639pub struct ListRoutesResponse {
3640    /// List of Routes.
3641    pub routes: std::vec::Vec<crate::model::Route>,
3642
3643    /// A token, which can be sent as `page_token` to retrieve the next page.
3644    /// If this field is omitted, there are no subsequent pages.
3645    pub next_page_token: std::string::String,
3646
3647    /// Locations that could not be reached.
3648    pub unreachable: std::vec::Vec<std::string::String>,
3649
3650    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3651}
3652
3653impl ListRoutesResponse {
3654    pub fn new() -> Self {
3655        std::default::Default::default()
3656    }
3657
3658    /// Sets the value of [routes][crate::model::ListRoutesResponse::routes].
3659    ///
3660    /// # Example
3661    /// ```ignore,no_run
3662    /// # use google_cloud_datastream_v1::model::ListRoutesResponse;
3663    /// use google_cloud_datastream_v1::model::Route;
3664    /// let x = ListRoutesResponse::new()
3665    ///     .set_routes([
3666    ///         Route::default()/* use setters */,
3667    ///         Route::default()/* use (different) setters */,
3668    ///     ]);
3669    /// ```
3670    pub fn set_routes<T, V>(mut self, v: T) -> Self
3671    where
3672        T: std::iter::IntoIterator<Item = V>,
3673        V: std::convert::Into<crate::model::Route>,
3674    {
3675        use std::iter::Iterator;
3676        self.routes = v.into_iter().map(|i| i.into()).collect();
3677        self
3678    }
3679
3680    /// Sets the value of [next_page_token][crate::model::ListRoutesResponse::next_page_token].
3681    ///
3682    /// # Example
3683    /// ```ignore,no_run
3684    /// # use google_cloud_datastream_v1::model::ListRoutesResponse;
3685    /// let x = ListRoutesResponse::new().set_next_page_token("example");
3686    /// ```
3687    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3688        self.next_page_token = v.into();
3689        self
3690    }
3691
3692    /// Sets the value of [unreachable][crate::model::ListRoutesResponse::unreachable].
3693    ///
3694    /// # Example
3695    /// ```ignore,no_run
3696    /// # use google_cloud_datastream_v1::model::ListRoutesResponse;
3697    /// let x = ListRoutesResponse::new().set_unreachable(["a", "b", "c"]);
3698    /// ```
3699    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3700    where
3701        T: std::iter::IntoIterator<Item = V>,
3702        V: std::convert::Into<std::string::String>,
3703    {
3704        use std::iter::Iterator;
3705        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3706        self
3707    }
3708}
3709
3710impl wkt::message::Message for ListRoutesResponse {
3711    fn typename() -> &'static str {
3712        "type.googleapis.com/google.cloud.datastream.v1.ListRoutesResponse"
3713    }
3714}
3715
3716#[doc(hidden)]
3717impl google_cloud_gax::paginator::internal::PageableResponse for ListRoutesResponse {
3718    type PageItem = crate::model::Route;
3719
3720    fn items(self) -> std::vec::Vec<Self::PageItem> {
3721        self.routes
3722    }
3723
3724    fn next_page_token(&self) -> std::string::String {
3725        use std::clone::Clone;
3726        self.next_page_token.clone()
3727    }
3728}
3729
3730/// Route deletion request.
3731#[derive(Clone, Default, PartialEq)]
3732#[non_exhaustive]
3733pub struct DeleteRouteRequest {
3734    /// Required. The name of the Route resource to delete.
3735    pub name: std::string::String,
3736
3737    /// Optional. A request ID to identify requests. Specify a unique request ID
3738    /// so that if you must retry your request, the server will know to ignore
3739    /// the request if it has already been completed. The server will guarantee
3740    /// that for at least 60 minutes after the first request.
3741    ///
3742    /// For example, consider a situation where you make an initial request and the
3743    /// request times out. If you make the request again with the same request ID,
3744    /// the server can check if original operation with the same request ID was
3745    /// received, and if so, will ignore the second request. This prevents clients
3746    /// from accidentally creating duplicate commitments.
3747    ///
3748    /// The request ID must be a valid UUID with the exception that zero UUID is
3749    /// not supported (00000000-0000-0000-0000-000000000000).
3750    pub request_id: std::string::String,
3751
3752    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3753}
3754
3755impl DeleteRouteRequest {
3756    pub fn new() -> Self {
3757        std::default::Default::default()
3758    }
3759
3760    /// Sets the value of [name][crate::model::DeleteRouteRequest::name].
3761    ///
3762    /// # Example
3763    /// ```ignore,no_run
3764    /// # use google_cloud_datastream_v1::model::DeleteRouteRequest;
3765    /// let x = DeleteRouteRequest::new().set_name("example");
3766    /// ```
3767    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3768        self.name = v.into();
3769        self
3770    }
3771
3772    /// Sets the value of [request_id][crate::model::DeleteRouteRequest::request_id].
3773    ///
3774    /// # Example
3775    /// ```ignore,no_run
3776    /// # use google_cloud_datastream_v1::model::DeleteRouteRequest;
3777    /// let x = DeleteRouteRequest::new().set_request_id("example");
3778    /// ```
3779    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3780        self.request_id = v.into();
3781        self
3782    }
3783}
3784
3785impl wkt::message::Message for DeleteRouteRequest {
3786    fn typename() -> &'static str {
3787        "type.googleapis.com/google.cloud.datastream.v1.DeleteRouteRequest"
3788    }
3789}
3790
3791/// Route get request.
3792#[derive(Clone, Default, PartialEq)]
3793#[non_exhaustive]
3794pub struct GetRouteRequest {
3795    /// Required. The name of the Route resource to get.
3796    pub name: std::string::String,
3797
3798    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3799}
3800
3801impl GetRouteRequest {
3802    pub fn new() -> Self {
3803        std::default::Default::default()
3804    }
3805
3806    /// Sets the value of [name][crate::model::GetRouteRequest::name].
3807    ///
3808    /// # Example
3809    /// ```ignore,no_run
3810    /// # use google_cloud_datastream_v1::model::GetRouteRequest;
3811    /// let x = GetRouteRequest::new().set_name("example");
3812    /// ```
3813    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3814        self.name = v.into();
3815        self
3816    }
3817}
3818
3819impl wkt::message::Message for GetRouteRequest {
3820    fn typename() -> &'static str {
3821        "type.googleapis.com/google.cloud.datastream.v1.GetRouteRequest"
3822    }
3823}
3824
3825/// Oracle database profile.
3826#[derive(Clone, Default, PartialEq)]
3827#[non_exhaustive]
3828pub struct OracleProfile {
3829    /// Required. Hostname for the Oracle connection.
3830    pub hostname: std::string::String,
3831
3832    /// Port for the Oracle connection, default value is 1521.
3833    pub port: i32,
3834
3835    /// Required. Username for the Oracle connection.
3836    pub username: std::string::String,
3837
3838    /// Optional. Password for the Oracle connection. Mutually exclusive with the
3839    /// `secret_manager_stored_password` field.
3840    pub password: std::string::String,
3841
3842    /// Required. Database for the Oracle connection.
3843    pub database_service: std::string::String,
3844
3845    /// Connection string attributes
3846    pub connection_attributes: std::collections::HashMap<std::string::String, std::string::String>,
3847
3848    /// Optional. SSL configuration for the Oracle connection.
3849    pub oracle_ssl_config: std::option::Option<crate::model::OracleSslConfig>,
3850
3851    /// Optional. Configuration for Oracle ASM connection.
3852    pub oracle_asm_config: std::option::Option<crate::model::OracleAsmConfig>,
3853
3854    /// Optional. A reference to a Secret Manager resource name storing the Oracle
3855    /// connection password. Mutually exclusive with the `password` field.
3856    pub secret_manager_stored_password: std::string::String,
3857
3858    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3859}
3860
3861impl OracleProfile {
3862    pub fn new() -> Self {
3863        std::default::Default::default()
3864    }
3865
3866    /// Sets the value of [hostname][crate::model::OracleProfile::hostname].
3867    ///
3868    /// # Example
3869    /// ```ignore,no_run
3870    /// # use google_cloud_datastream_v1::model::OracleProfile;
3871    /// let x = OracleProfile::new().set_hostname("example");
3872    /// ```
3873    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3874        self.hostname = v.into();
3875        self
3876    }
3877
3878    /// Sets the value of [port][crate::model::OracleProfile::port].
3879    ///
3880    /// # Example
3881    /// ```ignore,no_run
3882    /// # use google_cloud_datastream_v1::model::OracleProfile;
3883    /// let x = OracleProfile::new().set_port(42);
3884    /// ```
3885    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3886        self.port = v.into();
3887        self
3888    }
3889
3890    /// Sets the value of [username][crate::model::OracleProfile::username].
3891    ///
3892    /// # Example
3893    /// ```ignore,no_run
3894    /// # use google_cloud_datastream_v1::model::OracleProfile;
3895    /// let x = OracleProfile::new().set_username("example");
3896    /// ```
3897    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3898        self.username = v.into();
3899        self
3900    }
3901
3902    /// Sets the value of [password][crate::model::OracleProfile::password].
3903    ///
3904    /// # Example
3905    /// ```ignore,no_run
3906    /// # use google_cloud_datastream_v1::model::OracleProfile;
3907    /// let x = OracleProfile::new().set_password("example");
3908    /// ```
3909    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3910        self.password = v.into();
3911        self
3912    }
3913
3914    /// Sets the value of [database_service][crate::model::OracleProfile::database_service].
3915    ///
3916    /// # Example
3917    /// ```ignore,no_run
3918    /// # use google_cloud_datastream_v1::model::OracleProfile;
3919    /// let x = OracleProfile::new().set_database_service("example");
3920    /// ```
3921    pub fn set_database_service<T: std::convert::Into<std::string::String>>(
3922        mut self,
3923        v: T,
3924    ) -> Self {
3925        self.database_service = v.into();
3926        self
3927    }
3928
3929    /// Sets the value of [connection_attributes][crate::model::OracleProfile::connection_attributes].
3930    ///
3931    /// # Example
3932    /// ```ignore,no_run
3933    /// # use google_cloud_datastream_v1::model::OracleProfile;
3934    /// let x = OracleProfile::new().set_connection_attributes([
3935    ///     ("key0", "abc"),
3936    ///     ("key1", "xyz"),
3937    /// ]);
3938    /// ```
3939    pub fn set_connection_attributes<T, K, V>(mut self, v: T) -> Self
3940    where
3941        T: std::iter::IntoIterator<Item = (K, V)>,
3942        K: std::convert::Into<std::string::String>,
3943        V: std::convert::Into<std::string::String>,
3944    {
3945        use std::iter::Iterator;
3946        self.connection_attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3947        self
3948    }
3949
3950    /// Sets the value of [oracle_ssl_config][crate::model::OracleProfile::oracle_ssl_config].
3951    ///
3952    /// # Example
3953    /// ```ignore,no_run
3954    /// # use google_cloud_datastream_v1::model::OracleProfile;
3955    /// use google_cloud_datastream_v1::model::OracleSslConfig;
3956    /// let x = OracleProfile::new().set_oracle_ssl_config(OracleSslConfig::default()/* use setters */);
3957    /// ```
3958    pub fn set_oracle_ssl_config<T>(mut self, v: T) -> Self
3959    where
3960        T: std::convert::Into<crate::model::OracleSslConfig>,
3961    {
3962        self.oracle_ssl_config = std::option::Option::Some(v.into());
3963        self
3964    }
3965
3966    /// Sets or clears the value of [oracle_ssl_config][crate::model::OracleProfile::oracle_ssl_config].
3967    ///
3968    /// # Example
3969    /// ```ignore,no_run
3970    /// # use google_cloud_datastream_v1::model::OracleProfile;
3971    /// use google_cloud_datastream_v1::model::OracleSslConfig;
3972    /// let x = OracleProfile::new().set_or_clear_oracle_ssl_config(Some(OracleSslConfig::default()/* use setters */));
3973    /// let x = OracleProfile::new().set_or_clear_oracle_ssl_config(None::<OracleSslConfig>);
3974    /// ```
3975    pub fn set_or_clear_oracle_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
3976    where
3977        T: std::convert::Into<crate::model::OracleSslConfig>,
3978    {
3979        self.oracle_ssl_config = v.map(|x| x.into());
3980        self
3981    }
3982
3983    /// Sets the value of [oracle_asm_config][crate::model::OracleProfile::oracle_asm_config].
3984    ///
3985    /// # Example
3986    /// ```ignore,no_run
3987    /// # use google_cloud_datastream_v1::model::OracleProfile;
3988    /// use google_cloud_datastream_v1::model::OracleAsmConfig;
3989    /// let x = OracleProfile::new().set_oracle_asm_config(OracleAsmConfig::default()/* use setters */);
3990    /// ```
3991    pub fn set_oracle_asm_config<T>(mut self, v: T) -> Self
3992    where
3993        T: std::convert::Into<crate::model::OracleAsmConfig>,
3994    {
3995        self.oracle_asm_config = std::option::Option::Some(v.into());
3996        self
3997    }
3998
3999    /// Sets or clears the value of [oracle_asm_config][crate::model::OracleProfile::oracle_asm_config].
4000    ///
4001    /// # Example
4002    /// ```ignore,no_run
4003    /// # use google_cloud_datastream_v1::model::OracleProfile;
4004    /// use google_cloud_datastream_v1::model::OracleAsmConfig;
4005    /// let x = OracleProfile::new().set_or_clear_oracle_asm_config(Some(OracleAsmConfig::default()/* use setters */));
4006    /// let x = OracleProfile::new().set_or_clear_oracle_asm_config(None::<OracleAsmConfig>);
4007    /// ```
4008    pub fn set_or_clear_oracle_asm_config<T>(mut self, v: std::option::Option<T>) -> Self
4009    where
4010        T: std::convert::Into<crate::model::OracleAsmConfig>,
4011    {
4012        self.oracle_asm_config = v.map(|x| x.into());
4013        self
4014    }
4015
4016    /// Sets the value of [secret_manager_stored_password][crate::model::OracleProfile::secret_manager_stored_password].
4017    ///
4018    /// # Example
4019    /// ```ignore,no_run
4020    /// # use google_cloud_datastream_v1::model::OracleProfile;
4021    /// let x = OracleProfile::new().set_secret_manager_stored_password("example");
4022    /// ```
4023    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4024        mut self,
4025        v: T,
4026    ) -> Self {
4027        self.secret_manager_stored_password = v.into();
4028        self
4029    }
4030}
4031
4032impl wkt::message::Message for OracleProfile {
4033    fn typename() -> &'static str {
4034        "type.googleapis.com/google.cloud.datastream.v1.OracleProfile"
4035    }
4036}
4037
4038/// Configuration for Oracle Automatic Storage Management (ASM) connection.
4039#[derive(Clone, Default, PartialEq)]
4040#[non_exhaustive]
4041pub struct OracleAsmConfig {
4042    /// Required. Hostname for the Oracle ASM connection.
4043    pub hostname: std::string::String,
4044
4045    /// Required. Port for the Oracle ASM connection.
4046    pub port: i32,
4047
4048    /// Required. Username for the Oracle ASM connection.
4049    pub username: std::string::String,
4050
4051    /// Optional. Password for the Oracle ASM connection. Mutually exclusive with
4052    /// the `secret_manager_stored_password` field.
4053    pub password: std::string::String,
4054
4055    /// Required. ASM service name for the Oracle ASM connection.
4056    pub asm_service: std::string::String,
4057
4058    /// Optional. Connection string attributes
4059    pub connection_attributes: std::collections::HashMap<std::string::String, std::string::String>,
4060
4061    /// Optional. SSL configuration for the Oracle connection.
4062    pub oracle_ssl_config: std::option::Option<crate::model::OracleSslConfig>,
4063
4064    /// Optional. A reference to a Secret Manager resource name storing the Oracle
4065    /// ASM connection password. Mutually exclusive with the `password` field.
4066    pub secret_manager_stored_password: std::string::String,
4067
4068    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4069}
4070
4071impl OracleAsmConfig {
4072    pub fn new() -> Self {
4073        std::default::Default::default()
4074    }
4075
4076    /// Sets the value of [hostname][crate::model::OracleAsmConfig::hostname].
4077    ///
4078    /// # Example
4079    /// ```ignore,no_run
4080    /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4081    /// let x = OracleAsmConfig::new().set_hostname("example");
4082    /// ```
4083    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4084        self.hostname = v.into();
4085        self
4086    }
4087
4088    /// Sets the value of [port][crate::model::OracleAsmConfig::port].
4089    ///
4090    /// # Example
4091    /// ```ignore,no_run
4092    /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4093    /// let x = OracleAsmConfig::new().set_port(42);
4094    /// ```
4095    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4096        self.port = v.into();
4097        self
4098    }
4099
4100    /// Sets the value of [username][crate::model::OracleAsmConfig::username].
4101    ///
4102    /// # Example
4103    /// ```ignore,no_run
4104    /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4105    /// let x = OracleAsmConfig::new().set_username("example");
4106    /// ```
4107    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4108        self.username = v.into();
4109        self
4110    }
4111
4112    /// Sets the value of [password][crate::model::OracleAsmConfig::password].
4113    ///
4114    /// # Example
4115    /// ```ignore,no_run
4116    /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4117    /// let x = OracleAsmConfig::new().set_password("example");
4118    /// ```
4119    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4120        self.password = v.into();
4121        self
4122    }
4123
4124    /// Sets the value of [asm_service][crate::model::OracleAsmConfig::asm_service].
4125    ///
4126    /// # Example
4127    /// ```ignore,no_run
4128    /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4129    /// let x = OracleAsmConfig::new().set_asm_service("example");
4130    /// ```
4131    pub fn set_asm_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4132        self.asm_service = v.into();
4133        self
4134    }
4135
4136    /// Sets the value of [connection_attributes][crate::model::OracleAsmConfig::connection_attributes].
4137    ///
4138    /// # Example
4139    /// ```ignore,no_run
4140    /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4141    /// let x = OracleAsmConfig::new().set_connection_attributes([
4142    ///     ("key0", "abc"),
4143    ///     ("key1", "xyz"),
4144    /// ]);
4145    /// ```
4146    pub fn set_connection_attributes<T, K, V>(mut self, v: T) -> Self
4147    where
4148        T: std::iter::IntoIterator<Item = (K, V)>,
4149        K: std::convert::Into<std::string::String>,
4150        V: std::convert::Into<std::string::String>,
4151    {
4152        use std::iter::Iterator;
4153        self.connection_attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4154        self
4155    }
4156
4157    /// Sets the value of [oracle_ssl_config][crate::model::OracleAsmConfig::oracle_ssl_config].
4158    ///
4159    /// # Example
4160    /// ```ignore,no_run
4161    /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4162    /// use google_cloud_datastream_v1::model::OracleSslConfig;
4163    /// let x = OracleAsmConfig::new().set_oracle_ssl_config(OracleSslConfig::default()/* use setters */);
4164    /// ```
4165    pub fn set_oracle_ssl_config<T>(mut self, v: T) -> Self
4166    where
4167        T: std::convert::Into<crate::model::OracleSslConfig>,
4168    {
4169        self.oracle_ssl_config = std::option::Option::Some(v.into());
4170        self
4171    }
4172
4173    /// Sets or clears the value of [oracle_ssl_config][crate::model::OracleAsmConfig::oracle_ssl_config].
4174    ///
4175    /// # Example
4176    /// ```ignore,no_run
4177    /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4178    /// use google_cloud_datastream_v1::model::OracleSslConfig;
4179    /// let x = OracleAsmConfig::new().set_or_clear_oracle_ssl_config(Some(OracleSslConfig::default()/* use setters */));
4180    /// let x = OracleAsmConfig::new().set_or_clear_oracle_ssl_config(None::<OracleSslConfig>);
4181    /// ```
4182    pub fn set_or_clear_oracle_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
4183    where
4184        T: std::convert::Into<crate::model::OracleSslConfig>,
4185    {
4186        self.oracle_ssl_config = v.map(|x| x.into());
4187        self
4188    }
4189
4190    /// Sets the value of [secret_manager_stored_password][crate::model::OracleAsmConfig::secret_manager_stored_password].
4191    ///
4192    /// # Example
4193    /// ```ignore,no_run
4194    /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4195    /// let x = OracleAsmConfig::new().set_secret_manager_stored_password("example");
4196    /// ```
4197    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4198        mut self,
4199        v: T,
4200    ) -> Self {
4201        self.secret_manager_stored_password = v.into();
4202        self
4203    }
4204}
4205
4206impl wkt::message::Message for OracleAsmConfig {
4207    fn typename() -> &'static str {
4208        "type.googleapis.com/google.cloud.datastream.v1.OracleAsmConfig"
4209    }
4210}
4211
4212/// MySQL database profile.
4213#[derive(Clone, Default, PartialEq)]
4214#[non_exhaustive]
4215pub struct MysqlProfile {
4216    /// Required. Hostname for the MySQL connection.
4217    pub hostname: std::string::String,
4218
4219    /// Port for the MySQL connection, default value is 3306.
4220    pub port: i32,
4221
4222    /// Required. Username for the MySQL connection.
4223    pub username: std::string::String,
4224
4225    /// Optional. Input only. Password for the MySQL connection. Mutually exclusive
4226    /// with the `secret_manager_stored_password` field.
4227    pub password: std::string::String,
4228
4229    /// SSL configuration for the MySQL connection.
4230    pub ssl_config: std::option::Option<crate::model::MysqlSslConfig>,
4231
4232    /// Optional. A reference to a Secret Manager resource name storing the MySQL
4233    /// connection password. Mutually exclusive with the `password` field.
4234    pub secret_manager_stored_password: std::string::String,
4235
4236    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4237}
4238
4239impl MysqlProfile {
4240    pub fn new() -> Self {
4241        std::default::Default::default()
4242    }
4243
4244    /// Sets the value of [hostname][crate::model::MysqlProfile::hostname].
4245    ///
4246    /// # Example
4247    /// ```ignore,no_run
4248    /// # use google_cloud_datastream_v1::model::MysqlProfile;
4249    /// let x = MysqlProfile::new().set_hostname("example");
4250    /// ```
4251    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4252        self.hostname = v.into();
4253        self
4254    }
4255
4256    /// Sets the value of [port][crate::model::MysqlProfile::port].
4257    ///
4258    /// # Example
4259    /// ```ignore,no_run
4260    /// # use google_cloud_datastream_v1::model::MysqlProfile;
4261    /// let x = MysqlProfile::new().set_port(42);
4262    /// ```
4263    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4264        self.port = v.into();
4265        self
4266    }
4267
4268    /// Sets the value of [username][crate::model::MysqlProfile::username].
4269    ///
4270    /// # Example
4271    /// ```ignore,no_run
4272    /// # use google_cloud_datastream_v1::model::MysqlProfile;
4273    /// let x = MysqlProfile::new().set_username("example");
4274    /// ```
4275    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4276        self.username = v.into();
4277        self
4278    }
4279
4280    /// Sets the value of [password][crate::model::MysqlProfile::password].
4281    ///
4282    /// # Example
4283    /// ```ignore,no_run
4284    /// # use google_cloud_datastream_v1::model::MysqlProfile;
4285    /// let x = MysqlProfile::new().set_password("example");
4286    /// ```
4287    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4288        self.password = v.into();
4289        self
4290    }
4291
4292    /// Sets the value of [ssl_config][crate::model::MysqlProfile::ssl_config].
4293    ///
4294    /// # Example
4295    /// ```ignore,no_run
4296    /// # use google_cloud_datastream_v1::model::MysqlProfile;
4297    /// use google_cloud_datastream_v1::model::MysqlSslConfig;
4298    /// let x = MysqlProfile::new().set_ssl_config(MysqlSslConfig::default()/* use setters */);
4299    /// ```
4300    pub fn set_ssl_config<T>(mut self, v: T) -> Self
4301    where
4302        T: std::convert::Into<crate::model::MysqlSslConfig>,
4303    {
4304        self.ssl_config = std::option::Option::Some(v.into());
4305        self
4306    }
4307
4308    /// Sets or clears the value of [ssl_config][crate::model::MysqlProfile::ssl_config].
4309    ///
4310    /// # Example
4311    /// ```ignore,no_run
4312    /// # use google_cloud_datastream_v1::model::MysqlProfile;
4313    /// use google_cloud_datastream_v1::model::MysqlSslConfig;
4314    /// let x = MysqlProfile::new().set_or_clear_ssl_config(Some(MysqlSslConfig::default()/* use setters */));
4315    /// let x = MysqlProfile::new().set_or_clear_ssl_config(None::<MysqlSslConfig>);
4316    /// ```
4317    pub fn set_or_clear_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
4318    where
4319        T: std::convert::Into<crate::model::MysqlSslConfig>,
4320    {
4321        self.ssl_config = v.map(|x| x.into());
4322        self
4323    }
4324
4325    /// Sets the value of [secret_manager_stored_password][crate::model::MysqlProfile::secret_manager_stored_password].
4326    ///
4327    /// # Example
4328    /// ```ignore,no_run
4329    /// # use google_cloud_datastream_v1::model::MysqlProfile;
4330    /// let x = MysqlProfile::new().set_secret_manager_stored_password("example");
4331    /// ```
4332    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4333        mut self,
4334        v: T,
4335    ) -> Self {
4336        self.secret_manager_stored_password = v.into();
4337        self
4338    }
4339}
4340
4341impl wkt::message::Message for MysqlProfile {
4342    fn typename() -> &'static str {
4343        "type.googleapis.com/google.cloud.datastream.v1.MysqlProfile"
4344    }
4345}
4346
4347/// PostgreSQL database profile.
4348#[derive(Clone, Default, PartialEq)]
4349#[non_exhaustive]
4350pub struct PostgresqlProfile {
4351    /// Required. Hostname for the PostgreSQL connection.
4352    pub hostname: std::string::String,
4353
4354    /// Port for the PostgreSQL connection, default value is 5432.
4355    pub port: i32,
4356
4357    /// Required. Username for the PostgreSQL connection.
4358    pub username: std::string::String,
4359
4360    /// Optional. Password for the PostgreSQL connection. Mutually exclusive with
4361    /// the `secret_manager_stored_password` field.
4362    pub password: std::string::String,
4363
4364    /// Required. Database for the PostgreSQL connection.
4365    pub database: std::string::String,
4366
4367    /// Optional. A reference to a Secret Manager resource name storing the
4368    /// PostgreSQL connection password. Mutually exclusive with the `password`
4369    /// field.
4370    pub secret_manager_stored_password: std::string::String,
4371
4372    /// Optional. SSL configuration for the PostgreSQL connection.
4373    /// In case PostgresqlSslConfig is not set, the connection will use the default
4374    /// SSL mode, which is `prefer` (i.e. this mode will only use encryption if
4375    /// enabled from database side, otherwise will use unencrypted communication)
4376    pub ssl_config: std::option::Option<crate::model::PostgresqlSslConfig>,
4377
4378    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4379}
4380
4381impl PostgresqlProfile {
4382    pub fn new() -> Self {
4383        std::default::Default::default()
4384    }
4385
4386    /// Sets the value of [hostname][crate::model::PostgresqlProfile::hostname].
4387    ///
4388    /// # Example
4389    /// ```ignore,no_run
4390    /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4391    /// let x = PostgresqlProfile::new().set_hostname("example");
4392    /// ```
4393    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4394        self.hostname = v.into();
4395        self
4396    }
4397
4398    /// Sets the value of [port][crate::model::PostgresqlProfile::port].
4399    ///
4400    /// # Example
4401    /// ```ignore,no_run
4402    /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4403    /// let x = PostgresqlProfile::new().set_port(42);
4404    /// ```
4405    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4406        self.port = v.into();
4407        self
4408    }
4409
4410    /// Sets the value of [username][crate::model::PostgresqlProfile::username].
4411    ///
4412    /// # Example
4413    /// ```ignore,no_run
4414    /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4415    /// let x = PostgresqlProfile::new().set_username("example");
4416    /// ```
4417    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4418        self.username = v.into();
4419        self
4420    }
4421
4422    /// Sets the value of [password][crate::model::PostgresqlProfile::password].
4423    ///
4424    /// # Example
4425    /// ```ignore,no_run
4426    /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4427    /// let x = PostgresqlProfile::new().set_password("example");
4428    /// ```
4429    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4430        self.password = v.into();
4431        self
4432    }
4433
4434    /// Sets the value of [database][crate::model::PostgresqlProfile::database].
4435    ///
4436    /// # Example
4437    /// ```ignore,no_run
4438    /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4439    /// let x = PostgresqlProfile::new().set_database("example");
4440    /// ```
4441    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4442        self.database = v.into();
4443        self
4444    }
4445
4446    /// Sets the value of [secret_manager_stored_password][crate::model::PostgresqlProfile::secret_manager_stored_password].
4447    ///
4448    /// # Example
4449    /// ```ignore,no_run
4450    /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4451    /// let x = PostgresqlProfile::new().set_secret_manager_stored_password("example");
4452    /// ```
4453    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4454        mut self,
4455        v: T,
4456    ) -> Self {
4457        self.secret_manager_stored_password = v.into();
4458        self
4459    }
4460
4461    /// Sets the value of [ssl_config][crate::model::PostgresqlProfile::ssl_config].
4462    ///
4463    /// # Example
4464    /// ```ignore,no_run
4465    /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4466    /// use google_cloud_datastream_v1::model::PostgresqlSslConfig;
4467    /// let x = PostgresqlProfile::new().set_ssl_config(PostgresqlSslConfig::default()/* use setters */);
4468    /// ```
4469    pub fn set_ssl_config<T>(mut self, v: T) -> Self
4470    where
4471        T: std::convert::Into<crate::model::PostgresqlSslConfig>,
4472    {
4473        self.ssl_config = std::option::Option::Some(v.into());
4474        self
4475    }
4476
4477    /// Sets or clears the value of [ssl_config][crate::model::PostgresqlProfile::ssl_config].
4478    ///
4479    /// # Example
4480    /// ```ignore,no_run
4481    /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4482    /// use google_cloud_datastream_v1::model::PostgresqlSslConfig;
4483    /// let x = PostgresqlProfile::new().set_or_clear_ssl_config(Some(PostgresqlSslConfig::default()/* use setters */));
4484    /// let x = PostgresqlProfile::new().set_or_clear_ssl_config(None::<PostgresqlSslConfig>);
4485    /// ```
4486    pub fn set_or_clear_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
4487    where
4488        T: std::convert::Into<crate::model::PostgresqlSslConfig>,
4489    {
4490        self.ssl_config = v.map(|x| x.into());
4491        self
4492    }
4493}
4494
4495impl wkt::message::Message for PostgresqlProfile {
4496    fn typename() -> &'static str {
4497        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlProfile"
4498    }
4499}
4500
4501/// SQLServer database profile.
4502#[derive(Clone, Default, PartialEq)]
4503#[non_exhaustive]
4504pub struct SqlServerProfile {
4505    /// Required. Hostname for the SQLServer connection.
4506    pub hostname: std::string::String,
4507
4508    /// Port for the SQLServer connection, default value is 1433.
4509    pub port: i32,
4510
4511    /// Required. Username for the SQLServer connection.
4512    pub username: std::string::String,
4513
4514    /// Optional. Password for the SQLServer connection. Mutually exclusive with
4515    /// the `secret_manager_stored_password` field.
4516    pub password: std::string::String,
4517
4518    /// Required. Database for the SQLServer connection.
4519    pub database: std::string::String,
4520
4521    /// Optional. A reference to a Secret Manager resource name storing the
4522    /// SQLServer connection password. Mutually exclusive with the `password`
4523    /// field.
4524    pub secret_manager_stored_password: std::string::String,
4525
4526    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4527}
4528
4529impl SqlServerProfile {
4530    pub fn new() -> Self {
4531        std::default::Default::default()
4532    }
4533
4534    /// Sets the value of [hostname][crate::model::SqlServerProfile::hostname].
4535    ///
4536    /// # Example
4537    /// ```ignore,no_run
4538    /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4539    /// let x = SqlServerProfile::new().set_hostname("example");
4540    /// ```
4541    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4542        self.hostname = v.into();
4543        self
4544    }
4545
4546    /// Sets the value of [port][crate::model::SqlServerProfile::port].
4547    ///
4548    /// # Example
4549    /// ```ignore,no_run
4550    /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4551    /// let x = SqlServerProfile::new().set_port(42);
4552    /// ```
4553    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4554        self.port = v.into();
4555        self
4556    }
4557
4558    /// Sets the value of [username][crate::model::SqlServerProfile::username].
4559    ///
4560    /// # Example
4561    /// ```ignore,no_run
4562    /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4563    /// let x = SqlServerProfile::new().set_username("example");
4564    /// ```
4565    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4566        self.username = v.into();
4567        self
4568    }
4569
4570    /// Sets the value of [password][crate::model::SqlServerProfile::password].
4571    ///
4572    /// # Example
4573    /// ```ignore,no_run
4574    /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4575    /// let x = SqlServerProfile::new().set_password("example");
4576    /// ```
4577    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4578        self.password = v.into();
4579        self
4580    }
4581
4582    /// Sets the value of [database][crate::model::SqlServerProfile::database].
4583    ///
4584    /// # Example
4585    /// ```ignore,no_run
4586    /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4587    /// let x = SqlServerProfile::new().set_database("example");
4588    /// ```
4589    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4590        self.database = v.into();
4591        self
4592    }
4593
4594    /// Sets the value of [secret_manager_stored_password][crate::model::SqlServerProfile::secret_manager_stored_password].
4595    ///
4596    /// # Example
4597    /// ```ignore,no_run
4598    /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4599    /// let x = SqlServerProfile::new().set_secret_manager_stored_password("example");
4600    /// ```
4601    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4602        mut self,
4603        v: T,
4604    ) -> Self {
4605        self.secret_manager_stored_password = v.into();
4606        self
4607    }
4608}
4609
4610impl wkt::message::Message for SqlServerProfile {
4611    fn typename() -> &'static str {
4612        "type.googleapis.com/google.cloud.datastream.v1.SqlServerProfile"
4613    }
4614}
4615
4616/// Salesforce profile
4617#[derive(Clone, Default, PartialEq)]
4618#[non_exhaustive]
4619pub struct SalesforceProfile {
4620    /// Required. Domain endpoint for the Salesforce connection.
4621    pub domain: std::string::String,
4622
4623    /// Credentials for Salesforce connection.
4624    pub credentials: std::option::Option<crate::model::salesforce_profile::Credentials>,
4625
4626    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4627}
4628
4629impl SalesforceProfile {
4630    pub fn new() -> Self {
4631        std::default::Default::default()
4632    }
4633
4634    /// Sets the value of [domain][crate::model::SalesforceProfile::domain].
4635    ///
4636    /// # Example
4637    /// ```ignore,no_run
4638    /// # use google_cloud_datastream_v1::model::SalesforceProfile;
4639    /// let x = SalesforceProfile::new().set_domain("example");
4640    /// ```
4641    pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4642        self.domain = v.into();
4643        self
4644    }
4645
4646    /// Sets the value of [credentials][crate::model::SalesforceProfile::credentials].
4647    ///
4648    /// Note that all the setters affecting `credentials` are mutually
4649    /// exclusive.
4650    ///
4651    /// # Example
4652    /// ```ignore,no_run
4653    /// # use google_cloud_datastream_v1::model::SalesforceProfile;
4654    /// use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4655    /// let x = SalesforceProfile::new().set_credentials(Some(
4656    ///     google_cloud_datastream_v1::model::salesforce_profile::Credentials::UserCredentials(UserCredentials::default().into())));
4657    /// ```
4658    pub fn set_credentials<
4659        T: std::convert::Into<std::option::Option<crate::model::salesforce_profile::Credentials>>,
4660    >(
4661        mut self,
4662        v: T,
4663    ) -> Self {
4664        self.credentials = v.into();
4665        self
4666    }
4667
4668    /// The value of [credentials][crate::model::SalesforceProfile::credentials]
4669    /// if it holds a `UserCredentials`, `None` if the field is not set or
4670    /// holds a different branch.
4671    pub fn user_credentials(
4672        &self,
4673    ) -> std::option::Option<&std::boxed::Box<crate::model::salesforce_profile::UserCredentials>>
4674    {
4675        #[allow(unreachable_patterns)]
4676        self.credentials.as_ref().and_then(|v| match v {
4677            crate::model::salesforce_profile::Credentials::UserCredentials(v) => {
4678                std::option::Option::Some(v)
4679            }
4680            _ => std::option::Option::None,
4681        })
4682    }
4683
4684    /// Sets the value of [credentials][crate::model::SalesforceProfile::credentials]
4685    /// to hold a `UserCredentials`.
4686    ///
4687    /// Note that all the setters affecting `credentials` are
4688    /// mutually exclusive.
4689    ///
4690    /// # Example
4691    /// ```ignore,no_run
4692    /// # use google_cloud_datastream_v1::model::SalesforceProfile;
4693    /// use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4694    /// let x = SalesforceProfile::new().set_user_credentials(UserCredentials::default()/* use setters */);
4695    /// assert!(x.user_credentials().is_some());
4696    /// assert!(x.oauth2_client_credentials().is_none());
4697    /// ```
4698    pub fn set_user_credentials<
4699        T: std::convert::Into<std::boxed::Box<crate::model::salesforce_profile::UserCredentials>>,
4700    >(
4701        mut self,
4702        v: T,
4703    ) -> Self {
4704        self.credentials = std::option::Option::Some(
4705            crate::model::salesforce_profile::Credentials::UserCredentials(v.into()),
4706        );
4707        self
4708    }
4709
4710    /// The value of [credentials][crate::model::SalesforceProfile::credentials]
4711    /// if it holds a `Oauth2ClientCredentials`, `None` if the field is not set or
4712    /// holds a different branch.
4713    pub fn oauth2_client_credentials(
4714        &self,
4715    ) -> std::option::Option<
4716        &std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>,
4717    > {
4718        #[allow(unreachable_patterns)]
4719        self.credentials.as_ref().and_then(|v| match v {
4720            crate::model::salesforce_profile::Credentials::Oauth2ClientCredentials(v) => {
4721                std::option::Option::Some(v)
4722            }
4723            _ => std::option::Option::None,
4724        })
4725    }
4726
4727    /// Sets the value of [credentials][crate::model::SalesforceProfile::credentials]
4728    /// to hold a `Oauth2ClientCredentials`.
4729    ///
4730    /// Note that all the setters affecting `credentials` are
4731    /// mutually exclusive.
4732    ///
4733    /// # Example
4734    /// ```ignore,no_run
4735    /// # use google_cloud_datastream_v1::model::SalesforceProfile;
4736    /// use google_cloud_datastream_v1::model::salesforce_profile::Oauth2ClientCredentials;
4737    /// let x = SalesforceProfile::new().set_oauth2_client_credentials(Oauth2ClientCredentials::default()/* use setters */);
4738    /// assert!(x.oauth2_client_credentials().is_some());
4739    /// assert!(x.user_credentials().is_none());
4740    /// ```
4741    pub fn set_oauth2_client_credentials<
4742        T: std::convert::Into<
4743                std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>,
4744            >,
4745    >(
4746        mut self,
4747        v: T,
4748    ) -> Self {
4749        self.credentials = std::option::Option::Some(
4750            crate::model::salesforce_profile::Credentials::Oauth2ClientCredentials(v.into()),
4751        );
4752        self
4753    }
4754}
4755
4756impl wkt::message::Message for SalesforceProfile {
4757    fn typename() -> &'static str {
4758        "type.googleapis.com/google.cloud.datastream.v1.SalesforceProfile"
4759    }
4760}
4761
4762/// Defines additional types related to [SalesforceProfile].
4763pub mod salesforce_profile {
4764    #[allow(unused_imports)]
4765    use super::*;
4766
4767    /// Username-password credentials.
4768    #[derive(Clone, Default, PartialEq)]
4769    #[non_exhaustive]
4770    pub struct UserCredentials {
4771        /// Required. Username for the Salesforce connection.
4772        pub username: std::string::String,
4773
4774        /// Optional. Password for the Salesforce connection.
4775        /// Mutually exclusive with the `secret_manager_stored_password` field.
4776        pub password: std::string::String,
4777
4778        /// Optional. Security token for the Salesforce connection.
4779        /// Mutually exclusive with the `secret_manager_stored_security_token` field.
4780        pub security_token: std::string::String,
4781
4782        /// Optional. A reference to a Secret Manager resource name storing the
4783        /// Salesforce connection's password. Mutually exclusive with the `password`
4784        /// field.
4785        pub secret_manager_stored_password: std::string::String,
4786
4787        /// Optional. A reference to a Secret Manager resource name storing the
4788        /// Salesforce connection's security token. Mutually exclusive with the
4789        /// `security_token` field.
4790        pub secret_manager_stored_security_token: std::string::String,
4791
4792        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4793    }
4794
4795    impl UserCredentials {
4796        pub fn new() -> Self {
4797            std::default::Default::default()
4798        }
4799
4800        /// Sets the value of [username][crate::model::salesforce_profile::UserCredentials::username].
4801        ///
4802        /// # Example
4803        /// ```ignore,no_run
4804        /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4805        /// let x = UserCredentials::new().set_username("example");
4806        /// ```
4807        pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4808            self.username = v.into();
4809            self
4810        }
4811
4812        /// Sets the value of [password][crate::model::salesforce_profile::UserCredentials::password].
4813        ///
4814        /// # Example
4815        /// ```ignore,no_run
4816        /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4817        /// let x = UserCredentials::new().set_password("example");
4818        /// ```
4819        pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4820            self.password = v.into();
4821            self
4822        }
4823
4824        /// Sets the value of [security_token][crate::model::salesforce_profile::UserCredentials::security_token].
4825        ///
4826        /// # Example
4827        /// ```ignore,no_run
4828        /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4829        /// let x = UserCredentials::new().set_security_token("example");
4830        /// ```
4831        pub fn set_security_token<T: std::convert::Into<std::string::String>>(
4832            mut self,
4833            v: T,
4834        ) -> Self {
4835            self.security_token = v.into();
4836            self
4837        }
4838
4839        /// Sets the value of [secret_manager_stored_password][crate::model::salesforce_profile::UserCredentials::secret_manager_stored_password].
4840        ///
4841        /// # Example
4842        /// ```ignore,no_run
4843        /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4844        /// let x = UserCredentials::new().set_secret_manager_stored_password("example");
4845        /// ```
4846        pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4847            mut self,
4848            v: T,
4849        ) -> Self {
4850            self.secret_manager_stored_password = v.into();
4851            self
4852        }
4853
4854        /// Sets the value of [secret_manager_stored_security_token][crate::model::salesforce_profile::UserCredentials::secret_manager_stored_security_token].
4855        ///
4856        /// # Example
4857        /// ```ignore,no_run
4858        /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4859        /// let x = UserCredentials::new().set_secret_manager_stored_security_token("example");
4860        /// ```
4861        pub fn set_secret_manager_stored_security_token<
4862            T: std::convert::Into<std::string::String>,
4863        >(
4864            mut self,
4865            v: T,
4866        ) -> Self {
4867            self.secret_manager_stored_security_token = v.into();
4868            self
4869        }
4870    }
4871
4872    impl wkt::message::Message for UserCredentials {
4873        fn typename() -> &'static str {
4874            "type.googleapis.com/google.cloud.datastream.v1.SalesforceProfile.UserCredentials"
4875        }
4876    }
4877
4878    /// OAuth2 Client Credentials.
4879    #[derive(Clone, Default, PartialEq)]
4880    #[non_exhaustive]
4881    pub struct Oauth2ClientCredentials {
4882        /// Required. Client ID for Salesforce OAuth2 Client Credentials.
4883        pub client_id: std::string::String,
4884
4885        /// Optional. Client secret for Salesforce OAuth2 Client Credentials.
4886        /// Mutually exclusive with the `secret_manager_stored_client_secret` field.
4887        pub client_secret: std::string::String,
4888
4889        /// Optional. A reference to a Secret Manager resource name storing the
4890        /// Salesforce OAuth2 client_secret. Mutually exclusive with the
4891        /// `client_secret` field.
4892        pub secret_manager_stored_client_secret: std::string::String,
4893
4894        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4895    }
4896
4897    impl Oauth2ClientCredentials {
4898        pub fn new() -> Self {
4899            std::default::Default::default()
4900        }
4901
4902        /// Sets the value of [client_id][crate::model::salesforce_profile::Oauth2ClientCredentials::client_id].
4903        ///
4904        /// # Example
4905        /// ```ignore,no_run
4906        /// # use google_cloud_datastream_v1::model::salesforce_profile::Oauth2ClientCredentials;
4907        /// let x = Oauth2ClientCredentials::new().set_client_id("example");
4908        /// ```
4909        pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4910            self.client_id = v.into();
4911            self
4912        }
4913
4914        /// Sets the value of [client_secret][crate::model::salesforce_profile::Oauth2ClientCredentials::client_secret].
4915        ///
4916        /// # Example
4917        /// ```ignore,no_run
4918        /// # use google_cloud_datastream_v1::model::salesforce_profile::Oauth2ClientCredentials;
4919        /// let x = Oauth2ClientCredentials::new().set_client_secret("example");
4920        /// ```
4921        pub fn set_client_secret<T: std::convert::Into<std::string::String>>(
4922            mut self,
4923            v: T,
4924        ) -> Self {
4925            self.client_secret = v.into();
4926            self
4927        }
4928
4929        /// Sets the value of [secret_manager_stored_client_secret][crate::model::salesforce_profile::Oauth2ClientCredentials::secret_manager_stored_client_secret].
4930        ///
4931        /// # Example
4932        /// ```ignore,no_run
4933        /// # use google_cloud_datastream_v1::model::salesforce_profile::Oauth2ClientCredentials;
4934        /// let x = Oauth2ClientCredentials::new().set_secret_manager_stored_client_secret("example");
4935        /// ```
4936        pub fn set_secret_manager_stored_client_secret<
4937            T: std::convert::Into<std::string::String>,
4938        >(
4939            mut self,
4940            v: T,
4941        ) -> Self {
4942            self.secret_manager_stored_client_secret = v.into();
4943            self
4944        }
4945    }
4946
4947    impl wkt::message::Message for Oauth2ClientCredentials {
4948        fn typename() -> &'static str {
4949            "type.googleapis.com/google.cloud.datastream.v1.SalesforceProfile.Oauth2ClientCredentials"
4950        }
4951    }
4952
4953    /// Credentials for Salesforce connection.
4954    #[derive(Clone, Debug, PartialEq)]
4955    #[non_exhaustive]
4956    pub enum Credentials {
4957        /// User-password authentication.
4958        UserCredentials(std::boxed::Box<crate::model::salesforce_profile::UserCredentials>),
4959        /// Connected app authentication.
4960        Oauth2ClientCredentials(
4961            std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>,
4962        ),
4963    }
4964}
4965
4966/// MongoDB profile.
4967#[derive(Clone, Default, PartialEq)]
4968#[non_exhaustive]
4969pub struct MongodbProfile {
4970    /// Required. List of host addresses for a MongoDB cluster.
4971    /// For SRV connection format, this list must contain exactly one DNS host
4972    /// without a port. For Standard connection format, this list must contain all
4973    /// the required hosts in the cluster with their respective ports.
4974    pub host_addresses: std::vec::Vec<crate::model::HostAddress>,
4975
4976    /// Optional. Name of the replica set. Only needed for self hosted replica set
4977    /// type MongoDB cluster. For SRV connection format, this field must be empty.
4978    /// For Standard connection format, this field must be specified.
4979    pub replica_set: std::string::String,
4980
4981    /// Required. Username for the MongoDB connection.
4982    pub username: std::string::String,
4983
4984    /// Optional. Password for the MongoDB connection. Mutually exclusive with the
4985    /// `secret_manager_stored_password` field.
4986    pub password: std::string::String,
4987
4988    /// Optional. A reference to a Secret Manager resource name storing the
4989    /// SQLServer connection password. Mutually exclusive with the `password`
4990    /// field.
4991    pub secret_manager_stored_password: std::string::String,
4992
4993    /// Optional. SSL configuration for the MongoDB connection.
4994    pub ssl_config: std::option::Option<crate::model::MongodbSslConfig>,
4995
4996    /// MongoDB connection format.
4997    /// Must specify either srv_connection_format or standard_connection_format.
4998    pub mongodb_connection_format:
4999        std::option::Option<crate::model::mongodb_profile::MongodbConnectionFormat>,
5000
5001    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5002}
5003
5004impl MongodbProfile {
5005    pub fn new() -> Self {
5006        std::default::Default::default()
5007    }
5008
5009    /// Sets the value of [host_addresses][crate::model::MongodbProfile::host_addresses].
5010    ///
5011    /// # Example
5012    /// ```ignore,no_run
5013    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5014    /// use google_cloud_datastream_v1::model::HostAddress;
5015    /// let x = MongodbProfile::new()
5016    ///     .set_host_addresses([
5017    ///         HostAddress::default()/* use setters */,
5018    ///         HostAddress::default()/* use (different) setters */,
5019    ///     ]);
5020    /// ```
5021    pub fn set_host_addresses<T, V>(mut self, v: T) -> Self
5022    where
5023        T: std::iter::IntoIterator<Item = V>,
5024        V: std::convert::Into<crate::model::HostAddress>,
5025    {
5026        use std::iter::Iterator;
5027        self.host_addresses = v.into_iter().map(|i| i.into()).collect();
5028        self
5029    }
5030
5031    /// Sets the value of [replica_set][crate::model::MongodbProfile::replica_set].
5032    ///
5033    /// # Example
5034    /// ```ignore,no_run
5035    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5036    /// let x = MongodbProfile::new().set_replica_set("example");
5037    /// ```
5038    pub fn set_replica_set<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5039        self.replica_set = v.into();
5040        self
5041    }
5042
5043    /// Sets the value of [username][crate::model::MongodbProfile::username].
5044    ///
5045    /// # Example
5046    /// ```ignore,no_run
5047    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5048    /// let x = MongodbProfile::new().set_username("example");
5049    /// ```
5050    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5051        self.username = v.into();
5052        self
5053    }
5054
5055    /// Sets the value of [password][crate::model::MongodbProfile::password].
5056    ///
5057    /// # Example
5058    /// ```ignore,no_run
5059    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5060    /// let x = MongodbProfile::new().set_password("example");
5061    /// ```
5062    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5063        self.password = v.into();
5064        self
5065    }
5066
5067    /// Sets the value of [secret_manager_stored_password][crate::model::MongodbProfile::secret_manager_stored_password].
5068    ///
5069    /// # Example
5070    /// ```ignore,no_run
5071    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5072    /// let x = MongodbProfile::new().set_secret_manager_stored_password("example");
5073    /// ```
5074    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
5075        mut self,
5076        v: T,
5077    ) -> Self {
5078        self.secret_manager_stored_password = v.into();
5079        self
5080    }
5081
5082    /// Sets the value of [ssl_config][crate::model::MongodbProfile::ssl_config].
5083    ///
5084    /// # Example
5085    /// ```ignore,no_run
5086    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5087    /// use google_cloud_datastream_v1::model::MongodbSslConfig;
5088    /// let x = MongodbProfile::new().set_ssl_config(MongodbSslConfig::default()/* use setters */);
5089    /// ```
5090    pub fn set_ssl_config<T>(mut self, v: T) -> Self
5091    where
5092        T: std::convert::Into<crate::model::MongodbSslConfig>,
5093    {
5094        self.ssl_config = std::option::Option::Some(v.into());
5095        self
5096    }
5097
5098    /// Sets or clears the value of [ssl_config][crate::model::MongodbProfile::ssl_config].
5099    ///
5100    /// # Example
5101    /// ```ignore,no_run
5102    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5103    /// use google_cloud_datastream_v1::model::MongodbSslConfig;
5104    /// let x = MongodbProfile::new().set_or_clear_ssl_config(Some(MongodbSslConfig::default()/* use setters */));
5105    /// let x = MongodbProfile::new().set_or_clear_ssl_config(None::<MongodbSslConfig>);
5106    /// ```
5107    pub fn set_or_clear_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
5108    where
5109        T: std::convert::Into<crate::model::MongodbSslConfig>,
5110    {
5111        self.ssl_config = v.map(|x| x.into());
5112        self
5113    }
5114
5115    /// Sets the value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format].
5116    ///
5117    /// Note that all the setters affecting `mongodb_connection_format` are mutually
5118    /// exclusive.
5119    ///
5120    /// # Example
5121    /// ```ignore,no_run
5122    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5123    /// use google_cloud_datastream_v1::model::SrvConnectionFormat;
5124    /// let x = MongodbProfile::new().set_mongodb_connection_format(Some(
5125    ///     google_cloud_datastream_v1::model::mongodb_profile::MongodbConnectionFormat::SrvConnectionFormat(SrvConnectionFormat::default().into())));
5126    /// ```
5127    pub fn set_mongodb_connection_format<
5128        T: std::convert::Into<
5129                std::option::Option<crate::model::mongodb_profile::MongodbConnectionFormat>,
5130            >,
5131    >(
5132        mut self,
5133        v: T,
5134    ) -> Self {
5135        self.mongodb_connection_format = v.into();
5136        self
5137    }
5138
5139    /// The value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
5140    /// if it holds a `SrvConnectionFormat`, `None` if the field is not set or
5141    /// holds a different branch.
5142    pub fn srv_connection_format(
5143        &self,
5144    ) -> std::option::Option<&std::boxed::Box<crate::model::SrvConnectionFormat>> {
5145        #[allow(unreachable_patterns)]
5146        self.mongodb_connection_format
5147            .as_ref()
5148            .and_then(|v| match v {
5149                crate::model::mongodb_profile::MongodbConnectionFormat::SrvConnectionFormat(v) => {
5150                    std::option::Option::Some(v)
5151                }
5152                _ => std::option::Option::None,
5153            })
5154    }
5155
5156    /// Sets the value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
5157    /// to hold a `SrvConnectionFormat`.
5158    ///
5159    /// Note that all the setters affecting `mongodb_connection_format` are
5160    /// mutually exclusive.
5161    ///
5162    /// # Example
5163    /// ```ignore,no_run
5164    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5165    /// use google_cloud_datastream_v1::model::SrvConnectionFormat;
5166    /// let x = MongodbProfile::new().set_srv_connection_format(SrvConnectionFormat::default()/* use setters */);
5167    /// assert!(x.srv_connection_format().is_some());
5168    /// assert!(x.standard_connection_format().is_none());
5169    /// ```
5170    pub fn set_srv_connection_format<
5171        T: std::convert::Into<std::boxed::Box<crate::model::SrvConnectionFormat>>,
5172    >(
5173        mut self,
5174        v: T,
5175    ) -> Self {
5176        self.mongodb_connection_format = std::option::Option::Some(
5177            crate::model::mongodb_profile::MongodbConnectionFormat::SrvConnectionFormat(v.into()),
5178        );
5179        self
5180    }
5181
5182    /// The value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
5183    /// if it holds a `StandardConnectionFormat`, `None` if the field is not set or
5184    /// holds a different branch.
5185    pub fn standard_connection_format(
5186        &self,
5187    ) -> std::option::Option<&std::boxed::Box<crate::model::StandardConnectionFormat>> {
5188        #[allow(unreachable_patterns)]
5189        self.mongodb_connection_format.as_ref().and_then(|v| match v {
5190            crate::model::mongodb_profile::MongodbConnectionFormat::StandardConnectionFormat(v) => std::option::Option::Some(v),
5191            _ => std::option::Option::None,
5192        })
5193    }
5194
5195    /// Sets the value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
5196    /// to hold a `StandardConnectionFormat`.
5197    ///
5198    /// Note that all the setters affecting `mongodb_connection_format` are
5199    /// mutually exclusive.
5200    ///
5201    /// # Example
5202    /// ```ignore,no_run
5203    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5204    /// use google_cloud_datastream_v1::model::StandardConnectionFormat;
5205    /// let x = MongodbProfile::new().set_standard_connection_format(StandardConnectionFormat::default()/* use setters */);
5206    /// assert!(x.standard_connection_format().is_some());
5207    /// assert!(x.srv_connection_format().is_none());
5208    /// ```
5209    pub fn set_standard_connection_format<
5210        T: std::convert::Into<std::boxed::Box<crate::model::StandardConnectionFormat>>,
5211    >(
5212        mut self,
5213        v: T,
5214    ) -> Self {
5215        self.mongodb_connection_format = std::option::Option::Some(
5216            crate::model::mongodb_profile::MongodbConnectionFormat::StandardConnectionFormat(
5217                v.into(),
5218            ),
5219        );
5220        self
5221    }
5222}
5223
5224impl wkt::message::Message for MongodbProfile {
5225    fn typename() -> &'static str {
5226        "type.googleapis.com/google.cloud.datastream.v1.MongodbProfile"
5227    }
5228}
5229
5230/// Defines additional types related to [MongodbProfile].
5231pub mod mongodb_profile {
5232    #[allow(unused_imports)]
5233    use super::*;
5234
5235    /// MongoDB connection format.
5236    /// Must specify either srv_connection_format or standard_connection_format.
5237    #[derive(Clone, Debug, PartialEq)]
5238    #[non_exhaustive]
5239    pub enum MongodbConnectionFormat {
5240        /// Srv connection format.
5241        SrvConnectionFormat(std::boxed::Box<crate::model::SrvConnectionFormat>),
5242        /// Standard connection format.
5243        StandardConnectionFormat(std::boxed::Box<crate::model::StandardConnectionFormat>),
5244    }
5245}
5246
5247/// A HostAddress represents a transport end point, which is the combination
5248/// of an IP address or hostname and a port number.
5249#[derive(Clone, Default, PartialEq)]
5250#[non_exhaustive]
5251pub struct HostAddress {
5252    /// Required. Hostname for the connection.
5253    pub hostname: std::string::String,
5254
5255    /// Optional. Port for the connection.
5256    pub port: i32,
5257
5258    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5259}
5260
5261impl HostAddress {
5262    pub fn new() -> Self {
5263        std::default::Default::default()
5264    }
5265
5266    /// Sets the value of [hostname][crate::model::HostAddress::hostname].
5267    ///
5268    /// # Example
5269    /// ```ignore,no_run
5270    /// # use google_cloud_datastream_v1::model::HostAddress;
5271    /// let x = HostAddress::new().set_hostname("example");
5272    /// ```
5273    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5274        self.hostname = v.into();
5275        self
5276    }
5277
5278    /// Sets the value of [port][crate::model::HostAddress::port].
5279    ///
5280    /// # Example
5281    /// ```ignore,no_run
5282    /// # use google_cloud_datastream_v1::model::HostAddress;
5283    /// let x = HostAddress::new().set_port(42);
5284    /// ```
5285    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5286        self.port = v.into();
5287        self
5288    }
5289}
5290
5291impl wkt::message::Message for HostAddress {
5292    fn typename() -> &'static str {
5293        "type.googleapis.com/google.cloud.datastream.v1.HostAddress"
5294    }
5295}
5296
5297/// Srv connection format.
5298#[derive(Clone, Default, PartialEq)]
5299#[non_exhaustive]
5300pub struct SrvConnectionFormat {
5301    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5302}
5303
5304impl SrvConnectionFormat {
5305    pub fn new() -> Self {
5306        std::default::Default::default()
5307    }
5308}
5309
5310impl wkt::message::Message for SrvConnectionFormat {
5311    fn typename() -> &'static str {
5312        "type.googleapis.com/google.cloud.datastream.v1.SrvConnectionFormat"
5313    }
5314}
5315
5316/// Standard connection format.
5317#[derive(Clone, Default, PartialEq)]
5318#[non_exhaustive]
5319pub struct StandardConnectionFormat {
5320    /// Optional. Specifies whether the client connects directly to the host[:port]
5321    /// in the connection URI.
5322    pub direct_connection: bool,
5323
5324    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5325}
5326
5327impl StandardConnectionFormat {
5328    pub fn new() -> Self {
5329        std::default::Default::default()
5330    }
5331
5332    /// Sets the value of [direct_connection][crate::model::StandardConnectionFormat::direct_connection].
5333    ///
5334    /// # Example
5335    /// ```ignore,no_run
5336    /// # use google_cloud_datastream_v1::model::StandardConnectionFormat;
5337    /// let x = StandardConnectionFormat::new().set_direct_connection(true);
5338    /// ```
5339    pub fn set_direct_connection<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5340        self.direct_connection = v.into();
5341        self
5342    }
5343}
5344
5345impl wkt::message::Message for StandardConnectionFormat {
5346    fn typename() -> &'static str {
5347        "type.googleapis.com/google.cloud.datastream.v1.StandardConnectionFormat"
5348    }
5349}
5350
5351/// Cloud Storage bucket profile.
5352#[derive(Clone, Default, PartialEq)]
5353#[non_exhaustive]
5354pub struct GcsProfile {
5355    /// Required. The Cloud Storage bucket name.
5356    pub bucket: std::string::String,
5357
5358    /// The root path inside the Cloud Storage bucket.
5359    pub root_path: std::string::String,
5360
5361    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5362}
5363
5364impl GcsProfile {
5365    pub fn new() -> Self {
5366        std::default::Default::default()
5367    }
5368
5369    /// Sets the value of [bucket][crate::model::GcsProfile::bucket].
5370    ///
5371    /// # Example
5372    /// ```ignore,no_run
5373    /// # use google_cloud_datastream_v1::model::GcsProfile;
5374    /// let x = GcsProfile::new().set_bucket("example");
5375    /// ```
5376    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5377        self.bucket = v.into();
5378        self
5379    }
5380
5381    /// Sets the value of [root_path][crate::model::GcsProfile::root_path].
5382    ///
5383    /// # Example
5384    /// ```ignore,no_run
5385    /// # use google_cloud_datastream_v1::model::GcsProfile;
5386    /// let x = GcsProfile::new().set_root_path("example");
5387    /// ```
5388    pub fn set_root_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5389        self.root_path = v.into();
5390        self
5391    }
5392}
5393
5394impl wkt::message::Message for GcsProfile {
5395    fn typename() -> &'static str {
5396        "type.googleapis.com/google.cloud.datastream.v1.GcsProfile"
5397    }
5398}
5399
5400/// BigQuery warehouse profile.
5401#[derive(Clone, Default, PartialEq)]
5402#[non_exhaustive]
5403pub struct BigQueryProfile {
5404    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5405}
5406
5407impl BigQueryProfile {
5408    pub fn new() -> Self {
5409        std::default::Default::default()
5410    }
5411}
5412
5413impl wkt::message::Message for BigQueryProfile {
5414    fn typename() -> &'static str {
5415        "type.googleapis.com/google.cloud.datastream.v1.BigQueryProfile"
5416    }
5417}
5418
5419/// Static IP address connectivity. Used when the source database is configured
5420/// to allow incoming connections from the Datastream public IP addresses
5421/// for the region specified in the connection profile.
5422#[derive(Clone, Default, PartialEq)]
5423#[non_exhaustive]
5424pub struct StaticServiceIpConnectivity {
5425    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5426}
5427
5428impl StaticServiceIpConnectivity {
5429    pub fn new() -> Self {
5430        std::default::Default::default()
5431    }
5432}
5433
5434impl wkt::message::Message for StaticServiceIpConnectivity {
5435    fn typename() -> &'static str {
5436        "type.googleapis.com/google.cloud.datastream.v1.StaticServiceIpConnectivity"
5437    }
5438}
5439
5440/// Forward SSH Tunnel connectivity.
5441#[derive(Clone, Default, PartialEq)]
5442#[non_exhaustive]
5443pub struct ForwardSshTunnelConnectivity {
5444    /// Required. Hostname for the SSH tunnel.
5445    pub hostname: std::string::String,
5446
5447    /// Required. Username for the SSH tunnel.
5448    pub username: std::string::String,
5449
5450    /// Port for the SSH tunnel, default value is 22.
5451    pub port: i32,
5452
5453    pub authentication_method:
5454        std::option::Option<crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod>,
5455
5456    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5457}
5458
5459impl ForwardSshTunnelConnectivity {
5460    pub fn new() -> Self {
5461        std::default::Default::default()
5462    }
5463
5464    /// Sets the value of [hostname][crate::model::ForwardSshTunnelConnectivity::hostname].
5465    ///
5466    /// # Example
5467    /// ```ignore,no_run
5468    /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5469    /// let x = ForwardSshTunnelConnectivity::new().set_hostname("example");
5470    /// ```
5471    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5472        self.hostname = v.into();
5473        self
5474    }
5475
5476    /// Sets the value of [username][crate::model::ForwardSshTunnelConnectivity::username].
5477    ///
5478    /// # Example
5479    /// ```ignore,no_run
5480    /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5481    /// let x = ForwardSshTunnelConnectivity::new().set_username("example");
5482    /// ```
5483    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5484        self.username = v.into();
5485        self
5486    }
5487
5488    /// Sets the value of [port][crate::model::ForwardSshTunnelConnectivity::port].
5489    ///
5490    /// # Example
5491    /// ```ignore,no_run
5492    /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5493    /// let x = ForwardSshTunnelConnectivity::new().set_port(42);
5494    /// ```
5495    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5496        self.port = v.into();
5497        self
5498    }
5499
5500    /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method].
5501    ///
5502    /// Note that all the setters affecting `authentication_method` are mutually
5503    /// exclusive.
5504    ///
5505    /// # Example
5506    /// ```ignore,no_run
5507    /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5508    /// use google_cloud_datastream_v1::model::forward_ssh_tunnel_connectivity::AuthenticationMethod;
5509    /// let x = ForwardSshTunnelConnectivity::new().set_authentication_method(Some(AuthenticationMethod::Password("example".to_string())));
5510    /// ```
5511    pub fn set_authentication_method<
5512        T: std::convert::Into<
5513                std::option::Option<
5514                    crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod,
5515                >,
5516            >,
5517    >(
5518        mut self,
5519        v: T,
5520    ) -> Self {
5521        self.authentication_method = v.into();
5522        self
5523    }
5524
5525    /// The value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
5526    /// if it holds a `Password`, `None` if the field is not set or
5527    /// holds a different branch.
5528    pub fn password(&self) -> std::option::Option<&std::string::String> {
5529        #[allow(unreachable_patterns)]
5530        self.authentication_method.as_ref().and_then(|v| match v {
5531            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::Password(v) => {
5532                std::option::Option::Some(v)
5533            }
5534            _ => std::option::Option::None,
5535        })
5536    }
5537
5538    /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
5539    /// to hold a `Password`.
5540    ///
5541    /// Note that all the setters affecting `authentication_method` are
5542    /// mutually exclusive.
5543    ///
5544    /// # Example
5545    /// ```ignore,no_run
5546    /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5547    /// let x = ForwardSshTunnelConnectivity::new().set_password("example");
5548    /// assert!(x.password().is_some());
5549    /// assert!(x.private_key().is_none());
5550    /// ```
5551    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5552        self.authentication_method = std::option::Option::Some(
5553            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::Password(v.into()),
5554        );
5555        self
5556    }
5557
5558    /// The value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
5559    /// if it holds a `PrivateKey`, `None` if the field is not set or
5560    /// holds a different branch.
5561    pub fn private_key(&self) -> std::option::Option<&std::string::String> {
5562        #[allow(unreachable_patterns)]
5563        self.authentication_method.as_ref().and_then(|v| match v {
5564            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::PrivateKey(v) => {
5565                std::option::Option::Some(v)
5566            }
5567            _ => std::option::Option::None,
5568        })
5569    }
5570
5571    /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
5572    /// to hold a `PrivateKey`.
5573    ///
5574    /// Note that all the setters affecting `authentication_method` are
5575    /// mutually exclusive.
5576    ///
5577    /// # Example
5578    /// ```ignore,no_run
5579    /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5580    /// let x = ForwardSshTunnelConnectivity::new().set_private_key("example");
5581    /// assert!(x.private_key().is_some());
5582    /// assert!(x.password().is_none());
5583    /// ```
5584    pub fn set_private_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5585        self.authentication_method = std::option::Option::Some(
5586            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::PrivateKey(
5587                v.into(),
5588            ),
5589        );
5590        self
5591    }
5592}
5593
5594impl wkt::message::Message for ForwardSshTunnelConnectivity {
5595    fn typename() -> &'static str {
5596        "type.googleapis.com/google.cloud.datastream.v1.ForwardSshTunnelConnectivity"
5597    }
5598}
5599
5600/// Defines additional types related to [ForwardSshTunnelConnectivity].
5601pub mod forward_ssh_tunnel_connectivity {
5602    #[allow(unused_imports)]
5603    use super::*;
5604
5605    #[derive(Clone, Debug, PartialEq)]
5606    #[non_exhaustive]
5607    pub enum AuthenticationMethod {
5608        /// Input only. SSH password.
5609        Password(std::string::String),
5610        /// Input only. SSH private key.
5611        PrivateKey(std::string::String),
5612    }
5613}
5614
5615/// The VPC Peering configuration is used to create VPC peering between
5616/// Datastream and the consumer's VPC.
5617#[derive(Clone, Default, PartialEq)]
5618#[non_exhaustive]
5619pub struct VpcPeeringConfig {
5620    /// Required. Fully qualified name of the VPC that Datastream will peer to.
5621    /// Format: `projects/{project}/global/{networks}/{name}`
5622    pub vpc: std::string::String,
5623
5624    /// Required. A free subnet for peering. (CIDR of /29)
5625    pub subnet: std::string::String,
5626
5627    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5628}
5629
5630impl VpcPeeringConfig {
5631    pub fn new() -> Self {
5632        std::default::Default::default()
5633    }
5634
5635    /// Sets the value of [vpc][crate::model::VpcPeeringConfig::vpc].
5636    ///
5637    /// # Example
5638    /// ```ignore,no_run
5639    /// # use google_cloud_datastream_v1::model::VpcPeeringConfig;
5640    /// let x = VpcPeeringConfig::new().set_vpc("example");
5641    /// ```
5642    pub fn set_vpc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5643        self.vpc = v.into();
5644        self
5645    }
5646
5647    /// Sets the value of [subnet][crate::model::VpcPeeringConfig::subnet].
5648    ///
5649    /// # Example
5650    /// ```ignore,no_run
5651    /// # use google_cloud_datastream_v1::model::VpcPeeringConfig;
5652    /// let x = VpcPeeringConfig::new().set_subnet("example");
5653    /// ```
5654    pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5655        self.subnet = v.into();
5656        self
5657    }
5658}
5659
5660impl wkt::message::Message for VpcPeeringConfig {
5661    fn typename() -> &'static str {
5662        "type.googleapis.com/google.cloud.datastream.v1.VpcPeeringConfig"
5663    }
5664}
5665
5666/// The PSC Interface configuration is used to create PSC Interface between
5667/// Datastream and the consumer's PSC.
5668#[derive(Clone, Default, PartialEq)]
5669#[non_exhaustive]
5670pub struct PscInterfaceConfig {
5671    /// Required. Fully qualified name of the Network Attachment that Datastream
5672    /// will connect to. Format:
5673    /// `projects/{project}/regions/{region}/networkAttachments/{name}`
5674    pub network_attachment: std::string::String,
5675
5676    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5677}
5678
5679impl PscInterfaceConfig {
5680    pub fn new() -> Self {
5681        std::default::Default::default()
5682    }
5683
5684    /// Sets the value of [network_attachment][crate::model::PscInterfaceConfig::network_attachment].
5685    ///
5686    /// # Example
5687    /// ```ignore,no_run
5688    /// # use google_cloud_datastream_v1::model::PscInterfaceConfig;
5689    /// let x = PscInterfaceConfig::new().set_network_attachment("example");
5690    /// ```
5691    pub fn set_network_attachment<T: std::convert::Into<std::string::String>>(
5692        mut self,
5693        v: T,
5694    ) -> Self {
5695        self.network_attachment = v.into();
5696        self
5697    }
5698}
5699
5700impl wkt::message::Message for PscInterfaceConfig {
5701    fn typename() -> &'static str {
5702        "type.googleapis.com/google.cloud.datastream.v1.PscInterfaceConfig"
5703    }
5704}
5705
5706/// The PrivateConnection resource is used to establish private connectivity
5707/// between Datastream and a customer's network.
5708#[derive(Clone, Default, PartialEq)]
5709#[non_exhaustive]
5710pub struct PrivateConnection {
5711    /// Output only. Identifier. The resource's name.
5712    pub name: std::string::String,
5713
5714    /// Output only. The create time of the resource.
5715    pub create_time: std::option::Option<wkt::Timestamp>,
5716
5717    /// Output only. The update time of the resource.
5718    pub update_time: std::option::Option<wkt::Timestamp>,
5719
5720    /// Labels.
5721    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5722
5723    /// Required. Display name.
5724    pub display_name: std::string::String,
5725
5726    /// Output only. The state of the Private Connection.
5727    pub state: crate::model::private_connection::State,
5728
5729    /// Output only. In case of error, the details of the error in a user-friendly
5730    /// format.
5731    pub error: std::option::Option<crate::model::Error>,
5732
5733    /// Output only. Reserved for future use.
5734    pub satisfies_pzs: std::option::Option<bool>,
5735
5736    /// Output only. Reserved for future use.
5737    pub satisfies_pzi: std::option::Option<bool>,
5738
5739    /// VPC Peering Config.
5740    pub vpc_peering_config: std::option::Option<crate::model::VpcPeeringConfig>,
5741
5742    /// PSC Interface Config.
5743    pub psc_interface_config: std::option::Option<crate::model::PscInterfaceConfig>,
5744
5745    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5746}
5747
5748impl PrivateConnection {
5749    pub fn new() -> Self {
5750        std::default::Default::default()
5751    }
5752
5753    /// Sets the value of [name][crate::model::PrivateConnection::name].
5754    ///
5755    /// # Example
5756    /// ```ignore,no_run
5757    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5758    /// let x = PrivateConnection::new().set_name("example");
5759    /// ```
5760    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5761        self.name = v.into();
5762        self
5763    }
5764
5765    /// Sets the value of [create_time][crate::model::PrivateConnection::create_time].
5766    ///
5767    /// # Example
5768    /// ```ignore,no_run
5769    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5770    /// use wkt::Timestamp;
5771    /// let x = PrivateConnection::new().set_create_time(Timestamp::default()/* use setters */);
5772    /// ```
5773    pub fn set_create_time<T>(mut self, v: T) -> Self
5774    where
5775        T: std::convert::Into<wkt::Timestamp>,
5776    {
5777        self.create_time = std::option::Option::Some(v.into());
5778        self
5779    }
5780
5781    /// Sets or clears the value of [create_time][crate::model::PrivateConnection::create_time].
5782    ///
5783    /// # Example
5784    /// ```ignore,no_run
5785    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5786    /// use wkt::Timestamp;
5787    /// let x = PrivateConnection::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5788    /// let x = PrivateConnection::new().set_or_clear_create_time(None::<Timestamp>);
5789    /// ```
5790    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5791    where
5792        T: std::convert::Into<wkt::Timestamp>,
5793    {
5794        self.create_time = v.map(|x| x.into());
5795        self
5796    }
5797
5798    /// Sets the value of [update_time][crate::model::PrivateConnection::update_time].
5799    ///
5800    /// # Example
5801    /// ```ignore,no_run
5802    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5803    /// use wkt::Timestamp;
5804    /// let x = PrivateConnection::new().set_update_time(Timestamp::default()/* use setters */);
5805    /// ```
5806    pub fn set_update_time<T>(mut self, v: T) -> Self
5807    where
5808        T: std::convert::Into<wkt::Timestamp>,
5809    {
5810        self.update_time = std::option::Option::Some(v.into());
5811        self
5812    }
5813
5814    /// Sets or clears the value of [update_time][crate::model::PrivateConnection::update_time].
5815    ///
5816    /// # Example
5817    /// ```ignore,no_run
5818    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5819    /// use wkt::Timestamp;
5820    /// let x = PrivateConnection::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5821    /// let x = PrivateConnection::new().set_or_clear_update_time(None::<Timestamp>);
5822    /// ```
5823    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5824    where
5825        T: std::convert::Into<wkt::Timestamp>,
5826    {
5827        self.update_time = v.map(|x| x.into());
5828        self
5829    }
5830
5831    /// Sets the value of [labels][crate::model::PrivateConnection::labels].
5832    ///
5833    /// # Example
5834    /// ```ignore,no_run
5835    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5836    /// let x = PrivateConnection::new().set_labels([
5837    ///     ("key0", "abc"),
5838    ///     ("key1", "xyz"),
5839    /// ]);
5840    /// ```
5841    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5842    where
5843        T: std::iter::IntoIterator<Item = (K, V)>,
5844        K: std::convert::Into<std::string::String>,
5845        V: std::convert::Into<std::string::String>,
5846    {
5847        use std::iter::Iterator;
5848        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5849        self
5850    }
5851
5852    /// Sets the value of [display_name][crate::model::PrivateConnection::display_name].
5853    ///
5854    /// # Example
5855    /// ```ignore,no_run
5856    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5857    /// let x = PrivateConnection::new().set_display_name("example");
5858    /// ```
5859    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5860        self.display_name = v.into();
5861        self
5862    }
5863
5864    /// Sets the value of [state][crate::model::PrivateConnection::state].
5865    ///
5866    /// # Example
5867    /// ```ignore,no_run
5868    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5869    /// use google_cloud_datastream_v1::model::private_connection::State;
5870    /// let x0 = PrivateConnection::new().set_state(State::Creating);
5871    /// let x1 = PrivateConnection::new().set_state(State::Created);
5872    /// let x2 = PrivateConnection::new().set_state(State::Failed);
5873    /// ```
5874    pub fn set_state<T: std::convert::Into<crate::model::private_connection::State>>(
5875        mut self,
5876        v: T,
5877    ) -> Self {
5878        self.state = v.into();
5879        self
5880    }
5881
5882    /// Sets the value of [error][crate::model::PrivateConnection::error].
5883    ///
5884    /// # Example
5885    /// ```ignore,no_run
5886    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5887    /// use google_cloud_datastream_v1::model::Error;
5888    /// let x = PrivateConnection::new().set_error(Error::default()/* use setters */);
5889    /// ```
5890    pub fn set_error<T>(mut self, v: T) -> Self
5891    where
5892        T: std::convert::Into<crate::model::Error>,
5893    {
5894        self.error = std::option::Option::Some(v.into());
5895        self
5896    }
5897
5898    /// Sets or clears the value of [error][crate::model::PrivateConnection::error].
5899    ///
5900    /// # Example
5901    /// ```ignore,no_run
5902    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5903    /// use google_cloud_datastream_v1::model::Error;
5904    /// let x = PrivateConnection::new().set_or_clear_error(Some(Error::default()/* use setters */));
5905    /// let x = PrivateConnection::new().set_or_clear_error(None::<Error>);
5906    /// ```
5907    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
5908    where
5909        T: std::convert::Into<crate::model::Error>,
5910    {
5911        self.error = v.map(|x| x.into());
5912        self
5913    }
5914
5915    /// Sets the value of [satisfies_pzs][crate::model::PrivateConnection::satisfies_pzs].
5916    ///
5917    /// # Example
5918    /// ```ignore,no_run
5919    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5920    /// let x = PrivateConnection::new().set_satisfies_pzs(true);
5921    /// ```
5922    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
5923    where
5924        T: std::convert::Into<bool>,
5925    {
5926        self.satisfies_pzs = std::option::Option::Some(v.into());
5927        self
5928    }
5929
5930    /// Sets or clears the value of [satisfies_pzs][crate::model::PrivateConnection::satisfies_pzs].
5931    ///
5932    /// # Example
5933    /// ```ignore,no_run
5934    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5935    /// let x = PrivateConnection::new().set_or_clear_satisfies_pzs(Some(false));
5936    /// let x = PrivateConnection::new().set_or_clear_satisfies_pzs(None::<bool>);
5937    /// ```
5938    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
5939    where
5940        T: std::convert::Into<bool>,
5941    {
5942        self.satisfies_pzs = v.map(|x| x.into());
5943        self
5944    }
5945
5946    /// Sets the value of [satisfies_pzi][crate::model::PrivateConnection::satisfies_pzi].
5947    ///
5948    /// # Example
5949    /// ```ignore,no_run
5950    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5951    /// let x = PrivateConnection::new().set_satisfies_pzi(true);
5952    /// ```
5953    pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
5954    where
5955        T: std::convert::Into<bool>,
5956    {
5957        self.satisfies_pzi = std::option::Option::Some(v.into());
5958        self
5959    }
5960
5961    /// Sets or clears the value of [satisfies_pzi][crate::model::PrivateConnection::satisfies_pzi].
5962    ///
5963    /// # Example
5964    /// ```ignore,no_run
5965    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5966    /// let x = PrivateConnection::new().set_or_clear_satisfies_pzi(Some(false));
5967    /// let x = PrivateConnection::new().set_or_clear_satisfies_pzi(None::<bool>);
5968    /// ```
5969    pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
5970    where
5971        T: std::convert::Into<bool>,
5972    {
5973        self.satisfies_pzi = v.map(|x| x.into());
5974        self
5975    }
5976
5977    /// Sets the value of [vpc_peering_config][crate::model::PrivateConnection::vpc_peering_config].
5978    ///
5979    /// # Example
5980    /// ```ignore,no_run
5981    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5982    /// use google_cloud_datastream_v1::model::VpcPeeringConfig;
5983    /// let x = PrivateConnection::new().set_vpc_peering_config(VpcPeeringConfig::default()/* use setters */);
5984    /// ```
5985    pub fn set_vpc_peering_config<T>(mut self, v: T) -> Self
5986    where
5987        T: std::convert::Into<crate::model::VpcPeeringConfig>,
5988    {
5989        self.vpc_peering_config = std::option::Option::Some(v.into());
5990        self
5991    }
5992
5993    /// Sets or clears the value of [vpc_peering_config][crate::model::PrivateConnection::vpc_peering_config].
5994    ///
5995    /// # Example
5996    /// ```ignore,no_run
5997    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5998    /// use google_cloud_datastream_v1::model::VpcPeeringConfig;
5999    /// let x = PrivateConnection::new().set_or_clear_vpc_peering_config(Some(VpcPeeringConfig::default()/* use setters */));
6000    /// let x = PrivateConnection::new().set_or_clear_vpc_peering_config(None::<VpcPeeringConfig>);
6001    /// ```
6002    pub fn set_or_clear_vpc_peering_config<T>(mut self, v: std::option::Option<T>) -> Self
6003    where
6004        T: std::convert::Into<crate::model::VpcPeeringConfig>,
6005    {
6006        self.vpc_peering_config = v.map(|x| x.into());
6007        self
6008    }
6009
6010    /// Sets the value of [psc_interface_config][crate::model::PrivateConnection::psc_interface_config].
6011    ///
6012    /// # Example
6013    /// ```ignore,no_run
6014    /// # use google_cloud_datastream_v1::model::PrivateConnection;
6015    /// use google_cloud_datastream_v1::model::PscInterfaceConfig;
6016    /// let x = PrivateConnection::new().set_psc_interface_config(PscInterfaceConfig::default()/* use setters */);
6017    /// ```
6018    pub fn set_psc_interface_config<T>(mut self, v: T) -> Self
6019    where
6020        T: std::convert::Into<crate::model::PscInterfaceConfig>,
6021    {
6022        self.psc_interface_config = std::option::Option::Some(v.into());
6023        self
6024    }
6025
6026    /// Sets or clears the value of [psc_interface_config][crate::model::PrivateConnection::psc_interface_config].
6027    ///
6028    /// # Example
6029    /// ```ignore,no_run
6030    /// # use google_cloud_datastream_v1::model::PrivateConnection;
6031    /// use google_cloud_datastream_v1::model::PscInterfaceConfig;
6032    /// let x = PrivateConnection::new().set_or_clear_psc_interface_config(Some(PscInterfaceConfig::default()/* use setters */));
6033    /// let x = PrivateConnection::new().set_or_clear_psc_interface_config(None::<PscInterfaceConfig>);
6034    /// ```
6035    pub fn set_or_clear_psc_interface_config<T>(mut self, v: std::option::Option<T>) -> Self
6036    where
6037        T: std::convert::Into<crate::model::PscInterfaceConfig>,
6038    {
6039        self.psc_interface_config = v.map(|x| x.into());
6040        self
6041    }
6042}
6043
6044impl wkt::message::Message for PrivateConnection {
6045    fn typename() -> &'static str {
6046        "type.googleapis.com/google.cloud.datastream.v1.PrivateConnection"
6047    }
6048}
6049
6050/// Defines additional types related to [PrivateConnection].
6051pub mod private_connection {
6052    #[allow(unused_imports)]
6053    use super::*;
6054
6055    /// Private Connection state.
6056    ///
6057    /// # Working with unknown values
6058    ///
6059    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6060    /// additional enum variants at any time. Adding new variants is not considered
6061    /// a breaking change. Applications should write their code in anticipation of:
6062    ///
6063    /// - New values appearing in future releases of the client library, **and**
6064    /// - New values received dynamically, without application changes.
6065    ///
6066    /// Please consult the [Working with enums] section in the user guide for some
6067    /// guidelines.
6068    ///
6069    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6070    #[derive(Clone, Debug, PartialEq)]
6071    #[non_exhaustive]
6072    pub enum State {
6073        /// Unspecified state.
6074        Unspecified,
6075        /// The private connection is in creation state - creating resources.
6076        Creating,
6077        /// The private connection has been created with all of its resources.
6078        Created,
6079        /// The private connection creation has failed.
6080        Failed,
6081        /// The private connection is being deleted.
6082        Deleting,
6083        /// Delete request has failed, resource is in invalid state.
6084        FailedToDelete,
6085        /// If set, the enum was initialized with an unknown value.
6086        ///
6087        /// Applications can examine the value using [State::value] or
6088        /// [State::name].
6089        UnknownValue(state::UnknownValue),
6090    }
6091
6092    #[doc(hidden)]
6093    pub mod state {
6094        #[allow(unused_imports)]
6095        use super::*;
6096        #[derive(Clone, Debug, PartialEq)]
6097        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6098    }
6099
6100    impl State {
6101        /// Gets the enum value.
6102        ///
6103        /// Returns `None` if the enum contains an unknown value deserialized from
6104        /// the string representation of enums.
6105        pub fn value(&self) -> std::option::Option<i32> {
6106            match self {
6107                Self::Unspecified => std::option::Option::Some(0),
6108                Self::Creating => std::option::Option::Some(1),
6109                Self::Created => std::option::Option::Some(2),
6110                Self::Failed => std::option::Option::Some(3),
6111                Self::Deleting => std::option::Option::Some(4),
6112                Self::FailedToDelete => std::option::Option::Some(5),
6113                Self::UnknownValue(u) => u.0.value(),
6114            }
6115        }
6116
6117        /// Gets the enum value as a string.
6118        ///
6119        /// Returns `None` if the enum contains an unknown value deserialized from
6120        /// the integer representation of enums.
6121        pub fn name(&self) -> std::option::Option<&str> {
6122            match self {
6123                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6124                Self::Creating => std::option::Option::Some("CREATING"),
6125                Self::Created => std::option::Option::Some("CREATED"),
6126                Self::Failed => std::option::Option::Some("FAILED"),
6127                Self::Deleting => std::option::Option::Some("DELETING"),
6128                Self::FailedToDelete => std::option::Option::Some("FAILED_TO_DELETE"),
6129                Self::UnknownValue(u) => u.0.name(),
6130            }
6131        }
6132    }
6133
6134    impl std::default::Default for State {
6135        fn default() -> Self {
6136            use std::convert::From;
6137            Self::from(0)
6138        }
6139    }
6140
6141    impl std::fmt::Display for State {
6142        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6143            wkt::internal::display_enum(f, self.name(), self.value())
6144        }
6145    }
6146
6147    impl std::convert::From<i32> for State {
6148        fn from(value: i32) -> Self {
6149            match value {
6150                0 => Self::Unspecified,
6151                1 => Self::Creating,
6152                2 => Self::Created,
6153                3 => Self::Failed,
6154                4 => Self::Deleting,
6155                5 => Self::FailedToDelete,
6156                _ => Self::UnknownValue(state::UnknownValue(
6157                    wkt::internal::UnknownEnumValue::Integer(value),
6158                )),
6159            }
6160        }
6161    }
6162
6163    impl std::convert::From<&str> for State {
6164        fn from(value: &str) -> Self {
6165            use std::string::ToString;
6166            match value {
6167                "STATE_UNSPECIFIED" => Self::Unspecified,
6168                "CREATING" => Self::Creating,
6169                "CREATED" => Self::Created,
6170                "FAILED" => Self::Failed,
6171                "DELETING" => Self::Deleting,
6172                "FAILED_TO_DELETE" => Self::FailedToDelete,
6173                _ => Self::UnknownValue(state::UnknownValue(
6174                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6175                )),
6176            }
6177        }
6178    }
6179
6180    impl serde::ser::Serialize for State {
6181        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6182        where
6183            S: serde::Serializer,
6184        {
6185            match self {
6186                Self::Unspecified => serializer.serialize_i32(0),
6187                Self::Creating => serializer.serialize_i32(1),
6188                Self::Created => serializer.serialize_i32(2),
6189                Self::Failed => serializer.serialize_i32(3),
6190                Self::Deleting => serializer.serialize_i32(4),
6191                Self::FailedToDelete => serializer.serialize_i32(5),
6192                Self::UnknownValue(u) => u.0.serialize(serializer),
6193            }
6194        }
6195    }
6196
6197    impl<'de> serde::de::Deserialize<'de> for State {
6198        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6199        where
6200            D: serde::Deserializer<'de>,
6201        {
6202            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6203                ".google.cloud.datastream.v1.PrivateConnection.State",
6204            ))
6205        }
6206    }
6207}
6208
6209/// Private Connectivity
6210#[derive(Clone, Default, PartialEq)]
6211#[non_exhaustive]
6212pub struct PrivateConnectivity {
6213    /// Required. A reference to a private connection resource.
6214    /// Format: `projects/{project}/locations/{location}/privateConnections/{name}`
6215    pub private_connection: std::string::String,
6216
6217    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6218}
6219
6220impl PrivateConnectivity {
6221    pub fn new() -> Self {
6222        std::default::Default::default()
6223    }
6224
6225    /// Sets the value of [private_connection][crate::model::PrivateConnectivity::private_connection].
6226    ///
6227    /// # Example
6228    /// ```ignore,no_run
6229    /// # use google_cloud_datastream_v1::model::PrivateConnectivity;
6230    /// let x = PrivateConnectivity::new().set_private_connection("example");
6231    /// ```
6232    pub fn set_private_connection<T: std::convert::Into<std::string::String>>(
6233        mut self,
6234        v: T,
6235    ) -> Self {
6236        self.private_connection = v.into();
6237        self
6238    }
6239}
6240
6241impl wkt::message::Message for PrivateConnectivity {
6242    fn typename() -> &'static str {
6243        "type.googleapis.com/google.cloud.datastream.v1.PrivateConnectivity"
6244    }
6245}
6246
6247/// The route resource is the child of the private connection resource,
6248/// used for defining a route for a private connection.
6249#[derive(Clone, Default, PartialEq)]
6250#[non_exhaustive]
6251pub struct Route {
6252    /// Output only. Identifier. The resource's name.
6253    pub name: std::string::String,
6254
6255    /// Output only. The create time of the resource.
6256    pub create_time: std::option::Option<wkt::Timestamp>,
6257
6258    /// Output only. The update time of the resource.
6259    pub update_time: std::option::Option<wkt::Timestamp>,
6260
6261    /// Labels.
6262    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6263
6264    /// Required. Display name.
6265    pub display_name: std::string::String,
6266
6267    /// Required. Destination address for connection
6268    pub destination_address: std::string::String,
6269
6270    /// Destination port for connection
6271    pub destination_port: i32,
6272
6273    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6274}
6275
6276impl Route {
6277    pub fn new() -> Self {
6278        std::default::Default::default()
6279    }
6280
6281    /// Sets the value of [name][crate::model::Route::name].
6282    ///
6283    /// # Example
6284    /// ```ignore,no_run
6285    /// # use google_cloud_datastream_v1::model::Route;
6286    /// let x = Route::new().set_name("example");
6287    /// ```
6288    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6289        self.name = v.into();
6290        self
6291    }
6292
6293    /// Sets the value of [create_time][crate::model::Route::create_time].
6294    ///
6295    /// # Example
6296    /// ```ignore,no_run
6297    /// # use google_cloud_datastream_v1::model::Route;
6298    /// use wkt::Timestamp;
6299    /// let x = Route::new().set_create_time(Timestamp::default()/* use setters */);
6300    /// ```
6301    pub fn set_create_time<T>(mut self, v: T) -> Self
6302    where
6303        T: std::convert::Into<wkt::Timestamp>,
6304    {
6305        self.create_time = std::option::Option::Some(v.into());
6306        self
6307    }
6308
6309    /// Sets or clears the value of [create_time][crate::model::Route::create_time].
6310    ///
6311    /// # Example
6312    /// ```ignore,no_run
6313    /// # use google_cloud_datastream_v1::model::Route;
6314    /// use wkt::Timestamp;
6315    /// let x = Route::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6316    /// let x = Route::new().set_or_clear_create_time(None::<Timestamp>);
6317    /// ```
6318    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6319    where
6320        T: std::convert::Into<wkt::Timestamp>,
6321    {
6322        self.create_time = v.map(|x| x.into());
6323        self
6324    }
6325
6326    /// Sets the value of [update_time][crate::model::Route::update_time].
6327    ///
6328    /// # Example
6329    /// ```ignore,no_run
6330    /// # use google_cloud_datastream_v1::model::Route;
6331    /// use wkt::Timestamp;
6332    /// let x = Route::new().set_update_time(Timestamp::default()/* use setters */);
6333    /// ```
6334    pub fn set_update_time<T>(mut self, v: T) -> Self
6335    where
6336        T: std::convert::Into<wkt::Timestamp>,
6337    {
6338        self.update_time = std::option::Option::Some(v.into());
6339        self
6340    }
6341
6342    /// Sets or clears the value of [update_time][crate::model::Route::update_time].
6343    ///
6344    /// # Example
6345    /// ```ignore,no_run
6346    /// # use google_cloud_datastream_v1::model::Route;
6347    /// use wkt::Timestamp;
6348    /// let x = Route::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6349    /// let x = Route::new().set_or_clear_update_time(None::<Timestamp>);
6350    /// ```
6351    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6352    where
6353        T: std::convert::Into<wkt::Timestamp>,
6354    {
6355        self.update_time = v.map(|x| x.into());
6356        self
6357    }
6358
6359    /// Sets the value of [labels][crate::model::Route::labels].
6360    ///
6361    /// # Example
6362    /// ```ignore,no_run
6363    /// # use google_cloud_datastream_v1::model::Route;
6364    /// let x = Route::new().set_labels([
6365    ///     ("key0", "abc"),
6366    ///     ("key1", "xyz"),
6367    /// ]);
6368    /// ```
6369    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6370    where
6371        T: std::iter::IntoIterator<Item = (K, V)>,
6372        K: std::convert::Into<std::string::String>,
6373        V: std::convert::Into<std::string::String>,
6374    {
6375        use std::iter::Iterator;
6376        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6377        self
6378    }
6379
6380    /// Sets the value of [display_name][crate::model::Route::display_name].
6381    ///
6382    /// # Example
6383    /// ```ignore,no_run
6384    /// # use google_cloud_datastream_v1::model::Route;
6385    /// let x = Route::new().set_display_name("example");
6386    /// ```
6387    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6388        self.display_name = v.into();
6389        self
6390    }
6391
6392    /// Sets the value of [destination_address][crate::model::Route::destination_address].
6393    ///
6394    /// # Example
6395    /// ```ignore,no_run
6396    /// # use google_cloud_datastream_v1::model::Route;
6397    /// let x = Route::new().set_destination_address("example");
6398    /// ```
6399    pub fn set_destination_address<T: std::convert::Into<std::string::String>>(
6400        mut self,
6401        v: T,
6402    ) -> Self {
6403        self.destination_address = v.into();
6404        self
6405    }
6406
6407    /// Sets the value of [destination_port][crate::model::Route::destination_port].
6408    ///
6409    /// # Example
6410    /// ```ignore,no_run
6411    /// # use google_cloud_datastream_v1::model::Route;
6412    /// let x = Route::new().set_destination_port(42);
6413    /// ```
6414    pub fn set_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6415        self.destination_port = v.into();
6416        self
6417    }
6418}
6419
6420impl wkt::message::Message for Route {
6421    fn typename() -> &'static str {
6422        "type.googleapis.com/google.cloud.datastream.v1.Route"
6423    }
6424}
6425
6426/// MongoDB SSL configuration information.
6427#[derive(Clone, Default, PartialEq)]
6428#[non_exhaustive]
6429pub struct MongodbSslConfig {
6430    /// Optional. Input only. PEM-encoded private key associated with the Client
6431    /// Certificate. If this field is used then the 'client_certificate' and the
6432    /// 'ca_certificate' fields are mandatory.
6433    pub client_key: std::string::String,
6434
6435    /// Output only. Indicates whether the client_key field is set.
6436    pub client_key_set: bool,
6437
6438    /// Optional. Input only. PEM-encoded certificate that will be used by the
6439    /// replica to authenticate against the source database server. If this field
6440    /// is used then the 'client_key' and the 'ca_certificate' fields are
6441    /// mandatory.
6442    pub client_certificate: std::string::String,
6443
6444    /// Output only. Indicates whether the client_certificate field is set.
6445    pub client_certificate_set: bool,
6446
6447    /// Optional. Input only. PEM-encoded certificate of the CA that signed the
6448    /// source database server's certificate.
6449    pub ca_certificate: std::string::String,
6450
6451    /// Output only. Indicates whether the ca_certificate field is set.
6452    pub ca_certificate_set: bool,
6453
6454    /// Optional. Input only. A reference to a Secret Manager resource name storing
6455    /// the PEM-encoded private key associated with the Client Certificate. If this
6456    /// field is used then the 'client_certificate' and the 'ca_certificate' fields
6457    /// are mandatory. Mutually exclusive with the `client_key` field.
6458    pub secret_manager_stored_client_key: std::string::String,
6459
6460    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6461}
6462
6463impl MongodbSslConfig {
6464    pub fn new() -> Self {
6465        std::default::Default::default()
6466    }
6467
6468    /// Sets the value of [client_key][crate::model::MongodbSslConfig::client_key].
6469    ///
6470    /// # Example
6471    /// ```ignore,no_run
6472    /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6473    /// let x = MongodbSslConfig::new().set_client_key("example");
6474    /// ```
6475    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6476        self.client_key = v.into();
6477        self
6478    }
6479
6480    /// Sets the value of [client_key_set][crate::model::MongodbSslConfig::client_key_set].
6481    ///
6482    /// # Example
6483    /// ```ignore,no_run
6484    /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6485    /// let x = MongodbSslConfig::new().set_client_key_set(true);
6486    /// ```
6487    pub fn set_client_key_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6488        self.client_key_set = v.into();
6489        self
6490    }
6491
6492    /// Sets the value of [client_certificate][crate::model::MongodbSslConfig::client_certificate].
6493    ///
6494    /// # Example
6495    /// ```ignore,no_run
6496    /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6497    /// let x = MongodbSslConfig::new().set_client_certificate("example");
6498    /// ```
6499    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
6500        mut self,
6501        v: T,
6502    ) -> Self {
6503        self.client_certificate = v.into();
6504        self
6505    }
6506
6507    /// Sets the value of [client_certificate_set][crate::model::MongodbSslConfig::client_certificate_set].
6508    ///
6509    /// # Example
6510    /// ```ignore,no_run
6511    /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6512    /// let x = MongodbSslConfig::new().set_client_certificate_set(true);
6513    /// ```
6514    pub fn set_client_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6515        self.client_certificate_set = v.into();
6516        self
6517    }
6518
6519    /// Sets the value of [ca_certificate][crate::model::MongodbSslConfig::ca_certificate].
6520    ///
6521    /// # Example
6522    /// ```ignore,no_run
6523    /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6524    /// let x = MongodbSslConfig::new().set_ca_certificate("example");
6525    /// ```
6526    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6527        self.ca_certificate = v.into();
6528        self
6529    }
6530
6531    /// Sets the value of [ca_certificate_set][crate::model::MongodbSslConfig::ca_certificate_set].
6532    ///
6533    /// # Example
6534    /// ```ignore,no_run
6535    /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6536    /// let x = MongodbSslConfig::new().set_ca_certificate_set(true);
6537    /// ```
6538    pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6539        self.ca_certificate_set = v.into();
6540        self
6541    }
6542
6543    /// Sets the value of [secret_manager_stored_client_key][crate::model::MongodbSslConfig::secret_manager_stored_client_key].
6544    ///
6545    /// # Example
6546    /// ```ignore,no_run
6547    /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6548    /// let x = MongodbSslConfig::new().set_secret_manager_stored_client_key("example");
6549    /// ```
6550    pub fn set_secret_manager_stored_client_key<T: std::convert::Into<std::string::String>>(
6551        mut self,
6552        v: T,
6553    ) -> Self {
6554        self.secret_manager_stored_client_key = v.into();
6555        self
6556    }
6557}
6558
6559impl wkt::message::Message for MongodbSslConfig {
6560    fn typename() -> &'static str {
6561        "type.googleapis.com/google.cloud.datastream.v1.MongodbSslConfig"
6562    }
6563}
6564
6565/// MySQL SSL configuration information.
6566#[derive(Clone, Default, PartialEq)]
6567#[non_exhaustive]
6568pub struct MysqlSslConfig {
6569    /// Optional. Input only. PEM-encoded private key associated with the Client
6570    /// Certificate. If this field is used then the 'client_certificate' and the
6571    /// 'ca_certificate' fields are mandatory.
6572    pub client_key: std::string::String,
6573
6574    /// Output only. Indicates whether the client_key field is set.
6575    pub client_key_set: bool,
6576
6577    /// Optional. Input only. PEM-encoded certificate that will be used by the
6578    /// replica to authenticate against the source database server. If this field
6579    /// is used then the 'client_key' and the 'ca_certificate' fields are
6580    /// mandatory.
6581    pub client_certificate: std::string::String,
6582
6583    /// Output only. Indicates whether the client_certificate field is set.
6584    pub client_certificate_set: bool,
6585
6586    /// Input only. PEM-encoded certificate of the CA that signed the source
6587    /// database server's certificate.
6588    pub ca_certificate: std::string::String,
6589
6590    /// Output only. Indicates whether the ca_certificate field is set.
6591    pub ca_certificate_set: bool,
6592
6593    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6594}
6595
6596impl MysqlSslConfig {
6597    pub fn new() -> Self {
6598        std::default::Default::default()
6599    }
6600
6601    /// Sets the value of [client_key][crate::model::MysqlSslConfig::client_key].
6602    ///
6603    /// # Example
6604    /// ```ignore,no_run
6605    /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6606    /// let x = MysqlSslConfig::new().set_client_key("example");
6607    /// ```
6608    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6609        self.client_key = v.into();
6610        self
6611    }
6612
6613    /// Sets the value of [client_key_set][crate::model::MysqlSslConfig::client_key_set].
6614    ///
6615    /// # Example
6616    /// ```ignore,no_run
6617    /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6618    /// let x = MysqlSslConfig::new().set_client_key_set(true);
6619    /// ```
6620    pub fn set_client_key_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6621        self.client_key_set = v.into();
6622        self
6623    }
6624
6625    /// Sets the value of [client_certificate][crate::model::MysqlSslConfig::client_certificate].
6626    ///
6627    /// # Example
6628    /// ```ignore,no_run
6629    /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6630    /// let x = MysqlSslConfig::new().set_client_certificate("example");
6631    /// ```
6632    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
6633        mut self,
6634        v: T,
6635    ) -> Self {
6636        self.client_certificate = v.into();
6637        self
6638    }
6639
6640    /// Sets the value of [client_certificate_set][crate::model::MysqlSslConfig::client_certificate_set].
6641    ///
6642    /// # Example
6643    /// ```ignore,no_run
6644    /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6645    /// let x = MysqlSslConfig::new().set_client_certificate_set(true);
6646    /// ```
6647    pub fn set_client_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6648        self.client_certificate_set = v.into();
6649        self
6650    }
6651
6652    /// Sets the value of [ca_certificate][crate::model::MysqlSslConfig::ca_certificate].
6653    ///
6654    /// # Example
6655    /// ```ignore,no_run
6656    /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6657    /// let x = MysqlSslConfig::new().set_ca_certificate("example");
6658    /// ```
6659    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6660        self.ca_certificate = v.into();
6661        self
6662    }
6663
6664    /// Sets the value of [ca_certificate_set][crate::model::MysqlSslConfig::ca_certificate_set].
6665    ///
6666    /// # Example
6667    /// ```ignore,no_run
6668    /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6669    /// let x = MysqlSslConfig::new().set_ca_certificate_set(true);
6670    /// ```
6671    pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6672        self.ca_certificate_set = v.into();
6673        self
6674    }
6675}
6676
6677impl wkt::message::Message for MysqlSslConfig {
6678    fn typename() -> &'static str {
6679        "type.googleapis.com/google.cloud.datastream.v1.MysqlSslConfig"
6680    }
6681}
6682
6683/// Oracle SSL configuration information.
6684#[derive(Clone, Default, PartialEq)]
6685#[non_exhaustive]
6686pub struct OracleSslConfig {
6687    /// Input only. PEM-encoded certificate of the CA that signed the source
6688    /// database server's certificate.
6689    pub ca_certificate: std::string::String,
6690
6691    /// Output only. Indicates whether the ca_certificate field has been set for
6692    /// this Connection-Profile.
6693    pub ca_certificate_set: bool,
6694
6695    /// Optional. The distinguished name (DN) mentioned in the server
6696    /// certificate. This corresponds to SSL_SERVER_CERT_DN sqlnet parameter.
6697    /// Refer
6698    /// <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>
6699    /// If this field is not provided, the DN matching is not enforced.
6700    pub server_certificate_distinguished_name: std::string::String,
6701
6702    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6703}
6704
6705impl OracleSslConfig {
6706    pub fn new() -> Self {
6707        std::default::Default::default()
6708    }
6709
6710    /// Sets the value of [ca_certificate][crate::model::OracleSslConfig::ca_certificate].
6711    ///
6712    /// # Example
6713    /// ```ignore,no_run
6714    /// # use google_cloud_datastream_v1::model::OracleSslConfig;
6715    /// let x = OracleSslConfig::new().set_ca_certificate("example");
6716    /// ```
6717    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6718        self.ca_certificate = v.into();
6719        self
6720    }
6721
6722    /// Sets the value of [ca_certificate_set][crate::model::OracleSslConfig::ca_certificate_set].
6723    ///
6724    /// # Example
6725    /// ```ignore,no_run
6726    /// # use google_cloud_datastream_v1::model::OracleSslConfig;
6727    /// let x = OracleSslConfig::new().set_ca_certificate_set(true);
6728    /// ```
6729    pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6730        self.ca_certificate_set = v.into();
6731        self
6732    }
6733
6734    /// Sets the value of [server_certificate_distinguished_name][crate::model::OracleSslConfig::server_certificate_distinguished_name].
6735    ///
6736    /// # Example
6737    /// ```ignore,no_run
6738    /// # use google_cloud_datastream_v1::model::OracleSslConfig;
6739    /// let x = OracleSslConfig::new().set_server_certificate_distinguished_name("example");
6740    /// ```
6741    pub fn set_server_certificate_distinguished_name<T: std::convert::Into<std::string::String>>(
6742        mut self,
6743        v: T,
6744    ) -> Self {
6745        self.server_certificate_distinguished_name = v.into();
6746        self
6747    }
6748}
6749
6750impl wkt::message::Message for OracleSslConfig {
6751    fn typename() -> &'static str {
6752        "type.googleapis.com/google.cloud.datastream.v1.OracleSslConfig"
6753    }
6754}
6755
6756/// PostgreSQL SSL configuration information.
6757#[derive(Clone, Default, PartialEq)]
6758#[non_exhaustive]
6759pub struct PostgresqlSslConfig {
6760    /// The encryption settings available for PostgreSQL connection profiles.
6761    /// This captures various SSL mode supported by PostgreSQL, which includes
6762    /// TLS encryption with server verification, TLS encryption with both server
6763    /// and client verification and no TLS encryption.
6764    pub encryption_setting:
6765        std::option::Option<crate::model::postgresql_ssl_config::EncryptionSetting>,
6766
6767    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6768}
6769
6770impl PostgresqlSslConfig {
6771    pub fn new() -> Self {
6772        std::default::Default::default()
6773    }
6774
6775    /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting].
6776    ///
6777    /// Note that all the setters affecting `encryption_setting` are mutually
6778    /// exclusive.
6779    ///
6780    /// # Example
6781    /// ```ignore,no_run
6782    /// # use google_cloud_datastream_v1::model::PostgresqlSslConfig;
6783    /// use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerVerification;
6784    /// let x = PostgresqlSslConfig::new().set_encryption_setting(Some(
6785    ///     google_cloud_datastream_v1::model::postgresql_ssl_config::EncryptionSetting::ServerVerification(ServerVerification::default().into())));
6786    /// ```
6787    pub fn set_encryption_setting<
6788        T: std::convert::Into<
6789                std::option::Option<crate::model::postgresql_ssl_config::EncryptionSetting>,
6790            >,
6791    >(
6792        mut self,
6793        v: T,
6794    ) -> Self {
6795        self.encryption_setting = v.into();
6796        self
6797    }
6798
6799    /// The value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
6800    /// if it holds a `ServerVerification`, `None` if the field is not set or
6801    /// holds a different branch.
6802    pub fn server_verification(
6803        &self,
6804    ) -> std::option::Option<
6805        &std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
6806    > {
6807        #[allow(unreachable_patterns)]
6808        self.encryption_setting.as_ref().and_then(|v| match v {
6809            crate::model::postgresql_ssl_config::EncryptionSetting::ServerVerification(v) => {
6810                std::option::Option::Some(v)
6811            }
6812            _ => std::option::Option::None,
6813        })
6814    }
6815
6816    /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
6817    /// to hold a `ServerVerification`.
6818    ///
6819    /// Note that all the setters affecting `encryption_setting` are
6820    /// mutually exclusive.
6821    ///
6822    /// # Example
6823    /// ```ignore,no_run
6824    /// # use google_cloud_datastream_v1::model::PostgresqlSslConfig;
6825    /// use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerVerification;
6826    /// let x = PostgresqlSslConfig::new().set_server_verification(ServerVerification::default()/* use setters */);
6827    /// assert!(x.server_verification().is_some());
6828    /// assert!(x.server_and_client_verification().is_none());
6829    /// ```
6830    pub fn set_server_verification<
6831        T: std::convert::Into<
6832                std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
6833            >,
6834    >(
6835        mut self,
6836        v: T,
6837    ) -> Self {
6838        self.encryption_setting = std::option::Option::Some(
6839            crate::model::postgresql_ssl_config::EncryptionSetting::ServerVerification(v.into()),
6840        );
6841        self
6842    }
6843
6844    /// The value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
6845    /// if it holds a `ServerAndClientVerification`, `None` if the field is not set or
6846    /// holds a different branch.
6847    pub fn server_and_client_verification(
6848        &self,
6849    ) -> std::option::Option<
6850        &std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
6851    > {
6852        #[allow(unreachable_patterns)]
6853        self.encryption_setting.as_ref().and_then(|v| match v {
6854            crate::model::postgresql_ssl_config::EncryptionSetting::ServerAndClientVerification(
6855                v,
6856            ) => std::option::Option::Some(v),
6857            _ => std::option::Option::None,
6858        })
6859    }
6860
6861    /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
6862    /// to hold a `ServerAndClientVerification`.
6863    ///
6864    /// Note that all the setters affecting `encryption_setting` are
6865    /// mutually exclusive.
6866    ///
6867    /// # Example
6868    /// ```ignore,no_run
6869    /// # use google_cloud_datastream_v1::model::PostgresqlSslConfig;
6870    /// use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
6871    /// let x = PostgresqlSslConfig::new().set_server_and_client_verification(ServerAndClientVerification::default()/* use setters */);
6872    /// assert!(x.server_and_client_verification().is_some());
6873    /// assert!(x.server_verification().is_none());
6874    /// ```
6875    pub fn set_server_and_client_verification<
6876        T: std::convert::Into<
6877                std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
6878            >,
6879    >(
6880        mut self,
6881        v: T,
6882    ) -> Self {
6883        self.encryption_setting = std::option::Option::Some(
6884            crate::model::postgresql_ssl_config::EncryptionSetting::ServerAndClientVerification(
6885                v.into(),
6886            ),
6887        );
6888        self
6889    }
6890}
6891
6892impl wkt::message::Message for PostgresqlSslConfig {
6893    fn typename() -> &'static str {
6894        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig"
6895    }
6896}
6897
6898/// Defines additional types related to [PostgresqlSslConfig].
6899pub mod postgresql_ssl_config {
6900    #[allow(unused_imports)]
6901    use super::*;
6902
6903    /// Message represents the option where Datastream will enforce the encryption
6904    /// and authenticate the server identity. ca_certificate must be set if user
6905    /// selects this option.
6906    #[derive(Clone, Default, PartialEq)]
6907    #[non_exhaustive]
6908    pub struct ServerVerification {
6909        /// Required. Input only. PEM-encoded server root CA certificate.
6910        pub ca_certificate: std::string::String,
6911
6912        /// Optional. The hostname mentioned in the Subject or SAN extension of the
6913        /// server certificate. If this field is not provided, the hostname in the
6914        /// server certificate is not validated.
6915        pub server_certificate_hostname: std::string::String,
6916
6917        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6918    }
6919
6920    impl ServerVerification {
6921        pub fn new() -> Self {
6922            std::default::Default::default()
6923        }
6924
6925        /// Sets the value of [ca_certificate][crate::model::postgresql_ssl_config::ServerVerification::ca_certificate].
6926        ///
6927        /// # Example
6928        /// ```ignore,no_run
6929        /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerVerification;
6930        /// let x = ServerVerification::new().set_ca_certificate("example");
6931        /// ```
6932        pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(
6933            mut self,
6934            v: T,
6935        ) -> Self {
6936            self.ca_certificate = v.into();
6937            self
6938        }
6939
6940        /// Sets the value of [server_certificate_hostname][crate::model::postgresql_ssl_config::ServerVerification::server_certificate_hostname].
6941        ///
6942        /// # Example
6943        /// ```ignore,no_run
6944        /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerVerification;
6945        /// let x = ServerVerification::new().set_server_certificate_hostname("example");
6946        /// ```
6947        pub fn set_server_certificate_hostname<T: std::convert::Into<std::string::String>>(
6948            mut self,
6949            v: T,
6950        ) -> Self {
6951            self.server_certificate_hostname = v.into();
6952            self
6953        }
6954    }
6955
6956    impl wkt::message::Message for ServerVerification {
6957        fn typename() -> &'static str {
6958            "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig.ServerVerification"
6959        }
6960    }
6961
6962    /// Message represents the option where Datastream will enforce the encryption
6963    /// and authenticate the server identity as well as the client identity.
6964    /// ca_certificate, client_certificate and client_key must be set if user
6965    /// selects this option.
6966    #[derive(Clone, Default, PartialEq)]
6967    #[non_exhaustive]
6968    pub struct ServerAndClientVerification {
6969        /// Required. Input only. PEM-encoded certificate used by the source database
6970        /// to authenticate the client identity (i.e., the Datastream's identity).
6971        /// This certificate is signed by either a root certificate trusted by the
6972        /// server or one or more intermediate certificates (which is stored with the
6973        /// leaf certificate) to link the this certificate to the trusted root
6974        /// certificate.
6975        pub client_certificate: std::string::String,
6976
6977        /// Optional. Input only. PEM-encoded private key associated with the client
6978        /// certificate. This value will be used during the SSL/TLS handshake,
6979        /// allowing the PostgreSQL server to authenticate the client's identity,
6980        /// i.e. identity of the Datastream.
6981        pub client_key: std::string::String,
6982
6983        /// Required. Input only. PEM-encoded server root CA certificate.
6984        pub ca_certificate: std::string::String,
6985
6986        /// Optional. The hostname mentioned in the Subject or SAN extension of the
6987        /// server certificate. If this field is not provided, the hostname in the
6988        /// server certificate is not validated.
6989        pub server_certificate_hostname: std::string::String,
6990
6991        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6992    }
6993
6994    impl ServerAndClientVerification {
6995        pub fn new() -> Self {
6996            std::default::Default::default()
6997        }
6998
6999        /// Sets the value of [client_certificate][crate::model::postgresql_ssl_config::ServerAndClientVerification::client_certificate].
7000        ///
7001        /// # Example
7002        /// ```ignore,no_run
7003        /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
7004        /// let x = ServerAndClientVerification::new().set_client_certificate("example");
7005        /// ```
7006        pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
7007            mut self,
7008            v: T,
7009        ) -> Self {
7010            self.client_certificate = v.into();
7011            self
7012        }
7013
7014        /// Sets the value of [client_key][crate::model::postgresql_ssl_config::ServerAndClientVerification::client_key].
7015        ///
7016        /// # Example
7017        /// ```ignore,no_run
7018        /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
7019        /// let x = ServerAndClientVerification::new().set_client_key("example");
7020        /// ```
7021        pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7022            self.client_key = v.into();
7023            self
7024        }
7025
7026        /// Sets the value of [ca_certificate][crate::model::postgresql_ssl_config::ServerAndClientVerification::ca_certificate].
7027        ///
7028        /// # Example
7029        /// ```ignore,no_run
7030        /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
7031        /// let x = ServerAndClientVerification::new().set_ca_certificate("example");
7032        /// ```
7033        pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(
7034            mut self,
7035            v: T,
7036        ) -> Self {
7037            self.ca_certificate = v.into();
7038            self
7039        }
7040
7041        /// Sets the value of [server_certificate_hostname][crate::model::postgresql_ssl_config::ServerAndClientVerification::server_certificate_hostname].
7042        ///
7043        /// # Example
7044        /// ```ignore,no_run
7045        /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
7046        /// let x = ServerAndClientVerification::new().set_server_certificate_hostname("example");
7047        /// ```
7048        pub fn set_server_certificate_hostname<T: std::convert::Into<std::string::String>>(
7049            mut self,
7050            v: T,
7051        ) -> Self {
7052            self.server_certificate_hostname = v.into();
7053            self
7054        }
7055    }
7056
7057    impl wkt::message::Message for ServerAndClientVerification {
7058        fn typename() -> &'static str {
7059            "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig.ServerAndClientVerification"
7060        }
7061    }
7062
7063    /// The encryption settings available for PostgreSQL connection profiles.
7064    /// This captures various SSL mode supported by PostgreSQL, which includes
7065    /// TLS encryption with server verification, TLS encryption with both server
7066    /// and client verification and no TLS encryption.
7067    #[derive(Clone, Debug, PartialEq)]
7068    #[non_exhaustive]
7069    pub enum EncryptionSetting {
7070        ///  If this field is set, the communication will be encrypted with TLS
7071        /// encryption and the server identity will be authenticated.
7072        ServerVerification(
7073            std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
7074        ),
7075        /// If this field is set, the communication will be encrypted with TLS
7076        /// encryption and both the server identity and the client identity will be
7077        /// authenticated.
7078        ServerAndClientVerification(
7079            std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
7080        ),
7081    }
7082}
7083
7084/// A set of reusable connection configurations to be used as a source or
7085/// destination for a stream.
7086#[derive(Clone, Default, PartialEq)]
7087#[non_exhaustive]
7088pub struct ConnectionProfile {
7089    /// Output only. Identifier. The resource's name.
7090    pub name: std::string::String,
7091
7092    /// Output only. The create time of the resource.
7093    pub create_time: std::option::Option<wkt::Timestamp>,
7094
7095    /// Output only. The update time of the resource.
7096    pub update_time: std::option::Option<wkt::Timestamp>,
7097
7098    /// Labels.
7099    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7100
7101    /// Required. Display name.
7102    pub display_name: std::string::String,
7103
7104    /// Output only. Reserved for future use.
7105    pub satisfies_pzs: std::option::Option<bool>,
7106
7107    /// Output only. Reserved for future use.
7108    pub satisfies_pzi: std::option::Option<bool>,
7109
7110    /// Connection configuration for the ConnectionProfile.
7111    pub profile: std::option::Option<crate::model::connection_profile::Profile>,
7112
7113    /// Connectivity options used to establish a connection to the profile.
7114    pub connectivity: std::option::Option<crate::model::connection_profile::Connectivity>,
7115
7116    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7117}
7118
7119impl ConnectionProfile {
7120    pub fn new() -> Self {
7121        std::default::Default::default()
7122    }
7123
7124    /// Sets the value of [name][crate::model::ConnectionProfile::name].
7125    ///
7126    /// # Example
7127    /// ```ignore,no_run
7128    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7129    /// let x = ConnectionProfile::new().set_name("example");
7130    /// ```
7131    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7132        self.name = v.into();
7133        self
7134    }
7135
7136    /// Sets the value of [create_time][crate::model::ConnectionProfile::create_time].
7137    ///
7138    /// # Example
7139    /// ```ignore,no_run
7140    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7141    /// use wkt::Timestamp;
7142    /// let x = ConnectionProfile::new().set_create_time(Timestamp::default()/* use setters */);
7143    /// ```
7144    pub fn set_create_time<T>(mut self, v: T) -> Self
7145    where
7146        T: std::convert::Into<wkt::Timestamp>,
7147    {
7148        self.create_time = std::option::Option::Some(v.into());
7149        self
7150    }
7151
7152    /// Sets or clears the value of [create_time][crate::model::ConnectionProfile::create_time].
7153    ///
7154    /// # Example
7155    /// ```ignore,no_run
7156    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7157    /// use wkt::Timestamp;
7158    /// let x = ConnectionProfile::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7159    /// let x = ConnectionProfile::new().set_or_clear_create_time(None::<Timestamp>);
7160    /// ```
7161    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7162    where
7163        T: std::convert::Into<wkt::Timestamp>,
7164    {
7165        self.create_time = v.map(|x| x.into());
7166        self
7167    }
7168
7169    /// Sets the value of [update_time][crate::model::ConnectionProfile::update_time].
7170    ///
7171    /// # Example
7172    /// ```ignore,no_run
7173    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7174    /// use wkt::Timestamp;
7175    /// let x = ConnectionProfile::new().set_update_time(Timestamp::default()/* use setters */);
7176    /// ```
7177    pub fn set_update_time<T>(mut self, v: T) -> Self
7178    where
7179        T: std::convert::Into<wkt::Timestamp>,
7180    {
7181        self.update_time = std::option::Option::Some(v.into());
7182        self
7183    }
7184
7185    /// Sets or clears the value of [update_time][crate::model::ConnectionProfile::update_time].
7186    ///
7187    /// # Example
7188    /// ```ignore,no_run
7189    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7190    /// use wkt::Timestamp;
7191    /// let x = ConnectionProfile::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7192    /// let x = ConnectionProfile::new().set_or_clear_update_time(None::<Timestamp>);
7193    /// ```
7194    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7195    where
7196        T: std::convert::Into<wkt::Timestamp>,
7197    {
7198        self.update_time = v.map(|x| x.into());
7199        self
7200    }
7201
7202    /// Sets the value of [labels][crate::model::ConnectionProfile::labels].
7203    ///
7204    /// # Example
7205    /// ```ignore,no_run
7206    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7207    /// let x = ConnectionProfile::new().set_labels([
7208    ///     ("key0", "abc"),
7209    ///     ("key1", "xyz"),
7210    /// ]);
7211    /// ```
7212    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7213    where
7214        T: std::iter::IntoIterator<Item = (K, V)>,
7215        K: std::convert::Into<std::string::String>,
7216        V: std::convert::Into<std::string::String>,
7217    {
7218        use std::iter::Iterator;
7219        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7220        self
7221    }
7222
7223    /// Sets the value of [display_name][crate::model::ConnectionProfile::display_name].
7224    ///
7225    /// # Example
7226    /// ```ignore,no_run
7227    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7228    /// let x = ConnectionProfile::new().set_display_name("example");
7229    /// ```
7230    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7231        self.display_name = v.into();
7232        self
7233    }
7234
7235    /// Sets the value of [satisfies_pzs][crate::model::ConnectionProfile::satisfies_pzs].
7236    ///
7237    /// # Example
7238    /// ```ignore,no_run
7239    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7240    /// let x = ConnectionProfile::new().set_satisfies_pzs(true);
7241    /// ```
7242    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
7243    where
7244        T: std::convert::Into<bool>,
7245    {
7246        self.satisfies_pzs = std::option::Option::Some(v.into());
7247        self
7248    }
7249
7250    /// Sets or clears the value of [satisfies_pzs][crate::model::ConnectionProfile::satisfies_pzs].
7251    ///
7252    /// # Example
7253    /// ```ignore,no_run
7254    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7255    /// let x = ConnectionProfile::new().set_or_clear_satisfies_pzs(Some(false));
7256    /// let x = ConnectionProfile::new().set_or_clear_satisfies_pzs(None::<bool>);
7257    /// ```
7258    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
7259    where
7260        T: std::convert::Into<bool>,
7261    {
7262        self.satisfies_pzs = v.map(|x| x.into());
7263        self
7264    }
7265
7266    /// Sets the value of [satisfies_pzi][crate::model::ConnectionProfile::satisfies_pzi].
7267    ///
7268    /// # Example
7269    /// ```ignore,no_run
7270    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7271    /// let x = ConnectionProfile::new().set_satisfies_pzi(true);
7272    /// ```
7273    pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
7274    where
7275        T: std::convert::Into<bool>,
7276    {
7277        self.satisfies_pzi = std::option::Option::Some(v.into());
7278        self
7279    }
7280
7281    /// Sets or clears the value of [satisfies_pzi][crate::model::ConnectionProfile::satisfies_pzi].
7282    ///
7283    /// # Example
7284    /// ```ignore,no_run
7285    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7286    /// let x = ConnectionProfile::new().set_or_clear_satisfies_pzi(Some(false));
7287    /// let x = ConnectionProfile::new().set_or_clear_satisfies_pzi(None::<bool>);
7288    /// ```
7289    pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
7290    where
7291        T: std::convert::Into<bool>,
7292    {
7293        self.satisfies_pzi = v.map(|x| x.into());
7294        self
7295    }
7296
7297    /// Sets the value of [profile][crate::model::ConnectionProfile::profile].
7298    ///
7299    /// Note that all the setters affecting `profile` are mutually
7300    /// exclusive.
7301    ///
7302    /// # Example
7303    /// ```ignore,no_run
7304    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7305    /// use google_cloud_datastream_v1::model::OracleProfile;
7306    /// let x = ConnectionProfile::new().set_profile(Some(
7307    ///     google_cloud_datastream_v1::model::connection_profile::Profile::OracleProfile(OracleProfile::default().into())));
7308    /// ```
7309    pub fn set_profile<
7310        T: std::convert::Into<std::option::Option<crate::model::connection_profile::Profile>>,
7311    >(
7312        mut self,
7313        v: T,
7314    ) -> Self {
7315        self.profile = v.into();
7316        self
7317    }
7318
7319    /// The value of [profile][crate::model::ConnectionProfile::profile]
7320    /// if it holds a `OracleProfile`, `None` if the field is not set or
7321    /// holds a different branch.
7322    pub fn oracle_profile(
7323        &self,
7324    ) -> std::option::Option<&std::boxed::Box<crate::model::OracleProfile>> {
7325        #[allow(unreachable_patterns)]
7326        self.profile.as_ref().and_then(|v| match v {
7327            crate::model::connection_profile::Profile::OracleProfile(v) => {
7328                std::option::Option::Some(v)
7329            }
7330            _ => std::option::Option::None,
7331        })
7332    }
7333
7334    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7335    /// to hold a `OracleProfile`.
7336    ///
7337    /// Note that all the setters affecting `profile` are
7338    /// mutually exclusive.
7339    ///
7340    /// # Example
7341    /// ```ignore,no_run
7342    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7343    /// use google_cloud_datastream_v1::model::OracleProfile;
7344    /// let x = ConnectionProfile::new().set_oracle_profile(OracleProfile::default()/* use setters */);
7345    /// assert!(x.oracle_profile().is_some());
7346    /// assert!(x.gcs_profile().is_none());
7347    /// assert!(x.mysql_profile().is_none());
7348    /// assert!(x.bigquery_profile().is_none());
7349    /// assert!(x.postgresql_profile().is_none());
7350    /// assert!(x.sql_server_profile().is_none());
7351    /// assert!(x.salesforce_profile().is_none());
7352    /// assert!(x.mongodb_profile().is_none());
7353    /// ```
7354    pub fn set_oracle_profile<
7355        T: std::convert::Into<std::boxed::Box<crate::model::OracleProfile>>,
7356    >(
7357        mut self,
7358        v: T,
7359    ) -> Self {
7360        self.profile = std::option::Option::Some(
7361            crate::model::connection_profile::Profile::OracleProfile(v.into()),
7362        );
7363        self
7364    }
7365
7366    /// The value of [profile][crate::model::ConnectionProfile::profile]
7367    /// if it holds a `GcsProfile`, `None` if the field is not set or
7368    /// holds a different branch.
7369    pub fn gcs_profile(&self) -> std::option::Option<&std::boxed::Box<crate::model::GcsProfile>> {
7370        #[allow(unreachable_patterns)]
7371        self.profile.as_ref().and_then(|v| match v {
7372            crate::model::connection_profile::Profile::GcsProfile(v) => {
7373                std::option::Option::Some(v)
7374            }
7375            _ => std::option::Option::None,
7376        })
7377    }
7378
7379    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7380    /// to hold a `GcsProfile`.
7381    ///
7382    /// Note that all the setters affecting `profile` are
7383    /// mutually exclusive.
7384    ///
7385    /// # Example
7386    /// ```ignore,no_run
7387    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7388    /// use google_cloud_datastream_v1::model::GcsProfile;
7389    /// let x = ConnectionProfile::new().set_gcs_profile(GcsProfile::default()/* use setters */);
7390    /// assert!(x.gcs_profile().is_some());
7391    /// assert!(x.oracle_profile().is_none());
7392    /// assert!(x.mysql_profile().is_none());
7393    /// assert!(x.bigquery_profile().is_none());
7394    /// assert!(x.postgresql_profile().is_none());
7395    /// assert!(x.sql_server_profile().is_none());
7396    /// assert!(x.salesforce_profile().is_none());
7397    /// assert!(x.mongodb_profile().is_none());
7398    /// ```
7399    pub fn set_gcs_profile<T: std::convert::Into<std::boxed::Box<crate::model::GcsProfile>>>(
7400        mut self,
7401        v: T,
7402    ) -> Self {
7403        self.profile = std::option::Option::Some(
7404            crate::model::connection_profile::Profile::GcsProfile(v.into()),
7405        );
7406        self
7407    }
7408
7409    /// The value of [profile][crate::model::ConnectionProfile::profile]
7410    /// if it holds a `MysqlProfile`, `None` if the field is not set or
7411    /// holds a different branch.
7412    pub fn mysql_profile(
7413        &self,
7414    ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlProfile>> {
7415        #[allow(unreachable_patterns)]
7416        self.profile.as_ref().and_then(|v| match v {
7417            crate::model::connection_profile::Profile::MysqlProfile(v) => {
7418                std::option::Option::Some(v)
7419            }
7420            _ => std::option::Option::None,
7421        })
7422    }
7423
7424    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7425    /// to hold a `MysqlProfile`.
7426    ///
7427    /// Note that all the setters affecting `profile` are
7428    /// mutually exclusive.
7429    ///
7430    /// # Example
7431    /// ```ignore,no_run
7432    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7433    /// use google_cloud_datastream_v1::model::MysqlProfile;
7434    /// let x = ConnectionProfile::new().set_mysql_profile(MysqlProfile::default()/* use setters */);
7435    /// assert!(x.mysql_profile().is_some());
7436    /// assert!(x.oracle_profile().is_none());
7437    /// assert!(x.gcs_profile().is_none());
7438    /// assert!(x.bigquery_profile().is_none());
7439    /// assert!(x.postgresql_profile().is_none());
7440    /// assert!(x.sql_server_profile().is_none());
7441    /// assert!(x.salesforce_profile().is_none());
7442    /// assert!(x.mongodb_profile().is_none());
7443    /// ```
7444    pub fn set_mysql_profile<T: std::convert::Into<std::boxed::Box<crate::model::MysqlProfile>>>(
7445        mut self,
7446        v: T,
7447    ) -> Self {
7448        self.profile = std::option::Option::Some(
7449            crate::model::connection_profile::Profile::MysqlProfile(v.into()),
7450        );
7451        self
7452    }
7453
7454    /// The value of [profile][crate::model::ConnectionProfile::profile]
7455    /// if it holds a `BigqueryProfile`, `None` if the field is not set or
7456    /// holds a different branch.
7457    pub fn bigquery_profile(
7458        &self,
7459    ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryProfile>> {
7460        #[allow(unreachable_patterns)]
7461        self.profile.as_ref().and_then(|v| match v {
7462            crate::model::connection_profile::Profile::BigqueryProfile(v) => {
7463                std::option::Option::Some(v)
7464            }
7465            _ => std::option::Option::None,
7466        })
7467    }
7468
7469    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7470    /// to hold a `BigqueryProfile`.
7471    ///
7472    /// Note that all the setters affecting `profile` are
7473    /// mutually exclusive.
7474    ///
7475    /// # Example
7476    /// ```ignore,no_run
7477    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7478    /// use google_cloud_datastream_v1::model::BigQueryProfile;
7479    /// let x = ConnectionProfile::new().set_bigquery_profile(BigQueryProfile::default()/* use setters */);
7480    /// assert!(x.bigquery_profile().is_some());
7481    /// assert!(x.oracle_profile().is_none());
7482    /// assert!(x.gcs_profile().is_none());
7483    /// assert!(x.mysql_profile().is_none());
7484    /// assert!(x.postgresql_profile().is_none());
7485    /// assert!(x.sql_server_profile().is_none());
7486    /// assert!(x.salesforce_profile().is_none());
7487    /// assert!(x.mongodb_profile().is_none());
7488    /// ```
7489    pub fn set_bigquery_profile<
7490        T: std::convert::Into<std::boxed::Box<crate::model::BigQueryProfile>>,
7491    >(
7492        mut self,
7493        v: T,
7494    ) -> Self {
7495        self.profile = std::option::Option::Some(
7496            crate::model::connection_profile::Profile::BigqueryProfile(v.into()),
7497        );
7498        self
7499    }
7500
7501    /// The value of [profile][crate::model::ConnectionProfile::profile]
7502    /// if it holds a `PostgresqlProfile`, `None` if the field is not set or
7503    /// holds a different branch.
7504    pub fn postgresql_profile(
7505        &self,
7506    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlProfile>> {
7507        #[allow(unreachable_patterns)]
7508        self.profile.as_ref().and_then(|v| match v {
7509            crate::model::connection_profile::Profile::PostgresqlProfile(v) => {
7510                std::option::Option::Some(v)
7511            }
7512            _ => std::option::Option::None,
7513        })
7514    }
7515
7516    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7517    /// to hold a `PostgresqlProfile`.
7518    ///
7519    /// Note that all the setters affecting `profile` are
7520    /// mutually exclusive.
7521    ///
7522    /// # Example
7523    /// ```ignore,no_run
7524    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7525    /// use google_cloud_datastream_v1::model::PostgresqlProfile;
7526    /// let x = ConnectionProfile::new().set_postgresql_profile(PostgresqlProfile::default()/* use setters */);
7527    /// assert!(x.postgresql_profile().is_some());
7528    /// assert!(x.oracle_profile().is_none());
7529    /// assert!(x.gcs_profile().is_none());
7530    /// assert!(x.mysql_profile().is_none());
7531    /// assert!(x.bigquery_profile().is_none());
7532    /// assert!(x.sql_server_profile().is_none());
7533    /// assert!(x.salesforce_profile().is_none());
7534    /// assert!(x.mongodb_profile().is_none());
7535    /// ```
7536    pub fn set_postgresql_profile<
7537        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlProfile>>,
7538    >(
7539        mut self,
7540        v: T,
7541    ) -> Self {
7542        self.profile = std::option::Option::Some(
7543            crate::model::connection_profile::Profile::PostgresqlProfile(v.into()),
7544        );
7545        self
7546    }
7547
7548    /// The value of [profile][crate::model::ConnectionProfile::profile]
7549    /// if it holds a `SqlServerProfile`, `None` if the field is not set or
7550    /// holds a different branch.
7551    pub fn sql_server_profile(
7552        &self,
7553    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerProfile>> {
7554        #[allow(unreachable_patterns)]
7555        self.profile.as_ref().and_then(|v| match v {
7556            crate::model::connection_profile::Profile::SqlServerProfile(v) => {
7557                std::option::Option::Some(v)
7558            }
7559            _ => std::option::Option::None,
7560        })
7561    }
7562
7563    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7564    /// to hold a `SqlServerProfile`.
7565    ///
7566    /// Note that all the setters affecting `profile` are
7567    /// mutually exclusive.
7568    ///
7569    /// # Example
7570    /// ```ignore,no_run
7571    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7572    /// use google_cloud_datastream_v1::model::SqlServerProfile;
7573    /// let x = ConnectionProfile::new().set_sql_server_profile(SqlServerProfile::default()/* use setters */);
7574    /// assert!(x.sql_server_profile().is_some());
7575    /// assert!(x.oracle_profile().is_none());
7576    /// assert!(x.gcs_profile().is_none());
7577    /// assert!(x.mysql_profile().is_none());
7578    /// assert!(x.bigquery_profile().is_none());
7579    /// assert!(x.postgresql_profile().is_none());
7580    /// assert!(x.salesforce_profile().is_none());
7581    /// assert!(x.mongodb_profile().is_none());
7582    /// ```
7583    pub fn set_sql_server_profile<
7584        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerProfile>>,
7585    >(
7586        mut self,
7587        v: T,
7588    ) -> Self {
7589        self.profile = std::option::Option::Some(
7590            crate::model::connection_profile::Profile::SqlServerProfile(v.into()),
7591        );
7592        self
7593    }
7594
7595    /// The value of [profile][crate::model::ConnectionProfile::profile]
7596    /// if it holds a `SalesforceProfile`, `None` if the field is not set or
7597    /// holds a different branch.
7598    pub fn salesforce_profile(
7599        &self,
7600    ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceProfile>> {
7601        #[allow(unreachable_patterns)]
7602        self.profile.as_ref().and_then(|v| match v {
7603            crate::model::connection_profile::Profile::SalesforceProfile(v) => {
7604                std::option::Option::Some(v)
7605            }
7606            _ => std::option::Option::None,
7607        })
7608    }
7609
7610    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7611    /// to hold a `SalesforceProfile`.
7612    ///
7613    /// Note that all the setters affecting `profile` are
7614    /// mutually exclusive.
7615    ///
7616    /// # Example
7617    /// ```ignore,no_run
7618    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7619    /// use google_cloud_datastream_v1::model::SalesforceProfile;
7620    /// let x = ConnectionProfile::new().set_salesforce_profile(SalesforceProfile::default()/* use setters */);
7621    /// assert!(x.salesforce_profile().is_some());
7622    /// assert!(x.oracle_profile().is_none());
7623    /// assert!(x.gcs_profile().is_none());
7624    /// assert!(x.mysql_profile().is_none());
7625    /// assert!(x.bigquery_profile().is_none());
7626    /// assert!(x.postgresql_profile().is_none());
7627    /// assert!(x.sql_server_profile().is_none());
7628    /// assert!(x.mongodb_profile().is_none());
7629    /// ```
7630    pub fn set_salesforce_profile<
7631        T: std::convert::Into<std::boxed::Box<crate::model::SalesforceProfile>>,
7632    >(
7633        mut self,
7634        v: T,
7635    ) -> Self {
7636        self.profile = std::option::Option::Some(
7637            crate::model::connection_profile::Profile::SalesforceProfile(v.into()),
7638        );
7639        self
7640    }
7641
7642    /// The value of [profile][crate::model::ConnectionProfile::profile]
7643    /// if it holds a `MongodbProfile`, `None` if the field is not set or
7644    /// holds a different branch.
7645    pub fn mongodb_profile(
7646        &self,
7647    ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbProfile>> {
7648        #[allow(unreachable_patterns)]
7649        self.profile.as_ref().and_then(|v| match v {
7650            crate::model::connection_profile::Profile::MongodbProfile(v) => {
7651                std::option::Option::Some(v)
7652            }
7653            _ => std::option::Option::None,
7654        })
7655    }
7656
7657    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7658    /// to hold a `MongodbProfile`.
7659    ///
7660    /// Note that all the setters affecting `profile` are
7661    /// mutually exclusive.
7662    ///
7663    /// # Example
7664    /// ```ignore,no_run
7665    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7666    /// use google_cloud_datastream_v1::model::MongodbProfile;
7667    /// let x = ConnectionProfile::new().set_mongodb_profile(MongodbProfile::default()/* use setters */);
7668    /// assert!(x.mongodb_profile().is_some());
7669    /// assert!(x.oracle_profile().is_none());
7670    /// assert!(x.gcs_profile().is_none());
7671    /// assert!(x.mysql_profile().is_none());
7672    /// assert!(x.bigquery_profile().is_none());
7673    /// assert!(x.postgresql_profile().is_none());
7674    /// assert!(x.sql_server_profile().is_none());
7675    /// assert!(x.salesforce_profile().is_none());
7676    /// ```
7677    pub fn set_mongodb_profile<
7678        T: std::convert::Into<std::boxed::Box<crate::model::MongodbProfile>>,
7679    >(
7680        mut self,
7681        v: T,
7682    ) -> Self {
7683        self.profile = std::option::Option::Some(
7684            crate::model::connection_profile::Profile::MongodbProfile(v.into()),
7685        );
7686        self
7687    }
7688
7689    /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity].
7690    ///
7691    /// Note that all the setters affecting `connectivity` are mutually
7692    /// exclusive.
7693    ///
7694    /// # Example
7695    /// ```ignore,no_run
7696    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7697    /// use google_cloud_datastream_v1::model::StaticServiceIpConnectivity;
7698    /// let x = ConnectionProfile::new().set_connectivity(Some(
7699    ///     google_cloud_datastream_v1::model::connection_profile::Connectivity::StaticServiceIpConnectivity(StaticServiceIpConnectivity::default().into())));
7700    /// ```
7701    pub fn set_connectivity<
7702        T: std::convert::Into<std::option::Option<crate::model::connection_profile::Connectivity>>,
7703    >(
7704        mut self,
7705        v: T,
7706    ) -> Self {
7707        self.connectivity = v.into();
7708        self
7709    }
7710
7711    /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
7712    /// if it holds a `StaticServiceIpConnectivity`, `None` if the field is not set or
7713    /// holds a different branch.
7714    pub fn static_service_ip_connectivity(
7715        &self,
7716    ) -> std::option::Option<&std::boxed::Box<crate::model::StaticServiceIpConnectivity>> {
7717        #[allow(unreachable_patterns)]
7718        self.connectivity.as_ref().and_then(|v| match v {
7719            crate::model::connection_profile::Connectivity::StaticServiceIpConnectivity(v) => {
7720                std::option::Option::Some(v)
7721            }
7722            _ => std::option::Option::None,
7723        })
7724    }
7725
7726    /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
7727    /// to hold a `StaticServiceIpConnectivity`.
7728    ///
7729    /// Note that all the setters affecting `connectivity` are
7730    /// mutually exclusive.
7731    ///
7732    /// # Example
7733    /// ```ignore,no_run
7734    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7735    /// use google_cloud_datastream_v1::model::StaticServiceIpConnectivity;
7736    /// let x = ConnectionProfile::new().set_static_service_ip_connectivity(StaticServiceIpConnectivity::default()/* use setters */);
7737    /// assert!(x.static_service_ip_connectivity().is_some());
7738    /// assert!(x.forward_ssh_connectivity().is_none());
7739    /// assert!(x.private_connectivity().is_none());
7740    /// ```
7741    pub fn set_static_service_ip_connectivity<
7742        T: std::convert::Into<std::boxed::Box<crate::model::StaticServiceIpConnectivity>>,
7743    >(
7744        mut self,
7745        v: T,
7746    ) -> Self {
7747        self.connectivity = std::option::Option::Some(
7748            crate::model::connection_profile::Connectivity::StaticServiceIpConnectivity(v.into()),
7749        );
7750        self
7751    }
7752
7753    /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
7754    /// if it holds a `ForwardSshConnectivity`, `None` if the field is not set or
7755    /// holds a different branch.
7756    pub fn forward_ssh_connectivity(
7757        &self,
7758    ) -> std::option::Option<&std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>> {
7759        #[allow(unreachable_patterns)]
7760        self.connectivity.as_ref().and_then(|v| match v {
7761            crate::model::connection_profile::Connectivity::ForwardSshConnectivity(v) => {
7762                std::option::Option::Some(v)
7763            }
7764            _ => std::option::Option::None,
7765        })
7766    }
7767
7768    /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
7769    /// to hold a `ForwardSshConnectivity`.
7770    ///
7771    /// Note that all the setters affecting `connectivity` are
7772    /// mutually exclusive.
7773    ///
7774    /// # Example
7775    /// ```ignore,no_run
7776    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7777    /// use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
7778    /// let x = ConnectionProfile::new().set_forward_ssh_connectivity(ForwardSshTunnelConnectivity::default()/* use setters */);
7779    /// assert!(x.forward_ssh_connectivity().is_some());
7780    /// assert!(x.static_service_ip_connectivity().is_none());
7781    /// assert!(x.private_connectivity().is_none());
7782    /// ```
7783    pub fn set_forward_ssh_connectivity<
7784        T: std::convert::Into<std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>>,
7785    >(
7786        mut self,
7787        v: T,
7788    ) -> Self {
7789        self.connectivity = std::option::Option::Some(
7790            crate::model::connection_profile::Connectivity::ForwardSshConnectivity(v.into()),
7791        );
7792        self
7793    }
7794
7795    /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
7796    /// if it holds a `PrivateConnectivity`, `None` if the field is not set or
7797    /// holds a different branch.
7798    pub fn private_connectivity(
7799        &self,
7800    ) -> std::option::Option<&std::boxed::Box<crate::model::PrivateConnectivity>> {
7801        #[allow(unreachable_patterns)]
7802        self.connectivity.as_ref().and_then(|v| match v {
7803            crate::model::connection_profile::Connectivity::PrivateConnectivity(v) => {
7804                std::option::Option::Some(v)
7805            }
7806            _ => std::option::Option::None,
7807        })
7808    }
7809
7810    /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
7811    /// to hold a `PrivateConnectivity`.
7812    ///
7813    /// Note that all the setters affecting `connectivity` are
7814    /// mutually exclusive.
7815    ///
7816    /// # Example
7817    /// ```ignore,no_run
7818    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7819    /// use google_cloud_datastream_v1::model::PrivateConnectivity;
7820    /// let x = ConnectionProfile::new().set_private_connectivity(PrivateConnectivity::default()/* use setters */);
7821    /// assert!(x.private_connectivity().is_some());
7822    /// assert!(x.static_service_ip_connectivity().is_none());
7823    /// assert!(x.forward_ssh_connectivity().is_none());
7824    /// ```
7825    pub fn set_private_connectivity<
7826        T: std::convert::Into<std::boxed::Box<crate::model::PrivateConnectivity>>,
7827    >(
7828        mut self,
7829        v: T,
7830    ) -> Self {
7831        self.connectivity = std::option::Option::Some(
7832            crate::model::connection_profile::Connectivity::PrivateConnectivity(v.into()),
7833        );
7834        self
7835    }
7836}
7837
7838impl wkt::message::Message for ConnectionProfile {
7839    fn typename() -> &'static str {
7840        "type.googleapis.com/google.cloud.datastream.v1.ConnectionProfile"
7841    }
7842}
7843
7844/// Defines additional types related to [ConnectionProfile].
7845pub mod connection_profile {
7846    #[allow(unused_imports)]
7847    use super::*;
7848
7849    /// Connection configuration for the ConnectionProfile.
7850    #[derive(Clone, Debug, PartialEq)]
7851    #[non_exhaustive]
7852    pub enum Profile {
7853        /// Oracle ConnectionProfile configuration.
7854        OracleProfile(std::boxed::Box<crate::model::OracleProfile>),
7855        /// Cloud Storage ConnectionProfile configuration.
7856        GcsProfile(std::boxed::Box<crate::model::GcsProfile>),
7857        /// MySQL ConnectionProfile configuration.
7858        MysqlProfile(std::boxed::Box<crate::model::MysqlProfile>),
7859        /// BigQuery Connection Profile configuration.
7860        BigqueryProfile(std::boxed::Box<crate::model::BigQueryProfile>),
7861        /// PostgreSQL Connection Profile configuration.
7862        PostgresqlProfile(std::boxed::Box<crate::model::PostgresqlProfile>),
7863        /// SQLServer Connection Profile configuration.
7864        SqlServerProfile(std::boxed::Box<crate::model::SqlServerProfile>),
7865        /// Salesforce Connection Profile configuration.
7866        SalesforceProfile(std::boxed::Box<crate::model::SalesforceProfile>),
7867        /// MongoDB Connection Profile configuration.
7868        MongodbProfile(std::boxed::Box<crate::model::MongodbProfile>),
7869    }
7870
7871    /// Connectivity options used to establish a connection to the profile.
7872    #[derive(Clone, Debug, PartialEq)]
7873    #[non_exhaustive]
7874    pub enum Connectivity {
7875        /// Static Service IP connectivity.
7876        StaticServiceIpConnectivity(std::boxed::Box<crate::model::StaticServiceIpConnectivity>),
7877        /// Forward SSH tunnel connectivity.
7878        ForwardSshConnectivity(std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>),
7879        /// Private connectivity.
7880        PrivateConnectivity(std::boxed::Box<crate::model::PrivateConnectivity>),
7881    }
7882}
7883
7884/// Oracle Column.
7885#[derive(Clone, Default, PartialEq)]
7886#[non_exhaustive]
7887pub struct OracleColumn {
7888    /// Column name.
7889    pub column: std::string::String,
7890
7891    /// The Oracle data type.
7892    pub data_type: std::string::String,
7893
7894    /// Column length.
7895    pub length: i32,
7896
7897    /// Column precision.
7898    pub precision: i32,
7899
7900    /// Column scale.
7901    pub scale: i32,
7902
7903    /// Column encoding.
7904    pub encoding: std::string::String,
7905
7906    /// Whether or not the column represents a primary key.
7907    pub primary_key: bool,
7908
7909    /// Whether or not the column can accept a null value.
7910    pub nullable: bool,
7911
7912    /// The ordinal position of the column in the table.
7913    pub ordinal_position: i32,
7914
7915    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7916}
7917
7918impl OracleColumn {
7919    pub fn new() -> Self {
7920        std::default::Default::default()
7921    }
7922
7923    /// Sets the value of [column][crate::model::OracleColumn::column].
7924    ///
7925    /// # Example
7926    /// ```ignore,no_run
7927    /// # use google_cloud_datastream_v1::model::OracleColumn;
7928    /// let x = OracleColumn::new().set_column("example");
7929    /// ```
7930    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7931        self.column = v.into();
7932        self
7933    }
7934
7935    /// Sets the value of [data_type][crate::model::OracleColumn::data_type].
7936    ///
7937    /// # Example
7938    /// ```ignore,no_run
7939    /// # use google_cloud_datastream_v1::model::OracleColumn;
7940    /// let x = OracleColumn::new().set_data_type("example");
7941    /// ```
7942    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7943        self.data_type = v.into();
7944        self
7945    }
7946
7947    /// Sets the value of [length][crate::model::OracleColumn::length].
7948    ///
7949    /// # Example
7950    /// ```ignore,no_run
7951    /// # use google_cloud_datastream_v1::model::OracleColumn;
7952    /// let x = OracleColumn::new().set_length(42);
7953    /// ```
7954    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7955        self.length = v.into();
7956        self
7957    }
7958
7959    /// Sets the value of [precision][crate::model::OracleColumn::precision].
7960    ///
7961    /// # Example
7962    /// ```ignore,no_run
7963    /// # use google_cloud_datastream_v1::model::OracleColumn;
7964    /// let x = OracleColumn::new().set_precision(42);
7965    /// ```
7966    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7967        self.precision = v.into();
7968        self
7969    }
7970
7971    /// Sets the value of [scale][crate::model::OracleColumn::scale].
7972    ///
7973    /// # Example
7974    /// ```ignore,no_run
7975    /// # use google_cloud_datastream_v1::model::OracleColumn;
7976    /// let x = OracleColumn::new().set_scale(42);
7977    /// ```
7978    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7979        self.scale = v.into();
7980        self
7981    }
7982
7983    /// Sets the value of [encoding][crate::model::OracleColumn::encoding].
7984    ///
7985    /// # Example
7986    /// ```ignore,no_run
7987    /// # use google_cloud_datastream_v1::model::OracleColumn;
7988    /// let x = OracleColumn::new().set_encoding("example");
7989    /// ```
7990    pub fn set_encoding<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7991        self.encoding = v.into();
7992        self
7993    }
7994
7995    /// Sets the value of [primary_key][crate::model::OracleColumn::primary_key].
7996    ///
7997    /// # Example
7998    /// ```ignore,no_run
7999    /// # use google_cloud_datastream_v1::model::OracleColumn;
8000    /// let x = OracleColumn::new().set_primary_key(true);
8001    /// ```
8002    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8003        self.primary_key = v.into();
8004        self
8005    }
8006
8007    /// Sets the value of [nullable][crate::model::OracleColumn::nullable].
8008    ///
8009    /// # Example
8010    /// ```ignore,no_run
8011    /// # use google_cloud_datastream_v1::model::OracleColumn;
8012    /// let x = OracleColumn::new().set_nullable(true);
8013    /// ```
8014    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8015        self.nullable = v.into();
8016        self
8017    }
8018
8019    /// Sets the value of [ordinal_position][crate::model::OracleColumn::ordinal_position].
8020    ///
8021    /// # Example
8022    /// ```ignore,no_run
8023    /// # use google_cloud_datastream_v1::model::OracleColumn;
8024    /// let x = OracleColumn::new().set_ordinal_position(42);
8025    /// ```
8026    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8027        self.ordinal_position = v.into();
8028        self
8029    }
8030}
8031
8032impl wkt::message::Message for OracleColumn {
8033    fn typename() -> &'static str {
8034        "type.googleapis.com/google.cloud.datastream.v1.OracleColumn"
8035    }
8036}
8037
8038/// Oracle table.
8039#[derive(Clone, Default, PartialEq)]
8040#[non_exhaustive]
8041pub struct OracleTable {
8042    /// Table name.
8043    pub table: std::string::String,
8044
8045    /// Oracle columns in the schema.
8046    /// When unspecified as part of include/exclude objects, includes/excludes
8047    /// everything.
8048    pub oracle_columns: std::vec::Vec<crate::model::OracleColumn>,
8049
8050    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8051}
8052
8053impl OracleTable {
8054    pub fn new() -> Self {
8055        std::default::Default::default()
8056    }
8057
8058    /// Sets the value of [table][crate::model::OracleTable::table].
8059    ///
8060    /// # Example
8061    /// ```ignore,no_run
8062    /// # use google_cloud_datastream_v1::model::OracleTable;
8063    /// let x = OracleTable::new().set_table("example");
8064    /// ```
8065    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8066        self.table = v.into();
8067        self
8068    }
8069
8070    /// Sets the value of [oracle_columns][crate::model::OracleTable::oracle_columns].
8071    ///
8072    /// # Example
8073    /// ```ignore,no_run
8074    /// # use google_cloud_datastream_v1::model::OracleTable;
8075    /// use google_cloud_datastream_v1::model::OracleColumn;
8076    /// let x = OracleTable::new()
8077    ///     .set_oracle_columns([
8078    ///         OracleColumn::default()/* use setters */,
8079    ///         OracleColumn::default()/* use (different) setters */,
8080    ///     ]);
8081    /// ```
8082    pub fn set_oracle_columns<T, V>(mut self, v: T) -> Self
8083    where
8084        T: std::iter::IntoIterator<Item = V>,
8085        V: std::convert::Into<crate::model::OracleColumn>,
8086    {
8087        use std::iter::Iterator;
8088        self.oracle_columns = v.into_iter().map(|i| i.into()).collect();
8089        self
8090    }
8091}
8092
8093impl wkt::message::Message for OracleTable {
8094    fn typename() -> &'static str {
8095        "type.googleapis.com/google.cloud.datastream.v1.OracleTable"
8096    }
8097}
8098
8099/// Oracle schema.
8100#[derive(Clone, Default, PartialEq)]
8101#[non_exhaustive]
8102pub struct OracleSchema {
8103    /// Schema name.
8104    pub schema: std::string::String,
8105
8106    /// Tables in the schema.
8107    pub oracle_tables: std::vec::Vec<crate::model::OracleTable>,
8108
8109    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8110}
8111
8112impl OracleSchema {
8113    pub fn new() -> Self {
8114        std::default::Default::default()
8115    }
8116
8117    /// Sets the value of [schema][crate::model::OracleSchema::schema].
8118    ///
8119    /// # Example
8120    /// ```ignore,no_run
8121    /// # use google_cloud_datastream_v1::model::OracleSchema;
8122    /// let x = OracleSchema::new().set_schema("example");
8123    /// ```
8124    pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8125        self.schema = v.into();
8126        self
8127    }
8128
8129    /// Sets the value of [oracle_tables][crate::model::OracleSchema::oracle_tables].
8130    ///
8131    /// # Example
8132    /// ```ignore,no_run
8133    /// # use google_cloud_datastream_v1::model::OracleSchema;
8134    /// use google_cloud_datastream_v1::model::OracleTable;
8135    /// let x = OracleSchema::new()
8136    ///     .set_oracle_tables([
8137    ///         OracleTable::default()/* use setters */,
8138    ///         OracleTable::default()/* use (different) setters */,
8139    ///     ]);
8140    /// ```
8141    pub fn set_oracle_tables<T, V>(mut self, v: T) -> Self
8142    where
8143        T: std::iter::IntoIterator<Item = V>,
8144        V: std::convert::Into<crate::model::OracleTable>,
8145    {
8146        use std::iter::Iterator;
8147        self.oracle_tables = v.into_iter().map(|i| i.into()).collect();
8148        self
8149    }
8150}
8151
8152impl wkt::message::Message for OracleSchema {
8153    fn typename() -> &'static str {
8154        "type.googleapis.com/google.cloud.datastream.v1.OracleSchema"
8155    }
8156}
8157
8158/// Oracle database structure.
8159#[derive(Clone, Default, PartialEq)]
8160#[non_exhaustive]
8161pub struct OracleRdbms {
8162    /// Oracle schemas/databases in the database server.
8163    pub oracle_schemas: std::vec::Vec<crate::model::OracleSchema>,
8164
8165    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8166}
8167
8168impl OracleRdbms {
8169    pub fn new() -> Self {
8170        std::default::Default::default()
8171    }
8172
8173    /// Sets the value of [oracle_schemas][crate::model::OracleRdbms::oracle_schemas].
8174    ///
8175    /// # Example
8176    /// ```ignore,no_run
8177    /// # use google_cloud_datastream_v1::model::OracleRdbms;
8178    /// use google_cloud_datastream_v1::model::OracleSchema;
8179    /// let x = OracleRdbms::new()
8180    ///     .set_oracle_schemas([
8181    ///         OracleSchema::default()/* use setters */,
8182    ///         OracleSchema::default()/* use (different) setters */,
8183    ///     ]);
8184    /// ```
8185    pub fn set_oracle_schemas<T, V>(mut self, v: T) -> Self
8186    where
8187        T: std::iter::IntoIterator<Item = V>,
8188        V: std::convert::Into<crate::model::OracleSchema>,
8189    {
8190        use std::iter::Iterator;
8191        self.oracle_schemas = v.into_iter().map(|i| i.into()).collect();
8192        self
8193    }
8194}
8195
8196impl wkt::message::Message for OracleRdbms {
8197    fn typename() -> &'static str {
8198        "type.googleapis.com/google.cloud.datastream.v1.OracleRdbms"
8199    }
8200}
8201
8202/// Oracle data source configuration
8203#[derive(Clone, Default, PartialEq)]
8204#[non_exhaustive]
8205pub struct OracleSourceConfig {
8206    /// Oracle objects to include in the stream.
8207    pub include_objects: std::option::Option<crate::model::OracleRdbms>,
8208
8209    /// Oracle objects to exclude from the stream.
8210    pub exclude_objects: std::option::Option<crate::model::OracleRdbms>,
8211
8212    /// Maximum number of concurrent CDC tasks. The number should be non-negative.
8213    /// If not set (or set to 0), the system's default value is used.
8214    pub max_concurrent_cdc_tasks: i32,
8215
8216    /// Maximum number of concurrent backfill tasks. The number should be
8217    /// non-negative. If not set (or set to 0), the system's default value is used.
8218    pub max_concurrent_backfill_tasks: i32,
8219
8220    /// The configuration for handle Oracle large objects.
8221    pub large_objects_handling:
8222        std::option::Option<crate::model::oracle_source_config::LargeObjectsHandling>,
8223
8224    /// Configuration to select the CDC method.
8225    pub cdc_method: std::option::Option<crate::model::oracle_source_config::CdcMethod>,
8226
8227    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8228}
8229
8230impl OracleSourceConfig {
8231    pub fn new() -> Self {
8232        std::default::Default::default()
8233    }
8234
8235    /// Sets the value of [include_objects][crate::model::OracleSourceConfig::include_objects].
8236    ///
8237    /// # Example
8238    /// ```ignore,no_run
8239    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8240    /// use google_cloud_datastream_v1::model::OracleRdbms;
8241    /// let x = OracleSourceConfig::new().set_include_objects(OracleRdbms::default()/* use setters */);
8242    /// ```
8243    pub fn set_include_objects<T>(mut self, v: T) -> Self
8244    where
8245        T: std::convert::Into<crate::model::OracleRdbms>,
8246    {
8247        self.include_objects = std::option::Option::Some(v.into());
8248        self
8249    }
8250
8251    /// Sets or clears the value of [include_objects][crate::model::OracleSourceConfig::include_objects].
8252    ///
8253    /// # Example
8254    /// ```ignore,no_run
8255    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8256    /// use google_cloud_datastream_v1::model::OracleRdbms;
8257    /// let x = OracleSourceConfig::new().set_or_clear_include_objects(Some(OracleRdbms::default()/* use setters */));
8258    /// let x = OracleSourceConfig::new().set_or_clear_include_objects(None::<OracleRdbms>);
8259    /// ```
8260    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
8261    where
8262        T: std::convert::Into<crate::model::OracleRdbms>,
8263    {
8264        self.include_objects = v.map(|x| x.into());
8265        self
8266    }
8267
8268    /// Sets the value of [exclude_objects][crate::model::OracleSourceConfig::exclude_objects].
8269    ///
8270    /// # Example
8271    /// ```ignore,no_run
8272    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8273    /// use google_cloud_datastream_v1::model::OracleRdbms;
8274    /// let x = OracleSourceConfig::new().set_exclude_objects(OracleRdbms::default()/* use setters */);
8275    /// ```
8276    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
8277    where
8278        T: std::convert::Into<crate::model::OracleRdbms>,
8279    {
8280        self.exclude_objects = std::option::Option::Some(v.into());
8281        self
8282    }
8283
8284    /// Sets or clears the value of [exclude_objects][crate::model::OracleSourceConfig::exclude_objects].
8285    ///
8286    /// # Example
8287    /// ```ignore,no_run
8288    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8289    /// use google_cloud_datastream_v1::model::OracleRdbms;
8290    /// let x = OracleSourceConfig::new().set_or_clear_exclude_objects(Some(OracleRdbms::default()/* use setters */));
8291    /// let x = OracleSourceConfig::new().set_or_clear_exclude_objects(None::<OracleRdbms>);
8292    /// ```
8293    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
8294    where
8295        T: std::convert::Into<crate::model::OracleRdbms>,
8296    {
8297        self.exclude_objects = v.map(|x| x.into());
8298        self
8299    }
8300
8301    /// Sets the value of [max_concurrent_cdc_tasks][crate::model::OracleSourceConfig::max_concurrent_cdc_tasks].
8302    ///
8303    /// # Example
8304    /// ```ignore,no_run
8305    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8306    /// let x = OracleSourceConfig::new().set_max_concurrent_cdc_tasks(42);
8307    /// ```
8308    pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8309        self.max_concurrent_cdc_tasks = v.into();
8310        self
8311    }
8312
8313    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::OracleSourceConfig::max_concurrent_backfill_tasks].
8314    ///
8315    /// # Example
8316    /// ```ignore,no_run
8317    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8318    /// let x = OracleSourceConfig::new().set_max_concurrent_backfill_tasks(42);
8319    /// ```
8320    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8321        self.max_concurrent_backfill_tasks = v.into();
8322        self
8323    }
8324
8325    /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling].
8326    ///
8327    /// Note that all the setters affecting `large_objects_handling` are mutually
8328    /// exclusive.
8329    ///
8330    /// # Example
8331    /// ```ignore,no_run
8332    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8333    /// use google_cloud_datastream_v1::model::oracle_source_config::DropLargeObjects;
8334    /// let x = OracleSourceConfig::new().set_large_objects_handling(Some(
8335    ///     google_cloud_datastream_v1::model::oracle_source_config::LargeObjectsHandling::DropLargeObjects(DropLargeObjects::default().into())));
8336    /// ```
8337    pub fn set_large_objects_handling<
8338        T: std::convert::Into<
8339                std::option::Option<crate::model::oracle_source_config::LargeObjectsHandling>,
8340            >,
8341    >(
8342        mut self,
8343        v: T,
8344    ) -> Self {
8345        self.large_objects_handling = v.into();
8346        self
8347    }
8348
8349    /// The value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
8350    /// if it holds a `DropLargeObjects`, `None` if the field is not set or
8351    /// holds a different branch.
8352    pub fn drop_large_objects(
8353        &self,
8354    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>>
8355    {
8356        #[allow(unreachable_patterns)]
8357        self.large_objects_handling.as_ref().and_then(|v| match v {
8358            crate::model::oracle_source_config::LargeObjectsHandling::DropLargeObjects(v) => {
8359                std::option::Option::Some(v)
8360            }
8361            _ => std::option::Option::None,
8362        })
8363    }
8364
8365    /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
8366    /// to hold a `DropLargeObjects`.
8367    ///
8368    /// Note that all the setters affecting `large_objects_handling` are
8369    /// mutually exclusive.
8370    ///
8371    /// # Example
8372    /// ```ignore,no_run
8373    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8374    /// use google_cloud_datastream_v1::model::oracle_source_config::DropLargeObjects;
8375    /// let x = OracleSourceConfig::new().set_drop_large_objects(DropLargeObjects::default()/* use setters */);
8376    /// assert!(x.drop_large_objects().is_some());
8377    /// assert!(x.stream_large_objects().is_none());
8378    /// ```
8379    pub fn set_drop_large_objects<
8380        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>>,
8381    >(
8382        mut self,
8383        v: T,
8384    ) -> Self {
8385        self.large_objects_handling = std::option::Option::Some(
8386            crate::model::oracle_source_config::LargeObjectsHandling::DropLargeObjects(v.into()),
8387        );
8388        self
8389    }
8390
8391    /// The value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
8392    /// if it holds a `StreamLargeObjects`, `None` if the field is not set or
8393    /// holds a different branch.
8394    pub fn stream_large_objects(
8395        &self,
8396    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>>
8397    {
8398        #[allow(unreachable_patterns)]
8399        self.large_objects_handling.as_ref().and_then(|v| match v {
8400            crate::model::oracle_source_config::LargeObjectsHandling::StreamLargeObjects(v) => {
8401                std::option::Option::Some(v)
8402            }
8403            _ => std::option::Option::None,
8404        })
8405    }
8406
8407    /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
8408    /// to hold a `StreamLargeObjects`.
8409    ///
8410    /// Note that all the setters affecting `large_objects_handling` are
8411    /// mutually exclusive.
8412    ///
8413    /// # Example
8414    /// ```ignore,no_run
8415    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8416    /// use google_cloud_datastream_v1::model::oracle_source_config::StreamLargeObjects;
8417    /// let x = OracleSourceConfig::new().set_stream_large_objects(StreamLargeObjects::default()/* use setters */);
8418    /// assert!(x.stream_large_objects().is_some());
8419    /// assert!(x.drop_large_objects().is_none());
8420    /// ```
8421    pub fn set_stream_large_objects<
8422        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>>,
8423    >(
8424        mut self,
8425        v: T,
8426    ) -> Self {
8427        self.large_objects_handling = std::option::Option::Some(
8428            crate::model::oracle_source_config::LargeObjectsHandling::StreamLargeObjects(v.into()),
8429        );
8430        self
8431    }
8432
8433    /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method].
8434    ///
8435    /// Note that all the setters affecting `cdc_method` are mutually
8436    /// exclusive.
8437    ///
8438    /// # Example
8439    /// ```ignore,no_run
8440    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8441    /// use google_cloud_datastream_v1::model::oracle_source_config::LogMiner;
8442    /// let x = OracleSourceConfig::new().set_cdc_method(Some(
8443    ///     google_cloud_datastream_v1::model::oracle_source_config::CdcMethod::LogMiner(LogMiner::default().into())));
8444    /// ```
8445    pub fn set_cdc_method<
8446        T: std::convert::Into<std::option::Option<crate::model::oracle_source_config::CdcMethod>>,
8447    >(
8448        mut self,
8449        v: T,
8450    ) -> Self {
8451        self.cdc_method = v.into();
8452        self
8453    }
8454
8455    /// The value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
8456    /// if it holds a `LogMiner`, `None` if the field is not set or
8457    /// holds a different branch.
8458    pub fn log_miner(
8459        &self,
8460    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::LogMiner>> {
8461        #[allow(unreachable_patterns)]
8462        self.cdc_method.as_ref().and_then(|v| match v {
8463            crate::model::oracle_source_config::CdcMethod::LogMiner(v) => {
8464                std::option::Option::Some(v)
8465            }
8466            _ => std::option::Option::None,
8467        })
8468    }
8469
8470    /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
8471    /// to hold a `LogMiner`.
8472    ///
8473    /// Note that all the setters affecting `cdc_method` are
8474    /// mutually exclusive.
8475    ///
8476    /// # Example
8477    /// ```ignore,no_run
8478    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8479    /// use google_cloud_datastream_v1::model::oracle_source_config::LogMiner;
8480    /// let x = OracleSourceConfig::new().set_log_miner(LogMiner::default()/* use setters */);
8481    /// assert!(x.log_miner().is_some());
8482    /// assert!(x.binary_log_parser().is_none());
8483    /// ```
8484    pub fn set_log_miner<
8485        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::LogMiner>>,
8486    >(
8487        mut self,
8488        v: T,
8489    ) -> Self {
8490        self.cdc_method = std::option::Option::Some(
8491            crate::model::oracle_source_config::CdcMethod::LogMiner(v.into()),
8492        );
8493        self
8494    }
8495
8496    /// The value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
8497    /// if it holds a `BinaryLogParser`, `None` if the field is not set or
8498    /// holds a different branch.
8499    pub fn binary_log_parser(
8500        &self,
8501    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>>
8502    {
8503        #[allow(unreachable_patterns)]
8504        self.cdc_method.as_ref().and_then(|v| match v {
8505            crate::model::oracle_source_config::CdcMethod::BinaryLogParser(v) => {
8506                std::option::Option::Some(v)
8507            }
8508            _ => std::option::Option::None,
8509        })
8510    }
8511
8512    /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
8513    /// to hold a `BinaryLogParser`.
8514    ///
8515    /// Note that all the setters affecting `cdc_method` are
8516    /// mutually exclusive.
8517    ///
8518    /// # Example
8519    /// ```ignore,no_run
8520    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8521    /// use google_cloud_datastream_v1::model::oracle_source_config::BinaryLogParser;
8522    /// let x = OracleSourceConfig::new().set_binary_log_parser(BinaryLogParser::default()/* use setters */);
8523    /// assert!(x.binary_log_parser().is_some());
8524    /// assert!(x.log_miner().is_none());
8525    /// ```
8526    pub fn set_binary_log_parser<
8527        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>>,
8528    >(
8529        mut self,
8530        v: T,
8531    ) -> Self {
8532        self.cdc_method = std::option::Option::Some(
8533            crate::model::oracle_source_config::CdcMethod::BinaryLogParser(v.into()),
8534        );
8535        self
8536    }
8537}
8538
8539impl wkt::message::Message for OracleSourceConfig {
8540    fn typename() -> &'static str {
8541        "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig"
8542    }
8543}
8544
8545/// Defines additional types related to [OracleSourceConfig].
8546pub mod oracle_source_config {
8547    #[allow(unused_imports)]
8548    use super::*;
8549
8550    /// Configuration to drop large object values.
8551    #[derive(Clone, Default, PartialEq)]
8552    #[non_exhaustive]
8553    pub struct DropLargeObjects {
8554        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8555    }
8556
8557    impl DropLargeObjects {
8558        pub fn new() -> Self {
8559            std::default::Default::default()
8560        }
8561    }
8562
8563    impl wkt::message::Message for DropLargeObjects {
8564        fn typename() -> &'static str {
8565            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.DropLargeObjects"
8566        }
8567    }
8568
8569    /// Configuration to stream large object values.
8570    #[derive(Clone, Default, PartialEq)]
8571    #[non_exhaustive]
8572    pub struct StreamLargeObjects {
8573        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8574    }
8575
8576    impl StreamLargeObjects {
8577        pub fn new() -> Self {
8578            std::default::Default::default()
8579        }
8580    }
8581
8582    impl wkt::message::Message for StreamLargeObjects {
8583        fn typename() -> &'static str {
8584            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.StreamLargeObjects"
8585        }
8586    }
8587
8588    /// Configuration to use LogMiner CDC method.
8589    #[derive(Clone, Default, PartialEq)]
8590    #[non_exhaustive]
8591    pub struct LogMiner {
8592        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8593    }
8594
8595    impl LogMiner {
8596        pub fn new() -> Self {
8597            std::default::Default::default()
8598        }
8599    }
8600
8601    impl wkt::message::Message for LogMiner {
8602        fn typename() -> &'static str {
8603            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.LogMiner"
8604        }
8605    }
8606
8607    /// Configuration to use Binary Log Parser CDC technique.
8608    #[derive(Clone, Default, PartialEq)]
8609    #[non_exhaustive]
8610    pub struct BinaryLogParser {
8611        /// Configuration to specify how the log file should be accessed.
8612        pub log_file_access: std::option::Option<
8613            crate::model::oracle_source_config::binary_log_parser::LogFileAccess,
8614        >,
8615
8616        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8617    }
8618
8619    impl BinaryLogParser {
8620        pub fn new() -> Self {
8621            std::default::Default::default()
8622        }
8623
8624        /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access].
8625        ///
8626        /// Note that all the setters affecting `log_file_access` are mutually
8627        /// exclusive.
8628        ///
8629        /// # Example
8630        /// ```ignore,no_run
8631        /// # use google_cloud_datastream_v1::model::oracle_source_config::BinaryLogParser;
8632        /// use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess;
8633        /// let x = BinaryLogParser::new().set_log_file_access(Some(
8634        ///     google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::LogFileAccess::OracleAsmLogFileAccess(OracleAsmLogFileAccess::default().into())));
8635        /// ```
8636        pub fn set_log_file_access<
8637            T: std::convert::Into<
8638                    std::option::Option<
8639                        crate::model::oracle_source_config::binary_log_parser::LogFileAccess,
8640                    >,
8641                >,
8642        >(
8643            mut self,
8644            v: T,
8645        ) -> Self {
8646            self.log_file_access = v.into();
8647            self
8648        }
8649
8650        /// The value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
8651        /// if it holds a `OracleAsmLogFileAccess`, `None` if the field is not set or
8652        /// holds a different branch.
8653        pub fn oracle_asm_log_file_access(
8654            &self,
8655        ) -> std::option::Option<
8656            &std::boxed::Box<
8657                crate::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess,
8658            >,
8659        > {
8660            #[allow(unreachable_patterns)]
8661            self.log_file_access.as_ref().and_then(|v| match v {
8662                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::OracleAsmLogFileAccess(v) => std::option::Option::Some(v),
8663                _ => std::option::Option::None,
8664            })
8665        }
8666
8667        /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
8668        /// to hold a `OracleAsmLogFileAccess`.
8669        ///
8670        /// Note that all the setters affecting `log_file_access` are
8671        /// mutually exclusive.
8672        ///
8673        /// # Example
8674        /// ```ignore,no_run
8675        /// # use google_cloud_datastream_v1::model::oracle_source_config::BinaryLogParser;
8676        /// use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess;
8677        /// let x = BinaryLogParser::new().set_oracle_asm_log_file_access(OracleAsmLogFileAccess::default()/* use setters */);
8678        /// assert!(x.oracle_asm_log_file_access().is_some());
8679        /// assert!(x.log_file_directories().is_none());
8680        /// ```
8681        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{
8682            self.log_file_access = std::option::Option::Some(
8683                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::OracleAsmLogFileAccess(
8684                    v.into()
8685                )
8686            );
8687            self
8688        }
8689
8690        /// The value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
8691        /// if it holds a `LogFileDirectories`, `None` if the field is not set or
8692        /// holds a different branch.
8693        pub fn log_file_directories(
8694            &self,
8695        ) -> std::option::Option<
8696            &std::boxed::Box<
8697                crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
8698            >,
8699        > {
8700            #[allow(unreachable_patterns)]
8701            self.log_file_access.as_ref().and_then(|v| match v {
8702                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::LogFileDirectories(v) => std::option::Option::Some(v),
8703                _ => std::option::Option::None,
8704            })
8705        }
8706
8707        /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
8708        /// to hold a `LogFileDirectories`.
8709        ///
8710        /// Note that all the setters affecting `log_file_access` are
8711        /// mutually exclusive.
8712        ///
8713        /// # Example
8714        /// ```ignore,no_run
8715        /// # use google_cloud_datastream_v1::model::oracle_source_config::BinaryLogParser;
8716        /// use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::LogFileDirectories;
8717        /// let x = BinaryLogParser::new().set_log_file_directories(LogFileDirectories::default()/* use setters */);
8718        /// assert!(x.log_file_directories().is_some());
8719        /// assert!(x.oracle_asm_log_file_access().is_none());
8720        /// ```
8721        pub fn set_log_file_directories<
8722            T: std::convert::Into<
8723                    std::boxed::Box<
8724                        crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
8725                    >,
8726                >,
8727        >(
8728            mut self,
8729            v: T,
8730        ) -> Self {
8731            self.log_file_access = std::option::Option::Some(
8732                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::LogFileDirectories(
8733                    v.into()
8734                )
8735            );
8736            self
8737        }
8738    }
8739
8740    impl wkt::message::Message for BinaryLogParser {
8741        fn typename() -> &'static str {
8742            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser"
8743        }
8744    }
8745
8746    /// Defines additional types related to [BinaryLogParser].
8747    pub mod binary_log_parser {
8748        #[allow(unused_imports)]
8749        use super::*;
8750
8751        /// Configuration to use Oracle ASM to access the log files.
8752        #[derive(Clone, Default, PartialEq)]
8753        #[non_exhaustive]
8754        pub struct OracleAsmLogFileAccess {
8755            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8756        }
8757
8758        impl OracleAsmLogFileAccess {
8759            pub fn new() -> Self {
8760                std::default::Default::default()
8761            }
8762        }
8763
8764        impl wkt::message::Message for OracleAsmLogFileAccess {
8765            fn typename() -> &'static str {
8766                "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser.OracleAsmLogFileAccess"
8767            }
8768        }
8769
8770        /// Configuration to specify the Oracle directories to access the log files.
8771        #[derive(Clone, Default, PartialEq)]
8772        #[non_exhaustive]
8773        pub struct LogFileDirectories {
8774            /// Required. Oracle directory for online logs.
8775            pub online_log_directory: std::string::String,
8776
8777            /// Required. Oracle directory for archived logs.
8778            pub archived_log_directory: std::string::String,
8779
8780            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8781        }
8782
8783        impl LogFileDirectories {
8784            pub fn new() -> Self {
8785                std::default::Default::default()
8786            }
8787
8788            /// Sets the value of [online_log_directory][crate::model::oracle_source_config::binary_log_parser::LogFileDirectories::online_log_directory].
8789            ///
8790            /// # Example
8791            /// ```ignore,no_run
8792            /// # use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::LogFileDirectories;
8793            /// let x = LogFileDirectories::new().set_online_log_directory("example");
8794            /// ```
8795            pub fn set_online_log_directory<T: std::convert::Into<std::string::String>>(
8796                mut self,
8797                v: T,
8798            ) -> Self {
8799                self.online_log_directory = v.into();
8800                self
8801            }
8802
8803            /// Sets the value of [archived_log_directory][crate::model::oracle_source_config::binary_log_parser::LogFileDirectories::archived_log_directory].
8804            ///
8805            /// # Example
8806            /// ```ignore,no_run
8807            /// # use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::LogFileDirectories;
8808            /// let x = LogFileDirectories::new().set_archived_log_directory("example");
8809            /// ```
8810            pub fn set_archived_log_directory<T: std::convert::Into<std::string::String>>(
8811                mut self,
8812                v: T,
8813            ) -> Self {
8814                self.archived_log_directory = v.into();
8815                self
8816            }
8817        }
8818
8819        impl wkt::message::Message for LogFileDirectories {
8820            fn typename() -> &'static str {
8821                "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser.LogFileDirectories"
8822            }
8823        }
8824
8825        /// Configuration to specify how the log file should be accessed.
8826        #[derive(Clone, Debug, PartialEq)]
8827        #[non_exhaustive]
8828        pub enum LogFileAccess {
8829            /// Use Oracle ASM.
8830            OracleAsmLogFileAccess(
8831                std::boxed::Box<
8832                    crate::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess,
8833                >,
8834            ),
8835            /// Use Oracle directories.
8836            LogFileDirectories(
8837                std::boxed::Box<
8838                    crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
8839                >,
8840            ),
8841        }
8842    }
8843
8844    /// The configuration for handle Oracle large objects.
8845    #[derive(Clone, Debug, PartialEq)]
8846    #[non_exhaustive]
8847    pub enum LargeObjectsHandling {
8848        /// Drop large object values.
8849        DropLargeObjects(std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>),
8850        /// Stream large object values.
8851        StreamLargeObjects(std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>),
8852    }
8853
8854    /// Configuration to select the CDC method.
8855    #[derive(Clone, Debug, PartialEq)]
8856    #[non_exhaustive]
8857    pub enum CdcMethod {
8858        /// Use LogMiner.
8859        LogMiner(std::boxed::Box<crate::model::oracle_source_config::LogMiner>),
8860        /// Use Binary Log Parser.
8861        BinaryLogParser(std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>),
8862    }
8863}
8864
8865/// PostgreSQL Column.
8866#[derive(Clone, Default, PartialEq)]
8867#[non_exhaustive]
8868pub struct PostgresqlColumn {
8869    /// Column name.
8870    pub column: std::string::String,
8871
8872    /// The PostgreSQL data type.
8873    pub data_type: std::string::String,
8874
8875    /// Column length.
8876    pub length: i32,
8877
8878    /// Column precision.
8879    pub precision: i32,
8880
8881    /// Column scale.
8882    pub scale: i32,
8883
8884    /// Whether or not the column represents a primary key.
8885    pub primary_key: bool,
8886
8887    /// Whether or not the column can accept a null value.
8888    pub nullable: bool,
8889
8890    /// The ordinal position of the column in the table.
8891    pub ordinal_position: i32,
8892
8893    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8894}
8895
8896impl PostgresqlColumn {
8897    pub fn new() -> Self {
8898        std::default::Default::default()
8899    }
8900
8901    /// Sets the value of [column][crate::model::PostgresqlColumn::column].
8902    ///
8903    /// # Example
8904    /// ```ignore,no_run
8905    /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
8906    /// let x = PostgresqlColumn::new().set_column("example");
8907    /// ```
8908    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8909        self.column = v.into();
8910        self
8911    }
8912
8913    /// Sets the value of [data_type][crate::model::PostgresqlColumn::data_type].
8914    ///
8915    /// # Example
8916    /// ```ignore,no_run
8917    /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
8918    /// let x = PostgresqlColumn::new().set_data_type("example");
8919    /// ```
8920    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8921        self.data_type = v.into();
8922        self
8923    }
8924
8925    /// Sets the value of [length][crate::model::PostgresqlColumn::length].
8926    ///
8927    /// # Example
8928    /// ```ignore,no_run
8929    /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
8930    /// let x = PostgresqlColumn::new().set_length(42);
8931    /// ```
8932    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8933        self.length = v.into();
8934        self
8935    }
8936
8937    /// Sets the value of [precision][crate::model::PostgresqlColumn::precision].
8938    ///
8939    /// # Example
8940    /// ```ignore,no_run
8941    /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
8942    /// let x = PostgresqlColumn::new().set_precision(42);
8943    /// ```
8944    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8945        self.precision = v.into();
8946        self
8947    }
8948
8949    /// Sets the value of [scale][crate::model::PostgresqlColumn::scale].
8950    ///
8951    /// # Example
8952    /// ```ignore,no_run
8953    /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
8954    /// let x = PostgresqlColumn::new().set_scale(42);
8955    /// ```
8956    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8957        self.scale = v.into();
8958        self
8959    }
8960
8961    /// Sets the value of [primary_key][crate::model::PostgresqlColumn::primary_key].
8962    ///
8963    /// # Example
8964    /// ```ignore,no_run
8965    /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
8966    /// let x = PostgresqlColumn::new().set_primary_key(true);
8967    /// ```
8968    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8969        self.primary_key = v.into();
8970        self
8971    }
8972
8973    /// Sets the value of [nullable][crate::model::PostgresqlColumn::nullable].
8974    ///
8975    /// # Example
8976    /// ```ignore,no_run
8977    /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
8978    /// let x = PostgresqlColumn::new().set_nullable(true);
8979    /// ```
8980    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8981        self.nullable = v.into();
8982        self
8983    }
8984
8985    /// Sets the value of [ordinal_position][crate::model::PostgresqlColumn::ordinal_position].
8986    ///
8987    /// # Example
8988    /// ```ignore,no_run
8989    /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
8990    /// let x = PostgresqlColumn::new().set_ordinal_position(42);
8991    /// ```
8992    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8993        self.ordinal_position = v.into();
8994        self
8995    }
8996}
8997
8998impl wkt::message::Message for PostgresqlColumn {
8999    fn typename() -> &'static str {
9000        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlColumn"
9001    }
9002}
9003
9004/// PostgreSQL table.
9005#[derive(Clone, Default, PartialEq)]
9006#[non_exhaustive]
9007pub struct PostgresqlTable {
9008    /// Table name.
9009    pub table: std::string::String,
9010
9011    /// PostgreSQL columns in the schema.
9012    /// When unspecified as part of include/exclude objects,
9013    /// includes/excludes everything.
9014    pub postgresql_columns: std::vec::Vec<crate::model::PostgresqlColumn>,
9015
9016    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9017}
9018
9019impl PostgresqlTable {
9020    pub fn new() -> Self {
9021        std::default::Default::default()
9022    }
9023
9024    /// Sets the value of [table][crate::model::PostgresqlTable::table].
9025    ///
9026    /// # Example
9027    /// ```ignore,no_run
9028    /// # use google_cloud_datastream_v1::model::PostgresqlTable;
9029    /// let x = PostgresqlTable::new().set_table("example");
9030    /// ```
9031    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9032        self.table = v.into();
9033        self
9034    }
9035
9036    /// Sets the value of [postgresql_columns][crate::model::PostgresqlTable::postgresql_columns].
9037    ///
9038    /// # Example
9039    /// ```ignore,no_run
9040    /// # use google_cloud_datastream_v1::model::PostgresqlTable;
9041    /// use google_cloud_datastream_v1::model::PostgresqlColumn;
9042    /// let x = PostgresqlTable::new()
9043    ///     .set_postgresql_columns([
9044    ///         PostgresqlColumn::default()/* use setters */,
9045    ///         PostgresqlColumn::default()/* use (different) setters */,
9046    ///     ]);
9047    /// ```
9048    pub fn set_postgresql_columns<T, V>(mut self, v: T) -> Self
9049    where
9050        T: std::iter::IntoIterator<Item = V>,
9051        V: std::convert::Into<crate::model::PostgresqlColumn>,
9052    {
9053        use std::iter::Iterator;
9054        self.postgresql_columns = v.into_iter().map(|i| i.into()).collect();
9055        self
9056    }
9057}
9058
9059impl wkt::message::Message for PostgresqlTable {
9060    fn typename() -> &'static str {
9061        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlTable"
9062    }
9063}
9064
9065/// PostgreSQL schema.
9066#[derive(Clone, Default, PartialEq)]
9067#[non_exhaustive]
9068pub struct PostgresqlSchema {
9069    /// Schema name.
9070    pub schema: std::string::String,
9071
9072    /// Tables in the schema.
9073    pub postgresql_tables: std::vec::Vec<crate::model::PostgresqlTable>,
9074
9075    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9076}
9077
9078impl PostgresqlSchema {
9079    pub fn new() -> Self {
9080        std::default::Default::default()
9081    }
9082
9083    /// Sets the value of [schema][crate::model::PostgresqlSchema::schema].
9084    ///
9085    /// # Example
9086    /// ```ignore,no_run
9087    /// # use google_cloud_datastream_v1::model::PostgresqlSchema;
9088    /// let x = PostgresqlSchema::new().set_schema("example");
9089    /// ```
9090    pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9091        self.schema = v.into();
9092        self
9093    }
9094
9095    /// Sets the value of [postgresql_tables][crate::model::PostgresqlSchema::postgresql_tables].
9096    ///
9097    /// # Example
9098    /// ```ignore,no_run
9099    /// # use google_cloud_datastream_v1::model::PostgresqlSchema;
9100    /// use google_cloud_datastream_v1::model::PostgresqlTable;
9101    /// let x = PostgresqlSchema::new()
9102    ///     .set_postgresql_tables([
9103    ///         PostgresqlTable::default()/* use setters */,
9104    ///         PostgresqlTable::default()/* use (different) setters */,
9105    ///     ]);
9106    /// ```
9107    pub fn set_postgresql_tables<T, V>(mut self, v: T) -> Self
9108    where
9109        T: std::iter::IntoIterator<Item = V>,
9110        V: std::convert::Into<crate::model::PostgresqlTable>,
9111    {
9112        use std::iter::Iterator;
9113        self.postgresql_tables = v.into_iter().map(|i| i.into()).collect();
9114        self
9115    }
9116}
9117
9118impl wkt::message::Message for PostgresqlSchema {
9119    fn typename() -> &'static str {
9120        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSchema"
9121    }
9122}
9123
9124/// PostgreSQL database structure.
9125#[derive(Clone, Default, PartialEq)]
9126#[non_exhaustive]
9127pub struct PostgresqlRdbms {
9128    /// PostgreSQL schemas in the database server.
9129    pub postgresql_schemas: std::vec::Vec<crate::model::PostgresqlSchema>,
9130
9131    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9132}
9133
9134impl PostgresqlRdbms {
9135    pub fn new() -> Self {
9136        std::default::Default::default()
9137    }
9138
9139    /// Sets the value of [postgresql_schemas][crate::model::PostgresqlRdbms::postgresql_schemas].
9140    ///
9141    /// # Example
9142    /// ```ignore,no_run
9143    /// # use google_cloud_datastream_v1::model::PostgresqlRdbms;
9144    /// use google_cloud_datastream_v1::model::PostgresqlSchema;
9145    /// let x = PostgresqlRdbms::new()
9146    ///     .set_postgresql_schemas([
9147    ///         PostgresqlSchema::default()/* use setters */,
9148    ///         PostgresqlSchema::default()/* use (different) setters */,
9149    ///     ]);
9150    /// ```
9151    pub fn set_postgresql_schemas<T, V>(mut self, v: T) -> Self
9152    where
9153        T: std::iter::IntoIterator<Item = V>,
9154        V: std::convert::Into<crate::model::PostgresqlSchema>,
9155    {
9156        use std::iter::Iterator;
9157        self.postgresql_schemas = v.into_iter().map(|i| i.into()).collect();
9158        self
9159    }
9160}
9161
9162impl wkt::message::Message for PostgresqlRdbms {
9163    fn typename() -> &'static str {
9164        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlRdbms"
9165    }
9166}
9167
9168/// PostgreSQL data source configuration
9169#[derive(Clone, Default, PartialEq)]
9170#[non_exhaustive]
9171pub struct PostgresqlSourceConfig {
9172    /// PostgreSQL objects to include in the stream.
9173    pub include_objects: std::option::Option<crate::model::PostgresqlRdbms>,
9174
9175    /// PostgreSQL objects to exclude from the stream.
9176    pub exclude_objects: std::option::Option<crate::model::PostgresqlRdbms>,
9177
9178    /// Required. Immutable. The name of the logical replication slot that's
9179    /// configured with the pgoutput plugin.
9180    pub replication_slot: std::string::String,
9181
9182    /// Required. The name of the publication that includes the set of all tables
9183    /// that are defined in the stream's include_objects.
9184    pub publication: std::string::String,
9185
9186    /// Maximum number of concurrent backfill tasks. The number should be non
9187    /// negative. If not set (or set to 0), the system's default value will be
9188    /// used.
9189    pub max_concurrent_backfill_tasks: i32,
9190
9191    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9192}
9193
9194impl PostgresqlSourceConfig {
9195    pub fn new() -> Self {
9196        std::default::Default::default()
9197    }
9198
9199    /// Sets the value of [include_objects][crate::model::PostgresqlSourceConfig::include_objects].
9200    ///
9201    /// # Example
9202    /// ```ignore,no_run
9203    /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9204    /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
9205    /// let x = PostgresqlSourceConfig::new().set_include_objects(PostgresqlRdbms::default()/* use setters */);
9206    /// ```
9207    pub fn set_include_objects<T>(mut self, v: T) -> Self
9208    where
9209        T: std::convert::Into<crate::model::PostgresqlRdbms>,
9210    {
9211        self.include_objects = std::option::Option::Some(v.into());
9212        self
9213    }
9214
9215    /// Sets or clears the value of [include_objects][crate::model::PostgresqlSourceConfig::include_objects].
9216    ///
9217    /// # Example
9218    /// ```ignore,no_run
9219    /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9220    /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
9221    /// let x = PostgresqlSourceConfig::new().set_or_clear_include_objects(Some(PostgresqlRdbms::default()/* use setters */));
9222    /// let x = PostgresqlSourceConfig::new().set_or_clear_include_objects(None::<PostgresqlRdbms>);
9223    /// ```
9224    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
9225    where
9226        T: std::convert::Into<crate::model::PostgresqlRdbms>,
9227    {
9228        self.include_objects = v.map(|x| x.into());
9229        self
9230    }
9231
9232    /// Sets the value of [exclude_objects][crate::model::PostgresqlSourceConfig::exclude_objects].
9233    ///
9234    /// # Example
9235    /// ```ignore,no_run
9236    /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9237    /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
9238    /// let x = PostgresqlSourceConfig::new().set_exclude_objects(PostgresqlRdbms::default()/* use setters */);
9239    /// ```
9240    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
9241    where
9242        T: std::convert::Into<crate::model::PostgresqlRdbms>,
9243    {
9244        self.exclude_objects = std::option::Option::Some(v.into());
9245        self
9246    }
9247
9248    /// Sets or clears the value of [exclude_objects][crate::model::PostgresqlSourceConfig::exclude_objects].
9249    ///
9250    /// # Example
9251    /// ```ignore,no_run
9252    /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9253    /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
9254    /// let x = PostgresqlSourceConfig::new().set_or_clear_exclude_objects(Some(PostgresqlRdbms::default()/* use setters */));
9255    /// let x = PostgresqlSourceConfig::new().set_or_clear_exclude_objects(None::<PostgresqlRdbms>);
9256    /// ```
9257    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
9258    where
9259        T: std::convert::Into<crate::model::PostgresqlRdbms>,
9260    {
9261        self.exclude_objects = v.map(|x| x.into());
9262        self
9263    }
9264
9265    /// Sets the value of [replication_slot][crate::model::PostgresqlSourceConfig::replication_slot].
9266    ///
9267    /// # Example
9268    /// ```ignore,no_run
9269    /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9270    /// let x = PostgresqlSourceConfig::new().set_replication_slot("example");
9271    /// ```
9272    pub fn set_replication_slot<T: std::convert::Into<std::string::String>>(
9273        mut self,
9274        v: T,
9275    ) -> Self {
9276        self.replication_slot = v.into();
9277        self
9278    }
9279
9280    /// Sets the value of [publication][crate::model::PostgresqlSourceConfig::publication].
9281    ///
9282    /// # Example
9283    /// ```ignore,no_run
9284    /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9285    /// let x = PostgresqlSourceConfig::new().set_publication("example");
9286    /// ```
9287    pub fn set_publication<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9288        self.publication = v.into();
9289        self
9290    }
9291
9292    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::PostgresqlSourceConfig::max_concurrent_backfill_tasks].
9293    ///
9294    /// # Example
9295    /// ```ignore,no_run
9296    /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9297    /// let x = PostgresqlSourceConfig::new().set_max_concurrent_backfill_tasks(42);
9298    /// ```
9299    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9300        self.max_concurrent_backfill_tasks = v.into();
9301        self
9302    }
9303}
9304
9305impl wkt::message::Message for PostgresqlSourceConfig {
9306    fn typename() -> &'static str {
9307        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSourceConfig"
9308    }
9309}
9310
9311/// SQLServer Column.
9312#[derive(Clone, Default, PartialEq)]
9313#[non_exhaustive]
9314pub struct SqlServerColumn {
9315    /// Column name.
9316    pub column: std::string::String,
9317
9318    /// The SQLServer data type.
9319    pub data_type: std::string::String,
9320
9321    /// Column length.
9322    pub length: i32,
9323
9324    /// Column precision.
9325    pub precision: i32,
9326
9327    /// Column scale.
9328    pub scale: i32,
9329
9330    /// Whether or not the column represents a primary key.
9331    pub primary_key: bool,
9332
9333    /// Whether or not the column can accept a null value.
9334    pub nullable: bool,
9335
9336    /// The ordinal position of the column in the table.
9337    pub ordinal_position: i32,
9338
9339    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9340}
9341
9342impl SqlServerColumn {
9343    pub fn new() -> Self {
9344        std::default::Default::default()
9345    }
9346
9347    /// Sets the value of [column][crate::model::SqlServerColumn::column].
9348    ///
9349    /// # Example
9350    /// ```ignore,no_run
9351    /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9352    /// let x = SqlServerColumn::new().set_column("example");
9353    /// ```
9354    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9355        self.column = v.into();
9356        self
9357    }
9358
9359    /// Sets the value of [data_type][crate::model::SqlServerColumn::data_type].
9360    ///
9361    /// # Example
9362    /// ```ignore,no_run
9363    /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9364    /// let x = SqlServerColumn::new().set_data_type("example");
9365    /// ```
9366    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9367        self.data_type = v.into();
9368        self
9369    }
9370
9371    /// Sets the value of [length][crate::model::SqlServerColumn::length].
9372    ///
9373    /// # Example
9374    /// ```ignore,no_run
9375    /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9376    /// let x = SqlServerColumn::new().set_length(42);
9377    /// ```
9378    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9379        self.length = v.into();
9380        self
9381    }
9382
9383    /// Sets the value of [precision][crate::model::SqlServerColumn::precision].
9384    ///
9385    /// # Example
9386    /// ```ignore,no_run
9387    /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9388    /// let x = SqlServerColumn::new().set_precision(42);
9389    /// ```
9390    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9391        self.precision = v.into();
9392        self
9393    }
9394
9395    /// Sets the value of [scale][crate::model::SqlServerColumn::scale].
9396    ///
9397    /// # Example
9398    /// ```ignore,no_run
9399    /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9400    /// let x = SqlServerColumn::new().set_scale(42);
9401    /// ```
9402    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9403        self.scale = v.into();
9404        self
9405    }
9406
9407    /// Sets the value of [primary_key][crate::model::SqlServerColumn::primary_key].
9408    ///
9409    /// # Example
9410    /// ```ignore,no_run
9411    /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9412    /// let x = SqlServerColumn::new().set_primary_key(true);
9413    /// ```
9414    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9415        self.primary_key = v.into();
9416        self
9417    }
9418
9419    /// Sets the value of [nullable][crate::model::SqlServerColumn::nullable].
9420    ///
9421    /// # Example
9422    /// ```ignore,no_run
9423    /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9424    /// let x = SqlServerColumn::new().set_nullable(true);
9425    /// ```
9426    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9427        self.nullable = v.into();
9428        self
9429    }
9430
9431    /// Sets the value of [ordinal_position][crate::model::SqlServerColumn::ordinal_position].
9432    ///
9433    /// # Example
9434    /// ```ignore,no_run
9435    /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9436    /// let x = SqlServerColumn::new().set_ordinal_position(42);
9437    /// ```
9438    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9439        self.ordinal_position = v.into();
9440        self
9441    }
9442}
9443
9444impl wkt::message::Message for SqlServerColumn {
9445    fn typename() -> &'static str {
9446        "type.googleapis.com/google.cloud.datastream.v1.SqlServerColumn"
9447    }
9448}
9449
9450/// SQLServer table.
9451#[derive(Clone, Default, PartialEq)]
9452#[non_exhaustive]
9453pub struct SqlServerTable {
9454    /// Table name.
9455    pub table: std::string::String,
9456
9457    /// SQLServer columns in the schema.
9458    /// When unspecified as part of include/exclude objects,
9459    /// includes/excludes everything.
9460    pub columns: std::vec::Vec<crate::model::SqlServerColumn>,
9461
9462    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9463}
9464
9465impl SqlServerTable {
9466    pub fn new() -> Self {
9467        std::default::Default::default()
9468    }
9469
9470    /// Sets the value of [table][crate::model::SqlServerTable::table].
9471    ///
9472    /// # Example
9473    /// ```ignore,no_run
9474    /// # use google_cloud_datastream_v1::model::SqlServerTable;
9475    /// let x = SqlServerTable::new().set_table("example");
9476    /// ```
9477    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9478        self.table = v.into();
9479        self
9480    }
9481
9482    /// Sets the value of [columns][crate::model::SqlServerTable::columns].
9483    ///
9484    /// # Example
9485    /// ```ignore,no_run
9486    /// # use google_cloud_datastream_v1::model::SqlServerTable;
9487    /// use google_cloud_datastream_v1::model::SqlServerColumn;
9488    /// let x = SqlServerTable::new()
9489    ///     .set_columns([
9490    ///         SqlServerColumn::default()/* use setters */,
9491    ///         SqlServerColumn::default()/* use (different) setters */,
9492    ///     ]);
9493    /// ```
9494    pub fn set_columns<T, V>(mut self, v: T) -> Self
9495    where
9496        T: std::iter::IntoIterator<Item = V>,
9497        V: std::convert::Into<crate::model::SqlServerColumn>,
9498    {
9499        use std::iter::Iterator;
9500        self.columns = v.into_iter().map(|i| i.into()).collect();
9501        self
9502    }
9503}
9504
9505impl wkt::message::Message for SqlServerTable {
9506    fn typename() -> &'static str {
9507        "type.googleapis.com/google.cloud.datastream.v1.SqlServerTable"
9508    }
9509}
9510
9511/// SQLServer schema.
9512#[derive(Clone, Default, PartialEq)]
9513#[non_exhaustive]
9514pub struct SqlServerSchema {
9515    /// Schema name.
9516    pub schema: std::string::String,
9517
9518    /// Tables in the schema.
9519    pub tables: std::vec::Vec<crate::model::SqlServerTable>,
9520
9521    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9522}
9523
9524impl SqlServerSchema {
9525    pub fn new() -> Self {
9526        std::default::Default::default()
9527    }
9528
9529    /// Sets the value of [schema][crate::model::SqlServerSchema::schema].
9530    ///
9531    /// # Example
9532    /// ```ignore,no_run
9533    /// # use google_cloud_datastream_v1::model::SqlServerSchema;
9534    /// let x = SqlServerSchema::new().set_schema("example");
9535    /// ```
9536    pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9537        self.schema = v.into();
9538        self
9539    }
9540
9541    /// Sets the value of [tables][crate::model::SqlServerSchema::tables].
9542    ///
9543    /// # Example
9544    /// ```ignore,no_run
9545    /// # use google_cloud_datastream_v1::model::SqlServerSchema;
9546    /// use google_cloud_datastream_v1::model::SqlServerTable;
9547    /// let x = SqlServerSchema::new()
9548    ///     .set_tables([
9549    ///         SqlServerTable::default()/* use setters */,
9550    ///         SqlServerTable::default()/* use (different) setters */,
9551    ///     ]);
9552    /// ```
9553    pub fn set_tables<T, V>(mut self, v: T) -> Self
9554    where
9555        T: std::iter::IntoIterator<Item = V>,
9556        V: std::convert::Into<crate::model::SqlServerTable>,
9557    {
9558        use std::iter::Iterator;
9559        self.tables = v.into_iter().map(|i| i.into()).collect();
9560        self
9561    }
9562}
9563
9564impl wkt::message::Message for SqlServerSchema {
9565    fn typename() -> &'static str {
9566        "type.googleapis.com/google.cloud.datastream.v1.SqlServerSchema"
9567    }
9568}
9569
9570/// SQLServer database structure.
9571#[derive(Clone, Default, PartialEq)]
9572#[non_exhaustive]
9573pub struct SqlServerRdbms {
9574    /// SQLServer schemas in the database server.
9575    pub schemas: std::vec::Vec<crate::model::SqlServerSchema>,
9576
9577    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9578}
9579
9580impl SqlServerRdbms {
9581    pub fn new() -> Self {
9582        std::default::Default::default()
9583    }
9584
9585    /// Sets the value of [schemas][crate::model::SqlServerRdbms::schemas].
9586    ///
9587    /// # Example
9588    /// ```ignore,no_run
9589    /// # use google_cloud_datastream_v1::model::SqlServerRdbms;
9590    /// use google_cloud_datastream_v1::model::SqlServerSchema;
9591    /// let x = SqlServerRdbms::new()
9592    ///     .set_schemas([
9593    ///         SqlServerSchema::default()/* use setters */,
9594    ///         SqlServerSchema::default()/* use (different) setters */,
9595    ///     ]);
9596    /// ```
9597    pub fn set_schemas<T, V>(mut self, v: T) -> Self
9598    where
9599        T: std::iter::IntoIterator<Item = V>,
9600        V: std::convert::Into<crate::model::SqlServerSchema>,
9601    {
9602        use std::iter::Iterator;
9603        self.schemas = v.into_iter().map(|i| i.into()).collect();
9604        self
9605    }
9606}
9607
9608impl wkt::message::Message for SqlServerRdbms {
9609    fn typename() -> &'static str {
9610        "type.googleapis.com/google.cloud.datastream.v1.SqlServerRdbms"
9611    }
9612}
9613
9614/// SQLServer data source configuration
9615#[derive(Clone, Default, PartialEq)]
9616#[non_exhaustive]
9617pub struct SqlServerSourceConfig {
9618    /// SQLServer objects to include in the stream.
9619    pub include_objects: std::option::Option<crate::model::SqlServerRdbms>,
9620
9621    /// SQLServer objects to exclude from the stream.
9622    pub exclude_objects: std::option::Option<crate::model::SqlServerRdbms>,
9623
9624    /// Max concurrent CDC tasks.
9625    pub max_concurrent_cdc_tasks: i32,
9626
9627    /// Max concurrent backfill tasks.
9628    pub max_concurrent_backfill_tasks: i32,
9629
9630    /// Configuration to select the CDC read method for the stream.
9631    pub cdc_method: std::option::Option<crate::model::sql_server_source_config::CdcMethod>,
9632
9633    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9634}
9635
9636impl SqlServerSourceConfig {
9637    pub fn new() -> Self {
9638        std::default::Default::default()
9639    }
9640
9641    /// Sets the value of [include_objects][crate::model::SqlServerSourceConfig::include_objects].
9642    ///
9643    /// # Example
9644    /// ```ignore,no_run
9645    /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9646    /// use google_cloud_datastream_v1::model::SqlServerRdbms;
9647    /// let x = SqlServerSourceConfig::new().set_include_objects(SqlServerRdbms::default()/* use setters */);
9648    /// ```
9649    pub fn set_include_objects<T>(mut self, v: T) -> Self
9650    where
9651        T: std::convert::Into<crate::model::SqlServerRdbms>,
9652    {
9653        self.include_objects = std::option::Option::Some(v.into());
9654        self
9655    }
9656
9657    /// Sets or clears the value of [include_objects][crate::model::SqlServerSourceConfig::include_objects].
9658    ///
9659    /// # Example
9660    /// ```ignore,no_run
9661    /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9662    /// use google_cloud_datastream_v1::model::SqlServerRdbms;
9663    /// let x = SqlServerSourceConfig::new().set_or_clear_include_objects(Some(SqlServerRdbms::default()/* use setters */));
9664    /// let x = SqlServerSourceConfig::new().set_or_clear_include_objects(None::<SqlServerRdbms>);
9665    /// ```
9666    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
9667    where
9668        T: std::convert::Into<crate::model::SqlServerRdbms>,
9669    {
9670        self.include_objects = v.map(|x| x.into());
9671        self
9672    }
9673
9674    /// Sets the value of [exclude_objects][crate::model::SqlServerSourceConfig::exclude_objects].
9675    ///
9676    /// # Example
9677    /// ```ignore,no_run
9678    /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9679    /// use google_cloud_datastream_v1::model::SqlServerRdbms;
9680    /// let x = SqlServerSourceConfig::new().set_exclude_objects(SqlServerRdbms::default()/* use setters */);
9681    /// ```
9682    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
9683    where
9684        T: std::convert::Into<crate::model::SqlServerRdbms>,
9685    {
9686        self.exclude_objects = std::option::Option::Some(v.into());
9687        self
9688    }
9689
9690    /// Sets or clears the value of [exclude_objects][crate::model::SqlServerSourceConfig::exclude_objects].
9691    ///
9692    /// # Example
9693    /// ```ignore,no_run
9694    /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9695    /// use google_cloud_datastream_v1::model::SqlServerRdbms;
9696    /// let x = SqlServerSourceConfig::new().set_or_clear_exclude_objects(Some(SqlServerRdbms::default()/* use setters */));
9697    /// let x = SqlServerSourceConfig::new().set_or_clear_exclude_objects(None::<SqlServerRdbms>);
9698    /// ```
9699    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
9700    where
9701        T: std::convert::Into<crate::model::SqlServerRdbms>,
9702    {
9703        self.exclude_objects = v.map(|x| x.into());
9704        self
9705    }
9706
9707    /// Sets the value of [max_concurrent_cdc_tasks][crate::model::SqlServerSourceConfig::max_concurrent_cdc_tasks].
9708    ///
9709    /// # Example
9710    /// ```ignore,no_run
9711    /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9712    /// let x = SqlServerSourceConfig::new().set_max_concurrent_cdc_tasks(42);
9713    /// ```
9714    pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9715        self.max_concurrent_cdc_tasks = v.into();
9716        self
9717    }
9718
9719    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::SqlServerSourceConfig::max_concurrent_backfill_tasks].
9720    ///
9721    /// # Example
9722    /// ```ignore,no_run
9723    /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9724    /// let x = SqlServerSourceConfig::new().set_max_concurrent_backfill_tasks(42);
9725    /// ```
9726    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9727        self.max_concurrent_backfill_tasks = v.into();
9728        self
9729    }
9730
9731    /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method].
9732    ///
9733    /// Note that all the setters affecting `cdc_method` are mutually
9734    /// exclusive.
9735    ///
9736    /// # Example
9737    /// ```ignore,no_run
9738    /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9739    /// use google_cloud_datastream_v1::model::SqlServerTransactionLogs;
9740    /// let x = SqlServerSourceConfig::new().set_cdc_method(Some(
9741    ///     google_cloud_datastream_v1::model::sql_server_source_config::CdcMethod::TransactionLogs(SqlServerTransactionLogs::default().into())));
9742    /// ```
9743    pub fn set_cdc_method<
9744        T: std::convert::Into<std::option::Option<crate::model::sql_server_source_config::CdcMethod>>,
9745    >(
9746        mut self,
9747        v: T,
9748    ) -> Self {
9749        self.cdc_method = v.into();
9750        self
9751    }
9752
9753    /// The value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
9754    /// if it holds a `TransactionLogs`, `None` if the field is not set or
9755    /// holds a different branch.
9756    pub fn transaction_logs(
9757        &self,
9758    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerTransactionLogs>> {
9759        #[allow(unreachable_patterns)]
9760        self.cdc_method.as_ref().and_then(|v| match v {
9761            crate::model::sql_server_source_config::CdcMethod::TransactionLogs(v) => {
9762                std::option::Option::Some(v)
9763            }
9764            _ => std::option::Option::None,
9765        })
9766    }
9767
9768    /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
9769    /// to hold a `TransactionLogs`.
9770    ///
9771    /// Note that all the setters affecting `cdc_method` are
9772    /// mutually exclusive.
9773    ///
9774    /// # Example
9775    /// ```ignore,no_run
9776    /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9777    /// use google_cloud_datastream_v1::model::SqlServerTransactionLogs;
9778    /// let x = SqlServerSourceConfig::new().set_transaction_logs(SqlServerTransactionLogs::default()/* use setters */);
9779    /// assert!(x.transaction_logs().is_some());
9780    /// assert!(x.change_tables().is_none());
9781    /// ```
9782    pub fn set_transaction_logs<
9783        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerTransactionLogs>>,
9784    >(
9785        mut self,
9786        v: T,
9787    ) -> Self {
9788        self.cdc_method = std::option::Option::Some(
9789            crate::model::sql_server_source_config::CdcMethod::TransactionLogs(v.into()),
9790        );
9791        self
9792    }
9793
9794    /// The value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
9795    /// if it holds a `ChangeTables`, `None` if the field is not set or
9796    /// holds a different branch.
9797    pub fn change_tables(
9798        &self,
9799    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerChangeTables>> {
9800        #[allow(unreachable_patterns)]
9801        self.cdc_method.as_ref().and_then(|v| match v {
9802            crate::model::sql_server_source_config::CdcMethod::ChangeTables(v) => {
9803                std::option::Option::Some(v)
9804            }
9805            _ => std::option::Option::None,
9806        })
9807    }
9808
9809    /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
9810    /// to hold a `ChangeTables`.
9811    ///
9812    /// Note that all the setters affecting `cdc_method` are
9813    /// mutually exclusive.
9814    ///
9815    /// # Example
9816    /// ```ignore,no_run
9817    /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9818    /// use google_cloud_datastream_v1::model::SqlServerChangeTables;
9819    /// let x = SqlServerSourceConfig::new().set_change_tables(SqlServerChangeTables::default()/* use setters */);
9820    /// assert!(x.change_tables().is_some());
9821    /// assert!(x.transaction_logs().is_none());
9822    /// ```
9823    pub fn set_change_tables<
9824        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerChangeTables>>,
9825    >(
9826        mut self,
9827        v: T,
9828    ) -> Self {
9829        self.cdc_method = std::option::Option::Some(
9830            crate::model::sql_server_source_config::CdcMethod::ChangeTables(v.into()),
9831        );
9832        self
9833    }
9834}
9835
9836impl wkt::message::Message for SqlServerSourceConfig {
9837    fn typename() -> &'static str {
9838        "type.googleapis.com/google.cloud.datastream.v1.SqlServerSourceConfig"
9839    }
9840}
9841
9842/// Defines additional types related to [SqlServerSourceConfig].
9843pub mod sql_server_source_config {
9844    #[allow(unused_imports)]
9845    use super::*;
9846
9847    /// Configuration to select the CDC read method for the stream.
9848    #[derive(Clone, Debug, PartialEq)]
9849    #[non_exhaustive]
9850    pub enum CdcMethod {
9851        /// CDC reader reads from transaction logs.
9852        TransactionLogs(std::boxed::Box<crate::model::SqlServerTransactionLogs>),
9853        /// CDC reader reads from change tables.
9854        ChangeTables(std::boxed::Box<crate::model::SqlServerChangeTables>),
9855    }
9856}
9857
9858/// Configuration to use Transaction Logs CDC read method.
9859#[derive(Clone, Default, PartialEq)]
9860#[non_exhaustive]
9861pub struct SqlServerTransactionLogs {
9862    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9863}
9864
9865impl SqlServerTransactionLogs {
9866    pub fn new() -> Self {
9867        std::default::Default::default()
9868    }
9869}
9870
9871impl wkt::message::Message for SqlServerTransactionLogs {
9872    fn typename() -> &'static str {
9873        "type.googleapis.com/google.cloud.datastream.v1.SqlServerTransactionLogs"
9874    }
9875}
9876
9877/// Configuration to use Change Tables CDC read method.
9878#[derive(Clone, Default, PartialEq)]
9879#[non_exhaustive]
9880pub struct SqlServerChangeTables {
9881    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9882}
9883
9884impl SqlServerChangeTables {
9885    pub fn new() -> Self {
9886        std::default::Default::default()
9887    }
9888}
9889
9890impl wkt::message::Message for SqlServerChangeTables {
9891    fn typename() -> &'static str {
9892        "type.googleapis.com/google.cloud.datastream.v1.SqlServerChangeTables"
9893    }
9894}
9895
9896/// MySQL Column.
9897#[derive(Clone, Default, PartialEq)]
9898#[non_exhaustive]
9899pub struct MysqlColumn {
9900    /// Column name.
9901    pub column: std::string::String,
9902
9903    /// The MySQL data type. Full data types list can be found here:
9904    /// <https://dev.mysql.com/doc/refman/8.0/en/data-types.html>
9905    pub data_type: std::string::String,
9906
9907    /// Column length.
9908    pub length: i32,
9909
9910    /// Column collation.
9911    pub collation: std::string::String,
9912
9913    /// Whether or not the column represents a primary key.
9914    pub primary_key: bool,
9915
9916    /// Whether or not the column can accept a null value.
9917    pub nullable: bool,
9918
9919    /// The ordinal position of the column in the table.
9920    pub ordinal_position: i32,
9921
9922    /// Column precision.
9923    pub precision: i32,
9924
9925    /// Column scale.
9926    pub scale: i32,
9927
9928    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9929}
9930
9931impl MysqlColumn {
9932    pub fn new() -> Self {
9933        std::default::Default::default()
9934    }
9935
9936    /// Sets the value of [column][crate::model::MysqlColumn::column].
9937    ///
9938    /// # Example
9939    /// ```ignore,no_run
9940    /// # use google_cloud_datastream_v1::model::MysqlColumn;
9941    /// let x = MysqlColumn::new().set_column("example");
9942    /// ```
9943    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9944        self.column = v.into();
9945        self
9946    }
9947
9948    /// Sets the value of [data_type][crate::model::MysqlColumn::data_type].
9949    ///
9950    /// # Example
9951    /// ```ignore,no_run
9952    /// # use google_cloud_datastream_v1::model::MysqlColumn;
9953    /// let x = MysqlColumn::new().set_data_type("example");
9954    /// ```
9955    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9956        self.data_type = v.into();
9957        self
9958    }
9959
9960    /// Sets the value of [length][crate::model::MysqlColumn::length].
9961    ///
9962    /// # Example
9963    /// ```ignore,no_run
9964    /// # use google_cloud_datastream_v1::model::MysqlColumn;
9965    /// let x = MysqlColumn::new().set_length(42);
9966    /// ```
9967    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9968        self.length = v.into();
9969        self
9970    }
9971
9972    /// Sets the value of [collation][crate::model::MysqlColumn::collation].
9973    ///
9974    /// # Example
9975    /// ```ignore,no_run
9976    /// # use google_cloud_datastream_v1::model::MysqlColumn;
9977    /// let x = MysqlColumn::new().set_collation("example");
9978    /// ```
9979    pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9980        self.collation = v.into();
9981        self
9982    }
9983
9984    /// Sets the value of [primary_key][crate::model::MysqlColumn::primary_key].
9985    ///
9986    /// # Example
9987    /// ```ignore,no_run
9988    /// # use google_cloud_datastream_v1::model::MysqlColumn;
9989    /// let x = MysqlColumn::new().set_primary_key(true);
9990    /// ```
9991    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9992        self.primary_key = v.into();
9993        self
9994    }
9995
9996    /// Sets the value of [nullable][crate::model::MysqlColumn::nullable].
9997    ///
9998    /// # Example
9999    /// ```ignore,no_run
10000    /// # use google_cloud_datastream_v1::model::MysqlColumn;
10001    /// let x = MysqlColumn::new().set_nullable(true);
10002    /// ```
10003    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10004        self.nullable = v.into();
10005        self
10006    }
10007
10008    /// Sets the value of [ordinal_position][crate::model::MysqlColumn::ordinal_position].
10009    ///
10010    /// # Example
10011    /// ```ignore,no_run
10012    /// # use google_cloud_datastream_v1::model::MysqlColumn;
10013    /// let x = MysqlColumn::new().set_ordinal_position(42);
10014    /// ```
10015    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10016        self.ordinal_position = v.into();
10017        self
10018    }
10019
10020    /// Sets the value of [precision][crate::model::MysqlColumn::precision].
10021    ///
10022    /// # Example
10023    /// ```ignore,no_run
10024    /// # use google_cloud_datastream_v1::model::MysqlColumn;
10025    /// let x = MysqlColumn::new().set_precision(42);
10026    /// ```
10027    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10028        self.precision = v.into();
10029        self
10030    }
10031
10032    /// Sets the value of [scale][crate::model::MysqlColumn::scale].
10033    ///
10034    /// # Example
10035    /// ```ignore,no_run
10036    /// # use google_cloud_datastream_v1::model::MysqlColumn;
10037    /// let x = MysqlColumn::new().set_scale(42);
10038    /// ```
10039    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10040        self.scale = v.into();
10041        self
10042    }
10043}
10044
10045impl wkt::message::Message for MysqlColumn {
10046    fn typename() -> &'static str {
10047        "type.googleapis.com/google.cloud.datastream.v1.MysqlColumn"
10048    }
10049}
10050
10051/// MySQL table.
10052#[derive(Clone, Default, PartialEq)]
10053#[non_exhaustive]
10054pub struct MysqlTable {
10055    /// Table name.
10056    pub table: std::string::String,
10057
10058    /// MySQL columns in the database.
10059    /// When unspecified as part of include/exclude objects, includes/excludes
10060    /// everything.
10061    pub mysql_columns: std::vec::Vec<crate::model::MysqlColumn>,
10062
10063    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10064}
10065
10066impl MysqlTable {
10067    pub fn new() -> Self {
10068        std::default::Default::default()
10069    }
10070
10071    /// Sets the value of [table][crate::model::MysqlTable::table].
10072    ///
10073    /// # Example
10074    /// ```ignore,no_run
10075    /// # use google_cloud_datastream_v1::model::MysqlTable;
10076    /// let x = MysqlTable::new().set_table("example");
10077    /// ```
10078    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10079        self.table = v.into();
10080        self
10081    }
10082
10083    /// Sets the value of [mysql_columns][crate::model::MysqlTable::mysql_columns].
10084    ///
10085    /// # Example
10086    /// ```ignore,no_run
10087    /// # use google_cloud_datastream_v1::model::MysqlTable;
10088    /// use google_cloud_datastream_v1::model::MysqlColumn;
10089    /// let x = MysqlTable::new()
10090    ///     .set_mysql_columns([
10091    ///         MysqlColumn::default()/* use setters */,
10092    ///         MysqlColumn::default()/* use (different) setters */,
10093    ///     ]);
10094    /// ```
10095    pub fn set_mysql_columns<T, V>(mut self, v: T) -> Self
10096    where
10097        T: std::iter::IntoIterator<Item = V>,
10098        V: std::convert::Into<crate::model::MysqlColumn>,
10099    {
10100        use std::iter::Iterator;
10101        self.mysql_columns = v.into_iter().map(|i| i.into()).collect();
10102        self
10103    }
10104}
10105
10106impl wkt::message::Message for MysqlTable {
10107    fn typename() -> &'static str {
10108        "type.googleapis.com/google.cloud.datastream.v1.MysqlTable"
10109    }
10110}
10111
10112/// MySQL database.
10113#[derive(Clone, Default, PartialEq)]
10114#[non_exhaustive]
10115pub struct MysqlDatabase {
10116    /// Database name.
10117    pub database: std::string::String,
10118
10119    /// Tables in the database.
10120    pub mysql_tables: std::vec::Vec<crate::model::MysqlTable>,
10121
10122    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10123}
10124
10125impl MysqlDatabase {
10126    pub fn new() -> Self {
10127        std::default::Default::default()
10128    }
10129
10130    /// Sets the value of [database][crate::model::MysqlDatabase::database].
10131    ///
10132    /// # Example
10133    /// ```ignore,no_run
10134    /// # use google_cloud_datastream_v1::model::MysqlDatabase;
10135    /// let x = MysqlDatabase::new().set_database("example");
10136    /// ```
10137    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10138        self.database = v.into();
10139        self
10140    }
10141
10142    /// Sets the value of [mysql_tables][crate::model::MysqlDatabase::mysql_tables].
10143    ///
10144    /// # Example
10145    /// ```ignore,no_run
10146    /// # use google_cloud_datastream_v1::model::MysqlDatabase;
10147    /// use google_cloud_datastream_v1::model::MysqlTable;
10148    /// let x = MysqlDatabase::new()
10149    ///     .set_mysql_tables([
10150    ///         MysqlTable::default()/* use setters */,
10151    ///         MysqlTable::default()/* use (different) setters */,
10152    ///     ]);
10153    /// ```
10154    pub fn set_mysql_tables<T, V>(mut self, v: T) -> Self
10155    where
10156        T: std::iter::IntoIterator<Item = V>,
10157        V: std::convert::Into<crate::model::MysqlTable>,
10158    {
10159        use std::iter::Iterator;
10160        self.mysql_tables = v.into_iter().map(|i| i.into()).collect();
10161        self
10162    }
10163}
10164
10165impl wkt::message::Message for MysqlDatabase {
10166    fn typename() -> &'static str {
10167        "type.googleapis.com/google.cloud.datastream.v1.MysqlDatabase"
10168    }
10169}
10170
10171/// MySQL database structure
10172#[derive(Clone, Default, PartialEq)]
10173#[non_exhaustive]
10174pub struct MysqlRdbms {
10175    /// Mysql databases on the server
10176    pub mysql_databases: std::vec::Vec<crate::model::MysqlDatabase>,
10177
10178    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10179}
10180
10181impl MysqlRdbms {
10182    pub fn new() -> Self {
10183        std::default::Default::default()
10184    }
10185
10186    /// Sets the value of [mysql_databases][crate::model::MysqlRdbms::mysql_databases].
10187    ///
10188    /// # Example
10189    /// ```ignore,no_run
10190    /// # use google_cloud_datastream_v1::model::MysqlRdbms;
10191    /// use google_cloud_datastream_v1::model::MysqlDatabase;
10192    /// let x = MysqlRdbms::new()
10193    ///     .set_mysql_databases([
10194    ///         MysqlDatabase::default()/* use setters */,
10195    ///         MysqlDatabase::default()/* use (different) setters */,
10196    ///     ]);
10197    /// ```
10198    pub fn set_mysql_databases<T, V>(mut self, v: T) -> Self
10199    where
10200        T: std::iter::IntoIterator<Item = V>,
10201        V: std::convert::Into<crate::model::MysqlDatabase>,
10202    {
10203        use std::iter::Iterator;
10204        self.mysql_databases = v.into_iter().map(|i| i.into()).collect();
10205        self
10206    }
10207}
10208
10209impl wkt::message::Message for MysqlRdbms {
10210    fn typename() -> &'static str {
10211        "type.googleapis.com/google.cloud.datastream.v1.MysqlRdbms"
10212    }
10213}
10214
10215/// MySQL source configuration
10216#[derive(Clone, Default, PartialEq)]
10217#[non_exhaustive]
10218pub struct MysqlSourceConfig {
10219    /// MySQL objects to retrieve from the source.
10220    pub include_objects: std::option::Option<crate::model::MysqlRdbms>,
10221
10222    /// MySQL objects to exclude from the stream.
10223    pub exclude_objects: std::option::Option<crate::model::MysqlRdbms>,
10224
10225    /// Maximum number of concurrent CDC tasks. The number should be non negative.
10226    /// If not set (or set to 0), the system's default value will be used.
10227    pub max_concurrent_cdc_tasks: i32,
10228
10229    /// Maximum number of concurrent backfill tasks. The number should be non
10230    /// negative. If not set (or set to 0), the system's default value will be
10231    /// used.
10232    pub max_concurrent_backfill_tasks: i32,
10233
10234    /// The CDC method to use for the stream.
10235    pub cdc_method: std::option::Option<crate::model::mysql_source_config::CdcMethod>,
10236
10237    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10238}
10239
10240impl MysqlSourceConfig {
10241    pub fn new() -> Self {
10242        std::default::Default::default()
10243    }
10244
10245    /// Sets the value of [include_objects][crate::model::MysqlSourceConfig::include_objects].
10246    ///
10247    /// # Example
10248    /// ```ignore,no_run
10249    /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10250    /// use google_cloud_datastream_v1::model::MysqlRdbms;
10251    /// let x = MysqlSourceConfig::new().set_include_objects(MysqlRdbms::default()/* use setters */);
10252    /// ```
10253    pub fn set_include_objects<T>(mut self, v: T) -> Self
10254    where
10255        T: std::convert::Into<crate::model::MysqlRdbms>,
10256    {
10257        self.include_objects = std::option::Option::Some(v.into());
10258        self
10259    }
10260
10261    /// Sets or clears the value of [include_objects][crate::model::MysqlSourceConfig::include_objects].
10262    ///
10263    /// # Example
10264    /// ```ignore,no_run
10265    /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10266    /// use google_cloud_datastream_v1::model::MysqlRdbms;
10267    /// let x = MysqlSourceConfig::new().set_or_clear_include_objects(Some(MysqlRdbms::default()/* use setters */));
10268    /// let x = MysqlSourceConfig::new().set_or_clear_include_objects(None::<MysqlRdbms>);
10269    /// ```
10270    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
10271    where
10272        T: std::convert::Into<crate::model::MysqlRdbms>,
10273    {
10274        self.include_objects = v.map(|x| x.into());
10275        self
10276    }
10277
10278    /// Sets the value of [exclude_objects][crate::model::MysqlSourceConfig::exclude_objects].
10279    ///
10280    /// # Example
10281    /// ```ignore,no_run
10282    /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10283    /// use google_cloud_datastream_v1::model::MysqlRdbms;
10284    /// let x = MysqlSourceConfig::new().set_exclude_objects(MysqlRdbms::default()/* use setters */);
10285    /// ```
10286    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
10287    where
10288        T: std::convert::Into<crate::model::MysqlRdbms>,
10289    {
10290        self.exclude_objects = std::option::Option::Some(v.into());
10291        self
10292    }
10293
10294    /// Sets or clears the value of [exclude_objects][crate::model::MysqlSourceConfig::exclude_objects].
10295    ///
10296    /// # Example
10297    /// ```ignore,no_run
10298    /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10299    /// use google_cloud_datastream_v1::model::MysqlRdbms;
10300    /// let x = MysqlSourceConfig::new().set_or_clear_exclude_objects(Some(MysqlRdbms::default()/* use setters */));
10301    /// let x = MysqlSourceConfig::new().set_or_clear_exclude_objects(None::<MysqlRdbms>);
10302    /// ```
10303    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
10304    where
10305        T: std::convert::Into<crate::model::MysqlRdbms>,
10306    {
10307        self.exclude_objects = v.map(|x| x.into());
10308        self
10309    }
10310
10311    /// Sets the value of [max_concurrent_cdc_tasks][crate::model::MysqlSourceConfig::max_concurrent_cdc_tasks].
10312    ///
10313    /// # Example
10314    /// ```ignore,no_run
10315    /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10316    /// let x = MysqlSourceConfig::new().set_max_concurrent_cdc_tasks(42);
10317    /// ```
10318    pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10319        self.max_concurrent_cdc_tasks = v.into();
10320        self
10321    }
10322
10323    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::MysqlSourceConfig::max_concurrent_backfill_tasks].
10324    ///
10325    /// # Example
10326    /// ```ignore,no_run
10327    /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10328    /// let x = MysqlSourceConfig::new().set_max_concurrent_backfill_tasks(42);
10329    /// ```
10330    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10331        self.max_concurrent_backfill_tasks = v.into();
10332        self
10333    }
10334
10335    /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method].
10336    ///
10337    /// Note that all the setters affecting `cdc_method` are mutually
10338    /// exclusive.
10339    ///
10340    /// # Example
10341    /// ```ignore,no_run
10342    /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10343    /// use google_cloud_datastream_v1::model::mysql_source_config::BinaryLogPosition;
10344    /// let x = MysqlSourceConfig::new().set_cdc_method(Some(
10345    ///     google_cloud_datastream_v1::model::mysql_source_config::CdcMethod::BinaryLogPosition(BinaryLogPosition::default().into())));
10346    /// ```
10347    pub fn set_cdc_method<
10348        T: std::convert::Into<std::option::Option<crate::model::mysql_source_config::CdcMethod>>,
10349    >(
10350        mut self,
10351        v: T,
10352    ) -> Self {
10353        self.cdc_method = v.into();
10354        self
10355    }
10356
10357    /// The value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
10358    /// if it holds a `BinaryLogPosition`, `None` if the field is not set or
10359    /// holds a different branch.
10360    pub fn binary_log_position(
10361        &self,
10362    ) -> std::option::Option<&std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>>
10363    {
10364        #[allow(unreachable_patterns)]
10365        self.cdc_method.as_ref().and_then(|v| match v {
10366            crate::model::mysql_source_config::CdcMethod::BinaryLogPosition(v) => {
10367                std::option::Option::Some(v)
10368            }
10369            _ => std::option::Option::None,
10370        })
10371    }
10372
10373    /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
10374    /// to hold a `BinaryLogPosition`.
10375    ///
10376    /// Note that all the setters affecting `cdc_method` are
10377    /// mutually exclusive.
10378    ///
10379    /// # Example
10380    /// ```ignore,no_run
10381    /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10382    /// use google_cloud_datastream_v1::model::mysql_source_config::BinaryLogPosition;
10383    /// let x = MysqlSourceConfig::new().set_binary_log_position(BinaryLogPosition::default()/* use setters */);
10384    /// assert!(x.binary_log_position().is_some());
10385    /// assert!(x.gtid().is_none());
10386    /// ```
10387    pub fn set_binary_log_position<
10388        T: std::convert::Into<std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>>,
10389    >(
10390        mut self,
10391        v: T,
10392    ) -> Self {
10393        self.cdc_method = std::option::Option::Some(
10394            crate::model::mysql_source_config::CdcMethod::BinaryLogPosition(v.into()),
10395        );
10396        self
10397    }
10398
10399    /// The value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
10400    /// if it holds a `Gtid`, `None` if the field is not set or
10401    /// holds a different branch.
10402    pub fn gtid(
10403        &self,
10404    ) -> std::option::Option<&std::boxed::Box<crate::model::mysql_source_config::Gtid>> {
10405        #[allow(unreachable_patterns)]
10406        self.cdc_method.as_ref().and_then(|v| match v {
10407            crate::model::mysql_source_config::CdcMethod::Gtid(v) => std::option::Option::Some(v),
10408            _ => std::option::Option::None,
10409        })
10410    }
10411
10412    /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
10413    /// to hold a `Gtid`.
10414    ///
10415    /// Note that all the setters affecting `cdc_method` are
10416    /// mutually exclusive.
10417    ///
10418    /// # Example
10419    /// ```ignore,no_run
10420    /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10421    /// use google_cloud_datastream_v1::model::mysql_source_config::Gtid;
10422    /// let x = MysqlSourceConfig::new().set_gtid(Gtid::default()/* use setters */);
10423    /// assert!(x.gtid().is_some());
10424    /// assert!(x.binary_log_position().is_none());
10425    /// ```
10426    pub fn set_gtid<
10427        T: std::convert::Into<std::boxed::Box<crate::model::mysql_source_config::Gtid>>,
10428    >(
10429        mut self,
10430        v: T,
10431    ) -> Self {
10432        self.cdc_method =
10433            std::option::Option::Some(crate::model::mysql_source_config::CdcMethod::Gtid(v.into()));
10434        self
10435    }
10436}
10437
10438impl wkt::message::Message for MysqlSourceConfig {
10439    fn typename() -> &'static str {
10440        "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig"
10441    }
10442}
10443
10444/// Defines additional types related to [MysqlSourceConfig].
10445pub mod mysql_source_config {
10446    #[allow(unused_imports)]
10447    use super::*;
10448
10449    /// Use Binary log position based replication.
10450    #[derive(Clone, Default, PartialEq)]
10451    #[non_exhaustive]
10452    pub struct BinaryLogPosition {
10453        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10454    }
10455
10456    impl BinaryLogPosition {
10457        pub fn new() -> Self {
10458            std::default::Default::default()
10459        }
10460    }
10461
10462    impl wkt::message::Message for BinaryLogPosition {
10463        fn typename() -> &'static str {
10464            "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig.BinaryLogPosition"
10465        }
10466    }
10467
10468    /// Use GTID based replication.
10469    #[derive(Clone, Default, PartialEq)]
10470    #[non_exhaustive]
10471    pub struct Gtid {
10472        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10473    }
10474
10475    impl Gtid {
10476        pub fn new() -> Self {
10477            std::default::Default::default()
10478        }
10479    }
10480
10481    impl wkt::message::Message for Gtid {
10482        fn typename() -> &'static str {
10483            "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig.Gtid"
10484        }
10485    }
10486
10487    /// The CDC method to use for the stream.
10488    #[derive(Clone, Debug, PartialEq)]
10489    #[non_exhaustive]
10490    pub enum CdcMethod {
10491        /// Use Binary log position based replication.
10492        BinaryLogPosition(std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>),
10493        /// Use GTID based replication.
10494        Gtid(std::boxed::Box<crate::model::mysql_source_config::Gtid>),
10495    }
10496}
10497
10498/// Salesforce source configuration
10499#[derive(Clone, Default, PartialEq)]
10500#[non_exhaustive]
10501pub struct SalesforceSourceConfig {
10502    /// Salesforce objects to retrieve from the source.
10503    pub include_objects: std::option::Option<crate::model::SalesforceOrg>,
10504
10505    /// Salesforce objects to exclude from the stream.
10506    pub exclude_objects: std::option::Option<crate::model::SalesforceOrg>,
10507
10508    /// Required. Salesforce objects polling interval. The interval at which new
10509    /// changes will be polled for each object. The duration must be between 5
10510    /// minutes and 24 hours.
10511    pub polling_interval: std::option::Option<wkt::Duration>,
10512
10513    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10514}
10515
10516impl SalesforceSourceConfig {
10517    pub fn new() -> Self {
10518        std::default::Default::default()
10519    }
10520
10521    /// Sets the value of [include_objects][crate::model::SalesforceSourceConfig::include_objects].
10522    ///
10523    /// # Example
10524    /// ```ignore,no_run
10525    /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10526    /// use google_cloud_datastream_v1::model::SalesforceOrg;
10527    /// let x = SalesforceSourceConfig::new().set_include_objects(SalesforceOrg::default()/* use setters */);
10528    /// ```
10529    pub fn set_include_objects<T>(mut self, v: T) -> Self
10530    where
10531        T: std::convert::Into<crate::model::SalesforceOrg>,
10532    {
10533        self.include_objects = std::option::Option::Some(v.into());
10534        self
10535    }
10536
10537    /// Sets or clears the value of [include_objects][crate::model::SalesforceSourceConfig::include_objects].
10538    ///
10539    /// # Example
10540    /// ```ignore,no_run
10541    /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10542    /// use google_cloud_datastream_v1::model::SalesforceOrg;
10543    /// let x = SalesforceSourceConfig::new().set_or_clear_include_objects(Some(SalesforceOrg::default()/* use setters */));
10544    /// let x = SalesforceSourceConfig::new().set_or_clear_include_objects(None::<SalesforceOrg>);
10545    /// ```
10546    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
10547    where
10548        T: std::convert::Into<crate::model::SalesforceOrg>,
10549    {
10550        self.include_objects = v.map(|x| x.into());
10551        self
10552    }
10553
10554    /// Sets the value of [exclude_objects][crate::model::SalesforceSourceConfig::exclude_objects].
10555    ///
10556    /// # Example
10557    /// ```ignore,no_run
10558    /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10559    /// use google_cloud_datastream_v1::model::SalesforceOrg;
10560    /// let x = SalesforceSourceConfig::new().set_exclude_objects(SalesforceOrg::default()/* use setters */);
10561    /// ```
10562    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
10563    where
10564        T: std::convert::Into<crate::model::SalesforceOrg>,
10565    {
10566        self.exclude_objects = std::option::Option::Some(v.into());
10567        self
10568    }
10569
10570    /// Sets or clears the value of [exclude_objects][crate::model::SalesforceSourceConfig::exclude_objects].
10571    ///
10572    /// # Example
10573    /// ```ignore,no_run
10574    /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10575    /// use google_cloud_datastream_v1::model::SalesforceOrg;
10576    /// let x = SalesforceSourceConfig::new().set_or_clear_exclude_objects(Some(SalesforceOrg::default()/* use setters */));
10577    /// let x = SalesforceSourceConfig::new().set_or_clear_exclude_objects(None::<SalesforceOrg>);
10578    /// ```
10579    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
10580    where
10581        T: std::convert::Into<crate::model::SalesforceOrg>,
10582    {
10583        self.exclude_objects = v.map(|x| x.into());
10584        self
10585    }
10586
10587    /// Sets the value of [polling_interval][crate::model::SalesforceSourceConfig::polling_interval].
10588    ///
10589    /// # Example
10590    /// ```ignore,no_run
10591    /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10592    /// use wkt::Duration;
10593    /// let x = SalesforceSourceConfig::new().set_polling_interval(Duration::default()/* use setters */);
10594    /// ```
10595    pub fn set_polling_interval<T>(mut self, v: T) -> Self
10596    where
10597        T: std::convert::Into<wkt::Duration>,
10598    {
10599        self.polling_interval = std::option::Option::Some(v.into());
10600        self
10601    }
10602
10603    /// Sets or clears the value of [polling_interval][crate::model::SalesforceSourceConfig::polling_interval].
10604    ///
10605    /// # Example
10606    /// ```ignore,no_run
10607    /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10608    /// use wkt::Duration;
10609    /// let x = SalesforceSourceConfig::new().set_or_clear_polling_interval(Some(Duration::default()/* use setters */));
10610    /// let x = SalesforceSourceConfig::new().set_or_clear_polling_interval(None::<Duration>);
10611    /// ```
10612    pub fn set_or_clear_polling_interval<T>(mut self, v: std::option::Option<T>) -> Self
10613    where
10614        T: std::convert::Into<wkt::Duration>,
10615    {
10616        self.polling_interval = v.map(|x| x.into());
10617        self
10618    }
10619}
10620
10621impl wkt::message::Message for SalesforceSourceConfig {
10622    fn typename() -> &'static str {
10623        "type.googleapis.com/google.cloud.datastream.v1.SalesforceSourceConfig"
10624    }
10625}
10626
10627/// Salesforce organization structure.
10628#[derive(Clone, Default, PartialEq)]
10629#[non_exhaustive]
10630pub struct SalesforceOrg {
10631    /// Salesforce objects in the database server.
10632    pub objects: std::vec::Vec<crate::model::SalesforceObject>,
10633
10634    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10635}
10636
10637impl SalesforceOrg {
10638    pub fn new() -> Self {
10639        std::default::Default::default()
10640    }
10641
10642    /// Sets the value of [objects][crate::model::SalesforceOrg::objects].
10643    ///
10644    /// # Example
10645    /// ```ignore,no_run
10646    /// # use google_cloud_datastream_v1::model::SalesforceOrg;
10647    /// use google_cloud_datastream_v1::model::SalesforceObject;
10648    /// let x = SalesforceOrg::new()
10649    ///     .set_objects([
10650    ///         SalesforceObject::default()/* use setters */,
10651    ///         SalesforceObject::default()/* use (different) setters */,
10652    ///     ]);
10653    /// ```
10654    pub fn set_objects<T, V>(mut self, v: T) -> Self
10655    where
10656        T: std::iter::IntoIterator<Item = V>,
10657        V: std::convert::Into<crate::model::SalesforceObject>,
10658    {
10659        use std::iter::Iterator;
10660        self.objects = v.into_iter().map(|i| i.into()).collect();
10661        self
10662    }
10663}
10664
10665impl wkt::message::Message for SalesforceOrg {
10666    fn typename() -> &'static str {
10667        "type.googleapis.com/google.cloud.datastream.v1.SalesforceOrg"
10668    }
10669}
10670
10671/// Salesforce object.
10672#[derive(Clone, Default, PartialEq)]
10673#[non_exhaustive]
10674pub struct SalesforceObject {
10675    /// Object name.
10676    pub object_name: std::string::String,
10677
10678    /// Salesforce fields.
10679    /// When unspecified as part of include objects,
10680    /// includes everything, when unspecified as part of exclude objects,
10681    /// excludes nothing.
10682    pub fields: std::vec::Vec<crate::model::SalesforceField>,
10683
10684    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10685}
10686
10687impl SalesforceObject {
10688    pub fn new() -> Self {
10689        std::default::Default::default()
10690    }
10691
10692    /// Sets the value of [object_name][crate::model::SalesforceObject::object_name].
10693    ///
10694    /// # Example
10695    /// ```ignore,no_run
10696    /// # use google_cloud_datastream_v1::model::SalesforceObject;
10697    /// let x = SalesforceObject::new().set_object_name("example");
10698    /// ```
10699    pub fn set_object_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10700        self.object_name = v.into();
10701        self
10702    }
10703
10704    /// Sets the value of [fields][crate::model::SalesforceObject::fields].
10705    ///
10706    /// # Example
10707    /// ```ignore,no_run
10708    /// # use google_cloud_datastream_v1::model::SalesforceObject;
10709    /// use google_cloud_datastream_v1::model::SalesforceField;
10710    /// let x = SalesforceObject::new()
10711    ///     .set_fields([
10712    ///         SalesforceField::default()/* use setters */,
10713    ///         SalesforceField::default()/* use (different) setters */,
10714    ///     ]);
10715    /// ```
10716    pub fn set_fields<T, V>(mut self, v: T) -> Self
10717    where
10718        T: std::iter::IntoIterator<Item = V>,
10719        V: std::convert::Into<crate::model::SalesforceField>,
10720    {
10721        use std::iter::Iterator;
10722        self.fields = v.into_iter().map(|i| i.into()).collect();
10723        self
10724    }
10725}
10726
10727impl wkt::message::Message for SalesforceObject {
10728    fn typename() -> &'static str {
10729        "type.googleapis.com/google.cloud.datastream.v1.SalesforceObject"
10730    }
10731}
10732
10733/// Salesforce field.
10734#[derive(Clone, Default, PartialEq)]
10735#[non_exhaustive]
10736pub struct SalesforceField {
10737    /// Field name.
10738    pub name: std::string::String,
10739
10740    /// The data type.
10741    pub data_type: std::string::String,
10742
10743    /// Indicates whether the field can accept nil values.
10744    pub nillable: bool,
10745
10746    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10747}
10748
10749impl SalesforceField {
10750    pub fn new() -> Self {
10751        std::default::Default::default()
10752    }
10753
10754    /// Sets the value of [name][crate::model::SalesforceField::name].
10755    ///
10756    /// # Example
10757    /// ```ignore,no_run
10758    /// # use google_cloud_datastream_v1::model::SalesforceField;
10759    /// let x = SalesforceField::new().set_name("example");
10760    /// ```
10761    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10762        self.name = v.into();
10763        self
10764    }
10765
10766    /// Sets the value of [data_type][crate::model::SalesforceField::data_type].
10767    ///
10768    /// # Example
10769    /// ```ignore,no_run
10770    /// # use google_cloud_datastream_v1::model::SalesforceField;
10771    /// let x = SalesforceField::new().set_data_type("example");
10772    /// ```
10773    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10774        self.data_type = v.into();
10775        self
10776    }
10777
10778    /// Sets the value of [nillable][crate::model::SalesforceField::nillable].
10779    ///
10780    /// # Example
10781    /// ```ignore,no_run
10782    /// # use google_cloud_datastream_v1::model::SalesforceField;
10783    /// let x = SalesforceField::new().set_nillable(true);
10784    /// ```
10785    pub fn set_nillable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10786        self.nillable = v.into();
10787        self
10788    }
10789}
10790
10791impl wkt::message::Message for SalesforceField {
10792    fn typename() -> &'static str {
10793        "type.googleapis.com/google.cloud.datastream.v1.SalesforceField"
10794    }
10795}
10796
10797/// MongoDB source configuration.
10798#[derive(Clone, Default, PartialEq)]
10799#[non_exhaustive]
10800pub struct MongodbSourceConfig {
10801    /// MongoDB collections to include in the stream.
10802    pub include_objects: std::option::Option<crate::model::MongodbCluster>,
10803
10804    /// MongoDB collections to exclude from the stream.
10805    pub exclude_objects: std::option::Option<crate::model::MongodbCluster>,
10806
10807    /// Optional. Maximum number of concurrent backfill tasks. The number should be
10808    /// non-negative and less than or equal to 50. If not set (or set to 0), the
10809    /// system's default value is used
10810    pub max_concurrent_backfill_tasks: i32,
10811
10812    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10813}
10814
10815impl MongodbSourceConfig {
10816    pub fn new() -> Self {
10817        std::default::Default::default()
10818    }
10819
10820    /// Sets the value of [include_objects][crate::model::MongodbSourceConfig::include_objects].
10821    ///
10822    /// # Example
10823    /// ```ignore,no_run
10824    /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
10825    /// use google_cloud_datastream_v1::model::MongodbCluster;
10826    /// let x = MongodbSourceConfig::new().set_include_objects(MongodbCluster::default()/* use setters */);
10827    /// ```
10828    pub fn set_include_objects<T>(mut self, v: T) -> Self
10829    where
10830        T: std::convert::Into<crate::model::MongodbCluster>,
10831    {
10832        self.include_objects = std::option::Option::Some(v.into());
10833        self
10834    }
10835
10836    /// Sets or clears the value of [include_objects][crate::model::MongodbSourceConfig::include_objects].
10837    ///
10838    /// # Example
10839    /// ```ignore,no_run
10840    /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
10841    /// use google_cloud_datastream_v1::model::MongodbCluster;
10842    /// let x = MongodbSourceConfig::new().set_or_clear_include_objects(Some(MongodbCluster::default()/* use setters */));
10843    /// let x = MongodbSourceConfig::new().set_or_clear_include_objects(None::<MongodbCluster>);
10844    /// ```
10845    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
10846    where
10847        T: std::convert::Into<crate::model::MongodbCluster>,
10848    {
10849        self.include_objects = v.map(|x| x.into());
10850        self
10851    }
10852
10853    /// Sets the value of [exclude_objects][crate::model::MongodbSourceConfig::exclude_objects].
10854    ///
10855    /// # Example
10856    /// ```ignore,no_run
10857    /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
10858    /// use google_cloud_datastream_v1::model::MongodbCluster;
10859    /// let x = MongodbSourceConfig::new().set_exclude_objects(MongodbCluster::default()/* use setters */);
10860    /// ```
10861    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
10862    where
10863        T: std::convert::Into<crate::model::MongodbCluster>,
10864    {
10865        self.exclude_objects = std::option::Option::Some(v.into());
10866        self
10867    }
10868
10869    /// Sets or clears the value of [exclude_objects][crate::model::MongodbSourceConfig::exclude_objects].
10870    ///
10871    /// # Example
10872    /// ```ignore,no_run
10873    /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
10874    /// use google_cloud_datastream_v1::model::MongodbCluster;
10875    /// let x = MongodbSourceConfig::new().set_or_clear_exclude_objects(Some(MongodbCluster::default()/* use setters */));
10876    /// let x = MongodbSourceConfig::new().set_or_clear_exclude_objects(None::<MongodbCluster>);
10877    /// ```
10878    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
10879    where
10880        T: std::convert::Into<crate::model::MongodbCluster>,
10881    {
10882        self.exclude_objects = v.map(|x| x.into());
10883        self
10884    }
10885
10886    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::MongodbSourceConfig::max_concurrent_backfill_tasks].
10887    ///
10888    /// # Example
10889    /// ```ignore,no_run
10890    /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
10891    /// let x = MongodbSourceConfig::new().set_max_concurrent_backfill_tasks(42);
10892    /// ```
10893    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10894        self.max_concurrent_backfill_tasks = v.into();
10895        self
10896    }
10897}
10898
10899impl wkt::message::Message for MongodbSourceConfig {
10900    fn typename() -> &'static str {
10901        "type.googleapis.com/google.cloud.datastream.v1.MongodbSourceConfig"
10902    }
10903}
10904
10905/// MongoDB Cluster structure.
10906#[derive(Clone, Default, PartialEq)]
10907#[non_exhaustive]
10908pub struct MongodbCluster {
10909    /// MongoDB databases in the cluster.
10910    pub databases: std::vec::Vec<crate::model::MongodbDatabase>,
10911
10912    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10913}
10914
10915impl MongodbCluster {
10916    pub fn new() -> Self {
10917        std::default::Default::default()
10918    }
10919
10920    /// Sets the value of [databases][crate::model::MongodbCluster::databases].
10921    ///
10922    /// # Example
10923    /// ```ignore,no_run
10924    /// # use google_cloud_datastream_v1::model::MongodbCluster;
10925    /// use google_cloud_datastream_v1::model::MongodbDatabase;
10926    /// let x = MongodbCluster::new()
10927    ///     .set_databases([
10928    ///         MongodbDatabase::default()/* use setters */,
10929    ///         MongodbDatabase::default()/* use (different) setters */,
10930    ///     ]);
10931    /// ```
10932    pub fn set_databases<T, V>(mut self, v: T) -> Self
10933    where
10934        T: std::iter::IntoIterator<Item = V>,
10935        V: std::convert::Into<crate::model::MongodbDatabase>,
10936    {
10937        use std::iter::Iterator;
10938        self.databases = v.into_iter().map(|i| i.into()).collect();
10939        self
10940    }
10941}
10942
10943impl wkt::message::Message for MongodbCluster {
10944    fn typename() -> &'static str {
10945        "type.googleapis.com/google.cloud.datastream.v1.MongodbCluster"
10946    }
10947}
10948
10949/// MongoDB Database.
10950#[derive(Clone, Default, PartialEq)]
10951#[non_exhaustive]
10952pub struct MongodbDatabase {
10953    /// Database name.
10954    pub database: std::string::String,
10955
10956    /// Collections in the database.
10957    pub collections: std::vec::Vec<crate::model::MongodbCollection>,
10958
10959    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10960}
10961
10962impl MongodbDatabase {
10963    pub fn new() -> Self {
10964        std::default::Default::default()
10965    }
10966
10967    /// Sets the value of [database][crate::model::MongodbDatabase::database].
10968    ///
10969    /// # Example
10970    /// ```ignore,no_run
10971    /// # use google_cloud_datastream_v1::model::MongodbDatabase;
10972    /// let x = MongodbDatabase::new().set_database("example");
10973    /// ```
10974    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10975        self.database = v.into();
10976        self
10977    }
10978
10979    /// Sets the value of [collections][crate::model::MongodbDatabase::collections].
10980    ///
10981    /// # Example
10982    /// ```ignore,no_run
10983    /// # use google_cloud_datastream_v1::model::MongodbDatabase;
10984    /// use google_cloud_datastream_v1::model::MongodbCollection;
10985    /// let x = MongodbDatabase::new()
10986    ///     .set_collections([
10987    ///         MongodbCollection::default()/* use setters */,
10988    ///         MongodbCollection::default()/* use (different) setters */,
10989    ///     ]);
10990    /// ```
10991    pub fn set_collections<T, V>(mut self, v: T) -> Self
10992    where
10993        T: std::iter::IntoIterator<Item = V>,
10994        V: std::convert::Into<crate::model::MongodbCollection>,
10995    {
10996        use std::iter::Iterator;
10997        self.collections = v.into_iter().map(|i| i.into()).collect();
10998        self
10999    }
11000}
11001
11002impl wkt::message::Message for MongodbDatabase {
11003    fn typename() -> &'static str {
11004        "type.googleapis.com/google.cloud.datastream.v1.MongodbDatabase"
11005    }
11006}
11007
11008/// MongoDB Collection.
11009#[derive(Clone, Default, PartialEq)]
11010#[non_exhaustive]
11011pub struct MongodbCollection {
11012    /// Collection name.
11013    pub collection: std::string::String,
11014
11015    /// Fields in the collection.
11016    pub fields: std::vec::Vec<crate::model::MongodbField>,
11017
11018    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11019}
11020
11021impl MongodbCollection {
11022    pub fn new() -> Self {
11023        std::default::Default::default()
11024    }
11025
11026    /// Sets the value of [collection][crate::model::MongodbCollection::collection].
11027    ///
11028    /// # Example
11029    /// ```ignore,no_run
11030    /// # use google_cloud_datastream_v1::model::MongodbCollection;
11031    /// let x = MongodbCollection::new().set_collection("example");
11032    /// ```
11033    pub fn set_collection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11034        self.collection = v.into();
11035        self
11036    }
11037
11038    /// Sets the value of [fields][crate::model::MongodbCollection::fields].
11039    ///
11040    /// # Example
11041    /// ```ignore,no_run
11042    /// # use google_cloud_datastream_v1::model::MongodbCollection;
11043    /// use google_cloud_datastream_v1::model::MongodbField;
11044    /// let x = MongodbCollection::new()
11045    ///     .set_fields([
11046    ///         MongodbField::default()/* use setters */,
11047    ///         MongodbField::default()/* use (different) setters */,
11048    ///     ]);
11049    /// ```
11050    pub fn set_fields<T, V>(mut self, v: T) -> Self
11051    where
11052        T: std::iter::IntoIterator<Item = V>,
11053        V: std::convert::Into<crate::model::MongodbField>,
11054    {
11055        use std::iter::Iterator;
11056        self.fields = v.into_iter().map(|i| i.into()).collect();
11057        self
11058    }
11059}
11060
11061impl wkt::message::Message for MongodbCollection {
11062    fn typename() -> &'static str {
11063        "type.googleapis.com/google.cloud.datastream.v1.MongodbCollection"
11064    }
11065}
11066
11067/// MongoDB Field.
11068#[derive(Clone, Default, PartialEq)]
11069#[non_exhaustive]
11070pub struct MongodbField {
11071    /// Field name.
11072    pub field: std::string::String,
11073
11074    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11075}
11076
11077impl MongodbField {
11078    pub fn new() -> Self {
11079        std::default::Default::default()
11080    }
11081
11082    /// Sets the value of [field][crate::model::MongodbField::field].
11083    ///
11084    /// # Example
11085    /// ```ignore,no_run
11086    /// # use google_cloud_datastream_v1::model::MongodbField;
11087    /// let x = MongodbField::new().set_field("example");
11088    /// ```
11089    pub fn set_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11090        self.field = v.into();
11091        self
11092    }
11093}
11094
11095impl wkt::message::Message for MongodbField {
11096    fn typename() -> &'static str {
11097        "type.googleapis.com/google.cloud.datastream.v1.MongodbField"
11098    }
11099}
11100
11101/// The configuration of the stream source.
11102#[derive(Clone, Default, PartialEq)]
11103#[non_exhaustive]
11104pub struct SourceConfig {
11105    /// Required. Source connection profile resource.
11106    /// Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
11107    pub source_connection_profile: std::string::String,
11108
11109    /// Stream configuration that is specific to the data source type.
11110    pub source_stream_config: std::option::Option<crate::model::source_config::SourceStreamConfig>,
11111
11112    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11113}
11114
11115impl SourceConfig {
11116    pub fn new() -> Self {
11117        std::default::Default::default()
11118    }
11119
11120    /// Sets the value of [source_connection_profile][crate::model::SourceConfig::source_connection_profile].
11121    ///
11122    /// # Example
11123    /// ```ignore,no_run
11124    /// # use google_cloud_datastream_v1::model::SourceConfig;
11125    /// let x = SourceConfig::new().set_source_connection_profile("example");
11126    /// ```
11127    pub fn set_source_connection_profile<T: std::convert::Into<std::string::String>>(
11128        mut self,
11129        v: T,
11130    ) -> Self {
11131        self.source_connection_profile = v.into();
11132        self
11133    }
11134
11135    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config].
11136    ///
11137    /// Note that all the setters affecting `source_stream_config` are mutually
11138    /// exclusive.
11139    ///
11140    /// # Example
11141    /// ```ignore,no_run
11142    /// # use google_cloud_datastream_v1::model::SourceConfig;
11143    /// use google_cloud_datastream_v1::model::OracleSourceConfig;
11144    /// let x = SourceConfig::new().set_source_stream_config(Some(
11145    ///     google_cloud_datastream_v1::model::source_config::SourceStreamConfig::OracleSourceConfig(OracleSourceConfig::default().into())));
11146    /// ```
11147    pub fn set_source_stream_config<
11148        T: std::convert::Into<std::option::Option<crate::model::source_config::SourceStreamConfig>>,
11149    >(
11150        mut self,
11151        v: T,
11152    ) -> Self {
11153        self.source_stream_config = v.into();
11154        self
11155    }
11156
11157    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11158    /// if it holds a `OracleSourceConfig`, `None` if the field is not set or
11159    /// holds a different branch.
11160    pub fn oracle_source_config(
11161        &self,
11162    ) -> std::option::Option<&std::boxed::Box<crate::model::OracleSourceConfig>> {
11163        #[allow(unreachable_patterns)]
11164        self.source_stream_config.as_ref().and_then(|v| match v {
11165            crate::model::source_config::SourceStreamConfig::OracleSourceConfig(v) => {
11166                std::option::Option::Some(v)
11167            }
11168            _ => std::option::Option::None,
11169        })
11170    }
11171
11172    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11173    /// to hold a `OracleSourceConfig`.
11174    ///
11175    /// Note that all the setters affecting `source_stream_config` are
11176    /// mutually exclusive.
11177    ///
11178    /// # Example
11179    /// ```ignore,no_run
11180    /// # use google_cloud_datastream_v1::model::SourceConfig;
11181    /// use google_cloud_datastream_v1::model::OracleSourceConfig;
11182    /// let x = SourceConfig::new().set_oracle_source_config(OracleSourceConfig::default()/* use setters */);
11183    /// assert!(x.oracle_source_config().is_some());
11184    /// assert!(x.mysql_source_config().is_none());
11185    /// assert!(x.postgresql_source_config().is_none());
11186    /// assert!(x.sql_server_source_config().is_none());
11187    /// assert!(x.salesforce_source_config().is_none());
11188    /// assert!(x.mongodb_source_config().is_none());
11189    /// ```
11190    pub fn set_oracle_source_config<
11191        T: std::convert::Into<std::boxed::Box<crate::model::OracleSourceConfig>>,
11192    >(
11193        mut self,
11194        v: T,
11195    ) -> Self {
11196        self.source_stream_config = std::option::Option::Some(
11197            crate::model::source_config::SourceStreamConfig::OracleSourceConfig(v.into()),
11198        );
11199        self
11200    }
11201
11202    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11203    /// if it holds a `MysqlSourceConfig`, `None` if the field is not set or
11204    /// holds a different branch.
11205    pub fn mysql_source_config(
11206        &self,
11207    ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlSourceConfig>> {
11208        #[allow(unreachable_patterns)]
11209        self.source_stream_config.as_ref().and_then(|v| match v {
11210            crate::model::source_config::SourceStreamConfig::MysqlSourceConfig(v) => {
11211                std::option::Option::Some(v)
11212            }
11213            _ => std::option::Option::None,
11214        })
11215    }
11216
11217    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11218    /// to hold a `MysqlSourceConfig`.
11219    ///
11220    /// Note that all the setters affecting `source_stream_config` are
11221    /// mutually exclusive.
11222    ///
11223    /// # Example
11224    /// ```ignore,no_run
11225    /// # use google_cloud_datastream_v1::model::SourceConfig;
11226    /// use google_cloud_datastream_v1::model::MysqlSourceConfig;
11227    /// let x = SourceConfig::new().set_mysql_source_config(MysqlSourceConfig::default()/* use setters */);
11228    /// assert!(x.mysql_source_config().is_some());
11229    /// assert!(x.oracle_source_config().is_none());
11230    /// assert!(x.postgresql_source_config().is_none());
11231    /// assert!(x.sql_server_source_config().is_none());
11232    /// assert!(x.salesforce_source_config().is_none());
11233    /// assert!(x.mongodb_source_config().is_none());
11234    /// ```
11235    pub fn set_mysql_source_config<
11236        T: std::convert::Into<std::boxed::Box<crate::model::MysqlSourceConfig>>,
11237    >(
11238        mut self,
11239        v: T,
11240    ) -> Self {
11241        self.source_stream_config = std::option::Option::Some(
11242            crate::model::source_config::SourceStreamConfig::MysqlSourceConfig(v.into()),
11243        );
11244        self
11245    }
11246
11247    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11248    /// if it holds a `PostgresqlSourceConfig`, `None` if the field is not set or
11249    /// holds a different branch.
11250    pub fn postgresql_source_config(
11251        &self,
11252    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlSourceConfig>> {
11253        #[allow(unreachable_patterns)]
11254        self.source_stream_config.as_ref().and_then(|v| match v {
11255            crate::model::source_config::SourceStreamConfig::PostgresqlSourceConfig(v) => {
11256                std::option::Option::Some(v)
11257            }
11258            _ => std::option::Option::None,
11259        })
11260    }
11261
11262    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11263    /// to hold a `PostgresqlSourceConfig`.
11264    ///
11265    /// Note that all the setters affecting `source_stream_config` are
11266    /// mutually exclusive.
11267    ///
11268    /// # Example
11269    /// ```ignore,no_run
11270    /// # use google_cloud_datastream_v1::model::SourceConfig;
11271    /// use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
11272    /// let x = SourceConfig::new().set_postgresql_source_config(PostgresqlSourceConfig::default()/* use setters */);
11273    /// assert!(x.postgresql_source_config().is_some());
11274    /// assert!(x.oracle_source_config().is_none());
11275    /// assert!(x.mysql_source_config().is_none());
11276    /// assert!(x.sql_server_source_config().is_none());
11277    /// assert!(x.salesforce_source_config().is_none());
11278    /// assert!(x.mongodb_source_config().is_none());
11279    /// ```
11280    pub fn set_postgresql_source_config<
11281        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlSourceConfig>>,
11282    >(
11283        mut self,
11284        v: T,
11285    ) -> Self {
11286        self.source_stream_config = std::option::Option::Some(
11287            crate::model::source_config::SourceStreamConfig::PostgresqlSourceConfig(v.into()),
11288        );
11289        self
11290    }
11291
11292    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11293    /// if it holds a `SqlServerSourceConfig`, `None` if the field is not set or
11294    /// holds a different branch.
11295    pub fn sql_server_source_config(
11296        &self,
11297    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerSourceConfig>> {
11298        #[allow(unreachable_patterns)]
11299        self.source_stream_config.as_ref().and_then(|v| match v {
11300            crate::model::source_config::SourceStreamConfig::SqlServerSourceConfig(v) => {
11301                std::option::Option::Some(v)
11302            }
11303            _ => std::option::Option::None,
11304        })
11305    }
11306
11307    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11308    /// to hold a `SqlServerSourceConfig`.
11309    ///
11310    /// Note that all the setters affecting `source_stream_config` are
11311    /// mutually exclusive.
11312    ///
11313    /// # Example
11314    /// ```ignore,no_run
11315    /// # use google_cloud_datastream_v1::model::SourceConfig;
11316    /// use google_cloud_datastream_v1::model::SqlServerSourceConfig;
11317    /// let x = SourceConfig::new().set_sql_server_source_config(SqlServerSourceConfig::default()/* use setters */);
11318    /// assert!(x.sql_server_source_config().is_some());
11319    /// assert!(x.oracle_source_config().is_none());
11320    /// assert!(x.mysql_source_config().is_none());
11321    /// assert!(x.postgresql_source_config().is_none());
11322    /// assert!(x.salesforce_source_config().is_none());
11323    /// assert!(x.mongodb_source_config().is_none());
11324    /// ```
11325    pub fn set_sql_server_source_config<
11326        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerSourceConfig>>,
11327    >(
11328        mut self,
11329        v: T,
11330    ) -> Self {
11331        self.source_stream_config = std::option::Option::Some(
11332            crate::model::source_config::SourceStreamConfig::SqlServerSourceConfig(v.into()),
11333        );
11334        self
11335    }
11336
11337    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11338    /// if it holds a `SalesforceSourceConfig`, `None` if the field is not set or
11339    /// holds a different branch.
11340    pub fn salesforce_source_config(
11341        &self,
11342    ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceSourceConfig>> {
11343        #[allow(unreachable_patterns)]
11344        self.source_stream_config.as_ref().and_then(|v| match v {
11345            crate::model::source_config::SourceStreamConfig::SalesforceSourceConfig(v) => {
11346                std::option::Option::Some(v)
11347            }
11348            _ => std::option::Option::None,
11349        })
11350    }
11351
11352    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11353    /// to hold a `SalesforceSourceConfig`.
11354    ///
11355    /// Note that all the setters affecting `source_stream_config` are
11356    /// mutually exclusive.
11357    ///
11358    /// # Example
11359    /// ```ignore,no_run
11360    /// # use google_cloud_datastream_v1::model::SourceConfig;
11361    /// use google_cloud_datastream_v1::model::SalesforceSourceConfig;
11362    /// let x = SourceConfig::new().set_salesforce_source_config(SalesforceSourceConfig::default()/* use setters */);
11363    /// assert!(x.salesforce_source_config().is_some());
11364    /// assert!(x.oracle_source_config().is_none());
11365    /// assert!(x.mysql_source_config().is_none());
11366    /// assert!(x.postgresql_source_config().is_none());
11367    /// assert!(x.sql_server_source_config().is_none());
11368    /// assert!(x.mongodb_source_config().is_none());
11369    /// ```
11370    pub fn set_salesforce_source_config<
11371        T: std::convert::Into<std::boxed::Box<crate::model::SalesforceSourceConfig>>,
11372    >(
11373        mut self,
11374        v: T,
11375    ) -> Self {
11376        self.source_stream_config = std::option::Option::Some(
11377            crate::model::source_config::SourceStreamConfig::SalesforceSourceConfig(v.into()),
11378        );
11379        self
11380    }
11381
11382    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11383    /// if it holds a `MongodbSourceConfig`, `None` if the field is not set or
11384    /// holds a different branch.
11385    pub fn mongodb_source_config(
11386        &self,
11387    ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbSourceConfig>> {
11388        #[allow(unreachable_patterns)]
11389        self.source_stream_config.as_ref().and_then(|v| match v {
11390            crate::model::source_config::SourceStreamConfig::MongodbSourceConfig(v) => {
11391                std::option::Option::Some(v)
11392            }
11393            _ => std::option::Option::None,
11394        })
11395    }
11396
11397    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11398    /// to hold a `MongodbSourceConfig`.
11399    ///
11400    /// Note that all the setters affecting `source_stream_config` are
11401    /// mutually exclusive.
11402    ///
11403    /// # Example
11404    /// ```ignore,no_run
11405    /// # use google_cloud_datastream_v1::model::SourceConfig;
11406    /// use google_cloud_datastream_v1::model::MongodbSourceConfig;
11407    /// let x = SourceConfig::new().set_mongodb_source_config(MongodbSourceConfig::default()/* use setters */);
11408    /// assert!(x.mongodb_source_config().is_some());
11409    /// assert!(x.oracle_source_config().is_none());
11410    /// assert!(x.mysql_source_config().is_none());
11411    /// assert!(x.postgresql_source_config().is_none());
11412    /// assert!(x.sql_server_source_config().is_none());
11413    /// assert!(x.salesforce_source_config().is_none());
11414    /// ```
11415    pub fn set_mongodb_source_config<
11416        T: std::convert::Into<std::boxed::Box<crate::model::MongodbSourceConfig>>,
11417    >(
11418        mut self,
11419        v: T,
11420    ) -> Self {
11421        self.source_stream_config = std::option::Option::Some(
11422            crate::model::source_config::SourceStreamConfig::MongodbSourceConfig(v.into()),
11423        );
11424        self
11425    }
11426}
11427
11428impl wkt::message::Message for SourceConfig {
11429    fn typename() -> &'static str {
11430        "type.googleapis.com/google.cloud.datastream.v1.SourceConfig"
11431    }
11432}
11433
11434/// Defines additional types related to [SourceConfig].
11435pub mod source_config {
11436    #[allow(unused_imports)]
11437    use super::*;
11438
11439    /// Stream configuration that is specific to the data source type.
11440    #[derive(Clone, Debug, PartialEq)]
11441    #[non_exhaustive]
11442    pub enum SourceStreamConfig {
11443        /// Oracle data source configuration.
11444        OracleSourceConfig(std::boxed::Box<crate::model::OracleSourceConfig>),
11445        /// MySQL data source configuration.
11446        MysqlSourceConfig(std::boxed::Box<crate::model::MysqlSourceConfig>),
11447        /// PostgreSQL data source configuration.
11448        PostgresqlSourceConfig(std::boxed::Box<crate::model::PostgresqlSourceConfig>),
11449        /// SQLServer data source configuration.
11450        SqlServerSourceConfig(std::boxed::Box<crate::model::SqlServerSourceConfig>),
11451        /// Salesforce data source configuration.
11452        SalesforceSourceConfig(std::boxed::Box<crate::model::SalesforceSourceConfig>),
11453        /// MongoDB data source configuration.
11454        MongodbSourceConfig(std::boxed::Box<crate::model::MongodbSourceConfig>),
11455    }
11456}
11457
11458/// AVRO file format configuration.
11459#[derive(Clone, Default, PartialEq)]
11460#[non_exhaustive]
11461pub struct AvroFileFormat {
11462    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11463}
11464
11465impl AvroFileFormat {
11466    pub fn new() -> Self {
11467        std::default::Default::default()
11468    }
11469}
11470
11471impl wkt::message::Message for AvroFileFormat {
11472    fn typename() -> &'static str {
11473        "type.googleapis.com/google.cloud.datastream.v1.AvroFileFormat"
11474    }
11475}
11476
11477/// JSON file format configuration.
11478#[derive(Clone, Default, PartialEq)]
11479#[non_exhaustive]
11480pub struct JsonFileFormat {
11481    /// The schema file format along JSON data files.
11482    pub schema_file_format: crate::model::json_file_format::SchemaFileFormat,
11483
11484    /// Compression of the loaded JSON file.
11485    pub compression: crate::model::json_file_format::JsonCompression,
11486
11487    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11488}
11489
11490impl JsonFileFormat {
11491    pub fn new() -> Self {
11492        std::default::Default::default()
11493    }
11494
11495    /// Sets the value of [schema_file_format][crate::model::JsonFileFormat::schema_file_format].
11496    ///
11497    /// # Example
11498    /// ```ignore,no_run
11499    /// # use google_cloud_datastream_v1::model::JsonFileFormat;
11500    /// use google_cloud_datastream_v1::model::json_file_format::SchemaFileFormat;
11501    /// let x0 = JsonFileFormat::new().set_schema_file_format(SchemaFileFormat::NoSchemaFile);
11502    /// let x1 = JsonFileFormat::new().set_schema_file_format(SchemaFileFormat::AvroSchemaFile);
11503    /// ```
11504    pub fn set_schema_file_format<
11505        T: std::convert::Into<crate::model::json_file_format::SchemaFileFormat>,
11506    >(
11507        mut self,
11508        v: T,
11509    ) -> Self {
11510        self.schema_file_format = v.into();
11511        self
11512    }
11513
11514    /// Sets the value of [compression][crate::model::JsonFileFormat::compression].
11515    ///
11516    /// # Example
11517    /// ```ignore,no_run
11518    /// # use google_cloud_datastream_v1::model::JsonFileFormat;
11519    /// use google_cloud_datastream_v1::model::json_file_format::JsonCompression;
11520    /// let x0 = JsonFileFormat::new().set_compression(JsonCompression::NoCompression);
11521    /// let x1 = JsonFileFormat::new().set_compression(JsonCompression::Gzip);
11522    /// ```
11523    pub fn set_compression<
11524        T: std::convert::Into<crate::model::json_file_format::JsonCompression>,
11525    >(
11526        mut self,
11527        v: T,
11528    ) -> Self {
11529        self.compression = v.into();
11530        self
11531    }
11532}
11533
11534impl wkt::message::Message for JsonFileFormat {
11535    fn typename() -> &'static str {
11536        "type.googleapis.com/google.cloud.datastream.v1.JsonFileFormat"
11537    }
11538}
11539
11540/// Defines additional types related to [JsonFileFormat].
11541pub mod json_file_format {
11542    #[allow(unused_imports)]
11543    use super::*;
11544
11545    /// Schema file format.
11546    ///
11547    /// # Working with unknown values
11548    ///
11549    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11550    /// additional enum variants at any time. Adding new variants is not considered
11551    /// a breaking change. Applications should write their code in anticipation of:
11552    ///
11553    /// - New values appearing in future releases of the client library, **and**
11554    /// - New values received dynamically, without application changes.
11555    ///
11556    /// Please consult the [Working with enums] section in the user guide for some
11557    /// guidelines.
11558    ///
11559    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11560    #[derive(Clone, Debug, PartialEq)]
11561    #[non_exhaustive]
11562    pub enum SchemaFileFormat {
11563        /// Unspecified schema file format.
11564        Unspecified,
11565        /// Do not attach schema file.
11566        NoSchemaFile,
11567        /// Avro schema format.
11568        AvroSchemaFile,
11569        /// If set, the enum was initialized with an unknown value.
11570        ///
11571        /// Applications can examine the value using [SchemaFileFormat::value] or
11572        /// [SchemaFileFormat::name].
11573        UnknownValue(schema_file_format::UnknownValue),
11574    }
11575
11576    #[doc(hidden)]
11577    pub mod schema_file_format {
11578        #[allow(unused_imports)]
11579        use super::*;
11580        #[derive(Clone, Debug, PartialEq)]
11581        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11582    }
11583
11584    impl SchemaFileFormat {
11585        /// Gets the enum value.
11586        ///
11587        /// Returns `None` if the enum contains an unknown value deserialized from
11588        /// the string representation of enums.
11589        pub fn value(&self) -> std::option::Option<i32> {
11590            match self {
11591                Self::Unspecified => std::option::Option::Some(0),
11592                Self::NoSchemaFile => std::option::Option::Some(1),
11593                Self::AvroSchemaFile => std::option::Option::Some(2),
11594                Self::UnknownValue(u) => u.0.value(),
11595            }
11596        }
11597
11598        /// Gets the enum value as a string.
11599        ///
11600        /// Returns `None` if the enum contains an unknown value deserialized from
11601        /// the integer representation of enums.
11602        pub fn name(&self) -> std::option::Option<&str> {
11603            match self {
11604                Self::Unspecified => std::option::Option::Some("SCHEMA_FILE_FORMAT_UNSPECIFIED"),
11605                Self::NoSchemaFile => std::option::Option::Some("NO_SCHEMA_FILE"),
11606                Self::AvroSchemaFile => std::option::Option::Some("AVRO_SCHEMA_FILE"),
11607                Self::UnknownValue(u) => u.0.name(),
11608            }
11609        }
11610    }
11611
11612    impl std::default::Default for SchemaFileFormat {
11613        fn default() -> Self {
11614            use std::convert::From;
11615            Self::from(0)
11616        }
11617    }
11618
11619    impl std::fmt::Display for SchemaFileFormat {
11620        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11621            wkt::internal::display_enum(f, self.name(), self.value())
11622        }
11623    }
11624
11625    impl std::convert::From<i32> for SchemaFileFormat {
11626        fn from(value: i32) -> Self {
11627            match value {
11628                0 => Self::Unspecified,
11629                1 => Self::NoSchemaFile,
11630                2 => Self::AvroSchemaFile,
11631                _ => Self::UnknownValue(schema_file_format::UnknownValue(
11632                    wkt::internal::UnknownEnumValue::Integer(value),
11633                )),
11634            }
11635        }
11636    }
11637
11638    impl std::convert::From<&str> for SchemaFileFormat {
11639        fn from(value: &str) -> Self {
11640            use std::string::ToString;
11641            match value {
11642                "SCHEMA_FILE_FORMAT_UNSPECIFIED" => Self::Unspecified,
11643                "NO_SCHEMA_FILE" => Self::NoSchemaFile,
11644                "AVRO_SCHEMA_FILE" => Self::AvroSchemaFile,
11645                _ => Self::UnknownValue(schema_file_format::UnknownValue(
11646                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11647                )),
11648            }
11649        }
11650    }
11651
11652    impl serde::ser::Serialize for SchemaFileFormat {
11653        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11654        where
11655            S: serde::Serializer,
11656        {
11657            match self {
11658                Self::Unspecified => serializer.serialize_i32(0),
11659                Self::NoSchemaFile => serializer.serialize_i32(1),
11660                Self::AvroSchemaFile => serializer.serialize_i32(2),
11661                Self::UnknownValue(u) => u.0.serialize(serializer),
11662            }
11663        }
11664    }
11665
11666    impl<'de> serde::de::Deserialize<'de> for SchemaFileFormat {
11667        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11668        where
11669            D: serde::Deserializer<'de>,
11670        {
11671            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SchemaFileFormat>::new(
11672                ".google.cloud.datastream.v1.JsonFileFormat.SchemaFileFormat",
11673            ))
11674        }
11675    }
11676
11677    /// Json file compression.
11678    ///
11679    /// # Working with unknown values
11680    ///
11681    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11682    /// additional enum variants at any time. Adding new variants is not considered
11683    /// a breaking change. Applications should write their code in anticipation of:
11684    ///
11685    /// - New values appearing in future releases of the client library, **and**
11686    /// - New values received dynamically, without application changes.
11687    ///
11688    /// Please consult the [Working with enums] section in the user guide for some
11689    /// guidelines.
11690    ///
11691    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11692    #[derive(Clone, Debug, PartialEq)]
11693    #[non_exhaustive]
11694    pub enum JsonCompression {
11695        /// Unspecified json file compression.
11696        Unspecified,
11697        /// Do not compress JSON file.
11698        NoCompression,
11699        /// Gzip compression.
11700        Gzip,
11701        /// If set, the enum was initialized with an unknown value.
11702        ///
11703        /// Applications can examine the value using [JsonCompression::value] or
11704        /// [JsonCompression::name].
11705        UnknownValue(json_compression::UnknownValue),
11706    }
11707
11708    #[doc(hidden)]
11709    pub mod json_compression {
11710        #[allow(unused_imports)]
11711        use super::*;
11712        #[derive(Clone, Debug, PartialEq)]
11713        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11714    }
11715
11716    impl JsonCompression {
11717        /// Gets the enum value.
11718        ///
11719        /// Returns `None` if the enum contains an unknown value deserialized from
11720        /// the string representation of enums.
11721        pub fn value(&self) -> std::option::Option<i32> {
11722            match self {
11723                Self::Unspecified => std::option::Option::Some(0),
11724                Self::NoCompression => std::option::Option::Some(1),
11725                Self::Gzip => std::option::Option::Some(2),
11726                Self::UnknownValue(u) => u.0.value(),
11727            }
11728        }
11729
11730        /// Gets the enum value as a string.
11731        ///
11732        /// Returns `None` if the enum contains an unknown value deserialized from
11733        /// the integer representation of enums.
11734        pub fn name(&self) -> std::option::Option<&str> {
11735            match self {
11736                Self::Unspecified => std::option::Option::Some("JSON_COMPRESSION_UNSPECIFIED"),
11737                Self::NoCompression => std::option::Option::Some("NO_COMPRESSION"),
11738                Self::Gzip => std::option::Option::Some("GZIP"),
11739                Self::UnknownValue(u) => u.0.name(),
11740            }
11741        }
11742    }
11743
11744    impl std::default::Default for JsonCompression {
11745        fn default() -> Self {
11746            use std::convert::From;
11747            Self::from(0)
11748        }
11749    }
11750
11751    impl std::fmt::Display for JsonCompression {
11752        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11753            wkt::internal::display_enum(f, self.name(), self.value())
11754        }
11755    }
11756
11757    impl std::convert::From<i32> for JsonCompression {
11758        fn from(value: i32) -> Self {
11759            match value {
11760                0 => Self::Unspecified,
11761                1 => Self::NoCompression,
11762                2 => Self::Gzip,
11763                _ => Self::UnknownValue(json_compression::UnknownValue(
11764                    wkt::internal::UnknownEnumValue::Integer(value),
11765                )),
11766            }
11767        }
11768    }
11769
11770    impl std::convert::From<&str> for JsonCompression {
11771        fn from(value: &str) -> Self {
11772            use std::string::ToString;
11773            match value {
11774                "JSON_COMPRESSION_UNSPECIFIED" => Self::Unspecified,
11775                "NO_COMPRESSION" => Self::NoCompression,
11776                "GZIP" => Self::Gzip,
11777                _ => Self::UnknownValue(json_compression::UnknownValue(
11778                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11779                )),
11780            }
11781        }
11782    }
11783
11784    impl serde::ser::Serialize for JsonCompression {
11785        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11786        where
11787            S: serde::Serializer,
11788        {
11789            match self {
11790                Self::Unspecified => serializer.serialize_i32(0),
11791                Self::NoCompression => serializer.serialize_i32(1),
11792                Self::Gzip => serializer.serialize_i32(2),
11793                Self::UnknownValue(u) => u.0.serialize(serializer),
11794            }
11795        }
11796    }
11797
11798    impl<'de> serde::de::Deserialize<'de> for JsonCompression {
11799        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11800        where
11801            D: serde::Deserializer<'de>,
11802        {
11803            deserializer.deserialize_any(wkt::internal::EnumVisitor::<JsonCompression>::new(
11804                ".google.cloud.datastream.v1.JsonFileFormat.JsonCompression",
11805            ))
11806        }
11807    }
11808}
11809
11810/// Google Cloud Storage destination configuration
11811#[derive(Clone, Default, PartialEq)]
11812#[non_exhaustive]
11813pub struct GcsDestinationConfig {
11814    /// Path inside the Cloud Storage bucket to write data to.
11815    pub path: std::string::String,
11816
11817    /// The maximum file size to be saved in the bucket.
11818    pub file_rotation_mb: i32,
11819
11820    /// The maximum duration for which new events are added before a file is
11821    /// closed and a new file is created. Values within the range of 15-60 seconds
11822    /// are allowed.
11823    pub file_rotation_interval: std::option::Option<wkt::Duration>,
11824
11825    /// File Format that the data should be written in.
11826    pub file_format: std::option::Option<crate::model::gcs_destination_config::FileFormat>,
11827
11828    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11829}
11830
11831impl GcsDestinationConfig {
11832    pub fn new() -> Self {
11833        std::default::Default::default()
11834    }
11835
11836    /// Sets the value of [path][crate::model::GcsDestinationConfig::path].
11837    ///
11838    /// # Example
11839    /// ```ignore,no_run
11840    /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
11841    /// let x = GcsDestinationConfig::new().set_path("example");
11842    /// ```
11843    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11844        self.path = v.into();
11845        self
11846    }
11847
11848    /// Sets the value of [file_rotation_mb][crate::model::GcsDestinationConfig::file_rotation_mb].
11849    ///
11850    /// # Example
11851    /// ```ignore,no_run
11852    /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
11853    /// let x = GcsDestinationConfig::new().set_file_rotation_mb(42);
11854    /// ```
11855    pub fn set_file_rotation_mb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11856        self.file_rotation_mb = v.into();
11857        self
11858    }
11859
11860    /// Sets the value of [file_rotation_interval][crate::model::GcsDestinationConfig::file_rotation_interval].
11861    ///
11862    /// # Example
11863    /// ```ignore,no_run
11864    /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
11865    /// use wkt::Duration;
11866    /// let x = GcsDestinationConfig::new().set_file_rotation_interval(Duration::default()/* use setters */);
11867    /// ```
11868    pub fn set_file_rotation_interval<T>(mut self, v: T) -> Self
11869    where
11870        T: std::convert::Into<wkt::Duration>,
11871    {
11872        self.file_rotation_interval = std::option::Option::Some(v.into());
11873        self
11874    }
11875
11876    /// Sets or clears the value of [file_rotation_interval][crate::model::GcsDestinationConfig::file_rotation_interval].
11877    ///
11878    /// # Example
11879    /// ```ignore,no_run
11880    /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
11881    /// use wkt::Duration;
11882    /// let x = GcsDestinationConfig::new().set_or_clear_file_rotation_interval(Some(Duration::default()/* use setters */));
11883    /// let x = GcsDestinationConfig::new().set_or_clear_file_rotation_interval(None::<Duration>);
11884    /// ```
11885    pub fn set_or_clear_file_rotation_interval<T>(mut self, v: std::option::Option<T>) -> Self
11886    where
11887        T: std::convert::Into<wkt::Duration>,
11888    {
11889        self.file_rotation_interval = v.map(|x| x.into());
11890        self
11891    }
11892
11893    /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format].
11894    ///
11895    /// Note that all the setters affecting `file_format` are mutually
11896    /// exclusive.
11897    ///
11898    /// # Example
11899    /// ```ignore,no_run
11900    /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
11901    /// use google_cloud_datastream_v1::model::AvroFileFormat;
11902    /// let x = GcsDestinationConfig::new().set_file_format(Some(
11903    ///     google_cloud_datastream_v1::model::gcs_destination_config::FileFormat::AvroFileFormat(AvroFileFormat::default().into())));
11904    /// ```
11905    pub fn set_file_format<
11906        T: std::convert::Into<std::option::Option<crate::model::gcs_destination_config::FileFormat>>,
11907    >(
11908        mut self,
11909        v: T,
11910    ) -> Self {
11911        self.file_format = v.into();
11912        self
11913    }
11914
11915    /// The value of [file_format][crate::model::GcsDestinationConfig::file_format]
11916    /// if it holds a `AvroFileFormat`, `None` if the field is not set or
11917    /// holds a different branch.
11918    pub fn avro_file_format(
11919        &self,
11920    ) -> std::option::Option<&std::boxed::Box<crate::model::AvroFileFormat>> {
11921        #[allow(unreachable_patterns)]
11922        self.file_format.as_ref().and_then(|v| match v {
11923            crate::model::gcs_destination_config::FileFormat::AvroFileFormat(v) => {
11924                std::option::Option::Some(v)
11925            }
11926            _ => std::option::Option::None,
11927        })
11928    }
11929
11930    /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format]
11931    /// to hold a `AvroFileFormat`.
11932    ///
11933    /// Note that all the setters affecting `file_format` are
11934    /// mutually exclusive.
11935    ///
11936    /// # Example
11937    /// ```ignore,no_run
11938    /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
11939    /// use google_cloud_datastream_v1::model::AvroFileFormat;
11940    /// let x = GcsDestinationConfig::new().set_avro_file_format(AvroFileFormat::default()/* use setters */);
11941    /// assert!(x.avro_file_format().is_some());
11942    /// assert!(x.json_file_format().is_none());
11943    /// ```
11944    pub fn set_avro_file_format<
11945        T: std::convert::Into<std::boxed::Box<crate::model::AvroFileFormat>>,
11946    >(
11947        mut self,
11948        v: T,
11949    ) -> Self {
11950        self.file_format = std::option::Option::Some(
11951            crate::model::gcs_destination_config::FileFormat::AvroFileFormat(v.into()),
11952        );
11953        self
11954    }
11955
11956    /// The value of [file_format][crate::model::GcsDestinationConfig::file_format]
11957    /// if it holds a `JsonFileFormat`, `None` if the field is not set or
11958    /// holds a different branch.
11959    pub fn json_file_format(
11960        &self,
11961    ) -> std::option::Option<&std::boxed::Box<crate::model::JsonFileFormat>> {
11962        #[allow(unreachable_patterns)]
11963        self.file_format.as_ref().and_then(|v| match v {
11964            crate::model::gcs_destination_config::FileFormat::JsonFileFormat(v) => {
11965                std::option::Option::Some(v)
11966            }
11967            _ => std::option::Option::None,
11968        })
11969    }
11970
11971    /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format]
11972    /// to hold a `JsonFileFormat`.
11973    ///
11974    /// Note that all the setters affecting `file_format` are
11975    /// mutually exclusive.
11976    ///
11977    /// # Example
11978    /// ```ignore,no_run
11979    /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
11980    /// use google_cloud_datastream_v1::model::JsonFileFormat;
11981    /// let x = GcsDestinationConfig::new().set_json_file_format(JsonFileFormat::default()/* use setters */);
11982    /// assert!(x.json_file_format().is_some());
11983    /// assert!(x.avro_file_format().is_none());
11984    /// ```
11985    pub fn set_json_file_format<
11986        T: std::convert::Into<std::boxed::Box<crate::model::JsonFileFormat>>,
11987    >(
11988        mut self,
11989        v: T,
11990    ) -> Self {
11991        self.file_format = std::option::Option::Some(
11992            crate::model::gcs_destination_config::FileFormat::JsonFileFormat(v.into()),
11993        );
11994        self
11995    }
11996}
11997
11998impl wkt::message::Message for GcsDestinationConfig {
11999    fn typename() -> &'static str {
12000        "type.googleapis.com/google.cloud.datastream.v1.GcsDestinationConfig"
12001    }
12002}
12003
12004/// Defines additional types related to [GcsDestinationConfig].
12005pub mod gcs_destination_config {
12006    #[allow(unused_imports)]
12007    use super::*;
12008
12009    /// File Format that the data should be written in.
12010    #[derive(Clone, Debug, PartialEq)]
12011    #[non_exhaustive]
12012    pub enum FileFormat {
12013        /// AVRO file format configuration.
12014        AvroFileFormat(std::boxed::Box<crate::model::AvroFileFormat>),
12015        /// JSON file format configuration.
12016        JsonFileFormat(std::boxed::Box<crate::model::JsonFileFormat>),
12017    }
12018}
12019
12020/// BigQuery destination configuration
12021#[derive(Clone, Default, PartialEq)]
12022#[non_exhaustive]
12023pub struct BigQueryDestinationConfig {
12024    /// The guaranteed data freshness (in seconds) when querying tables created by
12025    /// the stream. Editing this field will only affect new tables created in the
12026    /// future, but existing tables will not be impacted. Lower values mean that
12027    /// queries will return fresher data, but may result in higher cost.
12028    pub data_freshness: std::option::Option<wkt::Duration>,
12029
12030    /// Optional. Big Lake Managed Tables (BLMT) configuration.
12031    pub blmt_config: std::option::Option<crate::model::big_query_destination_config::BlmtConfig>,
12032
12033    /// Target dataset(s) configuration.
12034    pub dataset_config:
12035        std::option::Option<crate::model::big_query_destination_config::DatasetConfig>,
12036
12037    pub write_mode: std::option::Option<crate::model::big_query_destination_config::WriteMode>,
12038
12039    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12040}
12041
12042impl BigQueryDestinationConfig {
12043    pub fn new() -> Self {
12044        std::default::Default::default()
12045    }
12046
12047    /// Sets the value of [data_freshness][crate::model::BigQueryDestinationConfig::data_freshness].
12048    ///
12049    /// # Example
12050    /// ```ignore,no_run
12051    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12052    /// use wkt::Duration;
12053    /// let x = BigQueryDestinationConfig::new().set_data_freshness(Duration::default()/* use setters */);
12054    /// ```
12055    pub fn set_data_freshness<T>(mut self, v: T) -> Self
12056    where
12057        T: std::convert::Into<wkt::Duration>,
12058    {
12059        self.data_freshness = std::option::Option::Some(v.into());
12060        self
12061    }
12062
12063    /// Sets or clears the value of [data_freshness][crate::model::BigQueryDestinationConfig::data_freshness].
12064    ///
12065    /// # Example
12066    /// ```ignore,no_run
12067    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12068    /// use wkt::Duration;
12069    /// let x = BigQueryDestinationConfig::new().set_or_clear_data_freshness(Some(Duration::default()/* use setters */));
12070    /// let x = BigQueryDestinationConfig::new().set_or_clear_data_freshness(None::<Duration>);
12071    /// ```
12072    pub fn set_or_clear_data_freshness<T>(mut self, v: std::option::Option<T>) -> Self
12073    where
12074        T: std::convert::Into<wkt::Duration>,
12075    {
12076        self.data_freshness = v.map(|x| x.into());
12077        self
12078    }
12079
12080    /// Sets the value of [blmt_config][crate::model::BigQueryDestinationConfig::blmt_config].
12081    ///
12082    /// # Example
12083    /// ```ignore,no_run
12084    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12085    /// use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12086    /// let x = BigQueryDestinationConfig::new().set_blmt_config(BlmtConfig::default()/* use setters */);
12087    /// ```
12088    pub fn set_blmt_config<T>(mut self, v: T) -> Self
12089    where
12090        T: std::convert::Into<crate::model::big_query_destination_config::BlmtConfig>,
12091    {
12092        self.blmt_config = std::option::Option::Some(v.into());
12093        self
12094    }
12095
12096    /// Sets or clears the value of [blmt_config][crate::model::BigQueryDestinationConfig::blmt_config].
12097    ///
12098    /// # Example
12099    /// ```ignore,no_run
12100    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12101    /// use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12102    /// let x = BigQueryDestinationConfig::new().set_or_clear_blmt_config(Some(BlmtConfig::default()/* use setters */));
12103    /// let x = BigQueryDestinationConfig::new().set_or_clear_blmt_config(None::<BlmtConfig>);
12104    /// ```
12105    pub fn set_or_clear_blmt_config<T>(mut self, v: std::option::Option<T>) -> Self
12106    where
12107        T: std::convert::Into<crate::model::big_query_destination_config::BlmtConfig>,
12108    {
12109        self.blmt_config = v.map(|x| x.into());
12110        self
12111    }
12112
12113    /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config].
12114    ///
12115    /// Note that all the setters affecting `dataset_config` are mutually
12116    /// exclusive.
12117    ///
12118    /// # Example
12119    /// ```ignore,no_run
12120    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12121    /// use google_cloud_datastream_v1::model::big_query_destination_config::SingleTargetDataset;
12122    /// let x = BigQueryDestinationConfig::new().set_dataset_config(Some(
12123    ///     google_cloud_datastream_v1::model::big_query_destination_config::DatasetConfig::SingleTargetDataset(SingleTargetDataset::default().into())));
12124    /// ```
12125    pub fn set_dataset_config<
12126        T: std::convert::Into<
12127                std::option::Option<crate::model::big_query_destination_config::DatasetConfig>,
12128            >,
12129    >(
12130        mut self,
12131        v: T,
12132    ) -> Self {
12133        self.dataset_config = v.into();
12134        self
12135    }
12136
12137    /// The value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
12138    /// if it holds a `SingleTargetDataset`, `None` if the field is not set or
12139    /// holds a different branch.
12140    pub fn single_target_dataset(
12141        &self,
12142    ) -> std::option::Option<
12143        &std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
12144    > {
12145        #[allow(unreachable_patterns)]
12146        self.dataset_config.as_ref().and_then(|v| match v {
12147            crate::model::big_query_destination_config::DatasetConfig::SingleTargetDataset(v) => {
12148                std::option::Option::Some(v)
12149            }
12150            _ => std::option::Option::None,
12151        })
12152    }
12153
12154    /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
12155    /// to hold a `SingleTargetDataset`.
12156    ///
12157    /// Note that all the setters affecting `dataset_config` are
12158    /// mutually exclusive.
12159    ///
12160    /// # Example
12161    /// ```ignore,no_run
12162    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12163    /// use google_cloud_datastream_v1::model::big_query_destination_config::SingleTargetDataset;
12164    /// let x = BigQueryDestinationConfig::new().set_single_target_dataset(SingleTargetDataset::default()/* use setters */);
12165    /// assert!(x.single_target_dataset().is_some());
12166    /// assert!(x.source_hierarchy_datasets().is_none());
12167    /// ```
12168    pub fn set_single_target_dataset<
12169        T: std::convert::Into<
12170                std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
12171            >,
12172    >(
12173        mut self,
12174        v: T,
12175    ) -> Self {
12176        self.dataset_config = std::option::Option::Some(
12177            crate::model::big_query_destination_config::DatasetConfig::SingleTargetDataset(
12178                v.into(),
12179            ),
12180        );
12181        self
12182    }
12183
12184    /// The value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
12185    /// if it holds a `SourceHierarchyDatasets`, `None` if the field is not set or
12186    /// holds a different branch.
12187    pub fn source_hierarchy_datasets(
12188        &self,
12189    ) -> std::option::Option<
12190        &std::boxed::Box<crate::model::big_query_destination_config::SourceHierarchyDatasets>,
12191    > {
12192        #[allow(unreachable_patterns)]
12193        self.dataset_config.as_ref().and_then(|v| match v {
12194            crate::model::big_query_destination_config::DatasetConfig::SourceHierarchyDatasets(
12195                v,
12196            ) => std::option::Option::Some(v),
12197            _ => std::option::Option::None,
12198        })
12199    }
12200
12201    /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
12202    /// to hold a `SourceHierarchyDatasets`.
12203    ///
12204    /// Note that all the setters affecting `dataset_config` are
12205    /// mutually exclusive.
12206    ///
12207    /// # Example
12208    /// ```ignore,no_run
12209    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12210    /// use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12211    /// let x = BigQueryDestinationConfig::new().set_source_hierarchy_datasets(SourceHierarchyDatasets::default()/* use setters */);
12212    /// assert!(x.source_hierarchy_datasets().is_some());
12213    /// assert!(x.single_target_dataset().is_none());
12214    /// ```
12215    pub fn set_source_hierarchy_datasets<
12216        T: std::convert::Into<
12217                std::boxed::Box<
12218                    crate::model::big_query_destination_config::SourceHierarchyDatasets,
12219                >,
12220            >,
12221    >(
12222        mut self,
12223        v: T,
12224    ) -> Self {
12225        self.dataset_config = std::option::Option::Some(
12226            crate::model::big_query_destination_config::DatasetConfig::SourceHierarchyDatasets(
12227                v.into(),
12228            ),
12229        );
12230        self
12231    }
12232
12233    /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode].
12234    ///
12235    /// Note that all the setters affecting `write_mode` are mutually
12236    /// exclusive.
12237    ///
12238    /// # Example
12239    /// ```ignore,no_run
12240    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12241    /// use google_cloud_datastream_v1::model::big_query_destination_config::Merge;
12242    /// let x = BigQueryDestinationConfig::new().set_write_mode(Some(
12243    ///     google_cloud_datastream_v1::model::big_query_destination_config::WriteMode::Merge(Merge::default().into())));
12244    /// ```
12245    pub fn set_write_mode<
12246        T: std::convert::Into<
12247                std::option::Option<crate::model::big_query_destination_config::WriteMode>,
12248            >,
12249    >(
12250        mut self,
12251        v: T,
12252    ) -> Self {
12253        self.write_mode = v.into();
12254        self
12255    }
12256
12257    /// The value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
12258    /// if it holds a `Merge`, `None` if the field is not set or
12259    /// holds a different branch.
12260    pub fn merge(
12261        &self,
12262    ) -> std::option::Option<&std::boxed::Box<crate::model::big_query_destination_config::Merge>>
12263    {
12264        #[allow(unreachable_patterns)]
12265        self.write_mode.as_ref().and_then(|v| match v {
12266            crate::model::big_query_destination_config::WriteMode::Merge(v) => {
12267                std::option::Option::Some(v)
12268            }
12269            _ => std::option::Option::None,
12270        })
12271    }
12272
12273    /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
12274    /// to hold a `Merge`.
12275    ///
12276    /// Note that all the setters affecting `write_mode` are
12277    /// mutually exclusive.
12278    ///
12279    /// # Example
12280    /// ```ignore,no_run
12281    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12282    /// use google_cloud_datastream_v1::model::big_query_destination_config::Merge;
12283    /// let x = BigQueryDestinationConfig::new().set_merge(Merge::default()/* use setters */);
12284    /// assert!(x.merge().is_some());
12285    /// assert!(x.append_only().is_none());
12286    /// ```
12287    pub fn set_merge<
12288        T: std::convert::Into<std::boxed::Box<crate::model::big_query_destination_config::Merge>>,
12289    >(
12290        mut self,
12291        v: T,
12292    ) -> Self {
12293        self.write_mode = std::option::Option::Some(
12294            crate::model::big_query_destination_config::WriteMode::Merge(v.into()),
12295        );
12296        self
12297    }
12298
12299    /// The value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
12300    /// if it holds a `AppendOnly`, `None` if the field is not set or
12301    /// holds a different branch.
12302    pub fn append_only(
12303        &self,
12304    ) -> std::option::Option<&std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>>
12305    {
12306        #[allow(unreachable_patterns)]
12307        self.write_mode.as_ref().and_then(|v| match v {
12308            crate::model::big_query_destination_config::WriteMode::AppendOnly(v) => {
12309                std::option::Option::Some(v)
12310            }
12311            _ => std::option::Option::None,
12312        })
12313    }
12314
12315    /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
12316    /// to hold a `AppendOnly`.
12317    ///
12318    /// Note that all the setters affecting `write_mode` are
12319    /// mutually exclusive.
12320    ///
12321    /// # Example
12322    /// ```ignore,no_run
12323    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12324    /// use google_cloud_datastream_v1::model::big_query_destination_config::AppendOnly;
12325    /// let x = BigQueryDestinationConfig::new().set_append_only(AppendOnly::default()/* use setters */);
12326    /// assert!(x.append_only().is_some());
12327    /// assert!(x.merge().is_none());
12328    /// ```
12329    pub fn set_append_only<
12330        T: std::convert::Into<std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>>,
12331    >(
12332        mut self,
12333        v: T,
12334    ) -> Self {
12335        self.write_mode = std::option::Option::Some(
12336            crate::model::big_query_destination_config::WriteMode::AppendOnly(v.into()),
12337        );
12338        self
12339    }
12340}
12341
12342impl wkt::message::Message for BigQueryDestinationConfig {
12343    fn typename() -> &'static str {
12344        "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig"
12345    }
12346}
12347
12348/// Defines additional types related to [BigQueryDestinationConfig].
12349pub mod big_query_destination_config {
12350    #[allow(unused_imports)]
12351    use super::*;
12352
12353    /// A single target dataset to which all data will be streamed.
12354    #[derive(Clone, Default, PartialEq)]
12355    #[non_exhaustive]
12356    pub struct SingleTargetDataset {
12357        /// The dataset ID of the target dataset.
12358        /// DatasetIds allowed characters:
12359        /// <https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets#datasetreference>.
12360        pub dataset_id: std::string::String,
12361
12362        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12363    }
12364
12365    impl SingleTargetDataset {
12366        pub fn new() -> Self {
12367            std::default::Default::default()
12368        }
12369
12370        /// Sets the value of [dataset_id][crate::model::big_query_destination_config::SingleTargetDataset::dataset_id].
12371        ///
12372        /// # Example
12373        /// ```ignore,no_run
12374        /// # use google_cloud_datastream_v1::model::big_query_destination_config::SingleTargetDataset;
12375        /// let x = SingleTargetDataset::new().set_dataset_id("example");
12376        /// ```
12377        pub fn set_dataset_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12378            self.dataset_id = v.into();
12379            self
12380        }
12381    }
12382
12383    impl wkt::message::Message for SingleTargetDataset {
12384        fn typename() -> &'static str {
12385            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SingleTargetDataset"
12386        }
12387    }
12388
12389    /// Destination datasets are created so that hierarchy of the destination data
12390    /// objects matches the source hierarchy.
12391    #[derive(Clone, Default, PartialEq)]
12392    #[non_exhaustive]
12393    pub struct SourceHierarchyDatasets {
12394        /// The dataset template to use for dynamic dataset creation.
12395        pub dataset_template: std::option::Option<
12396            crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate,
12397        >,
12398
12399        /// Optional. The project id of the BigQuery dataset. If not specified, the
12400        /// project will be inferred from the stream resource.
12401        pub project_id: std::option::Option<std::string::String>,
12402
12403        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12404    }
12405
12406    impl SourceHierarchyDatasets {
12407        pub fn new() -> Self {
12408            std::default::Default::default()
12409        }
12410
12411        /// Sets the value of [dataset_template][crate::model::big_query_destination_config::SourceHierarchyDatasets::dataset_template].
12412        ///
12413        /// # Example
12414        /// ```ignore,no_run
12415        /// # use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12416        /// use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12417        /// let x = SourceHierarchyDatasets::new().set_dataset_template(DatasetTemplate::default()/* use setters */);
12418        /// ```
12419        pub fn set_dataset_template<T>(mut self, v: T) -> Self
12420        where T: std::convert::Into<crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate>
12421        {
12422            self.dataset_template = std::option::Option::Some(v.into());
12423            self
12424        }
12425
12426        /// Sets or clears the value of [dataset_template][crate::model::big_query_destination_config::SourceHierarchyDatasets::dataset_template].
12427        ///
12428        /// # Example
12429        /// ```ignore,no_run
12430        /// # use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12431        /// use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12432        /// let x = SourceHierarchyDatasets::new().set_or_clear_dataset_template(Some(DatasetTemplate::default()/* use setters */));
12433        /// let x = SourceHierarchyDatasets::new().set_or_clear_dataset_template(None::<DatasetTemplate>);
12434        /// ```
12435        pub fn set_or_clear_dataset_template<T>(mut self, v: std::option::Option<T>) -> Self
12436        where T: std::convert::Into<crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate>
12437        {
12438            self.dataset_template = v.map(|x| x.into());
12439            self
12440        }
12441
12442        /// Sets the value of [project_id][crate::model::big_query_destination_config::SourceHierarchyDatasets::project_id].
12443        ///
12444        /// # Example
12445        /// ```ignore,no_run
12446        /// # use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12447        /// let x = SourceHierarchyDatasets::new().set_project_id("example");
12448        /// ```
12449        pub fn set_project_id<T>(mut self, v: T) -> Self
12450        where
12451            T: std::convert::Into<std::string::String>,
12452        {
12453            self.project_id = std::option::Option::Some(v.into());
12454            self
12455        }
12456
12457        /// Sets or clears the value of [project_id][crate::model::big_query_destination_config::SourceHierarchyDatasets::project_id].
12458        ///
12459        /// # Example
12460        /// ```ignore,no_run
12461        /// # use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12462        /// let x = SourceHierarchyDatasets::new().set_or_clear_project_id(Some("example"));
12463        /// let x = SourceHierarchyDatasets::new().set_or_clear_project_id(None::<String>);
12464        /// ```
12465        pub fn set_or_clear_project_id<T>(mut self, v: std::option::Option<T>) -> Self
12466        where
12467            T: std::convert::Into<std::string::String>,
12468        {
12469            self.project_id = v.map(|x| x.into());
12470            self
12471        }
12472    }
12473
12474    impl wkt::message::Message for SourceHierarchyDatasets {
12475        fn typename() -> &'static str {
12476            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SourceHierarchyDatasets"
12477        }
12478    }
12479
12480    /// Defines additional types related to [SourceHierarchyDatasets].
12481    pub mod source_hierarchy_datasets {
12482        #[allow(unused_imports)]
12483        use super::*;
12484
12485        /// Dataset template used for dynamic dataset creation.
12486        #[derive(Clone, Default, PartialEq)]
12487        #[non_exhaustive]
12488        pub struct DatasetTemplate {
12489            /// Required. The geographic location where the dataset should reside. See
12490            /// <https://cloud.google.com/bigquery/docs/locations> for supported
12491            /// locations.
12492            pub location: std::string::String,
12493
12494            /// If supplied, every created dataset will have its name prefixed by the
12495            /// provided value. The prefix and name will be separated by an underscore.
12496            /// i.e. \<prefix\>_<dataset_name>.
12497            pub dataset_id_prefix: std::string::String,
12498
12499            /// Describes the Cloud KMS encryption key that will be used to
12500            /// protect destination BigQuery table. The BigQuery Service Account
12501            /// associated with your project requires access to this encryption key.
12502            /// i.e.
12503            /// projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{cryptoKey}.
12504            /// See <https://cloud.google.com/bigquery/docs/customer-managed-encryption>
12505            /// for more information.
12506            pub kms_key_name: std::string::String,
12507
12508            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12509        }
12510
12511        impl DatasetTemplate {
12512            pub fn new() -> Self {
12513                std::default::Default::default()
12514            }
12515
12516            /// Sets the value of [location][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::location].
12517            ///
12518            /// # Example
12519            /// ```ignore,no_run
12520            /// # use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12521            /// let x = DatasetTemplate::new().set_location("example");
12522            /// ```
12523            pub fn set_location<T: std::convert::Into<std::string::String>>(
12524                mut self,
12525                v: T,
12526            ) -> Self {
12527                self.location = v.into();
12528                self
12529            }
12530
12531            /// Sets the value of [dataset_id_prefix][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::dataset_id_prefix].
12532            ///
12533            /// # Example
12534            /// ```ignore,no_run
12535            /// # use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12536            /// let x = DatasetTemplate::new().set_dataset_id_prefix("example");
12537            /// ```
12538            pub fn set_dataset_id_prefix<T: std::convert::Into<std::string::String>>(
12539                mut self,
12540                v: T,
12541            ) -> Self {
12542                self.dataset_id_prefix = v.into();
12543                self
12544            }
12545
12546            /// Sets the value of [kms_key_name][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::kms_key_name].
12547            ///
12548            /// # Example
12549            /// ```ignore,no_run
12550            /// # use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12551            /// let x = DatasetTemplate::new().set_kms_key_name("example");
12552            /// ```
12553            pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(
12554                mut self,
12555                v: T,
12556            ) -> Self {
12557                self.kms_key_name = v.into();
12558                self
12559            }
12560        }
12561
12562        impl wkt::message::Message for DatasetTemplate {
12563            fn typename() -> &'static str {
12564                "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SourceHierarchyDatasets.DatasetTemplate"
12565            }
12566        }
12567    }
12568
12569    /// The configuration for BLMT.
12570    #[derive(Clone, Default, PartialEq)]
12571    #[non_exhaustive]
12572    pub struct BlmtConfig {
12573        /// Required. The Cloud Storage bucket name.
12574        pub bucket: std::string::String,
12575
12576        /// The root path inside the Cloud Storage bucket.
12577        pub root_path: std::string::String,
12578
12579        /// Required. The bigquery connection.
12580        /// Format: `{project}.{location}.{name}`
12581        pub connection_name: std::string::String,
12582
12583        /// Required. The file format.
12584        pub file_format: crate::model::big_query_destination_config::blmt_config::FileFormat,
12585
12586        /// Required. The table format.
12587        pub table_format: crate::model::big_query_destination_config::blmt_config::TableFormat,
12588
12589        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12590    }
12591
12592    impl BlmtConfig {
12593        pub fn new() -> Self {
12594            std::default::Default::default()
12595        }
12596
12597        /// Sets the value of [bucket][crate::model::big_query_destination_config::BlmtConfig::bucket].
12598        ///
12599        /// # Example
12600        /// ```ignore,no_run
12601        /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12602        /// let x = BlmtConfig::new().set_bucket("example");
12603        /// ```
12604        pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12605            self.bucket = v.into();
12606            self
12607        }
12608
12609        /// Sets the value of [root_path][crate::model::big_query_destination_config::BlmtConfig::root_path].
12610        ///
12611        /// # Example
12612        /// ```ignore,no_run
12613        /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12614        /// let x = BlmtConfig::new().set_root_path("example");
12615        /// ```
12616        pub fn set_root_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12617            self.root_path = v.into();
12618            self
12619        }
12620
12621        /// Sets the value of [connection_name][crate::model::big_query_destination_config::BlmtConfig::connection_name].
12622        ///
12623        /// # Example
12624        /// ```ignore,no_run
12625        /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12626        /// let x = BlmtConfig::new().set_connection_name("example");
12627        /// ```
12628        pub fn set_connection_name<T: std::convert::Into<std::string::String>>(
12629            mut self,
12630            v: T,
12631        ) -> Self {
12632            self.connection_name = v.into();
12633            self
12634        }
12635
12636        /// Sets the value of [file_format][crate::model::big_query_destination_config::BlmtConfig::file_format].
12637        ///
12638        /// # Example
12639        /// ```ignore,no_run
12640        /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12641        /// use google_cloud_datastream_v1::model::big_query_destination_config::blmt_config::FileFormat;
12642        /// let x0 = BlmtConfig::new().set_file_format(FileFormat::Parquet);
12643        /// ```
12644        pub fn set_file_format<
12645            T: std::convert::Into<crate::model::big_query_destination_config::blmt_config::FileFormat>,
12646        >(
12647            mut self,
12648            v: T,
12649        ) -> Self {
12650            self.file_format = v.into();
12651            self
12652        }
12653
12654        /// Sets the value of [table_format][crate::model::big_query_destination_config::BlmtConfig::table_format].
12655        ///
12656        /// # Example
12657        /// ```ignore,no_run
12658        /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12659        /// use google_cloud_datastream_v1::model::big_query_destination_config::blmt_config::TableFormat;
12660        /// let x0 = BlmtConfig::new().set_table_format(TableFormat::Iceberg);
12661        /// ```
12662        pub fn set_table_format<
12663            T: std::convert::Into<
12664                    crate::model::big_query_destination_config::blmt_config::TableFormat,
12665                >,
12666        >(
12667            mut self,
12668            v: T,
12669        ) -> Self {
12670            self.table_format = v.into();
12671            self
12672        }
12673    }
12674
12675    impl wkt::message::Message for BlmtConfig {
12676        fn typename() -> &'static str {
12677            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig"
12678        }
12679    }
12680
12681    /// Defines additional types related to [BlmtConfig].
12682    pub mod blmt_config {
12683        #[allow(unused_imports)]
12684        use super::*;
12685
12686        /// Supported file formats for BigLake managed tables.
12687        ///
12688        /// # Working with unknown values
12689        ///
12690        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12691        /// additional enum variants at any time. Adding new variants is not considered
12692        /// a breaking change. Applications should write their code in anticipation of:
12693        ///
12694        /// - New values appearing in future releases of the client library, **and**
12695        /// - New values received dynamically, without application changes.
12696        ///
12697        /// Please consult the [Working with enums] section in the user guide for some
12698        /// guidelines.
12699        ///
12700        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12701        #[derive(Clone, Debug, PartialEq)]
12702        #[non_exhaustive]
12703        pub enum FileFormat {
12704            /// Default value.
12705            Unspecified,
12706            /// Parquet file format.
12707            Parquet,
12708            /// If set, the enum was initialized with an unknown value.
12709            ///
12710            /// Applications can examine the value using [FileFormat::value] or
12711            /// [FileFormat::name].
12712            UnknownValue(file_format::UnknownValue),
12713        }
12714
12715        #[doc(hidden)]
12716        pub mod file_format {
12717            #[allow(unused_imports)]
12718            use super::*;
12719            #[derive(Clone, Debug, PartialEq)]
12720            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12721        }
12722
12723        impl FileFormat {
12724            /// Gets the enum value.
12725            ///
12726            /// Returns `None` if the enum contains an unknown value deserialized from
12727            /// the string representation of enums.
12728            pub fn value(&self) -> std::option::Option<i32> {
12729                match self {
12730                    Self::Unspecified => std::option::Option::Some(0),
12731                    Self::Parquet => std::option::Option::Some(1),
12732                    Self::UnknownValue(u) => u.0.value(),
12733                }
12734            }
12735
12736            /// Gets the enum value as a string.
12737            ///
12738            /// Returns `None` if the enum contains an unknown value deserialized from
12739            /// the integer representation of enums.
12740            pub fn name(&self) -> std::option::Option<&str> {
12741                match self {
12742                    Self::Unspecified => std::option::Option::Some("FILE_FORMAT_UNSPECIFIED"),
12743                    Self::Parquet => std::option::Option::Some("PARQUET"),
12744                    Self::UnknownValue(u) => u.0.name(),
12745                }
12746            }
12747        }
12748
12749        impl std::default::Default for FileFormat {
12750            fn default() -> Self {
12751                use std::convert::From;
12752                Self::from(0)
12753            }
12754        }
12755
12756        impl std::fmt::Display for FileFormat {
12757            fn fmt(
12758                &self,
12759                f: &mut std::fmt::Formatter<'_>,
12760            ) -> std::result::Result<(), std::fmt::Error> {
12761                wkt::internal::display_enum(f, self.name(), self.value())
12762            }
12763        }
12764
12765        impl std::convert::From<i32> for FileFormat {
12766            fn from(value: i32) -> Self {
12767                match value {
12768                    0 => Self::Unspecified,
12769                    1 => Self::Parquet,
12770                    _ => Self::UnknownValue(file_format::UnknownValue(
12771                        wkt::internal::UnknownEnumValue::Integer(value),
12772                    )),
12773                }
12774            }
12775        }
12776
12777        impl std::convert::From<&str> for FileFormat {
12778            fn from(value: &str) -> Self {
12779                use std::string::ToString;
12780                match value {
12781                    "FILE_FORMAT_UNSPECIFIED" => Self::Unspecified,
12782                    "PARQUET" => Self::Parquet,
12783                    _ => Self::UnknownValue(file_format::UnknownValue(
12784                        wkt::internal::UnknownEnumValue::String(value.to_string()),
12785                    )),
12786                }
12787            }
12788        }
12789
12790        impl serde::ser::Serialize for FileFormat {
12791            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12792            where
12793                S: serde::Serializer,
12794            {
12795                match self {
12796                    Self::Unspecified => serializer.serialize_i32(0),
12797                    Self::Parquet => serializer.serialize_i32(1),
12798                    Self::UnknownValue(u) => u.0.serialize(serializer),
12799                }
12800            }
12801        }
12802
12803        impl<'de> serde::de::Deserialize<'de> for FileFormat {
12804            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12805            where
12806                D: serde::Deserializer<'de>,
12807            {
12808                deserializer.deserialize_any(wkt::internal::EnumVisitor::<FileFormat>::new(
12809                    ".google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig.FileFormat",
12810                ))
12811            }
12812        }
12813
12814        /// Supported table formats for BigLake managed tables.
12815        ///
12816        /// # Working with unknown values
12817        ///
12818        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12819        /// additional enum variants at any time. Adding new variants is not considered
12820        /// a breaking change. Applications should write their code in anticipation of:
12821        ///
12822        /// - New values appearing in future releases of the client library, **and**
12823        /// - New values received dynamically, without application changes.
12824        ///
12825        /// Please consult the [Working with enums] section in the user guide for some
12826        /// guidelines.
12827        ///
12828        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12829        #[derive(Clone, Debug, PartialEq)]
12830        #[non_exhaustive]
12831        pub enum TableFormat {
12832            /// Default value.
12833            Unspecified,
12834            /// Iceberg table format.
12835            Iceberg,
12836            /// If set, the enum was initialized with an unknown value.
12837            ///
12838            /// Applications can examine the value using [TableFormat::value] or
12839            /// [TableFormat::name].
12840            UnknownValue(table_format::UnknownValue),
12841        }
12842
12843        #[doc(hidden)]
12844        pub mod table_format {
12845            #[allow(unused_imports)]
12846            use super::*;
12847            #[derive(Clone, Debug, PartialEq)]
12848            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12849        }
12850
12851        impl TableFormat {
12852            /// Gets the enum value.
12853            ///
12854            /// Returns `None` if the enum contains an unknown value deserialized from
12855            /// the string representation of enums.
12856            pub fn value(&self) -> std::option::Option<i32> {
12857                match self {
12858                    Self::Unspecified => std::option::Option::Some(0),
12859                    Self::Iceberg => std::option::Option::Some(1),
12860                    Self::UnknownValue(u) => u.0.value(),
12861                }
12862            }
12863
12864            /// Gets the enum value as a string.
12865            ///
12866            /// Returns `None` if the enum contains an unknown value deserialized from
12867            /// the integer representation of enums.
12868            pub fn name(&self) -> std::option::Option<&str> {
12869                match self {
12870                    Self::Unspecified => std::option::Option::Some("TABLE_FORMAT_UNSPECIFIED"),
12871                    Self::Iceberg => std::option::Option::Some("ICEBERG"),
12872                    Self::UnknownValue(u) => u.0.name(),
12873                }
12874            }
12875        }
12876
12877        impl std::default::Default for TableFormat {
12878            fn default() -> Self {
12879                use std::convert::From;
12880                Self::from(0)
12881            }
12882        }
12883
12884        impl std::fmt::Display for TableFormat {
12885            fn fmt(
12886                &self,
12887                f: &mut std::fmt::Formatter<'_>,
12888            ) -> std::result::Result<(), std::fmt::Error> {
12889                wkt::internal::display_enum(f, self.name(), self.value())
12890            }
12891        }
12892
12893        impl std::convert::From<i32> for TableFormat {
12894            fn from(value: i32) -> Self {
12895                match value {
12896                    0 => Self::Unspecified,
12897                    1 => Self::Iceberg,
12898                    _ => Self::UnknownValue(table_format::UnknownValue(
12899                        wkt::internal::UnknownEnumValue::Integer(value),
12900                    )),
12901                }
12902            }
12903        }
12904
12905        impl std::convert::From<&str> for TableFormat {
12906            fn from(value: &str) -> Self {
12907                use std::string::ToString;
12908                match value {
12909                    "TABLE_FORMAT_UNSPECIFIED" => Self::Unspecified,
12910                    "ICEBERG" => Self::Iceberg,
12911                    _ => Self::UnknownValue(table_format::UnknownValue(
12912                        wkt::internal::UnknownEnumValue::String(value.to_string()),
12913                    )),
12914                }
12915            }
12916        }
12917
12918        impl serde::ser::Serialize for TableFormat {
12919            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12920            where
12921                S: serde::Serializer,
12922            {
12923                match self {
12924                    Self::Unspecified => serializer.serialize_i32(0),
12925                    Self::Iceberg => serializer.serialize_i32(1),
12926                    Self::UnknownValue(u) => u.0.serialize(serializer),
12927                }
12928            }
12929        }
12930
12931        impl<'de> serde::de::Deserialize<'de> for TableFormat {
12932            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12933            where
12934                D: serde::Deserializer<'de>,
12935            {
12936                deserializer.deserialize_any(wkt::internal::EnumVisitor::<TableFormat>::new(
12937                    ".google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig.TableFormat",
12938                ))
12939            }
12940        }
12941    }
12942
12943    /// AppendOnly mode defines that all changes to a table will be written to the
12944    /// destination table.
12945    #[derive(Clone, Default, PartialEq)]
12946    #[non_exhaustive]
12947    pub struct AppendOnly {
12948        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12949    }
12950
12951    impl AppendOnly {
12952        pub fn new() -> Self {
12953            std::default::Default::default()
12954        }
12955    }
12956
12957    impl wkt::message::Message for AppendOnly {
12958        fn typename() -> &'static str {
12959            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.AppendOnly"
12960        }
12961    }
12962
12963    /// Merge mode defines that all changes to a table will be merged at the
12964    /// destination table.
12965    #[derive(Clone, Default, PartialEq)]
12966    #[non_exhaustive]
12967    pub struct Merge {
12968        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12969    }
12970
12971    impl Merge {
12972        pub fn new() -> Self {
12973            std::default::Default::default()
12974        }
12975    }
12976
12977    impl wkt::message::Message for Merge {
12978        fn typename() -> &'static str {
12979            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.Merge"
12980        }
12981    }
12982
12983    /// Target dataset(s) configuration.
12984    #[derive(Clone, Debug, PartialEq)]
12985    #[non_exhaustive]
12986    pub enum DatasetConfig {
12987        /// Single destination dataset.
12988        SingleTargetDataset(
12989            std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
12990        ),
12991        /// Source hierarchy datasets.
12992        SourceHierarchyDatasets(
12993            std::boxed::Box<crate::model::big_query_destination_config::SourceHierarchyDatasets>,
12994        ),
12995    }
12996
12997    #[derive(Clone, Debug, PartialEq)]
12998    #[non_exhaustive]
12999    pub enum WriteMode {
13000        /// The standard mode
13001        Merge(std::boxed::Box<crate::model::big_query_destination_config::Merge>),
13002        /// Append only mode
13003        AppendOnly(std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>),
13004    }
13005}
13006
13007/// The configuration of the stream destination.
13008#[derive(Clone, Default, PartialEq)]
13009#[non_exhaustive]
13010pub struct DestinationConfig {
13011    /// Required. Destination connection profile resource.
13012    /// Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
13013    pub destination_connection_profile: std::string::String,
13014
13015    /// Stream configuration that is specific to the data destination type.
13016    pub destination_stream_config:
13017        std::option::Option<crate::model::destination_config::DestinationStreamConfig>,
13018
13019    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13020}
13021
13022impl DestinationConfig {
13023    pub fn new() -> Self {
13024        std::default::Default::default()
13025    }
13026
13027    /// Sets the value of [destination_connection_profile][crate::model::DestinationConfig::destination_connection_profile].
13028    ///
13029    /// # Example
13030    /// ```ignore,no_run
13031    /// # use google_cloud_datastream_v1::model::DestinationConfig;
13032    /// let x = DestinationConfig::new().set_destination_connection_profile("example");
13033    /// ```
13034    pub fn set_destination_connection_profile<T: std::convert::Into<std::string::String>>(
13035        mut self,
13036        v: T,
13037    ) -> Self {
13038        self.destination_connection_profile = v.into();
13039        self
13040    }
13041
13042    /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config].
13043    ///
13044    /// Note that all the setters affecting `destination_stream_config` are mutually
13045    /// exclusive.
13046    ///
13047    /// # Example
13048    /// ```ignore,no_run
13049    /// # use google_cloud_datastream_v1::model::DestinationConfig;
13050    /// use google_cloud_datastream_v1::model::GcsDestinationConfig;
13051    /// let x = DestinationConfig::new().set_destination_stream_config(Some(
13052    ///     google_cloud_datastream_v1::model::destination_config::DestinationStreamConfig::GcsDestinationConfig(GcsDestinationConfig::default().into())));
13053    /// ```
13054    pub fn set_destination_stream_config<
13055        T: std::convert::Into<
13056                std::option::Option<crate::model::destination_config::DestinationStreamConfig>,
13057            >,
13058    >(
13059        mut self,
13060        v: T,
13061    ) -> Self {
13062        self.destination_stream_config = v.into();
13063        self
13064    }
13065
13066    /// The value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
13067    /// if it holds a `GcsDestinationConfig`, `None` if the field is not set or
13068    /// holds a different branch.
13069    pub fn gcs_destination_config(
13070        &self,
13071    ) -> std::option::Option<&std::boxed::Box<crate::model::GcsDestinationConfig>> {
13072        #[allow(unreachable_patterns)]
13073        self.destination_stream_config
13074            .as_ref()
13075            .and_then(|v| match v {
13076                crate::model::destination_config::DestinationStreamConfig::GcsDestinationConfig(
13077                    v,
13078                ) => std::option::Option::Some(v),
13079                _ => std::option::Option::None,
13080            })
13081    }
13082
13083    /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
13084    /// to hold a `GcsDestinationConfig`.
13085    ///
13086    /// Note that all the setters affecting `destination_stream_config` are
13087    /// mutually exclusive.
13088    ///
13089    /// # Example
13090    /// ```ignore,no_run
13091    /// # use google_cloud_datastream_v1::model::DestinationConfig;
13092    /// use google_cloud_datastream_v1::model::GcsDestinationConfig;
13093    /// let x = DestinationConfig::new().set_gcs_destination_config(GcsDestinationConfig::default()/* use setters */);
13094    /// assert!(x.gcs_destination_config().is_some());
13095    /// assert!(x.bigquery_destination_config().is_none());
13096    /// ```
13097    pub fn set_gcs_destination_config<
13098        T: std::convert::Into<std::boxed::Box<crate::model::GcsDestinationConfig>>,
13099    >(
13100        mut self,
13101        v: T,
13102    ) -> Self {
13103        self.destination_stream_config = std::option::Option::Some(
13104            crate::model::destination_config::DestinationStreamConfig::GcsDestinationConfig(
13105                v.into(),
13106            ),
13107        );
13108        self
13109    }
13110
13111    /// The value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
13112    /// if it holds a `BigqueryDestinationConfig`, `None` if the field is not set or
13113    /// holds a different branch.
13114    pub fn bigquery_destination_config(
13115        &self,
13116    ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryDestinationConfig>> {
13117        #[allow(unreachable_patterns)]
13118        self.destination_stream_config.as_ref().and_then(|v| match v {
13119            crate::model::destination_config::DestinationStreamConfig::BigqueryDestinationConfig(v) => std::option::Option::Some(v),
13120            _ => std::option::Option::None,
13121        })
13122    }
13123
13124    /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
13125    /// to hold a `BigqueryDestinationConfig`.
13126    ///
13127    /// Note that all the setters affecting `destination_stream_config` are
13128    /// mutually exclusive.
13129    ///
13130    /// # Example
13131    /// ```ignore,no_run
13132    /// # use google_cloud_datastream_v1::model::DestinationConfig;
13133    /// use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
13134    /// let x = DestinationConfig::new().set_bigquery_destination_config(BigQueryDestinationConfig::default()/* use setters */);
13135    /// assert!(x.bigquery_destination_config().is_some());
13136    /// assert!(x.gcs_destination_config().is_none());
13137    /// ```
13138    pub fn set_bigquery_destination_config<
13139        T: std::convert::Into<std::boxed::Box<crate::model::BigQueryDestinationConfig>>,
13140    >(
13141        mut self,
13142        v: T,
13143    ) -> Self {
13144        self.destination_stream_config = std::option::Option::Some(
13145            crate::model::destination_config::DestinationStreamConfig::BigqueryDestinationConfig(
13146                v.into(),
13147            ),
13148        );
13149        self
13150    }
13151}
13152
13153impl wkt::message::Message for DestinationConfig {
13154    fn typename() -> &'static str {
13155        "type.googleapis.com/google.cloud.datastream.v1.DestinationConfig"
13156    }
13157}
13158
13159/// Defines additional types related to [DestinationConfig].
13160pub mod destination_config {
13161    #[allow(unused_imports)]
13162    use super::*;
13163
13164    /// Stream configuration that is specific to the data destination type.
13165    #[derive(Clone, Debug, PartialEq)]
13166    #[non_exhaustive]
13167    pub enum DestinationStreamConfig {
13168        /// A configuration for how data should be loaded to Cloud Storage.
13169        GcsDestinationConfig(std::boxed::Box<crate::model::GcsDestinationConfig>),
13170        /// BigQuery destination configuration.
13171        BigqueryDestinationConfig(std::boxed::Box<crate::model::BigQueryDestinationConfig>),
13172    }
13173}
13174
13175/// A resource representing streaming data from a source to a destination.
13176#[derive(Clone, Default, PartialEq)]
13177#[non_exhaustive]
13178pub struct Stream {
13179    /// Output only. Identifier. The stream's name.
13180    pub name: std::string::String,
13181
13182    /// Output only. The creation time of the stream.
13183    pub create_time: std::option::Option<wkt::Timestamp>,
13184
13185    /// Output only. The last update time of the stream.
13186    pub update_time: std::option::Option<wkt::Timestamp>,
13187
13188    /// Labels.
13189    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
13190
13191    /// Required. Display name.
13192    pub display_name: std::string::String,
13193
13194    /// Required. Source connection profile configuration.
13195    pub source_config: std::option::Option<crate::model::SourceConfig>,
13196
13197    /// Required. Destination connection profile configuration.
13198    pub destination_config: std::option::Option<crate::model::DestinationConfig>,
13199
13200    /// The state of the stream.
13201    pub state: crate::model::stream::State,
13202
13203    /// Output only. Errors on the Stream.
13204    pub errors: std::vec::Vec<crate::model::Error>,
13205
13206    /// Immutable. A reference to a KMS encryption key.
13207    /// If provided, it will be used to encrypt the data.
13208    /// If left blank, data will be encrypted using an internal Stream-specific
13209    /// encryption key provisioned through KMS.
13210    pub customer_managed_encryption_key: std::option::Option<std::string::String>,
13211
13212    /// Output only. If the stream was recovered, the time of the last recovery.
13213    /// Note: This field is currently experimental.
13214    pub last_recovery_time: std::option::Option<wkt::Timestamp>,
13215
13216    /// Output only. Reserved for future use.
13217    pub satisfies_pzs: std::option::Option<bool>,
13218
13219    /// Output only. Reserved for future use.
13220    pub satisfies_pzi: std::option::Option<bool>,
13221
13222    /// Stream backfill strategy.
13223    pub backfill_strategy: std::option::Option<crate::model::stream::BackfillStrategy>,
13224
13225    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13226}
13227
13228impl Stream {
13229    pub fn new() -> Self {
13230        std::default::Default::default()
13231    }
13232
13233    /// Sets the value of [name][crate::model::Stream::name].
13234    ///
13235    /// # Example
13236    /// ```ignore,no_run
13237    /// # use google_cloud_datastream_v1::model::Stream;
13238    /// let x = Stream::new().set_name("example");
13239    /// ```
13240    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13241        self.name = v.into();
13242        self
13243    }
13244
13245    /// Sets the value of [create_time][crate::model::Stream::create_time].
13246    ///
13247    /// # Example
13248    /// ```ignore,no_run
13249    /// # use google_cloud_datastream_v1::model::Stream;
13250    /// use wkt::Timestamp;
13251    /// let x = Stream::new().set_create_time(Timestamp::default()/* use setters */);
13252    /// ```
13253    pub fn set_create_time<T>(mut self, v: T) -> Self
13254    where
13255        T: std::convert::Into<wkt::Timestamp>,
13256    {
13257        self.create_time = std::option::Option::Some(v.into());
13258        self
13259    }
13260
13261    /// Sets or clears the value of [create_time][crate::model::Stream::create_time].
13262    ///
13263    /// # Example
13264    /// ```ignore,no_run
13265    /// # use google_cloud_datastream_v1::model::Stream;
13266    /// use wkt::Timestamp;
13267    /// let x = Stream::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
13268    /// let x = Stream::new().set_or_clear_create_time(None::<Timestamp>);
13269    /// ```
13270    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13271    where
13272        T: std::convert::Into<wkt::Timestamp>,
13273    {
13274        self.create_time = v.map(|x| x.into());
13275        self
13276    }
13277
13278    /// Sets the value of [update_time][crate::model::Stream::update_time].
13279    ///
13280    /// # Example
13281    /// ```ignore,no_run
13282    /// # use google_cloud_datastream_v1::model::Stream;
13283    /// use wkt::Timestamp;
13284    /// let x = Stream::new().set_update_time(Timestamp::default()/* use setters */);
13285    /// ```
13286    pub fn set_update_time<T>(mut self, v: T) -> Self
13287    where
13288        T: std::convert::Into<wkt::Timestamp>,
13289    {
13290        self.update_time = std::option::Option::Some(v.into());
13291        self
13292    }
13293
13294    /// Sets or clears the value of [update_time][crate::model::Stream::update_time].
13295    ///
13296    /// # Example
13297    /// ```ignore,no_run
13298    /// # use google_cloud_datastream_v1::model::Stream;
13299    /// use wkt::Timestamp;
13300    /// let x = Stream::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
13301    /// let x = Stream::new().set_or_clear_update_time(None::<Timestamp>);
13302    /// ```
13303    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13304    where
13305        T: std::convert::Into<wkt::Timestamp>,
13306    {
13307        self.update_time = v.map(|x| x.into());
13308        self
13309    }
13310
13311    /// Sets the value of [labels][crate::model::Stream::labels].
13312    ///
13313    /// # Example
13314    /// ```ignore,no_run
13315    /// # use google_cloud_datastream_v1::model::Stream;
13316    /// let x = Stream::new().set_labels([
13317    ///     ("key0", "abc"),
13318    ///     ("key1", "xyz"),
13319    /// ]);
13320    /// ```
13321    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
13322    where
13323        T: std::iter::IntoIterator<Item = (K, V)>,
13324        K: std::convert::Into<std::string::String>,
13325        V: std::convert::Into<std::string::String>,
13326    {
13327        use std::iter::Iterator;
13328        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13329        self
13330    }
13331
13332    /// Sets the value of [display_name][crate::model::Stream::display_name].
13333    ///
13334    /// # Example
13335    /// ```ignore,no_run
13336    /// # use google_cloud_datastream_v1::model::Stream;
13337    /// let x = Stream::new().set_display_name("example");
13338    /// ```
13339    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13340        self.display_name = v.into();
13341        self
13342    }
13343
13344    /// Sets the value of [source_config][crate::model::Stream::source_config].
13345    ///
13346    /// # Example
13347    /// ```ignore,no_run
13348    /// # use google_cloud_datastream_v1::model::Stream;
13349    /// use google_cloud_datastream_v1::model::SourceConfig;
13350    /// let x = Stream::new().set_source_config(SourceConfig::default()/* use setters */);
13351    /// ```
13352    pub fn set_source_config<T>(mut self, v: T) -> Self
13353    where
13354        T: std::convert::Into<crate::model::SourceConfig>,
13355    {
13356        self.source_config = std::option::Option::Some(v.into());
13357        self
13358    }
13359
13360    /// Sets or clears the value of [source_config][crate::model::Stream::source_config].
13361    ///
13362    /// # Example
13363    /// ```ignore,no_run
13364    /// # use google_cloud_datastream_v1::model::Stream;
13365    /// use google_cloud_datastream_v1::model::SourceConfig;
13366    /// let x = Stream::new().set_or_clear_source_config(Some(SourceConfig::default()/* use setters */));
13367    /// let x = Stream::new().set_or_clear_source_config(None::<SourceConfig>);
13368    /// ```
13369    pub fn set_or_clear_source_config<T>(mut self, v: std::option::Option<T>) -> Self
13370    where
13371        T: std::convert::Into<crate::model::SourceConfig>,
13372    {
13373        self.source_config = v.map(|x| x.into());
13374        self
13375    }
13376
13377    /// Sets the value of [destination_config][crate::model::Stream::destination_config].
13378    ///
13379    /// # Example
13380    /// ```ignore,no_run
13381    /// # use google_cloud_datastream_v1::model::Stream;
13382    /// use google_cloud_datastream_v1::model::DestinationConfig;
13383    /// let x = Stream::new().set_destination_config(DestinationConfig::default()/* use setters */);
13384    /// ```
13385    pub fn set_destination_config<T>(mut self, v: T) -> Self
13386    where
13387        T: std::convert::Into<crate::model::DestinationConfig>,
13388    {
13389        self.destination_config = std::option::Option::Some(v.into());
13390        self
13391    }
13392
13393    /// Sets or clears the value of [destination_config][crate::model::Stream::destination_config].
13394    ///
13395    /// # Example
13396    /// ```ignore,no_run
13397    /// # use google_cloud_datastream_v1::model::Stream;
13398    /// use google_cloud_datastream_v1::model::DestinationConfig;
13399    /// let x = Stream::new().set_or_clear_destination_config(Some(DestinationConfig::default()/* use setters */));
13400    /// let x = Stream::new().set_or_clear_destination_config(None::<DestinationConfig>);
13401    /// ```
13402    pub fn set_or_clear_destination_config<T>(mut self, v: std::option::Option<T>) -> Self
13403    where
13404        T: std::convert::Into<crate::model::DestinationConfig>,
13405    {
13406        self.destination_config = v.map(|x| x.into());
13407        self
13408    }
13409
13410    /// Sets the value of [state][crate::model::Stream::state].
13411    ///
13412    /// # Example
13413    /// ```ignore,no_run
13414    /// # use google_cloud_datastream_v1::model::Stream;
13415    /// use google_cloud_datastream_v1::model::stream::State;
13416    /// let x0 = Stream::new().set_state(State::NotStarted);
13417    /// let x1 = Stream::new().set_state(State::Running);
13418    /// let x2 = Stream::new().set_state(State::Paused);
13419    /// ```
13420    pub fn set_state<T: std::convert::Into<crate::model::stream::State>>(mut self, v: T) -> Self {
13421        self.state = v.into();
13422        self
13423    }
13424
13425    /// Sets the value of [errors][crate::model::Stream::errors].
13426    ///
13427    /// # Example
13428    /// ```ignore,no_run
13429    /// # use google_cloud_datastream_v1::model::Stream;
13430    /// use google_cloud_datastream_v1::model::Error;
13431    /// let x = Stream::new()
13432    ///     .set_errors([
13433    ///         Error::default()/* use setters */,
13434    ///         Error::default()/* use (different) setters */,
13435    ///     ]);
13436    /// ```
13437    pub fn set_errors<T, V>(mut self, v: T) -> Self
13438    where
13439        T: std::iter::IntoIterator<Item = V>,
13440        V: std::convert::Into<crate::model::Error>,
13441    {
13442        use std::iter::Iterator;
13443        self.errors = v.into_iter().map(|i| i.into()).collect();
13444        self
13445    }
13446
13447    /// Sets the value of [customer_managed_encryption_key][crate::model::Stream::customer_managed_encryption_key].
13448    ///
13449    /// # Example
13450    /// ```ignore,no_run
13451    /// # use google_cloud_datastream_v1::model::Stream;
13452    /// let x = Stream::new().set_customer_managed_encryption_key("example");
13453    /// ```
13454    pub fn set_customer_managed_encryption_key<T>(mut self, v: T) -> Self
13455    where
13456        T: std::convert::Into<std::string::String>,
13457    {
13458        self.customer_managed_encryption_key = std::option::Option::Some(v.into());
13459        self
13460    }
13461
13462    /// Sets or clears the value of [customer_managed_encryption_key][crate::model::Stream::customer_managed_encryption_key].
13463    ///
13464    /// # Example
13465    /// ```ignore,no_run
13466    /// # use google_cloud_datastream_v1::model::Stream;
13467    /// let x = Stream::new().set_or_clear_customer_managed_encryption_key(Some("example"));
13468    /// let x = Stream::new().set_or_clear_customer_managed_encryption_key(None::<String>);
13469    /// ```
13470    pub fn set_or_clear_customer_managed_encryption_key<T>(
13471        mut self,
13472        v: std::option::Option<T>,
13473    ) -> Self
13474    where
13475        T: std::convert::Into<std::string::String>,
13476    {
13477        self.customer_managed_encryption_key = v.map(|x| x.into());
13478        self
13479    }
13480
13481    /// Sets the value of [last_recovery_time][crate::model::Stream::last_recovery_time].
13482    ///
13483    /// # Example
13484    /// ```ignore,no_run
13485    /// # use google_cloud_datastream_v1::model::Stream;
13486    /// use wkt::Timestamp;
13487    /// let x = Stream::new().set_last_recovery_time(Timestamp::default()/* use setters */);
13488    /// ```
13489    pub fn set_last_recovery_time<T>(mut self, v: T) -> Self
13490    where
13491        T: std::convert::Into<wkt::Timestamp>,
13492    {
13493        self.last_recovery_time = std::option::Option::Some(v.into());
13494        self
13495    }
13496
13497    /// Sets or clears the value of [last_recovery_time][crate::model::Stream::last_recovery_time].
13498    ///
13499    /// # Example
13500    /// ```ignore,no_run
13501    /// # use google_cloud_datastream_v1::model::Stream;
13502    /// use wkt::Timestamp;
13503    /// let x = Stream::new().set_or_clear_last_recovery_time(Some(Timestamp::default()/* use setters */));
13504    /// let x = Stream::new().set_or_clear_last_recovery_time(None::<Timestamp>);
13505    /// ```
13506    pub fn set_or_clear_last_recovery_time<T>(mut self, v: std::option::Option<T>) -> Self
13507    where
13508        T: std::convert::Into<wkt::Timestamp>,
13509    {
13510        self.last_recovery_time = v.map(|x| x.into());
13511        self
13512    }
13513
13514    /// Sets the value of [satisfies_pzs][crate::model::Stream::satisfies_pzs].
13515    ///
13516    /// # Example
13517    /// ```ignore,no_run
13518    /// # use google_cloud_datastream_v1::model::Stream;
13519    /// let x = Stream::new().set_satisfies_pzs(true);
13520    /// ```
13521    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
13522    where
13523        T: std::convert::Into<bool>,
13524    {
13525        self.satisfies_pzs = std::option::Option::Some(v.into());
13526        self
13527    }
13528
13529    /// Sets or clears the value of [satisfies_pzs][crate::model::Stream::satisfies_pzs].
13530    ///
13531    /// # Example
13532    /// ```ignore,no_run
13533    /// # use google_cloud_datastream_v1::model::Stream;
13534    /// let x = Stream::new().set_or_clear_satisfies_pzs(Some(false));
13535    /// let x = Stream::new().set_or_clear_satisfies_pzs(None::<bool>);
13536    /// ```
13537    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
13538    where
13539        T: std::convert::Into<bool>,
13540    {
13541        self.satisfies_pzs = v.map(|x| x.into());
13542        self
13543    }
13544
13545    /// Sets the value of [satisfies_pzi][crate::model::Stream::satisfies_pzi].
13546    ///
13547    /// # Example
13548    /// ```ignore,no_run
13549    /// # use google_cloud_datastream_v1::model::Stream;
13550    /// let x = Stream::new().set_satisfies_pzi(true);
13551    /// ```
13552    pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
13553    where
13554        T: std::convert::Into<bool>,
13555    {
13556        self.satisfies_pzi = std::option::Option::Some(v.into());
13557        self
13558    }
13559
13560    /// Sets or clears the value of [satisfies_pzi][crate::model::Stream::satisfies_pzi].
13561    ///
13562    /// # Example
13563    /// ```ignore,no_run
13564    /// # use google_cloud_datastream_v1::model::Stream;
13565    /// let x = Stream::new().set_or_clear_satisfies_pzi(Some(false));
13566    /// let x = Stream::new().set_or_clear_satisfies_pzi(None::<bool>);
13567    /// ```
13568    pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
13569    where
13570        T: std::convert::Into<bool>,
13571    {
13572        self.satisfies_pzi = v.map(|x| x.into());
13573        self
13574    }
13575
13576    /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy].
13577    ///
13578    /// Note that all the setters affecting `backfill_strategy` are mutually
13579    /// exclusive.
13580    ///
13581    /// # Example
13582    /// ```ignore,no_run
13583    /// # use google_cloud_datastream_v1::model::Stream;
13584    /// use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13585    /// let x = Stream::new().set_backfill_strategy(Some(
13586    ///     google_cloud_datastream_v1::model::stream::BackfillStrategy::BackfillAll(BackfillAllStrategy::default().into())));
13587    /// ```
13588    pub fn set_backfill_strategy<
13589        T: std::convert::Into<std::option::Option<crate::model::stream::BackfillStrategy>>,
13590    >(
13591        mut self,
13592        v: T,
13593    ) -> Self {
13594        self.backfill_strategy = v.into();
13595        self
13596    }
13597
13598    /// The value of [backfill_strategy][crate::model::Stream::backfill_strategy]
13599    /// if it holds a `BackfillAll`, `None` if the field is not set or
13600    /// holds a different branch.
13601    pub fn backfill_all(
13602        &self,
13603    ) -> std::option::Option<&std::boxed::Box<crate::model::stream::BackfillAllStrategy>> {
13604        #[allow(unreachable_patterns)]
13605        self.backfill_strategy.as_ref().and_then(|v| match v {
13606            crate::model::stream::BackfillStrategy::BackfillAll(v) => std::option::Option::Some(v),
13607            _ => std::option::Option::None,
13608        })
13609    }
13610
13611    /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy]
13612    /// to hold a `BackfillAll`.
13613    ///
13614    /// Note that all the setters affecting `backfill_strategy` are
13615    /// mutually exclusive.
13616    ///
13617    /// # Example
13618    /// ```ignore,no_run
13619    /// # use google_cloud_datastream_v1::model::Stream;
13620    /// use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13621    /// let x = Stream::new().set_backfill_all(BackfillAllStrategy::default()/* use setters */);
13622    /// assert!(x.backfill_all().is_some());
13623    /// assert!(x.backfill_none().is_none());
13624    /// ```
13625    pub fn set_backfill_all<
13626        T: std::convert::Into<std::boxed::Box<crate::model::stream::BackfillAllStrategy>>,
13627    >(
13628        mut self,
13629        v: T,
13630    ) -> Self {
13631        self.backfill_strategy = std::option::Option::Some(
13632            crate::model::stream::BackfillStrategy::BackfillAll(v.into()),
13633        );
13634        self
13635    }
13636
13637    /// The value of [backfill_strategy][crate::model::Stream::backfill_strategy]
13638    /// if it holds a `BackfillNone`, `None` if the field is not set or
13639    /// holds a different branch.
13640    pub fn backfill_none(
13641        &self,
13642    ) -> std::option::Option<&std::boxed::Box<crate::model::stream::BackfillNoneStrategy>> {
13643        #[allow(unreachable_patterns)]
13644        self.backfill_strategy.as_ref().and_then(|v| match v {
13645            crate::model::stream::BackfillStrategy::BackfillNone(v) => std::option::Option::Some(v),
13646            _ => std::option::Option::None,
13647        })
13648    }
13649
13650    /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy]
13651    /// to hold a `BackfillNone`.
13652    ///
13653    /// Note that all the setters affecting `backfill_strategy` are
13654    /// mutually exclusive.
13655    ///
13656    /// # Example
13657    /// ```ignore,no_run
13658    /// # use google_cloud_datastream_v1::model::Stream;
13659    /// use google_cloud_datastream_v1::model::stream::BackfillNoneStrategy;
13660    /// let x = Stream::new().set_backfill_none(BackfillNoneStrategy::default()/* use setters */);
13661    /// assert!(x.backfill_none().is_some());
13662    /// assert!(x.backfill_all().is_none());
13663    /// ```
13664    pub fn set_backfill_none<
13665        T: std::convert::Into<std::boxed::Box<crate::model::stream::BackfillNoneStrategy>>,
13666    >(
13667        mut self,
13668        v: T,
13669    ) -> Self {
13670        self.backfill_strategy = std::option::Option::Some(
13671            crate::model::stream::BackfillStrategy::BackfillNone(v.into()),
13672        );
13673        self
13674    }
13675}
13676
13677impl wkt::message::Message for Stream {
13678    fn typename() -> &'static str {
13679        "type.googleapis.com/google.cloud.datastream.v1.Stream"
13680    }
13681}
13682
13683/// Defines additional types related to [Stream].
13684pub mod stream {
13685    #[allow(unused_imports)]
13686    use super::*;
13687
13688    /// Backfill strategy to automatically backfill the Stream's objects.
13689    /// Specific objects can be excluded.
13690    #[derive(Clone, Default, PartialEq)]
13691    #[non_exhaustive]
13692    pub struct BackfillAllStrategy {
13693        /// List of objects to exclude.
13694        pub excluded_objects:
13695            std::option::Option<crate::model::stream::backfill_all_strategy::ExcludedObjects>,
13696
13697        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13698    }
13699
13700    impl BackfillAllStrategy {
13701        pub fn new() -> Self {
13702            std::default::Default::default()
13703        }
13704
13705        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects].
13706        ///
13707        /// Note that all the setters affecting `excluded_objects` are mutually
13708        /// exclusive.
13709        ///
13710        /// # Example
13711        /// ```ignore,no_run
13712        /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13713        /// use google_cloud_datastream_v1::model::OracleRdbms;
13714        /// let x = BackfillAllStrategy::new().set_excluded_objects(Some(
13715        ///     google_cloud_datastream_v1::model::stream::backfill_all_strategy::ExcludedObjects::OracleExcludedObjects(OracleRdbms::default().into())));
13716        /// ```
13717        pub fn set_excluded_objects<
13718            T: std::convert::Into<
13719                    std::option::Option<
13720                        crate::model::stream::backfill_all_strategy::ExcludedObjects,
13721                    >,
13722                >,
13723        >(
13724            mut self,
13725            v: T,
13726        ) -> Self {
13727            self.excluded_objects = v.into();
13728            self
13729        }
13730
13731        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13732        /// if it holds a `OracleExcludedObjects`, `None` if the field is not set or
13733        /// holds a different branch.
13734        pub fn oracle_excluded_objects(
13735            &self,
13736        ) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
13737            #[allow(unreachable_patterns)]
13738            self.excluded_objects.as_ref().and_then(|v| match v {
13739                crate::model::stream::backfill_all_strategy::ExcludedObjects::OracleExcludedObjects(v) => std::option::Option::Some(v),
13740                _ => std::option::Option::None,
13741            })
13742        }
13743
13744        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13745        /// to hold a `OracleExcludedObjects`.
13746        ///
13747        /// Note that all the setters affecting `excluded_objects` are
13748        /// mutually exclusive.
13749        ///
13750        /// # Example
13751        /// ```ignore,no_run
13752        /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13753        /// use google_cloud_datastream_v1::model::OracleRdbms;
13754        /// let x = BackfillAllStrategy::new().set_oracle_excluded_objects(OracleRdbms::default()/* use setters */);
13755        /// assert!(x.oracle_excluded_objects().is_some());
13756        /// assert!(x.mysql_excluded_objects().is_none());
13757        /// assert!(x.postgresql_excluded_objects().is_none());
13758        /// assert!(x.sql_server_excluded_objects().is_none());
13759        /// assert!(x.salesforce_excluded_objects().is_none());
13760        /// assert!(x.mongodb_excluded_objects().is_none());
13761        /// ```
13762        pub fn set_oracle_excluded_objects<
13763            T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>,
13764        >(
13765            mut self,
13766            v: T,
13767        ) -> Self {
13768            self.excluded_objects = std::option::Option::Some(
13769                crate::model::stream::backfill_all_strategy::ExcludedObjects::OracleExcludedObjects(
13770                    v.into(),
13771                ),
13772            );
13773            self
13774        }
13775
13776        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13777        /// if it holds a `MysqlExcludedObjects`, `None` if the field is not set or
13778        /// holds a different branch.
13779        pub fn mysql_excluded_objects(
13780            &self,
13781        ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
13782            #[allow(unreachable_patterns)]
13783            self.excluded_objects.as_ref().and_then(|v| match v {
13784                crate::model::stream::backfill_all_strategy::ExcludedObjects::MysqlExcludedObjects(v) => std::option::Option::Some(v),
13785                _ => std::option::Option::None,
13786            })
13787        }
13788
13789        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13790        /// to hold a `MysqlExcludedObjects`.
13791        ///
13792        /// Note that all the setters affecting `excluded_objects` are
13793        /// mutually exclusive.
13794        ///
13795        /// # Example
13796        /// ```ignore,no_run
13797        /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13798        /// use google_cloud_datastream_v1::model::MysqlRdbms;
13799        /// let x = BackfillAllStrategy::new().set_mysql_excluded_objects(MysqlRdbms::default()/* use setters */);
13800        /// assert!(x.mysql_excluded_objects().is_some());
13801        /// assert!(x.oracle_excluded_objects().is_none());
13802        /// assert!(x.postgresql_excluded_objects().is_none());
13803        /// assert!(x.sql_server_excluded_objects().is_none());
13804        /// assert!(x.salesforce_excluded_objects().is_none());
13805        /// assert!(x.mongodb_excluded_objects().is_none());
13806        /// ```
13807        pub fn set_mysql_excluded_objects<
13808            T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>,
13809        >(
13810            mut self,
13811            v: T,
13812        ) -> Self {
13813            self.excluded_objects = std::option::Option::Some(
13814                crate::model::stream::backfill_all_strategy::ExcludedObjects::MysqlExcludedObjects(
13815                    v.into(),
13816                ),
13817            );
13818            self
13819        }
13820
13821        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13822        /// if it holds a `PostgresqlExcludedObjects`, `None` if the field is not set or
13823        /// holds a different branch.
13824        pub fn postgresql_excluded_objects(
13825            &self,
13826        ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
13827            #[allow(unreachable_patterns)]
13828            self.excluded_objects.as_ref().and_then(|v| match v {
13829                crate::model::stream::backfill_all_strategy::ExcludedObjects::PostgresqlExcludedObjects(v) => std::option::Option::Some(v),
13830                _ => std::option::Option::None,
13831            })
13832        }
13833
13834        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13835        /// to hold a `PostgresqlExcludedObjects`.
13836        ///
13837        /// Note that all the setters affecting `excluded_objects` are
13838        /// mutually exclusive.
13839        ///
13840        /// # Example
13841        /// ```ignore,no_run
13842        /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13843        /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
13844        /// let x = BackfillAllStrategy::new().set_postgresql_excluded_objects(PostgresqlRdbms::default()/* use setters */);
13845        /// assert!(x.postgresql_excluded_objects().is_some());
13846        /// assert!(x.oracle_excluded_objects().is_none());
13847        /// assert!(x.mysql_excluded_objects().is_none());
13848        /// assert!(x.sql_server_excluded_objects().is_none());
13849        /// assert!(x.salesforce_excluded_objects().is_none());
13850        /// assert!(x.mongodb_excluded_objects().is_none());
13851        /// ```
13852        pub fn set_postgresql_excluded_objects<
13853            T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
13854        >(
13855            mut self,
13856            v: T,
13857        ) -> Self {
13858            self.excluded_objects = std::option::Option::Some(
13859                crate::model::stream::backfill_all_strategy::ExcludedObjects::PostgresqlExcludedObjects(
13860                    v.into()
13861                )
13862            );
13863            self
13864        }
13865
13866        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13867        /// if it holds a `SqlServerExcludedObjects`, `None` if the field is not set or
13868        /// holds a different branch.
13869        pub fn sql_server_excluded_objects(
13870            &self,
13871        ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
13872            #[allow(unreachable_patterns)]
13873            self.excluded_objects.as_ref().and_then(|v| match v {
13874                crate::model::stream::backfill_all_strategy::ExcludedObjects::SqlServerExcludedObjects(v) => std::option::Option::Some(v),
13875                _ => std::option::Option::None,
13876            })
13877        }
13878
13879        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13880        /// to hold a `SqlServerExcludedObjects`.
13881        ///
13882        /// Note that all the setters affecting `excluded_objects` are
13883        /// mutually exclusive.
13884        ///
13885        /// # Example
13886        /// ```ignore,no_run
13887        /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13888        /// use google_cloud_datastream_v1::model::SqlServerRdbms;
13889        /// let x = BackfillAllStrategy::new().set_sql_server_excluded_objects(SqlServerRdbms::default()/* use setters */);
13890        /// assert!(x.sql_server_excluded_objects().is_some());
13891        /// assert!(x.oracle_excluded_objects().is_none());
13892        /// assert!(x.mysql_excluded_objects().is_none());
13893        /// assert!(x.postgresql_excluded_objects().is_none());
13894        /// assert!(x.salesforce_excluded_objects().is_none());
13895        /// assert!(x.mongodb_excluded_objects().is_none());
13896        /// ```
13897        pub fn set_sql_server_excluded_objects<
13898            T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
13899        >(
13900            mut self,
13901            v: T,
13902        ) -> Self {
13903            self.excluded_objects = std::option::Option::Some(
13904                crate::model::stream::backfill_all_strategy::ExcludedObjects::SqlServerExcludedObjects(
13905                    v.into()
13906                )
13907            );
13908            self
13909        }
13910
13911        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13912        /// if it holds a `SalesforceExcludedObjects`, `None` if the field is not set or
13913        /// holds a different branch.
13914        pub fn salesforce_excluded_objects(
13915            &self,
13916        ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceOrg>> {
13917            #[allow(unreachable_patterns)]
13918            self.excluded_objects.as_ref().and_then(|v| match v {
13919                crate::model::stream::backfill_all_strategy::ExcludedObjects::SalesforceExcludedObjects(v) => std::option::Option::Some(v),
13920                _ => std::option::Option::None,
13921            })
13922        }
13923
13924        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13925        /// to hold a `SalesforceExcludedObjects`.
13926        ///
13927        /// Note that all the setters affecting `excluded_objects` are
13928        /// mutually exclusive.
13929        ///
13930        /// # Example
13931        /// ```ignore,no_run
13932        /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13933        /// use google_cloud_datastream_v1::model::SalesforceOrg;
13934        /// let x = BackfillAllStrategy::new().set_salesforce_excluded_objects(SalesforceOrg::default()/* use setters */);
13935        /// assert!(x.salesforce_excluded_objects().is_some());
13936        /// assert!(x.oracle_excluded_objects().is_none());
13937        /// assert!(x.mysql_excluded_objects().is_none());
13938        /// assert!(x.postgresql_excluded_objects().is_none());
13939        /// assert!(x.sql_server_excluded_objects().is_none());
13940        /// assert!(x.mongodb_excluded_objects().is_none());
13941        /// ```
13942        pub fn set_salesforce_excluded_objects<
13943            T: std::convert::Into<std::boxed::Box<crate::model::SalesforceOrg>>,
13944        >(
13945            mut self,
13946            v: T,
13947        ) -> Self {
13948            self.excluded_objects = std::option::Option::Some(
13949                crate::model::stream::backfill_all_strategy::ExcludedObjects::SalesforceExcludedObjects(
13950                    v.into()
13951                )
13952            );
13953            self
13954        }
13955
13956        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13957        /// if it holds a `MongodbExcludedObjects`, `None` if the field is not set or
13958        /// holds a different branch.
13959        pub fn mongodb_excluded_objects(
13960            &self,
13961        ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbCluster>> {
13962            #[allow(unreachable_patterns)]
13963            self.excluded_objects.as_ref().and_then(|v| match v {
13964                crate::model::stream::backfill_all_strategy::ExcludedObjects::MongodbExcludedObjects(v) => std::option::Option::Some(v),
13965                _ => std::option::Option::None,
13966            })
13967        }
13968
13969        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13970        /// to hold a `MongodbExcludedObjects`.
13971        ///
13972        /// Note that all the setters affecting `excluded_objects` are
13973        /// mutually exclusive.
13974        ///
13975        /// # Example
13976        /// ```ignore,no_run
13977        /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13978        /// use google_cloud_datastream_v1::model::MongodbCluster;
13979        /// let x = BackfillAllStrategy::new().set_mongodb_excluded_objects(MongodbCluster::default()/* use setters */);
13980        /// assert!(x.mongodb_excluded_objects().is_some());
13981        /// assert!(x.oracle_excluded_objects().is_none());
13982        /// assert!(x.mysql_excluded_objects().is_none());
13983        /// assert!(x.postgresql_excluded_objects().is_none());
13984        /// assert!(x.sql_server_excluded_objects().is_none());
13985        /// assert!(x.salesforce_excluded_objects().is_none());
13986        /// ```
13987        pub fn set_mongodb_excluded_objects<
13988            T: std::convert::Into<std::boxed::Box<crate::model::MongodbCluster>>,
13989        >(
13990            mut self,
13991            v: T,
13992        ) -> Self {
13993            self.excluded_objects = std::option::Option::Some(
13994                crate::model::stream::backfill_all_strategy::ExcludedObjects::MongodbExcludedObjects(
13995                    v.into()
13996                )
13997            );
13998            self
13999        }
14000    }
14001
14002    impl wkt::message::Message for BackfillAllStrategy {
14003        fn typename() -> &'static str {
14004            "type.googleapis.com/google.cloud.datastream.v1.Stream.BackfillAllStrategy"
14005        }
14006    }
14007
14008    /// Defines additional types related to [BackfillAllStrategy].
14009    pub mod backfill_all_strategy {
14010        #[allow(unused_imports)]
14011        use super::*;
14012
14013        /// List of objects to exclude.
14014        #[derive(Clone, Debug, PartialEq)]
14015        #[non_exhaustive]
14016        pub enum ExcludedObjects {
14017            /// Oracle data source objects to avoid backfilling.
14018            OracleExcludedObjects(std::boxed::Box<crate::model::OracleRdbms>),
14019            /// MySQL data source objects to avoid backfilling.
14020            MysqlExcludedObjects(std::boxed::Box<crate::model::MysqlRdbms>),
14021            /// PostgreSQL data source objects to avoid backfilling.
14022            PostgresqlExcludedObjects(std::boxed::Box<crate::model::PostgresqlRdbms>),
14023            /// SQLServer data source objects to avoid backfilling
14024            SqlServerExcludedObjects(std::boxed::Box<crate::model::SqlServerRdbms>),
14025            /// Salesforce data source objects to avoid backfilling
14026            SalesforceExcludedObjects(std::boxed::Box<crate::model::SalesforceOrg>),
14027            /// MongoDB data source objects to avoid backfilling
14028            MongodbExcludedObjects(std::boxed::Box<crate::model::MongodbCluster>),
14029        }
14030    }
14031
14032    /// Backfill strategy to disable automatic backfill for the Stream's objects.
14033    #[derive(Clone, Default, PartialEq)]
14034    #[non_exhaustive]
14035    pub struct BackfillNoneStrategy {
14036        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14037    }
14038
14039    impl BackfillNoneStrategy {
14040        pub fn new() -> Self {
14041            std::default::Default::default()
14042        }
14043    }
14044
14045    impl wkt::message::Message for BackfillNoneStrategy {
14046        fn typename() -> &'static str {
14047            "type.googleapis.com/google.cloud.datastream.v1.Stream.BackfillNoneStrategy"
14048        }
14049    }
14050
14051    /// Stream state.
14052    ///
14053    /// # Working with unknown values
14054    ///
14055    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14056    /// additional enum variants at any time. Adding new variants is not considered
14057    /// a breaking change. Applications should write their code in anticipation of:
14058    ///
14059    /// - New values appearing in future releases of the client library, **and**
14060    /// - New values received dynamically, without application changes.
14061    ///
14062    /// Please consult the [Working with enums] section in the user guide for some
14063    /// guidelines.
14064    ///
14065    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14066    #[derive(Clone, Debug, PartialEq)]
14067    #[non_exhaustive]
14068    pub enum State {
14069        /// Unspecified stream state.
14070        Unspecified,
14071        /// The stream has been created but has not yet started streaming data.
14072        NotStarted,
14073        /// The stream is running.
14074        Running,
14075        /// The stream is paused.
14076        Paused,
14077        /// The stream is in maintenance mode.
14078        ///
14079        /// Updates are rejected on the resource in this state.
14080        Maintenance,
14081        /// The stream is experiencing an error that is preventing data from being
14082        /// streamed.
14083        Failed,
14084        /// The stream has experienced a terminal failure.
14085        FailedPermanently,
14086        /// The stream is starting, but not yet running.
14087        Starting,
14088        /// The Stream is no longer reading new events, but still writing events in
14089        /// the buffer.
14090        Draining,
14091        /// If set, the enum was initialized with an unknown value.
14092        ///
14093        /// Applications can examine the value using [State::value] or
14094        /// [State::name].
14095        UnknownValue(state::UnknownValue),
14096    }
14097
14098    #[doc(hidden)]
14099    pub mod state {
14100        #[allow(unused_imports)]
14101        use super::*;
14102        #[derive(Clone, Debug, PartialEq)]
14103        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14104    }
14105
14106    impl State {
14107        /// Gets the enum value.
14108        ///
14109        /// Returns `None` if the enum contains an unknown value deserialized from
14110        /// the string representation of enums.
14111        pub fn value(&self) -> std::option::Option<i32> {
14112            match self {
14113                Self::Unspecified => std::option::Option::Some(0),
14114                Self::NotStarted => std::option::Option::Some(1),
14115                Self::Running => std::option::Option::Some(2),
14116                Self::Paused => std::option::Option::Some(3),
14117                Self::Maintenance => std::option::Option::Some(4),
14118                Self::Failed => std::option::Option::Some(5),
14119                Self::FailedPermanently => std::option::Option::Some(6),
14120                Self::Starting => std::option::Option::Some(7),
14121                Self::Draining => std::option::Option::Some(8),
14122                Self::UnknownValue(u) => u.0.value(),
14123            }
14124        }
14125
14126        /// Gets the enum value as a string.
14127        ///
14128        /// Returns `None` if the enum contains an unknown value deserialized from
14129        /// the integer representation of enums.
14130        pub fn name(&self) -> std::option::Option<&str> {
14131            match self {
14132                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14133                Self::NotStarted => std::option::Option::Some("NOT_STARTED"),
14134                Self::Running => std::option::Option::Some("RUNNING"),
14135                Self::Paused => std::option::Option::Some("PAUSED"),
14136                Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
14137                Self::Failed => std::option::Option::Some("FAILED"),
14138                Self::FailedPermanently => std::option::Option::Some("FAILED_PERMANENTLY"),
14139                Self::Starting => std::option::Option::Some("STARTING"),
14140                Self::Draining => std::option::Option::Some("DRAINING"),
14141                Self::UnknownValue(u) => u.0.name(),
14142            }
14143        }
14144    }
14145
14146    impl std::default::Default for State {
14147        fn default() -> Self {
14148            use std::convert::From;
14149            Self::from(0)
14150        }
14151    }
14152
14153    impl std::fmt::Display for State {
14154        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14155            wkt::internal::display_enum(f, self.name(), self.value())
14156        }
14157    }
14158
14159    impl std::convert::From<i32> for State {
14160        fn from(value: i32) -> Self {
14161            match value {
14162                0 => Self::Unspecified,
14163                1 => Self::NotStarted,
14164                2 => Self::Running,
14165                3 => Self::Paused,
14166                4 => Self::Maintenance,
14167                5 => Self::Failed,
14168                6 => Self::FailedPermanently,
14169                7 => Self::Starting,
14170                8 => Self::Draining,
14171                _ => Self::UnknownValue(state::UnknownValue(
14172                    wkt::internal::UnknownEnumValue::Integer(value),
14173                )),
14174            }
14175        }
14176    }
14177
14178    impl std::convert::From<&str> for State {
14179        fn from(value: &str) -> Self {
14180            use std::string::ToString;
14181            match value {
14182                "STATE_UNSPECIFIED" => Self::Unspecified,
14183                "NOT_STARTED" => Self::NotStarted,
14184                "RUNNING" => Self::Running,
14185                "PAUSED" => Self::Paused,
14186                "MAINTENANCE" => Self::Maintenance,
14187                "FAILED" => Self::Failed,
14188                "FAILED_PERMANENTLY" => Self::FailedPermanently,
14189                "STARTING" => Self::Starting,
14190                "DRAINING" => Self::Draining,
14191                _ => Self::UnknownValue(state::UnknownValue(
14192                    wkt::internal::UnknownEnumValue::String(value.to_string()),
14193                )),
14194            }
14195        }
14196    }
14197
14198    impl serde::ser::Serialize for State {
14199        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14200        where
14201            S: serde::Serializer,
14202        {
14203            match self {
14204                Self::Unspecified => serializer.serialize_i32(0),
14205                Self::NotStarted => serializer.serialize_i32(1),
14206                Self::Running => serializer.serialize_i32(2),
14207                Self::Paused => serializer.serialize_i32(3),
14208                Self::Maintenance => serializer.serialize_i32(4),
14209                Self::Failed => serializer.serialize_i32(5),
14210                Self::FailedPermanently => serializer.serialize_i32(6),
14211                Self::Starting => serializer.serialize_i32(7),
14212                Self::Draining => serializer.serialize_i32(8),
14213                Self::UnknownValue(u) => u.0.serialize(serializer),
14214            }
14215        }
14216    }
14217
14218    impl<'de> serde::de::Deserialize<'de> for State {
14219        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14220        where
14221            D: serde::Deserializer<'de>,
14222        {
14223            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14224                ".google.cloud.datastream.v1.Stream.State",
14225            ))
14226        }
14227    }
14228
14229    /// Stream backfill strategy.
14230    #[derive(Clone, Debug, PartialEq)]
14231    #[non_exhaustive]
14232    pub enum BackfillStrategy {
14233        /// Automatically backfill objects included in the stream source
14234        /// configuration. Specific objects can be excluded.
14235        BackfillAll(std::boxed::Box<crate::model::stream::BackfillAllStrategy>),
14236        /// Do not automatically backfill any objects.
14237        BackfillNone(std::boxed::Box<crate::model::stream::BackfillNoneStrategy>),
14238    }
14239}
14240
14241/// A specific stream object (e.g a specific DB table).
14242#[derive(Clone, Default, PartialEq)]
14243#[non_exhaustive]
14244pub struct StreamObject {
14245    /// Output only. Identifier. The object resource's name.
14246    pub name: std::string::String,
14247
14248    /// Output only. The creation time of the object.
14249    pub create_time: std::option::Option<wkt::Timestamp>,
14250
14251    /// Output only. The last update time of the object.
14252    pub update_time: std::option::Option<wkt::Timestamp>,
14253
14254    /// Required. Display name.
14255    pub display_name: std::string::String,
14256
14257    /// Output only. Active errors on the object.
14258    pub errors: std::vec::Vec<crate::model::Error>,
14259
14260    /// The latest backfill job that was initiated for the stream object.
14261    pub backfill_job: std::option::Option<crate::model::BackfillJob>,
14262
14263    /// The object identifier in the data source.
14264    pub source_object: std::option::Option<crate::model::SourceObjectIdentifier>,
14265
14266    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14267}
14268
14269impl StreamObject {
14270    pub fn new() -> Self {
14271        std::default::Default::default()
14272    }
14273
14274    /// Sets the value of [name][crate::model::StreamObject::name].
14275    ///
14276    /// # Example
14277    /// ```ignore,no_run
14278    /// # use google_cloud_datastream_v1::model::StreamObject;
14279    /// let x = StreamObject::new().set_name("example");
14280    /// ```
14281    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14282        self.name = v.into();
14283        self
14284    }
14285
14286    /// Sets the value of [create_time][crate::model::StreamObject::create_time].
14287    ///
14288    /// # Example
14289    /// ```ignore,no_run
14290    /// # use google_cloud_datastream_v1::model::StreamObject;
14291    /// use wkt::Timestamp;
14292    /// let x = StreamObject::new().set_create_time(Timestamp::default()/* use setters */);
14293    /// ```
14294    pub fn set_create_time<T>(mut self, v: T) -> Self
14295    where
14296        T: std::convert::Into<wkt::Timestamp>,
14297    {
14298        self.create_time = std::option::Option::Some(v.into());
14299        self
14300    }
14301
14302    /// Sets or clears the value of [create_time][crate::model::StreamObject::create_time].
14303    ///
14304    /// # Example
14305    /// ```ignore,no_run
14306    /// # use google_cloud_datastream_v1::model::StreamObject;
14307    /// use wkt::Timestamp;
14308    /// let x = StreamObject::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
14309    /// let x = StreamObject::new().set_or_clear_create_time(None::<Timestamp>);
14310    /// ```
14311    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14312    where
14313        T: std::convert::Into<wkt::Timestamp>,
14314    {
14315        self.create_time = v.map(|x| x.into());
14316        self
14317    }
14318
14319    /// Sets the value of [update_time][crate::model::StreamObject::update_time].
14320    ///
14321    /// # Example
14322    /// ```ignore,no_run
14323    /// # use google_cloud_datastream_v1::model::StreamObject;
14324    /// use wkt::Timestamp;
14325    /// let x = StreamObject::new().set_update_time(Timestamp::default()/* use setters */);
14326    /// ```
14327    pub fn set_update_time<T>(mut self, v: T) -> Self
14328    where
14329        T: std::convert::Into<wkt::Timestamp>,
14330    {
14331        self.update_time = std::option::Option::Some(v.into());
14332        self
14333    }
14334
14335    /// Sets or clears the value of [update_time][crate::model::StreamObject::update_time].
14336    ///
14337    /// # Example
14338    /// ```ignore,no_run
14339    /// # use google_cloud_datastream_v1::model::StreamObject;
14340    /// use wkt::Timestamp;
14341    /// let x = StreamObject::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
14342    /// let x = StreamObject::new().set_or_clear_update_time(None::<Timestamp>);
14343    /// ```
14344    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
14345    where
14346        T: std::convert::Into<wkt::Timestamp>,
14347    {
14348        self.update_time = v.map(|x| x.into());
14349        self
14350    }
14351
14352    /// Sets the value of [display_name][crate::model::StreamObject::display_name].
14353    ///
14354    /// # Example
14355    /// ```ignore,no_run
14356    /// # use google_cloud_datastream_v1::model::StreamObject;
14357    /// let x = StreamObject::new().set_display_name("example");
14358    /// ```
14359    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14360        self.display_name = v.into();
14361        self
14362    }
14363
14364    /// Sets the value of [errors][crate::model::StreamObject::errors].
14365    ///
14366    /// # Example
14367    /// ```ignore,no_run
14368    /// # use google_cloud_datastream_v1::model::StreamObject;
14369    /// use google_cloud_datastream_v1::model::Error;
14370    /// let x = StreamObject::new()
14371    ///     .set_errors([
14372    ///         Error::default()/* use setters */,
14373    ///         Error::default()/* use (different) setters */,
14374    ///     ]);
14375    /// ```
14376    pub fn set_errors<T, V>(mut self, v: T) -> Self
14377    where
14378        T: std::iter::IntoIterator<Item = V>,
14379        V: std::convert::Into<crate::model::Error>,
14380    {
14381        use std::iter::Iterator;
14382        self.errors = v.into_iter().map(|i| i.into()).collect();
14383        self
14384    }
14385
14386    /// Sets the value of [backfill_job][crate::model::StreamObject::backfill_job].
14387    ///
14388    /// # Example
14389    /// ```ignore,no_run
14390    /// # use google_cloud_datastream_v1::model::StreamObject;
14391    /// use google_cloud_datastream_v1::model::BackfillJob;
14392    /// let x = StreamObject::new().set_backfill_job(BackfillJob::default()/* use setters */);
14393    /// ```
14394    pub fn set_backfill_job<T>(mut self, v: T) -> Self
14395    where
14396        T: std::convert::Into<crate::model::BackfillJob>,
14397    {
14398        self.backfill_job = std::option::Option::Some(v.into());
14399        self
14400    }
14401
14402    /// Sets or clears the value of [backfill_job][crate::model::StreamObject::backfill_job].
14403    ///
14404    /// # Example
14405    /// ```ignore,no_run
14406    /// # use google_cloud_datastream_v1::model::StreamObject;
14407    /// use google_cloud_datastream_v1::model::BackfillJob;
14408    /// let x = StreamObject::new().set_or_clear_backfill_job(Some(BackfillJob::default()/* use setters */));
14409    /// let x = StreamObject::new().set_or_clear_backfill_job(None::<BackfillJob>);
14410    /// ```
14411    pub fn set_or_clear_backfill_job<T>(mut self, v: std::option::Option<T>) -> Self
14412    where
14413        T: std::convert::Into<crate::model::BackfillJob>,
14414    {
14415        self.backfill_job = v.map(|x| x.into());
14416        self
14417    }
14418
14419    /// Sets the value of [source_object][crate::model::StreamObject::source_object].
14420    ///
14421    /// # Example
14422    /// ```ignore,no_run
14423    /// # use google_cloud_datastream_v1::model::StreamObject;
14424    /// use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14425    /// let x = StreamObject::new().set_source_object(SourceObjectIdentifier::default()/* use setters */);
14426    /// ```
14427    pub fn set_source_object<T>(mut self, v: T) -> Self
14428    where
14429        T: std::convert::Into<crate::model::SourceObjectIdentifier>,
14430    {
14431        self.source_object = std::option::Option::Some(v.into());
14432        self
14433    }
14434
14435    /// Sets or clears the value of [source_object][crate::model::StreamObject::source_object].
14436    ///
14437    /// # Example
14438    /// ```ignore,no_run
14439    /// # use google_cloud_datastream_v1::model::StreamObject;
14440    /// use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14441    /// let x = StreamObject::new().set_or_clear_source_object(Some(SourceObjectIdentifier::default()/* use setters */));
14442    /// let x = StreamObject::new().set_or_clear_source_object(None::<SourceObjectIdentifier>);
14443    /// ```
14444    pub fn set_or_clear_source_object<T>(mut self, v: std::option::Option<T>) -> Self
14445    where
14446        T: std::convert::Into<crate::model::SourceObjectIdentifier>,
14447    {
14448        self.source_object = v.map(|x| x.into());
14449        self
14450    }
14451}
14452
14453impl wkt::message::Message for StreamObject {
14454    fn typename() -> &'static str {
14455        "type.googleapis.com/google.cloud.datastream.v1.StreamObject"
14456    }
14457}
14458
14459/// Represents an identifier of an object in the data source.
14460#[derive(Clone, Default, PartialEq)]
14461#[non_exhaustive]
14462pub struct SourceObjectIdentifier {
14463    /// The identifier for an object in the data source.
14464    pub source_identifier:
14465        std::option::Option<crate::model::source_object_identifier::SourceIdentifier>,
14466
14467    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14468}
14469
14470impl SourceObjectIdentifier {
14471    pub fn new() -> Self {
14472        std::default::Default::default()
14473    }
14474
14475    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier].
14476    ///
14477    /// Note that all the setters affecting `source_identifier` are mutually
14478    /// exclusive.
14479    ///
14480    /// # Example
14481    /// ```ignore,no_run
14482    /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14483    /// use google_cloud_datastream_v1::model::source_object_identifier::OracleObjectIdentifier;
14484    /// let x = SourceObjectIdentifier::new().set_source_identifier(Some(
14485    ///     google_cloud_datastream_v1::model::source_object_identifier::SourceIdentifier::OracleIdentifier(OracleObjectIdentifier::default().into())));
14486    /// ```
14487    pub fn set_source_identifier<
14488        T: std::convert::Into<
14489                std::option::Option<crate::model::source_object_identifier::SourceIdentifier>,
14490            >,
14491    >(
14492        mut self,
14493        v: T,
14494    ) -> Self {
14495        self.source_identifier = v.into();
14496        self
14497    }
14498
14499    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14500    /// if it holds a `OracleIdentifier`, `None` if the field is not set or
14501    /// holds a different branch.
14502    pub fn oracle_identifier(
14503        &self,
14504    ) -> std::option::Option<
14505        &std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
14506    > {
14507        #[allow(unreachable_patterns)]
14508        self.source_identifier.as_ref().and_then(|v| match v {
14509            crate::model::source_object_identifier::SourceIdentifier::OracleIdentifier(v) => {
14510                std::option::Option::Some(v)
14511            }
14512            _ => std::option::Option::None,
14513        })
14514    }
14515
14516    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14517    /// to hold a `OracleIdentifier`.
14518    ///
14519    /// Note that all the setters affecting `source_identifier` are
14520    /// mutually exclusive.
14521    ///
14522    /// # Example
14523    /// ```ignore,no_run
14524    /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14525    /// use google_cloud_datastream_v1::model::source_object_identifier::OracleObjectIdentifier;
14526    /// let x = SourceObjectIdentifier::new().set_oracle_identifier(OracleObjectIdentifier::default()/* use setters */);
14527    /// assert!(x.oracle_identifier().is_some());
14528    /// assert!(x.mysql_identifier().is_none());
14529    /// assert!(x.postgresql_identifier().is_none());
14530    /// assert!(x.sql_server_identifier().is_none());
14531    /// assert!(x.salesforce_identifier().is_none());
14532    /// assert!(x.mongodb_identifier().is_none());
14533    /// ```
14534    pub fn set_oracle_identifier<
14535        T: std::convert::Into<
14536                std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
14537            >,
14538    >(
14539        mut self,
14540        v: T,
14541    ) -> Self {
14542        self.source_identifier = std::option::Option::Some(
14543            crate::model::source_object_identifier::SourceIdentifier::OracleIdentifier(v.into()),
14544        );
14545        self
14546    }
14547
14548    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14549    /// if it holds a `MysqlIdentifier`, `None` if the field is not set or
14550    /// holds a different branch.
14551    pub fn mysql_identifier(
14552        &self,
14553    ) -> std::option::Option<
14554        &std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
14555    > {
14556        #[allow(unreachable_patterns)]
14557        self.source_identifier.as_ref().and_then(|v| match v {
14558            crate::model::source_object_identifier::SourceIdentifier::MysqlIdentifier(v) => {
14559                std::option::Option::Some(v)
14560            }
14561            _ => std::option::Option::None,
14562        })
14563    }
14564
14565    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14566    /// to hold a `MysqlIdentifier`.
14567    ///
14568    /// Note that all the setters affecting `source_identifier` are
14569    /// mutually exclusive.
14570    ///
14571    /// # Example
14572    /// ```ignore,no_run
14573    /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14574    /// use google_cloud_datastream_v1::model::source_object_identifier::MysqlObjectIdentifier;
14575    /// let x = SourceObjectIdentifier::new().set_mysql_identifier(MysqlObjectIdentifier::default()/* use setters */);
14576    /// assert!(x.mysql_identifier().is_some());
14577    /// assert!(x.oracle_identifier().is_none());
14578    /// assert!(x.postgresql_identifier().is_none());
14579    /// assert!(x.sql_server_identifier().is_none());
14580    /// assert!(x.salesforce_identifier().is_none());
14581    /// assert!(x.mongodb_identifier().is_none());
14582    /// ```
14583    pub fn set_mysql_identifier<
14584        T: std::convert::Into<
14585                std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
14586            >,
14587    >(
14588        mut self,
14589        v: T,
14590    ) -> Self {
14591        self.source_identifier = std::option::Option::Some(
14592            crate::model::source_object_identifier::SourceIdentifier::MysqlIdentifier(v.into()),
14593        );
14594        self
14595    }
14596
14597    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14598    /// if it holds a `PostgresqlIdentifier`, `None` if the field is not set or
14599    /// holds a different branch.
14600    pub fn postgresql_identifier(
14601        &self,
14602    ) -> std::option::Option<
14603        &std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
14604    > {
14605        #[allow(unreachable_patterns)]
14606        self.source_identifier.as_ref().and_then(|v| match v {
14607            crate::model::source_object_identifier::SourceIdentifier::PostgresqlIdentifier(v) => {
14608                std::option::Option::Some(v)
14609            }
14610            _ => std::option::Option::None,
14611        })
14612    }
14613
14614    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14615    /// to hold a `PostgresqlIdentifier`.
14616    ///
14617    /// Note that all the setters affecting `source_identifier` are
14618    /// mutually exclusive.
14619    ///
14620    /// # Example
14621    /// ```ignore,no_run
14622    /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14623    /// use google_cloud_datastream_v1::model::source_object_identifier::PostgresqlObjectIdentifier;
14624    /// let x = SourceObjectIdentifier::new().set_postgresql_identifier(PostgresqlObjectIdentifier::default()/* use setters */);
14625    /// assert!(x.postgresql_identifier().is_some());
14626    /// assert!(x.oracle_identifier().is_none());
14627    /// assert!(x.mysql_identifier().is_none());
14628    /// assert!(x.sql_server_identifier().is_none());
14629    /// assert!(x.salesforce_identifier().is_none());
14630    /// assert!(x.mongodb_identifier().is_none());
14631    /// ```
14632    pub fn set_postgresql_identifier<
14633        T: std::convert::Into<
14634                std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
14635            >,
14636    >(
14637        mut self,
14638        v: T,
14639    ) -> Self {
14640        self.source_identifier = std::option::Option::Some(
14641            crate::model::source_object_identifier::SourceIdentifier::PostgresqlIdentifier(
14642                v.into(),
14643            ),
14644        );
14645        self
14646    }
14647
14648    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14649    /// if it holds a `SqlServerIdentifier`, `None` if the field is not set or
14650    /// holds a different branch.
14651    pub fn sql_server_identifier(
14652        &self,
14653    ) -> std::option::Option<
14654        &std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
14655    > {
14656        #[allow(unreachable_patterns)]
14657        self.source_identifier.as_ref().and_then(|v| match v {
14658            crate::model::source_object_identifier::SourceIdentifier::SqlServerIdentifier(v) => {
14659                std::option::Option::Some(v)
14660            }
14661            _ => std::option::Option::None,
14662        })
14663    }
14664
14665    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14666    /// to hold a `SqlServerIdentifier`.
14667    ///
14668    /// Note that all the setters affecting `source_identifier` are
14669    /// mutually exclusive.
14670    ///
14671    /// # Example
14672    /// ```ignore,no_run
14673    /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14674    /// use google_cloud_datastream_v1::model::source_object_identifier::SqlServerObjectIdentifier;
14675    /// let x = SourceObjectIdentifier::new().set_sql_server_identifier(SqlServerObjectIdentifier::default()/* use setters */);
14676    /// assert!(x.sql_server_identifier().is_some());
14677    /// assert!(x.oracle_identifier().is_none());
14678    /// assert!(x.mysql_identifier().is_none());
14679    /// assert!(x.postgresql_identifier().is_none());
14680    /// assert!(x.salesforce_identifier().is_none());
14681    /// assert!(x.mongodb_identifier().is_none());
14682    /// ```
14683    pub fn set_sql_server_identifier<
14684        T: std::convert::Into<
14685                std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
14686            >,
14687    >(
14688        mut self,
14689        v: T,
14690    ) -> Self {
14691        self.source_identifier = std::option::Option::Some(
14692            crate::model::source_object_identifier::SourceIdentifier::SqlServerIdentifier(v.into()),
14693        );
14694        self
14695    }
14696
14697    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14698    /// if it holds a `SalesforceIdentifier`, `None` if the field is not set or
14699    /// holds a different branch.
14700    pub fn salesforce_identifier(
14701        &self,
14702    ) -> std::option::Option<
14703        &std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>,
14704    > {
14705        #[allow(unreachable_patterns)]
14706        self.source_identifier.as_ref().and_then(|v| match v {
14707            crate::model::source_object_identifier::SourceIdentifier::SalesforceIdentifier(v) => {
14708                std::option::Option::Some(v)
14709            }
14710            _ => std::option::Option::None,
14711        })
14712    }
14713
14714    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14715    /// to hold a `SalesforceIdentifier`.
14716    ///
14717    /// Note that all the setters affecting `source_identifier` are
14718    /// mutually exclusive.
14719    ///
14720    /// # Example
14721    /// ```ignore,no_run
14722    /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14723    /// use google_cloud_datastream_v1::model::source_object_identifier::SalesforceObjectIdentifier;
14724    /// let x = SourceObjectIdentifier::new().set_salesforce_identifier(SalesforceObjectIdentifier::default()/* use setters */);
14725    /// assert!(x.salesforce_identifier().is_some());
14726    /// assert!(x.oracle_identifier().is_none());
14727    /// assert!(x.mysql_identifier().is_none());
14728    /// assert!(x.postgresql_identifier().is_none());
14729    /// assert!(x.sql_server_identifier().is_none());
14730    /// assert!(x.mongodb_identifier().is_none());
14731    /// ```
14732    pub fn set_salesforce_identifier<
14733        T: std::convert::Into<
14734                std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>,
14735            >,
14736    >(
14737        mut self,
14738        v: T,
14739    ) -> Self {
14740        self.source_identifier = std::option::Option::Some(
14741            crate::model::source_object_identifier::SourceIdentifier::SalesforceIdentifier(
14742                v.into(),
14743            ),
14744        );
14745        self
14746    }
14747
14748    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14749    /// if it holds a `MongodbIdentifier`, `None` if the field is not set or
14750    /// holds a different branch.
14751    pub fn mongodb_identifier(
14752        &self,
14753    ) -> std::option::Option<
14754        &std::boxed::Box<crate::model::source_object_identifier::MongodbObjectIdentifier>,
14755    > {
14756        #[allow(unreachable_patterns)]
14757        self.source_identifier.as_ref().and_then(|v| match v {
14758            crate::model::source_object_identifier::SourceIdentifier::MongodbIdentifier(v) => {
14759                std::option::Option::Some(v)
14760            }
14761            _ => std::option::Option::None,
14762        })
14763    }
14764
14765    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14766    /// to hold a `MongodbIdentifier`.
14767    ///
14768    /// Note that all the setters affecting `source_identifier` are
14769    /// mutually exclusive.
14770    ///
14771    /// # Example
14772    /// ```ignore,no_run
14773    /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14774    /// use google_cloud_datastream_v1::model::source_object_identifier::MongodbObjectIdentifier;
14775    /// let x = SourceObjectIdentifier::new().set_mongodb_identifier(MongodbObjectIdentifier::default()/* use setters */);
14776    /// assert!(x.mongodb_identifier().is_some());
14777    /// assert!(x.oracle_identifier().is_none());
14778    /// assert!(x.mysql_identifier().is_none());
14779    /// assert!(x.postgresql_identifier().is_none());
14780    /// assert!(x.sql_server_identifier().is_none());
14781    /// assert!(x.salesforce_identifier().is_none());
14782    /// ```
14783    pub fn set_mongodb_identifier<
14784        T: std::convert::Into<
14785                std::boxed::Box<crate::model::source_object_identifier::MongodbObjectIdentifier>,
14786            >,
14787    >(
14788        mut self,
14789        v: T,
14790    ) -> Self {
14791        self.source_identifier = std::option::Option::Some(
14792            crate::model::source_object_identifier::SourceIdentifier::MongodbIdentifier(v.into()),
14793        );
14794        self
14795    }
14796}
14797
14798impl wkt::message::Message for SourceObjectIdentifier {
14799    fn typename() -> &'static str {
14800        "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier"
14801    }
14802}
14803
14804/// Defines additional types related to [SourceObjectIdentifier].
14805pub mod source_object_identifier {
14806    #[allow(unused_imports)]
14807    use super::*;
14808
14809    /// Oracle data source object identifier.
14810    #[derive(Clone, Default, PartialEq)]
14811    #[non_exhaustive]
14812    pub struct OracleObjectIdentifier {
14813        /// Required. The schema name.
14814        pub schema: std::string::String,
14815
14816        /// Required. The table name.
14817        pub table: std::string::String,
14818
14819        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14820    }
14821
14822    impl OracleObjectIdentifier {
14823        pub fn new() -> Self {
14824            std::default::Default::default()
14825        }
14826
14827        /// Sets the value of [schema][crate::model::source_object_identifier::OracleObjectIdentifier::schema].
14828        ///
14829        /// # Example
14830        /// ```ignore,no_run
14831        /// # use google_cloud_datastream_v1::model::source_object_identifier::OracleObjectIdentifier;
14832        /// let x = OracleObjectIdentifier::new().set_schema("example");
14833        /// ```
14834        pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14835            self.schema = v.into();
14836            self
14837        }
14838
14839        /// Sets the value of [table][crate::model::source_object_identifier::OracleObjectIdentifier::table].
14840        ///
14841        /// # Example
14842        /// ```ignore,no_run
14843        /// # use google_cloud_datastream_v1::model::source_object_identifier::OracleObjectIdentifier;
14844        /// let x = OracleObjectIdentifier::new().set_table("example");
14845        /// ```
14846        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14847            self.table = v.into();
14848            self
14849        }
14850    }
14851
14852    impl wkt::message::Message for OracleObjectIdentifier {
14853        fn typename() -> &'static str {
14854            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.OracleObjectIdentifier"
14855        }
14856    }
14857
14858    /// PostgreSQL data source object identifier.
14859    #[derive(Clone, Default, PartialEq)]
14860    #[non_exhaustive]
14861    pub struct PostgresqlObjectIdentifier {
14862        /// Required. The schema name.
14863        pub schema: std::string::String,
14864
14865        /// Required. The table name.
14866        pub table: std::string::String,
14867
14868        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14869    }
14870
14871    impl PostgresqlObjectIdentifier {
14872        pub fn new() -> Self {
14873            std::default::Default::default()
14874        }
14875
14876        /// Sets the value of [schema][crate::model::source_object_identifier::PostgresqlObjectIdentifier::schema].
14877        ///
14878        /// # Example
14879        /// ```ignore,no_run
14880        /// # use google_cloud_datastream_v1::model::source_object_identifier::PostgresqlObjectIdentifier;
14881        /// let x = PostgresqlObjectIdentifier::new().set_schema("example");
14882        /// ```
14883        pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14884            self.schema = v.into();
14885            self
14886        }
14887
14888        /// Sets the value of [table][crate::model::source_object_identifier::PostgresqlObjectIdentifier::table].
14889        ///
14890        /// # Example
14891        /// ```ignore,no_run
14892        /// # use google_cloud_datastream_v1::model::source_object_identifier::PostgresqlObjectIdentifier;
14893        /// let x = PostgresqlObjectIdentifier::new().set_table("example");
14894        /// ```
14895        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14896            self.table = v.into();
14897            self
14898        }
14899    }
14900
14901    impl wkt::message::Message for PostgresqlObjectIdentifier {
14902        fn typename() -> &'static str {
14903            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.PostgresqlObjectIdentifier"
14904        }
14905    }
14906
14907    /// Mysql data source object identifier.
14908    #[derive(Clone, Default, PartialEq)]
14909    #[non_exhaustive]
14910    pub struct MysqlObjectIdentifier {
14911        /// Required. The database name.
14912        pub database: std::string::String,
14913
14914        /// Required. The table name.
14915        pub table: std::string::String,
14916
14917        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14918    }
14919
14920    impl MysqlObjectIdentifier {
14921        pub fn new() -> Self {
14922            std::default::Default::default()
14923        }
14924
14925        /// Sets the value of [database][crate::model::source_object_identifier::MysqlObjectIdentifier::database].
14926        ///
14927        /// # Example
14928        /// ```ignore,no_run
14929        /// # use google_cloud_datastream_v1::model::source_object_identifier::MysqlObjectIdentifier;
14930        /// let x = MysqlObjectIdentifier::new().set_database("example");
14931        /// ```
14932        pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14933            self.database = v.into();
14934            self
14935        }
14936
14937        /// Sets the value of [table][crate::model::source_object_identifier::MysqlObjectIdentifier::table].
14938        ///
14939        /// # Example
14940        /// ```ignore,no_run
14941        /// # use google_cloud_datastream_v1::model::source_object_identifier::MysqlObjectIdentifier;
14942        /// let x = MysqlObjectIdentifier::new().set_table("example");
14943        /// ```
14944        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14945            self.table = v.into();
14946            self
14947        }
14948    }
14949
14950    impl wkt::message::Message for MysqlObjectIdentifier {
14951        fn typename() -> &'static str {
14952            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.MysqlObjectIdentifier"
14953        }
14954    }
14955
14956    /// SQLServer data source object identifier.
14957    #[derive(Clone, Default, PartialEq)]
14958    #[non_exhaustive]
14959    pub struct SqlServerObjectIdentifier {
14960        /// Required. The schema name.
14961        pub schema: std::string::String,
14962
14963        /// Required. The table name.
14964        pub table: std::string::String,
14965
14966        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14967    }
14968
14969    impl SqlServerObjectIdentifier {
14970        pub fn new() -> Self {
14971            std::default::Default::default()
14972        }
14973
14974        /// Sets the value of [schema][crate::model::source_object_identifier::SqlServerObjectIdentifier::schema].
14975        ///
14976        /// # Example
14977        /// ```ignore,no_run
14978        /// # use google_cloud_datastream_v1::model::source_object_identifier::SqlServerObjectIdentifier;
14979        /// let x = SqlServerObjectIdentifier::new().set_schema("example");
14980        /// ```
14981        pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14982            self.schema = v.into();
14983            self
14984        }
14985
14986        /// Sets the value of [table][crate::model::source_object_identifier::SqlServerObjectIdentifier::table].
14987        ///
14988        /// # Example
14989        /// ```ignore,no_run
14990        /// # use google_cloud_datastream_v1::model::source_object_identifier::SqlServerObjectIdentifier;
14991        /// let x = SqlServerObjectIdentifier::new().set_table("example");
14992        /// ```
14993        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14994            self.table = v.into();
14995            self
14996        }
14997    }
14998
14999    impl wkt::message::Message for SqlServerObjectIdentifier {
15000        fn typename() -> &'static str {
15001            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.SqlServerObjectIdentifier"
15002        }
15003    }
15004
15005    /// Salesforce data source object identifier.
15006    #[derive(Clone, Default, PartialEq)]
15007    #[non_exhaustive]
15008    pub struct SalesforceObjectIdentifier {
15009        /// Required. The object name.
15010        pub object_name: std::string::String,
15011
15012        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15013    }
15014
15015    impl SalesforceObjectIdentifier {
15016        pub fn new() -> Self {
15017            std::default::Default::default()
15018        }
15019
15020        /// Sets the value of [object_name][crate::model::source_object_identifier::SalesforceObjectIdentifier::object_name].
15021        ///
15022        /// # Example
15023        /// ```ignore,no_run
15024        /// # use google_cloud_datastream_v1::model::source_object_identifier::SalesforceObjectIdentifier;
15025        /// let x = SalesforceObjectIdentifier::new().set_object_name("example");
15026        /// ```
15027        pub fn set_object_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15028            self.object_name = v.into();
15029            self
15030        }
15031    }
15032
15033    impl wkt::message::Message for SalesforceObjectIdentifier {
15034        fn typename() -> &'static str {
15035            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.SalesforceObjectIdentifier"
15036        }
15037    }
15038
15039    /// MongoDB data source object identifier.
15040    #[derive(Clone, Default, PartialEq)]
15041    #[non_exhaustive]
15042    pub struct MongodbObjectIdentifier {
15043        /// Required. The database name.
15044        pub database: std::string::String,
15045
15046        /// Required. The collection name.
15047        pub collection: std::string::String,
15048
15049        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15050    }
15051
15052    impl MongodbObjectIdentifier {
15053        pub fn new() -> Self {
15054            std::default::Default::default()
15055        }
15056
15057        /// Sets the value of [database][crate::model::source_object_identifier::MongodbObjectIdentifier::database].
15058        ///
15059        /// # Example
15060        /// ```ignore,no_run
15061        /// # use google_cloud_datastream_v1::model::source_object_identifier::MongodbObjectIdentifier;
15062        /// let x = MongodbObjectIdentifier::new().set_database("example");
15063        /// ```
15064        pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15065            self.database = v.into();
15066            self
15067        }
15068
15069        /// Sets the value of [collection][crate::model::source_object_identifier::MongodbObjectIdentifier::collection].
15070        ///
15071        /// # Example
15072        /// ```ignore,no_run
15073        /// # use google_cloud_datastream_v1::model::source_object_identifier::MongodbObjectIdentifier;
15074        /// let x = MongodbObjectIdentifier::new().set_collection("example");
15075        /// ```
15076        pub fn set_collection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15077            self.collection = v.into();
15078            self
15079        }
15080    }
15081
15082    impl wkt::message::Message for MongodbObjectIdentifier {
15083        fn typename() -> &'static str {
15084            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.MongodbObjectIdentifier"
15085        }
15086    }
15087
15088    /// The identifier for an object in the data source.
15089    #[derive(Clone, Debug, PartialEq)]
15090    #[non_exhaustive]
15091    pub enum SourceIdentifier {
15092        /// Oracle data source object identifier.
15093        OracleIdentifier(
15094            std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
15095        ),
15096        /// Mysql data source object identifier.
15097        MysqlIdentifier(
15098            std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
15099        ),
15100        /// PostgreSQL data source object identifier.
15101        PostgresqlIdentifier(
15102            std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
15103        ),
15104        /// SQLServer data source object identifier.
15105        SqlServerIdentifier(
15106            std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
15107        ),
15108        /// Salesforce data source object identifier.
15109        SalesforceIdentifier(
15110            std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>,
15111        ),
15112        /// MongoDB data source object identifier.
15113        MongodbIdentifier(
15114            std::boxed::Box<crate::model::source_object_identifier::MongodbObjectIdentifier>,
15115        ),
15116    }
15117}
15118
15119/// Represents a backfill job on a specific stream object.
15120#[derive(Clone, Default, PartialEq)]
15121#[non_exhaustive]
15122pub struct BackfillJob {
15123    /// Output only. Backfill job state.
15124    pub state: crate::model::backfill_job::State,
15125
15126    /// Backfill job's triggering reason.
15127    pub trigger: crate::model::backfill_job::Trigger,
15128
15129    /// Output only. Backfill job's start time.
15130    pub last_start_time: std::option::Option<wkt::Timestamp>,
15131
15132    /// Output only. Backfill job's end time.
15133    pub last_end_time: std::option::Option<wkt::Timestamp>,
15134
15135    /// Output only. Errors which caused the backfill job to fail.
15136    pub errors: std::vec::Vec<crate::model::Error>,
15137
15138    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15139}
15140
15141impl BackfillJob {
15142    pub fn new() -> Self {
15143        std::default::Default::default()
15144    }
15145
15146    /// Sets the value of [state][crate::model::BackfillJob::state].
15147    ///
15148    /// # Example
15149    /// ```ignore,no_run
15150    /// # use google_cloud_datastream_v1::model::BackfillJob;
15151    /// use google_cloud_datastream_v1::model::backfill_job::State;
15152    /// let x0 = BackfillJob::new().set_state(State::NotStarted);
15153    /// let x1 = BackfillJob::new().set_state(State::Pending);
15154    /// let x2 = BackfillJob::new().set_state(State::Active);
15155    /// ```
15156    pub fn set_state<T: std::convert::Into<crate::model::backfill_job::State>>(
15157        mut self,
15158        v: T,
15159    ) -> Self {
15160        self.state = v.into();
15161        self
15162    }
15163
15164    /// Sets the value of [trigger][crate::model::BackfillJob::trigger].
15165    ///
15166    /// # Example
15167    /// ```ignore,no_run
15168    /// # use google_cloud_datastream_v1::model::BackfillJob;
15169    /// use google_cloud_datastream_v1::model::backfill_job::Trigger;
15170    /// let x0 = BackfillJob::new().set_trigger(Trigger::Automatic);
15171    /// let x1 = BackfillJob::new().set_trigger(Trigger::Manual);
15172    /// ```
15173    pub fn set_trigger<T: std::convert::Into<crate::model::backfill_job::Trigger>>(
15174        mut self,
15175        v: T,
15176    ) -> Self {
15177        self.trigger = v.into();
15178        self
15179    }
15180
15181    /// Sets the value of [last_start_time][crate::model::BackfillJob::last_start_time].
15182    ///
15183    /// # Example
15184    /// ```ignore,no_run
15185    /// # use google_cloud_datastream_v1::model::BackfillJob;
15186    /// use wkt::Timestamp;
15187    /// let x = BackfillJob::new().set_last_start_time(Timestamp::default()/* use setters */);
15188    /// ```
15189    pub fn set_last_start_time<T>(mut self, v: T) -> Self
15190    where
15191        T: std::convert::Into<wkt::Timestamp>,
15192    {
15193        self.last_start_time = std::option::Option::Some(v.into());
15194        self
15195    }
15196
15197    /// Sets or clears the value of [last_start_time][crate::model::BackfillJob::last_start_time].
15198    ///
15199    /// # Example
15200    /// ```ignore,no_run
15201    /// # use google_cloud_datastream_v1::model::BackfillJob;
15202    /// use wkt::Timestamp;
15203    /// let x = BackfillJob::new().set_or_clear_last_start_time(Some(Timestamp::default()/* use setters */));
15204    /// let x = BackfillJob::new().set_or_clear_last_start_time(None::<Timestamp>);
15205    /// ```
15206    pub fn set_or_clear_last_start_time<T>(mut self, v: std::option::Option<T>) -> Self
15207    where
15208        T: std::convert::Into<wkt::Timestamp>,
15209    {
15210        self.last_start_time = v.map(|x| x.into());
15211        self
15212    }
15213
15214    /// Sets the value of [last_end_time][crate::model::BackfillJob::last_end_time].
15215    ///
15216    /// # Example
15217    /// ```ignore,no_run
15218    /// # use google_cloud_datastream_v1::model::BackfillJob;
15219    /// use wkt::Timestamp;
15220    /// let x = BackfillJob::new().set_last_end_time(Timestamp::default()/* use setters */);
15221    /// ```
15222    pub fn set_last_end_time<T>(mut self, v: T) -> Self
15223    where
15224        T: std::convert::Into<wkt::Timestamp>,
15225    {
15226        self.last_end_time = std::option::Option::Some(v.into());
15227        self
15228    }
15229
15230    /// Sets or clears the value of [last_end_time][crate::model::BackfillJob::last_end_time].
15231    ///
15232    /// # Example
15233    /// ```ignore,no_run
15234    /// # use google_cloud_datastream_v1::model::BackfillJob;
15235    /// use wkt::Timestamp;
15236    /// let x = BackfillJob::new().set_or_clear_last_end_time(Some(Timestamp::default()/* use setters */));
15237    /// let x = BackfillJob::new().set_or_clear_last_end_time(None::<Timestamp>);
15238    /// ```
15239    pub fn set_or_clear_last_end_time<T>(mut self, v: std::option::Option<T>) -> Self
15240    where
15241        T: std::convert::Into<wkt::Timestamp>,
15242    {
15243        self.last_end_time = v.map(|x| x.into());
15244        self
15245    }
15246
15247    /// Sets the value of [errors][crate::model::BackfillJob::errors].
15248    ///
15249    /// # Example
15250    /// ```ignore,no_run
15251    /// # use google_cloud_datastream_v1::model::BackfillJob;
15252    /// use google_cloud_datastream_v1::model::Error;
15253    /// let x = BackfillJob::new()
15254    ///     .set_errors([
15255    ///         Error::default()/* use setters */,
15256    ///         Error::default()/* use (different) setters */,
15257    ///     ]);
15258    /// ```
15259    pub fn set_errors<T, V>(mut self, v: T) -> Self
15260    where
15261        T: std::iter::IntoIterator<Item = V>,
15262        V: std::convert::Into<crate::model::Error>,
15263    {
15264        use std::iter::Iterator;
15265        self.errors = v.into_iter().map(|i| i.into()).collect();
15266        self
15267    }
15268}
15269
15270impl wkt::message::Message for BackfillJob {
15271    fn typename() -> &'static str {
15272        "type.googleapis.com/google.cloud.datastream.v1.BackfillJob"
15273    }
15274}
15275
15276/// Defines additional types related to [BackfillJob].
15277pub mod backfill_job {
15278    #[allow(unused_imports)]
15279    use super::*;
15280
15281    /// State of the stream object's backfill job.
15282    ///
15283    /// # Working with unknown values
15284    ///
15285    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15286    /// additional enum variants at any time. Adding new variants is not considered
15287    /// a breaking change. Applications should write their code in anticipation of:
15288    ///
15289    /// - New values appearing in future releases of the client library, **and**
15290    /// - New values received dynamically, without application changes.
15291    ///
15292    /// Please consult the [Working with enums] section in the user guide for some
15293    /// guidelines.
15294    ///
15295    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15296    #[derive(Clone, Debug, PartialEq)]
15297    #[non_exhaustive]
15298    pub enum State {
15299        /// Default value.
15300        Unspecified,
15301        /// Backfill job was never started for the stream object (stream has backfill
15302        /// strategy defined as manual or object was explicitly excluded from
15303        /// automatic backfill).
15304        NotStarted,
15305        /// Backfill job will start pending available resources.
15306        Pending,
15307        /// Backfill job is running.
15308        Active,
15309        /// Backfill job stopped (next job run will start from beginning).
15310        Stopped,
15311        /// Backfill job failed (due to an error).
15312        Failed,
15313        /// Backfill completed successfully.
15314        Completed,
15315        /// Backfill job failed since the table structure is currently unsupported
15316        /// for backfill.
15317        Unsupported,
15318        /// If set, the enum was initialized with an unknown value.
15319        ///
15320        /// Applications can examine the value using [State::value] or
15321        /// [State::name].
15322        UnknownValue(state::UnknownValue),
15323    }
15324
15325    #[doc(hidden)]
15326    pub mod state {
15327        #[allow(unused_imports)]
15328        use super::*;
15329        #[derive(Clone, Debug, PartialEq)]
15330        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15331    }
15332
15333    impl State {
15334        /// Gets the enum value.
15335        ///
15336        /// Returns `None` if the enum contains an unknown value deserialized from
15337        /// the string representation of enums.
15338        pub fn value(&self) -> std::option::Option<i32> {
15339            match self {
15340                Self::Unspecified => std::option::Option::Some(0),
15341                Self::NotStarted => std::option::Option::Some(1),
15342                Self::Pending => std::option::Option::Some(2),
15343                Self::Active => std::option::Option::Some(3),
15344                Self::Stopped => std::option::Option::Some(4),
15345                Self::Failed => std::option::Option::Some(5),
15346                Self::Completed => std::option::Option::Some(6),
15347                Self::Unsupported => std::option::Option::Some(7),
15348                Self::UnknownValue(u) => u.0.value(),
15349            }
15350        }
15351
15352        /// Gets the enum value as a string.
15353        ///
15354        /// Returns `None` if the enum contains an unknown value deserialized from
15355        /// the integer representation of enums.
15356        pub fn name(&self) -> std::option::Option<&str> {
15357            match self {
15358                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
15359                Self::NotStarted => std::option::Option::Some("NOT_STARTED"),
15360                Self::Pending => std::option::Option::Some("PENDING"),
15361                Self::Active => std::option::Option::Some("ACTIVE"),
15362                Self::Stopped => std::option::Option::Some("STOPPED"),
15363                Self::Failed => std::option::Option::Some("FAILED"),
15364                Self::Completed => std::option::Option::Some("COMPLETED"),
15365                Self::Unsupported => std::option::Option::Some("UNSUPPORTED"),
15366                Self::UnknownValue(u) => u.0.name(),
15367            }
15368        }
15369    }
15370
15371    impl std::default::Default for State {
15372        fn default() -> Self {
15373            use std::convert::From;
15374            Self::from(0)
15375        }
15376    }
15377
15378    impl std::fmt::Display for State {
15379        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15380            wkt::internal::display_enum(f, self.name(), self.value())
15381        }
15382    }
15383
15384    impl std::convert::From<i32> for State {
15385        fn from(value: i32) -> Self {
15386            match value {
15387                0 => Self::Unspecified,
15388                1 => Self::NotStarted,
15389                2 => Self::Pending,
15390                3 => Self::Active,
15391                4 => Self::Stopped,
15392                5 => Self::Failed,
15393                6 => Self::Completed,
15394                7 => Self::Unsupported,
15395                _ => Self::UnknownValue(state::UnknownValue(
15396                    wkt::internal::UnknownEnumValue::Integer(value),
15397                )),
15398            }
15399        }
15400    }
15401
15402    impl std::convert::From<&str> for State {
15403        fn from(value: &str) -> Self {
15404            use std::string::ToString;
15405            match value {
15406                "STATE_UNSPECIFIED" => Self::Unspecified,
15407                "NOT_STARTED" => Self::NotStarted,
15408                "PENDING" => Self::Pending,
15409                "ACTIVE" => Self::Active,
15410                "STOPPED" => Self::Stopped,
15411                "FAILED" => Self::Failed,
15412                "COMPLETED" => Self::Completed,
15413                "UNSUPPORTED" => Self::Unsupported,
15414                _ => Self::UnknownValue(state::UnknownValue(
15415                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15416                )),
15417            }
15418        }
15419    }
15420
15421    impl serde::ser::Serialize for State {
15422        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15423        where
15424            S: serde::Serializer,
15425        {
15426            match self {
15427                Self::Unspecified => serializer.serialize_i32(0),
15428                Self::NotStarted => serializer.serialize_i32(1),
15429                Self::Pending => serializer.serialize_i32(2),
15430                Self::Active => serializer.serialize_i32(3),
15431                Self::Stopped => serializer.serialize_i32(4),
15432                Self::Failed => serializer.serialize_i32(5),
15433                Self::Completed => serializer.serialize_i32(6),
15434                Self::Unsupported => serializer.serialize_i32(7),
15435                Self::UnknownValue(u) => u.0.serialize(serializer),
15436            }
15437        }
15438    }
15439
15440    impl<'de> serde::de::Deserialize<'de> for State {
15441        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15442        where
15443            D: serde::Deserializer<'de>,
15444        {
15445            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
15446                ".google.cloud.datastream.v1.BackfillJob.State",
15447            ))
15448        }
15449    }
15450
15451    /// Triggering reason for a backfill job.
15452    ///
15453    /// # Working with unknown values
15454    ///
15455    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15456    /// additional enum variants at any time. Adding new variants is not considered
15457    /// a breaking change. Applications should write their code in anticipation of:
15458    ///
15459    /// - New values appearing in future releases of the client library, **and**
15460    /// - New values received dynamically, without application changes.
15461    ///
15462    /// Please consult the [Working with enums] section in the user guide for some
15463    /// guidelines.
15464    ///
15465    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15466    #[derive(Clone, Debug, PartialEq)]
15467    #[non_exhaustive]
15468    pub enum Trigger {
15469        /// Default value.
15470        Unspecified,
15471        /// Object backfill job was triggered automatically according to the stream's
15472        /// backfill strategy.
15473        Automatic,
15474        /// Object backfill job was triggered manually using the dedicated API.
15475        Manual,
15476        /// If set, the enum was initialized with an unknown value.
15477        ///
15478        /// Applications can examine the value using [Trigger::value] or
15479        /// [Trigger::name].
15480        UnknownValue(trigger::UnknownValue),
15481    }
15482
15483    #[doc(hidden)]
15484    pub mod trigger {
15485        #[allow(unused_imports)]
15486        use super::*;
15487        #[derive(Clone, Debug, PartialEq)]
15488        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15489    }
15490
15491    impl Trigger {
15492        /// Gets the enum value.
15493        ///
15494        /// Returns `None` if the enum contains an unknown value deserialized from
15495        /// the string representation of enums.
15496        pub fn value(&self) -> std::option::Option<i32> {
15497            match self {
15498                Self::Unspecified => std::option::Option::Some(0),
15499                Self::Automatic => std::option::Option::Some(1),
15500                Self::Manual => std::option::Option::Some(2),
15501                Self::UnknownValue(u) => u.0.value(),
15502            }
15503        }
15504
15505        /// Gets the enum value as a string.
15506        ///
15507        /// Returns `None` if the enum contains an unknown value deserialized from
15508        /// the integer representation of enums.
15509        pub fn name(&self) -> std::option::Option<&str> {
15510            match self {
15511                Self::Unspecified => std::option::Option::Some("TRIGGER_UNSPECIFIED"),
15512                Self::Automatic => std::option::Option::Some("AUTOMATIC"),
15513                Self::Manual => std::option::Option::Some("MANUAL"),
15514                Self::UnknownValue(u) => u.0.name(),
15515            }
15516        }
15517    }
15518
15519    impl std::default::Default for Trigger {
15520        fn default() -> Self {
15521            use std::convert::From;
15522            Self::from(0)
15523        }
15524    }
15525
15526    impl std::fmt::Display for Trigger {
15527        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15528            wkt::internal::display_enum(f, self.name(), self.value())
15529        }
15530    }
15531
15532    impl std::convert::From<i32> for Trigger {
15533        fn from(value: i32) -> Self {
15534            match value {
15535                0 => Self::Unspecified,
15536                1 => Self::Automatic,
15537                2 => Self::Manual,
15538                _ => Self::UnknownValue(trigger::UnknownValue(
15539                    wkt::internal::UnknownEnumValue::Integer(value),
15540                )),
15541            }
15542        }
15543    }
15544
15545    impl std::convert::From<&str> for Trigger {
15546        fn from(value: &str) -> Self {
15547            use std::string::ToString;
15548            match value {
15549                "TRIGGER_UNSPECIFIED" => Self::Unspecified,
15550                "AUTOMATIC" => Self::Automatic,
15551                "MANUAL" => Self::Manual,
15552                _ => Self::UnknownValue(trigger::UnknownValue(
15553                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15554                )),
15555            }
15556        }
15557    }
15558
15559    impl serde::ser::Serialize for Trigger {
15560        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15561        where
15562            S: serde::Serializer,
15563        {
15564            match self {
15565                Self::Unspecified => serializer.serialize_i32(0),
15566                Self::Automatic => serializer.serialize_i32(1),
15567                Self::Manual => serializer.serialize_i32(2),
15568                Self::UnknownValue(u) => u.0.serialize(serializer),
15569            }
15570        }
15571    }
15572
15573    impl<'de> serde::de::Deserialize<'de> for Trigger {
15574        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15575        where
15576            D: serde::Deserializer<'de>,
15577        {
15578            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Trigger>::new(
15579                ".google.cloud.datastream.v1.BackfillJob.Trigger",
15580            ))
15581        }
15582    }
15583}
15584
15585/// Represent a user-facing Error.
15586#[derive(Clone, Default, PartialEq)]
15587#[non_exhaustive]
15588pub struct Error {
15589    /// A title that explains the reason for the error.
15590    pub reason: std::string::String,
15591
15592    /// A unique identifier for this specific error,
15593    /// allowing it to be traced throughout the system in logs and API responses.
15594    pub error_uuid: std::string::String,
15595
15596    /// A message containing more information about the error that occurred.
15597    pub message: std::string::String,
15598
15599    /// The time when the error occurred.
15600    pub error_time: std::option::Option<wkt::Timestamp>,
15601
15602    /// Additional information about the error.
15603    pub details: std::collections::HashMap<std::string::String, std::string::String>,
15604
15605    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15606}
15607
15608impl Error {
15609    pub fn new() -> Self {
15610        std::default::Default::default()
15611    }
15612
15613    /// Sets the value of [reason][crate::model::Error::reason].
15614    ///
15615    /// # Example
15616    /// ```ignore,no_run
15617    /// # use google_cloud_datastream_v1::model::Error;
15618    /// let x = Error::new().set_reason("example");
15619    /// ```
15620    pub fn set_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15621        self.reason = v.into();
15622        self
15623    }
15624
15625    /// Sets the value of [error_uuid][crate::model::Error::error_uuid].
15626    ///
15627    /// # Example
15628    /// ```ignore,no_run
15629    /// # use google_cloud_datastream_v1::model::Error;
15630    /// let x = Error::new().set_error_uuid("example");
15631    /// ```
15632    pub fn set_error_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15633        self.error_uuid = v.into();
15634        self
15635    }
15636
15637    /// Sets the value of [message][crate::model::Error::message].
15638    ///
15639    /// # Example
15640    /// ```ignore,no_run
15641    /// # use google_cloud_datastream_v1::model::Error;
15642    /// let x = Error::new().set_message("example");
15643    /// ```
15644    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15645        self.message = v.into();
15646        self
15647    }
15648
15649    /// Sets the value of [error_time][crate::model::Error::error_time].
15650    ///
15651    /// # Example
15652    /// ```ignore,no_run
15653    /// # use google_cloud_datastream_v1::model::Error;
15654    /// use wkt::Timestamp;
15655    /// let x = Error::new().set_error_time(Timestamp::default()/* use setters */);
15656    /// ```
15657    pub fn set_error_time<T>(mut self, v: T) -> Self
15658    where
15659        T: std::convert::Into<wkt::Timestamp>,
15660    {
15661        self.error_time = std::option::Option::Some(v.into());
15662        self
15663    }
15664
15665    /// Sets or clears the value of [error_time][crate::model::Error::error_time].
15666    ///
15667    /// # Example
15668    /// ```ignore,no_run
15669    /// # use google_cloud_datastream_v1::model::Error;
15670    /// use wkt::Timestamp;
15671    /// let x = Error::new().set_or_clear_error_time(Some(Timestamp::default()/* use setters */));
15672    /// let x = Error::new().set_or_clear_error_time(None::<Timestamp>);
15673    /// ```
15674    pub fn set_or_clear_error_time<T>(mut self, v: std::option::Option<T>) -> Self
15675    where
15676        T: std::convert::Into<wkt::Timestamp>,
15677    {
15678        self.error_time = v.map(|x| x.into());
15679        self
15680    }
15681
15682    /// Sets the value of [details][crate::model::Error::details].
15683    ///
15684    /// # Example
15685    /// ```ignore,no_run
15686    /// # use google_cloud_datastream_v1::model::Error;
15687    /// let x = Error::new().set_details([
15688    ///     ("key0", "abc"),
15689    ///     ("key1", "xyz"),
15690    /// ]);
15691    /// ```
15692    pub fn set_details<T, K, V>(mut self, v: T) -> Self
15693    where
15694        T: std::iter::IntoIterator<Item = (K, V)>,
15695        K: std::convert::Into<std::string::String>,
15696        V: std::convert::Into<std::string::String>,
15697    {
15698        use std::iter::Iterator;
15699        self.details = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
15700        self
15701    }
15702}
15703
15704impl wkt::message::Message for Error {
15705    fn typename() -> &'static str {
15706        "type.googleapis.com/google.cloud.datastream.v1.Error"
15707    }
15708}
15709
15710/// Contains the current validation results.
15711#[derive(Clone, Default, PartialEq)]
15712#[non_exhaustive]
15713pub struct ValidationResult {
15714    /// A list of validations (includes both executed as well as not executed
15715    /// validations).
15716    pub validations: std::vec::Vec<crate::model::Validation>,
15717
15718    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15719}
15720
15721impl ValidationResult {
15722    pub fn new() -> Self {
15723        std::default::Default::default()
15724    }
15725
15726    /// Sets the value of [validations][crate::model::ValidationResult::validations].
15727    ///
15728    /// # Example
15729    /// ```ignore,no_run
15730    /// # use google_cloud_datastream_v1::model::ValidationResult;
15731    /// use google_cloud_datastream_v1::model::Validation;
15732    /// let x = ValidationResult::new()
15733    ///     .set_validations([
15734    ///         Validation::default()/* use setters */,
15735    ///         Validation::default()/* use (different) setters */,
15736    ///     ]);
15737    /// ```
15738    pub fn set_validations<T, V>(mut self, v: T) -> Self
15739    where
15740        T: std::iter::IntoIterator<Item = V>,
15741        V: std::convert::Into<crate::model::Validation>,
15742    {
15743        use std::iter::Iterator;
15744        self.validations = v.into_iter().map(|i| i.into()).collect();
15745        self
15746    }
15747}
15748
15749impl wkt::message::Message for ValidationResult {
15750    fn typename() -> &'static str {
15751        "type.googleapis.com/google.cloud.datastream.v1.ValidationResult"
15752    }
15753}
15754
15755/// A validation to perform on a stream.
15756#[derive(Clone, Default, PartialEq)]
15757#[non_exhaustive]
15758pub struct Validation {
15759    /// A short description of the validation.
15760    pub description: std::string::String,
15761
15762    /// Output only. Validation execution status.
15763    pub state: crate::model::validation::State,
15764
15765    /// Messages reflecting the validation results.
15766    pub message: std::vec::Vec<crate::model::ValidationMessage>,
15767
15768    /// A custom code identifying this validation.
15769    pub code: std::string::String,
15770
15771    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15772}
15773
15774impl Validation {
15775    pub fn new() -> Self {
15776        std::default::Default::default()
15777    }
15778
15779    /// Sets the value of [description][crate::model::Validation::description].
15780    ///
15781    /// # Example
15782    /// ```ignore,no_run
15783    /// # use google_cloud_datastream_v1::model::Validation;
15784    /// let x = Validation::new().set_description("example");
15785    /// ```
15786    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15787        self.description = v.into();
15788        self
15789    }
15790
15791    /// Sets the value of [state][crate::model::Validation::state].
15792    ///
15793    /// # Example
15794    /// ```ignore,no_run
15795    /// # use google_cloud_datastream_v1::model::Validation;
15796    /// use google_cloud_datastream_v1::model::validation::State;
15797    /// let x0 = Validation::new().set_state(State::NotExecuted);
15798    /// let x1 = Validation::new().set_state(State::Failed);
15799    /// let x2 = Validation::new().set_state(State::Passed);
15800    /// ```
15801    pub fn set_state<T: std::convert::Into<crate::model::validation::State>>(
15802        mut self,
15803        v: T,
15804    ) -> Self {
15805        self.state = v.into();
15806        self
15807    }
15808
15809    /// Sets the value of [message][crate::model::Validation::message].
15810    ///
15811    /// # Example
15812    /// ```ignore,no_run
15813    /// # use google_cloud_datastream_v1::model::Validation;
15814    /// use google_cloud_datastream_v1::model::ValidationMessage;
15815    /// let x = Validation::new()
15816    ///     .set_message([
15817    ///         ValidationMessage::default()/* use setters */,
15818    ///         ValidationMessage::default()/* use (different) setters */,
15819    ///     ]);
15820    /// ```
15821    pub fn set_message<T, V>(mut self, v: T) -> Self
15822    where
15823        T: std::iter::IntoIterator<Item = V>,
15824        V: std::convert::Into<crate::model::ValidationMessage>,
15825    {
15826        use std::iter::Iterator;
15827        self.message = v.into_iter().map(|i| i.into()).collect();
15828        self
15829    }
15830
15831    /// Sets the value of [code][crate::model::Validation::code].
15832    ///
15833    /// # Example
15834    /// ```ignore,no_run
15835    /// # use google_cloud_datastream_v1::model::Validation;
15836    /// let x = Validation::new().set_code("example");
15837    /// ```
15838    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15839        self.code = v.into();
15840        self
15841    }
15842}
15843
15844impl wkt::message::Message for Validation {
15845    fn typename() -> &'static str {
15846        "type.googleapis.com/google.cloud.datastream.v1.Validation"
15847    }
15848}
15849
15850/// Defines additional types related to [Validation].
15851pub mod validation {
15852    #[allow(unused_imports)]
15853    use super::*;
15854
15855    /// Validation execution state.
15856    ///
15857    /// # Working with unknown values
15858    ///
15859    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15860    /// additional enum variants at any time. Adding new variants is not considered
15861    /// a breaking change. Applications should write their code in anticipation of:
15862    ///
15863    /// - New values appearing in future releases of the client library, **and**
15864    /// - New values received dynamically, without application changes.
15865    ///
15866    /// Please consult the [Working with enums] section in the user guide for some
15867    /// guidelines.
15868    ///
15869    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15870    #[derive(Clone, Debug, PartialEq)]
15871    #[non_exhaustive]
15872    pub enum State {
15873        /// Unspecified state.
15874        Unspecified,
15875        /// Validation did not execute.
15876        NotExecuted,
15877        /// Validation failed.
15878        Failed,
15879        /// Validation passed.
15880        Passed,
15881        /// Validation executed with warnings.
15882        Warning,
15883        /// If set, the enum was initialized with an unknown value.
15884        ///
15885        /// Applications can examine the value using [State::value] or
15886        /// [State::name].
15887        UnknownValue(state::UnknownValue),
15888    }
15889
15890    #[doc(hidden)]
15891    pub mod state {
15892        #[allow(unused_imports)]
15893        use super::*;
15894        #[derive(Clone, Debug, PartialEq)]
15895        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15896    }
15897
15898    impl State {
15899        /// Gets the enum value.
15900        ///
15901        /// Returns `None` if the enum contains an unknown value deserialized from
15902        /// the string representation of enums.
15903        pub fn value(&self) -> std::option::Option<i32> {
15904            match self {
15905                Self::Unspecified => std::option::Option::Some(0),
15906                Self::NotExecuted => std::option::Option::Some(1),
15907                Self::Failed => std::option::Option::Some(2),
15908                Self::Passed => std::option::Option::Some(3),
15909                Self::Warning => std::option::Option::Some(4),
15910                Self::UnknownValue(u) => u.0.value(),
15911            }
15912        }
15913
15914        /// Gets the enum value as a string.
15915        ///
15916        /// Returns `None` if the enum contains an unknown value deserialized from
15917        /// the integer representation of enums.
15918        pub fn name(&self) -> std::option::Option<&str> {
15919            match self {
15920                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
15921                Self::NotExecuted => std::option::Option::Some("NOT_EXECUTED"),
15922                Self::Failed => std::option::Option::Some("FAILED"),
15923                Self::Passed => std::option::Option::Some("PASSED"),
15924                Self::Warning => std::option::Option::Some("WARNING"),
15925                Self::UnknownValue(u) => u.0.name(),
15926            }
15927        }
15928    }
15929
15930    impl std::default::Default for State {
15931        fn default() -> Self {
15932            use std::convert::From;
15933            Self::from(0)
15934        }
15935    }
15936
15937    impl std::fmt::Display for State {
15938        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15939            wkt::internal::display_enum(f, self.name(), self.value())
15940        }
15941    }
15942
15943    impl std::convert::From<i32> for State {
15944        fn from(value: i32) -> Self {
15945            match value {
15946                0 => Self::Unspecified,
15947                1 => Self::NotExecuted,
15948                2 => Self::Failed,
15949                3 => Self::Passed,
15950                4 => Self::Warning,
15951                _ => Self::UnknownValue(state::UnknownValue(
15952                    wkt::internal::UnknownEnumValue::Integer(value),
15953                )),
15954            }
15955        }
15956    }
15957
15958    impl std::convert::From<&str> for State {
15959        fn from(value: &str) -> Self {
15960            use std::string::ToString;
15961            match value {
15962                "STATE_UNSPECIFIED" => Self::Unspecified,
15963                "NOT_EXECUTED" => Self::NotExecuted,
15964                "FAILED" => Self::Failed,
15965                "PASSED" => Self::Passed,
15966                "WARNING" => Self::Warning,
15967                _ => Self::UnknownValue(state::UnknownValue(
15968                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15969                )),
15970            }
15971        }
15972    }
15973
15974    impl serde::ser::Serialize for State {
15975        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15976        where
15977            S: serde::Serializer,
15978        {
15979            match self {
15980                Self::Unspecified => serializer.serialize_i32(0),
15981                Self::NotExecuted => serializer.serialize_i32(1),
15982                Self::Failed => serializer.serialize_i32(2),
15983                Self::Passed => serializer.serialize_i32(3),
15984                Self::Warning => serializer.serialize_i32(4),
15985                Self::UnknownValue(u) => u.0.serialize(serializer),
15986            }
15987        }
15988    }
15989
15990    impl<'de> serde::de::Deserialize<'de> for State {
15991        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15992        where
15993            D: serde::Deserializer<'de>,
15994        {
15995            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
15996                ".google.cloud.datastream.v1.Validation.State",
15997            ))
15998        }
15999    }
16000}
16001
16002/// Represent user-facing validation result message.
16003#[derive(Clone, Default, PartialEq)]
16004#[non_exhaustive]
16005pub struct ValidationMessage {
16006    /// The result of the validation.
16007    pub message: std::string::String,
16008
16009    /// Message severity level (warning or error).
16010    pub level: crate::model::validation_message::Level,
16011
16012    /// Additional metadata related to the result.
16013    pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
16014
16015    /// A custom code identifying this specific message.
16016    pub code: std::string::String,
16017
16018    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16019}
16020
16021impl ValidationMessage {
16022    pub fn new() -> Self {
16023        std::default::Default::default()
16024    }
16025
16026    /// Sets the value of [message][crate::model::ValidationMessage::message].
16027    ///
16028    /// # Example
16029    /// ```ignore,no_run
16030    /// # use google_cloud_datastream_v1::model::ValidationMessage;
16031    /// let x = ValidationMessage::new().set_message("example");
16032    /// ```
16033    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16034        self.message = v.into();
16035        self
16036    }
16037
16038    /// Sets the value of [level][crate::model::ValidationMessage::level].
16039    ///
16040    /// # Example
16041    /// ```ignore,no_run
16042    /// # use google_cloud_datastream_v1::model::ValidationMessage;
16043    /// use google_cloud_datastream_v1::model::validation_message::Level;
16044    /// let x0 = ValidationMessage::new().set_level(Level::Warning);
16045    /// let x1 = ValidationMessage::new().set_level(Level::Error);
16046    /// ```
16047    pub fn set_level<T: std::convert::Into<crate::model::validation_message::Level>>(
16048        mut self,
16049        v: T,
16050    ) -> Self {
16051        self.level = v.into();
16052        self
16053    }
16054
16055    /// Sets the value of [metadata][crate::model::ValidationMessage::metadata].
16056    ///
16057    /// # Example
16058    /// ```ignore,no_run
16059    /// # use google_cloud_datastream_v1::model::ValidationMessage;
16060    /// let x = ValidationMessage::new().set_metadata([
16061    ///     ("key0", "abc"),
16062    ///     ("key1", "xyz"),
16063    /// ]);
16064    /// ```
16065    pub fn set_metadata<T, K, V>(mut self, v: T) -> Self
16066    where
16067        T: std::iter::IntoIterator<Item = (K, V)>,
16068        K: std::convert::Into<std::string::String>,
16069        V: std::convert::Into<std::string::String>,
16070    {
16071        use std::iter::Iterator;
16072        self.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16073        self
16074    }
16075
16076    /// Sets the value of [code][crate::model::ValidationMessage::code].
16077    ///
16078    /// # Example
16079    /// ```ignore,no_run
16080    /// # use google_cloud_datastream_v1::model::ValidationMessage;
16081    /// let x = ValidationMessage::new().set_code("example");
16082    /// ```
16083    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16084        self.code = v.into();
16085        self
16086    }
16087}
16088
16089impl wkt::message::Message for ValidationMessage {
16090    fn typename() -> &'static str {
16091        "type.googleapis.com/google.cloud.datastream.v1.ValidationMessage"
16092    }
16093}
16094
16095/// Defines additional types related to [ValidationMessage].
16096pub mod validation_message {
16097    #[allow(unused_imports)]
16098    use super::*;
16099
16100    /// Validation message level.
16101    ///
16102    /// # Working with unknown values
16103    ///
16104    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16105    /// additional enum variants at any time. Adding new variants is not considered
16106    /// a breaking change. Applications should write their code in anticipation of:
16107    ///
16108    /// - New values appearing in future releases of the client library, **and**
16109    /// - New values received dynamically, without application changes.
16110    ///
16111    /// Please consult the [Working with enums] section in the user guide for some
16112    /// guidelines.
16113    ///
16114    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16115    #[derive(Clone, Debug, PartialEq)]
16116    #[non_exhaustive]
16117    pub enum Level {
16118        /// Unspecified level.
16119        Unspecified,
16120        /// Potentially cause issues with the Stream.
16121        Warning,
16122        /// Definitely cause issues with the Stream.
16123        Error,
16124        /// If set, the enum was initialized with an unknown value.
16125        ///
16126        /// Applications can examine the value using [Level::value] or
16127        /// [Level::name].
16128        UnknownValue(level::UnknownValue),
16129    }
16130
16131    #[doc(hidden)]
16132    pub mod level {
16133        #[allow(unused_imports)]
16134        use super::*;
16135        #[derive(Clone, Debug, PartialEq)]
16136        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16137    }
16138
16139    impl Level {
16140        /// Gets the enum value.
16141        ///
16142        /// Returns `None` if the enum contains an unknown value deserialized from
16143        /// the string representation of enums.
16144        pub fn value(&self) -> std::option::Option<i32> {
16145            match self {
16146                Self::Unspecified => std::option::Option::Some(0),
16147                Self::Warning => std::option::Option::Some(1),
16148                Self::Error => std::option::Option::Some(2),
16149                Self::UnknownValue(u) => u.0.value(),
16150            }
16151        }
16152
16153        /// Gets the enum value as a string.
16154        ///
16155        /// Returns `None` if the enum contains an unknown value deserialized from
16156        /// the integer representation of enums.
16157        pub fn name(&self) -> std::option::Option<&str> {
16158            match self {
16159                Self::Unspecified => std::option::Option::Some("LEVEL_UNSPECIFIED"),
16160                Self::Warning => std::option::Option::Some("WARNING"),
16161                Self::Error => std::option::Option::Some("ERROR"),
16162                Self::UnknownValue(u) => u.0.name(),
16163            }
16164        }
16165    }
16166
16167    impl std::default::Default for Level {
16168        fn default() -> Self {
16169            use std::convert::From;
16170            Self::from(0)
16171        }
16172    }
16173
16174    impl std::fmt::Display for Level {
16175        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16176            wkt::internal::display_enum(f, self.name(), self.value())
16177        }
16178    }
16179
16180    impl std::convert::From<i32> for Level {
16181        fn from(value: i32) -> Self {
16182            match value {
16183                0 => Self::Unspecified,
16184                1 => Self::Warning,
16185                2 => Self::Error,
16186                _ => Self::UnknownValue(level::UnknownValue(
16187                    wkt::internal::UnknownEnumValue::Integer(value),
16188                )),
16189            }
16190        }
16191    }
16192
16193    impl std::convert::From<&str> for Level {
16194        fn from(value: &str) -> Self {
16195            use std::string::ToString;
16196            match value {
16197                "LEVEL_UNSPECIFIED" => Self::Unspecified,
16198                "WARNING" => Self::Warning,
16199                "ERROR" => Self::Error,
16200                _ => Self::UnknownValue(level::UnknownValue(
16201                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16202                )),
16203            }
16204        }
16205    }
16206
16207    impl serde::ser::Serialize for Level {
16208        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16209        where
16210            S: serde::Serializer,
16211        {
16212            match self {
16213                Self::Unspecified => serializer.serialize_i32(0),
16214                Self::Warning => serializer.serialize_i32(1),
16215                Self::Error => serializer.serialize_i32(2),
16216                Self::UnknownValue(u) => u.0.serialize(serializer),
16217            }
16218        }
16219    }
16220
16221    impl<'de> serde::de::Deserialize<'de> for Level {
16222        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16223        where
16224            D: serde::Deserializer<'de>,
16225        {
16226            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Level>::new(
16227                ".google.cloud.datastream.v1.ValidationMessage.Level",
16228            ))
16229        }
16230    }
16231}
16232
16233/// The strategy that the stream uses for CDC replication.
16234#[derive(Clone, Default, PartialEq)]
16235#[non_exhaustive]
16236pub struct CdcStrategy {
16237    /// The position to start reading from when starting, resuming, or recovering
16238    /// the stream.
16239    /// If not set, the system's default value will be used.
16240    pub start_position: std::option::Option<crate::model::cdc_strategy::StartPosition>,
16241
16242    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16243}
16244
16245impl CdcStrategy {
16246    pub fn new() -> Self {
16247        std::default::Default::default()
16248    }
16249
16250    /// Sets the value of [start_position][crate::model::CdcStrategy::start_position].
16251    ///
16252    /// Note that all the setters affecting `start_position` are mutually
16253    /// exclusive.
16254    ///
16255    /// # Example
16256    /// ```ignore,no_run
16257    /// # use google_cloud_datastream_v1::model::CdcStrategy;
16258    /// use google_cloud_datastream_v1::model::cdc_strategy::MostRecentStartPosition;
16259    /// let x = CdcStrategy::new().set_start_position(Some(
16260    ///     google_cloud_datastream_v1::model::cdc_strategy::StartPosition::MostRecentStartPosition(MostRecentStartPosition::default().into())));
16261    /// ```
16262    pub fn set_start_position<
16263        T: std::convert::Into<std::option::Option<crate::model::cdc_strategy::StartPosition>>,
16264    >(
16265        mut self,
16266        v: T,
16267    ) -> Self {
16268        self.start_position = v.into();
16269        self
16270    }
16271
16272    /// The value of [start_position][crate::model::CdcStrategy::start_position]
16273    /// if it holds a `MostRecentStartPosition`, `None` if the field is not set or
16274    /// holds a different branch.
16275    pub fn most_recent_start_position(
16276        &self,
16277    ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>>
16278    {
16279        #[allow(unreachable_patterns)]
16280        self.start_position.as_ref().and_then(|v| match v {
16281            crate::model::cdc_strategy::StartPosition::MostRecentStartPosition(v) => {
16282                std::option::Option::Some(v)
16283            }
16284            _ => std::option::Option::None,
16285        })
16286    }
16287
16288    /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
16289    /// to hold a `MostRecentStartPosition`.
16290    ///
16291    /// Note that all the setters affecting `start_position` are
16292    /// mutually exclusive.
16293    ///
16294    /// # Example
16295    /// ```ignore,no_run
16296    /// # use google_cloud_datastream_v1::model::CdcStrategy;
16297    /// use google_cloud_datastream_v1::model::cdc_strategy::MostRecentStartPosition;
16298    /// let x = CdcStrategy::new().set_most_recent_start_position(MostRecentStartPosition::default()/* use setters */);
16299    /// assert!(x.most_recent_start_position().is_some());
16300    /// assert!(x.next_available_start_position().is_none());
16301    /// assert!(x.specific_start_position().is_none());
16302    /// ```
16303    pub fn set_most_recent_start_position<
16304        T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>>,
16305    >(
16306        mut self,
16307        v: T,
16308    ) -> Self {
16309        self.start_position = std::option::Option::Some(
16310            crate::model::cdc_strategy::StartPosition::MostRecentStartPosition(v.into()),
16311        );
16312        self
16313    }
16314
16315    /// The value of [start_position][crate::model::CdcStrategy::start_position]
16316    /// if it holds a `NextAvailableStartPosition`, `None` if the field is not set or
16317    /// holds a different branch.
16318    pub fn next_available_start_position(
16319        &self,
16320    ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>>
16321    {
16322        #[allow(unreachable_patterns)]
16323        self.start_position.as_ref().and_then(|v| match v {
16324            crate::model::cdc_strategy::StartPosition::NextAvailableStartPosition(v) => {
16325                std::option::Option::Some(v)
16326            }
16327            _ => std::option::Option::None,
16328        })
16329    }
16330
16331    /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
16332    /// to hold a `NextAvailableStartPosition`.
16333    ///
16334    /// Note that all the setters affecting `start_position` are
16335    /// mutually exclusive.
16336    ///
16337    /// # Example
16338    /// ```ignore,no_run
16339    /// # use google_cloud_datastream_v1::model::CdcStrategy;
16340    /// use google_cloud_datastream_v1::model::cdc_strategy::NextAvailableStartPosition;
16341    /// let x = CdcStrategy::new().set_next_available_start_position(NextAvailableStartPosition::default()/* use setters */);
16342    /// assert!(x.next_available_start_position().is_some());
16343    /// assert!(x.most_recent_start_position().is_none());
16344    /// assert!(x.specific_start_position().is_none());
16345    /// ```
16346    pub fn set_next_available_start_position<
16347        T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>>,
16348    >(
16349        mut self,
16350        v: T,
16351    ) -> Self {
16352        self.start_position = std::option::Option::Some(
16353            crate::model::cdc_strategy::StartPosition::NextAvailableStartPosition(v.into()),
16354        );
16355        self
16356    }
16357
16358    /// The value of [start_position][crate::model::CdcStrategy::start_position]
16359    /// if it holds a `SpecificStartPosition`, `None` if the field is not set or
16360    /// holds a different branch.
16361    pub fn specific_start_position(
16362        &self,
16363    ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>>
16364    {
16365        #[allow(unreachable_patterns)]
16366        self.start_position.as_ref().and_then(|v| match v {
16367            crate::model::cdc_strategy::StartPosition::SpecificStartPosition(v) => {
16368                std::option::Option::Some(v)
16369            }
16370            _ => std::option::Option::None,
16371        })
16372    }
16373
16374    /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
16375    /// to hold a `SpecificStartPosition`.
16376    ///
16377    /// Note that all the setters affecting `start_position` are
16378    /// mutually exclusive.
16379    ///
16380    /// # Example
16381    /// ```ignore,no_run
16382    /// # use google_cloud_datastream_v1::model::CdcStrategy;
16383    /// use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16384    /// let x = CdcStrategy::new().set_specific_start_position(SpecificStartPosition::default()/* use setters */);
16385    /// assert!(x.specific_start_position().is_some());
16386    /// assert!(x.most_recent_start_position().is_none());
16387    /// assert!(x.next_available_start_position().is_none());
16388    /// ```
16389    pub fn set_specific_start_position<
16390        T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>>,
16391    >(
16392        mut self,
16393        v: T,
16394    ) -> Self {
16395        self.start_position = std::option::Option::Some(
16396            crate::model::cdc_strategy::StartPosition::SpecificStartPosition(v.into()),
16397        );
16398        self
16399    }
16400}
16401
16402impl wkt::message::Message for CdcStrategy {
16403    fn typename() -> &'static str {
16404        "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy"
16405    }
16406}
16407
16408/// Defines additional types related to [CdcStrategy].
16409pub mod cdc_strategy {
16410    #[allow(unused_imports)]
16411    use super::*;
16412
16413    /// CDC strategy to start replicating from the most recent position in the
16414    /// source.
16415    #[derive(Clone, Default, PartialEq)]
16416    #[non_exhaustive]
16417    pub struct MostRecentStartPosition {
16418        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16419    }
16420
16421    impl MostRecentStartPosition {
16422        pub fn new() -> Self {
16423            std::default::Default::default()
16424        }
16425    }
16426
16427    impl wkt::message::Message for MostRecentStartPosition {
16428        fn typename() -> &'static str {
16429            "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.MostRecentStartPosition"
16430        }
16431    }
16432
16433    /// CDC strategy to resume replication from the next available position in the
16434    /// source.
16435    #[derive(Clone, Default, PartialEq)]
16436    #[non_exhaustive]
16437    pub struct NextAvailableStartPosition {
16438        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16439    }
16440
16441    impl NextAvailableStartPosition {
16442        pub fn new() -> Self {
16443            std::default::Default::default()
16444        }
16445    }
16446
16447    impl wkt::message::Message for NextAvailableStartPosition {
16448        fn typename() -> &'static str {
16449            "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.NextAvailableStartPosition"
16450        }
16451    }
16452
16453    /// CDC strategy to start replicating from a specific position in the source.
16454    #[derive(Clone, Default, PartialEq)]
16455    #[non_exhaustive]
16456    pub struct SpecificStartPosition {
16457        pub position:
16458            std::option::Option<crate::model::cdc_strategy::specific_start_position::Position>,
16459
16460        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16461    }
16462
16463    impl SpecificStartPosition {
16464        pub fn new() -> Self {
16465            std::default::Default::default()
16466        }
16467
16468        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position].
16469        ///
16470        /// Note that all the setters affecting `position` are mutually
16471        /// exclusive.
16472        ///
16473        /// # Example
16474        /// ```ignore,no_run
16475        /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16476        /// use google_cloud_datastream_v1::model::MysqlLogPosition;
16477        /// let x = SpecificStartPosition::new().set_position(Some(
16478        ///     google_cloud_datastream_v1::model::cdc_strategy::specific_start_position::Position::MysqlLogPosition(MysqlLogPosition::default().into())));
16479        /// ```
16480        pub fn set_position<
16481            T: std::convert::Into<
16482                    std::option::Option<
16483                        crate::model::cdc_strategy::specific_start_position::Position,
16484                    >,
16485                >,
16486        >(
16487            mut self,
16488            v: T,
16489        ) -> Self {
16490            self.position = v.into();
16491            self
16492        }
16493
16494        /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16495        /// if it holds a `MysqlLogPosition`, `None` if the field is not set or
16496        /// holds a different branch.
16497        pub fn mysql_log_position(
16498            &self,
16499        ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlLogPosition>> {
16500            #[allow(unreachable_patterns)]
16501            self.position.as_ref().and_then(|v| match v {
16502                crate::model::cdc_strategy::specific_start_position::Position::MysqlLogPosition(
16503                    v,
16504                ) => std::option::Option::Some(v),
16505                _ => std::option::Option::None,
16506            })
16507        }
16508
16509        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16510        /// to hold a `MysqlLogPosition`.
16511        ///
16512        /// Note that all the setters affecting `position` are
16513        /// mutually exclusive.
16514        ///
16515        /// # Example
16516        /// ```ignore,no_run
16517        /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16518        /// use google_cloud_datastream_v1::model::MysqlLogPosition;
16519        /// let x = SpecificStartPosition::new().set_mysql_log_position(MysqlLogPosition::default()/* use setters */);
16520        /// assert!(x.mysql_log_position().is_some());
16521        /// assert!(x.oracle_scn_position().is_none());
16522        /// assert!(x.sql_server_lsn_position().is_none());
16523        /// assert!(x.mysql_gtid_position().is_none());
16524        /// ```
16525        pub fn set_mysql_log_position<
16526            T: std::convert::Into<std::boxed::Box<crate::model::MysqlLogPosition>>,
16527        >(
16528            mut self,
16529            v: T,
16530        ) -> Self {
16531            self.position = std::option::Option::Some(
16532                crate::model::cdc_strategy::specific_start_position::Position::MysqlLogPosition(
16533                    v.into(),
16534                ),
16535            );
16536            self
16537        }
16538
16539        /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16540        /// if it holds a `OracleScnPosition`, `None` if the field is not set or
16541        /// holds a different branch.
16542        pub fn oracle_scn_position(
16543            &self,
16544        ) -> std::option::Option<&std::boxed::Box<crate::model::OracleScnPosition>> {
16545            #[allow(unreachable_patterns)]
16546            self.position.as_ref().and_then(|v| match v {
16547                crate::model::cdc_strategy::specific_start_position::Position::OracleScnPosition(v) => std::option::Option::Some(v),
16548                _ => std::option::Option::None,
16549            })
16550        }
16551
16552        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16553        /// to hold a `OracleScnPosition`.
16554        ///
16555        /// Note that all the setters affecting `position` are
16556        /// mutually exclusive.
16557        ///
16558        /// # Example
16559        /// ```ignore,no_run
16560        /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16561        /// use google_cloud_datastream_v1::model::OracleScnPosition;
16562        /// let x = SpecificStartPosition::new().set_oracle_scn_position(OracleScnPosition::default()/* use setters */);
16563        /// assert!(x.oracle_scn_position().is_some());
16564        /// assert!(x.mysql_log_position().is_none());
16565        /// assert!(x.sql_server_lsn_position().is_none());
16566        /// assert!(x.mysql_gtid_position().is_none());
16567        /// ```
16568        pub fn set_oracle_scn_position<
16569            T: std::convert::Into<std::boxed::Box<crate::model::OracleScnPosition>>,
16570        >(
16571            mut self,
16572            v: T,
16573        ) -> Self {
16574            self.position = std::option::Option::Some(
16575                crate::model::cdc_strategy::specific_start_position::Position::OracleScnPosition(
16576                    v.into(),
16577                ),
16578            );
16579            self
16580        }
16581
16582        /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16583        /// if it holds a `SqlServerLsnPosition`, `None` if the field is not set or
16584        /// holds a different branch.
16585        pub fn sql_server_lsn_position(
16586            &self,
16587        ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerLsnPosition>> {
16588            #[allow(unreachable_patterns)]
16589            self.position.as_ref().and_then(|v| match v {
16590                crate::model::cdc_strategy::specific_start_position::Position::SqlServerLsnPosition(v) => std::option::Option::Some(v),
16591                _ => std::option::Option::None,
16592            })
16593        }
16594
16595        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16596        /// to hold a `SqlServerLsnPosition`.
16597        ///
16598        /// Note that all the setters affecting `position` are
16599        /// mutually exclusive.
16600        ///
16601        /// # Example
16602        /// ```ignore,no_run
16603        /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16604        /// use google_cloud_datastream_v1::model::SqlServerLsnPosition;
16605        /// let x = SpecificStartPosition::new().set_sql_server_lsn_position(SqlServerLsnPosition::default()/* use setters */);
16606        /// assert!(x.sql_server_lsn_position().is_some());
16607        /// assert!(x.mysql_log_position().is_none());
16608        /// assert!(x.oracle_scn_position().is_none());
16609        /// assert!(x.mysql_gtid_position().is_none());
16610        /// ```
16611        pub fn set_sql_server_lsn_position<
16612            T: std::convert::Into<std::boxed::Box<crate::model::SqlServerLsnPosition>>,
16613        >(
16614            mut self,
16615            v: T,
16616        ) -> Self {
16617            self.position = std::option::Option::Some(
16618                crate::model::cdc_strategy::specific_start_position::Position::SqlServerLsnPosition(
16619                    v.into(),
16620                ),
16621            );
16622            self
16623        }
16624
16625        /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16626        /// if it holds a `MysqlGtidPosition`, `None` if the field is not set or
16627        /// holds a different branch.
16628        pub fn mysql_gtid_position(
16629            &self,
16630        ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlGtidPosition>> {
16631            #[allow(unreachable_patterns)]
16632            self.position.as_ref().and_then(|v| match v {
16633                crate::model::cdc_strategy::specific_start_position::Position::MysqlGtidPosition(v) => std::option::Option::Some(v),
16634                _ => std::option::Option::None,
16635            })
16636        }
16637
16638        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16639        /// to hold a `MysqlGtidPosition`.
16640        ///
16641        /// Note that all the setters affecting `position` are
16642        /// mutually exclusive.
16643        ///
16644        /// # Example
16645        /// ```ignore,no_run
16646        /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16647        /// use google_cloud_datastream_v1::model::MysqlGtidPosition;
16648        /// let x = SpecificStartPosition::new().set_mysql_gtid_position(MysqlGtidPosition::default()/* use setters */);
16649        /// assert!(x.mysql_gtid_position().is_some());
16650        /// assert!(x.mysql_log_position().is_none());
16651        /// assert!(x.oracle_scn_position().is_none());
16652        /// assert!(x.sql_server_lsn_position().is_none());
16653        /// ```
16654        pub fn set_mysql_gtid_position<
16655            T: std::convert::Into<std::boxed::Box<crate::model::MysqlGtidPosition>>,
16656        >(
16657            mut self,
16658            v: T,
16659        ) -> Self {
16660            self.position = std::option::Option::Some(
16661                crate::model::cdc_strategy::specific_start_position::Position::MysqlGtidPosition(
16662                    v.into(),
16663                ),
16664            );
16665            self
16666        }
16667    }
16668
16669    impl wkt::message::Message for SpecificStartPosition {
16670        fn typename() -> &'static str {
16671            "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.SpecificStartPosition"
16672        }
16673    }
16674
16675    /// Defines additional types related to [SpecificStartPosition].
16676    pub mod specific_start_position {
16677        #[allow(unused_imports)]
16678        use super::*;
16679
16680        #[derive(Clone, Debug, PartialEq)]
16681        #[non_exhaustive]
16682        pub enum Position {
16683            /// MySQL specific log position to start replicating from.
16684            MysqlLogPosition(std::boxed::Box<crate::model::MysqlLogPosition>),
16685            /// Oracle SCN to start replicating from.
16686            OracleScnPosition(std::boxed::Box<crate::model::OracleScnPosition>),
16687            /// SqlServer LSN to start replicating from.
16688            SqlServerLsnPosition(std::boxed::Box<crate::model::SqlServerLsnPosition>),
16689            /// MySQL GTID set to start replicating from.
16690            MysqlGtidPosition(std::boxed::Box<crate::model::MysqlGtidPosition>),
16691        }
16692    }
16693
16694    /// The position to start reading from when starting, resuming, or recovering
16695    /// the stream.
16696    /// If not set, the system's default value will be used.
16697    #[derive(Clone, Debug, PartialEq)]
16698    #[non_exhaustive]
16699    pub enum StartPosition {
16700        /// Optional. Start replicating from the most recent position in the source.
16701        MostRecentStartPosition(
16702            std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>,
16703        ),
16704        /// Optional. Resume replication from the next available position in the
16705        /// source.
16706        NextAvailableStartPosition(
16707            std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>,
16708        ),
16709        /// Optional. Start replicating from a specific position in the source.
16710        SpecificStartPosition(std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>),
16711    }
16712}
16713
16714/// SQL Server LSN position
16715#[derive(Clone, Default, PartialEq)]
16716#[non_exhaustive]
16717pub struct SqlServerLsnPosition {
16718    /// Required. Log sequence number (LSN) from where Logs will be read
16719    pub lsn: std::string::String,
16720
16721    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16722}
16723
16724impl SqlServerLsnPosition {
16725    pub fn new() -> Self {
16726        std::default::Default::default()
16727    }
16728
16729    /// Sets the value of [lsn][crate::model::SqlServerLsnPosition::lsn].
16730    ///
16731    /// # Example
16732    /// ```ignore,no_run
16733    /// # use google_cloud_datastream_v1::model::SqlServerLsnPosition;
16734    /// let x = SqlServerLsnPosition::new().set_lsn("example");
16735    /// ```
16736    pub fn set_lsn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16737        self.lsn = v.into();
16738        self
16739    }
16740}
16741
16742impl wkt::message::Message for SqlServerLsnPosition {
16743    fn typename() -> &'static str {
16744        "type.googleapis.com/google.cloud.datastream.v1.SqlServerLsnPosition"
16745    }
16746}
16747
16748/// Oracle SCN position
16749#[derive(Clone, Default, PartialEq)]
16750#[non_exhaustive]
16751pub struct OracleScnPosition {
16752    /// Required. SCN number from where Logs will be read
16753    pub scn: i64,
16754
16755    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16756}
16757
16758impl OracleScnPosition {
16759    pub fn new() -> Self {
16760        std::default::Default::default()
16761    }
16762
16763    /// Sets the value of [scn][crate::model::OracleScnPosition::scn].
16764    ///
16765    /// # Example
16766    /// ```ignore,no_run
16767    /// # use google_cloud_datastream_v1::model::OracleScnPosition;
16768    /// let x = OracleScnPosition::new().set_scn(42);
16769    /// ```
16770    pub fn set_scn<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
16771        self.scn = v.into();
16772        self
16773    }
16774}
16775
16776impl wkt::message::Message for OracleScnPosition {
16777    fn typename() -> &'static str {
16778        "type.googleapis.com/google.cloud.datastream.v1.OracleScnPosition"
16779    }
16780}
16781
16782/// MySQL log position
16783#[derive(Clone, Default, PartialEq)]
16784#[non_exhaustive]
16785pub struct MysqlLogPosition {
16786    /// Required. The binary log file name.
16787    pub log_file: std::string::String,
16788
16789    /// Optional. The position within the binary log file. Default is head of file.
16790    pub log_position: std::option::Option<i32>,
16791
16792    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16793}
16794
16795impl MysqlLogPosition {
16796    pub fn new() -> Self {
16797        std::default::Default::default()
16798    }
16799
16800    /// Sets the value of [log_file][crate::model::MysqlLogPosition::log_file].
16801    ///
16802    /// # Example
16803    /// ```ignore,no_run
16804    /// # use google_cloud_datastream_v1::model::MysqlLogPosition;
16805    /// let x = MysqlLogPosition::new().set_log_file("example");
16806    /// ```
16807    pub fn set_log_file<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16808        self.log_file = v.into();
16809        self
16810    }
16811
16812    /// Sets the value of [log_position][crate::model::MysqlLogPosition::log_position].
16813    ///
16814    /// # Example
16815    /// ```ignore,no_run
16816    /// # use google_cloud_datastream_v1::model::MysqlLogPosition;
16817    /// let x = MysqlLogPosition::new().set_log_position(42);
16818    /// ```
16819    pub fn set_log_position<T>(mut self, v: T) -> Self
16820    where
16821        T: std::convert::Into<i32>,
16822    {
16823        self.log_position = std::option::Option::Some(v.into());
16824        self
16825    }
16826
16827    /// Sets or clears the value of [log_position][crate::model::MysqlLogPosition::log_position].
16828    ///
16829    /// # Example
16830    /// ```ignore,no_run
16831    /// # use google_cloud_datastream_v1::model::MysqlLogPosition;
16832    /// let x = MysqlLogPosition::new().set_or_clear_log_position(Some(42));
16833    /// let x = MysqlLogPosition::new().set_or_clear_log_position(None::<i32>);
16834    /// ```
16835    pub fn set_or_clear_log_position<T>(mut self, v: std::option::Option<T>) -> Self
16836    where
16837        T: std::convert::Into<i32>,
16838    {
16839        self.log_position = v.map(|x| x.into());
16840        self
16841    }
16842}
16843
16844impl wkt::message::Message for MysqlLogPosition {
16845    fn typename() -> &'static str {
16846        "type.googleapis.com/google.cloud.datastream.v1.MysqlLogPosition"
16847    }
16848}
16849
16850/// MySQL GTID position
16851#[derive(Clone, Default, PartialEq)]
16852#[non_exhaustive]
16853pub struct MysqlGtidPosition {
16854    /// Required. The gtid set to start replication from.
16855    pub gtid_set: std::string::String,
16856
16857    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16858}
16859
16860impl MysqlGtidPosition {
16861    pub fn new() -> Self {
16862        std::default::Default::default()
16863    }
16864
16865    /// Sets the value of [gtid_set][crate::model::MysqlGtidPosition::gtid_set].
16866    ///
16867    /// # Example
16868    /// ```ignore,no_run
16869    /// # use google_cloud_datastream_v1::model::MysqlGtidPosition;
16870    /// let x = MysqlGtidPosition::new().set_gtid_set("example");
16871    /// ```
16872    pub fn set_gtid_set<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16873        self.gtid_set = v.into();
16874        self
16875    }
16876}
16877
16878impl wkt::message::Message for MysqlGtidPosition {
16879    fn typename() -> &'static str {
16880        "type.googleapis.com/google.cloud.datastream.v1.MysqlGtidPosition"
16881    }
16882}