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 lazy_static;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35mod debug;
36mod deserialize;
37mod serialize;
38
39/// Request message for 'discover' ConnectionProfile request.
40#[derive(Clone, Default, PartialEq)]
41#[non_exhaustive]
42pub struct DiscoverConnectionProfileRequest {
43    /// Required. The parent resource of the connection profile type. Must be in
44    /// the format `projects/*/locations/*`.
45    pub parent: std::string::String,
46
47    /// The connection profile on which to run discover.
48    pub target: std::option::Option<crate::model::discover_connection_profile_request::Target>,
49
50    /// The depth of the retrieved hierarchy of data objects.
51    pub hierarchy:
52        std::option::Option<crate::model::discover_connection_profile_request::Hierarchy>,
53
54    /// The data object to populate with child data objects and metadata.
55    pub data_object:
56        std::option::Option<crate::model::discover_connection_profile_request::DataObject>,
57
58    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
59}
60
61impl DiscoverConnectionProfileRequest {
62    pub fn new() -> Self {
63        std::default::Default::default()
64    }
65
66    /// Sets the value of [parent][crate::model::DiscoverConnectionProfileRequest::parent].
67    ///
68    /// # Example
69    /// ```ignore,no_run
70    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
71    /// let x = DiscoverConnectionProfileRequest::new().set_parent("example");
72    /// ```
73    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
74        self.parent = v.into();
75        self
76    }
77
78    /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target].
79    ///
80    /// Note that all the setters affecting `target` are mutually
81    /// exclusive.
82    ///
83    /// # Example
84    /// ```ignore,no_run
85    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
86    /// use google_cloud_datastream_v1::model::discover_connection_profile_request::Target;
87    /// let x = DiscoverConnectionProfileRequest::new().set_target(Some(Target::ConnectionProfileName("example".to_string())));
88    /// ```
89    pub fn set_target<
90        T: std::convert::Into<
91                std::option::Option<crate::model::discover_connection_profile_request::Target>,
92            >,
93    >(
94        mut self,
95        v: T,
96    ) -> Self {
97        self.target = v.into();
98        self
99    }
100
101    /// The value of [target][crate::model::DiscoverConnectionProfileRequest::target]
102    /// if it holds a `ConnectionProfile`, `None` if the field is not set or
103    /// holds a different branch.
104    pub fn connection_profile(
105        &self,
106    ) -> std::option::Option<&std::boxed::Box<crate::model::ConnectionProfile>> {
107        #[allow(unreachable_patterns)]
108        self.target.as_ref().and_then(|v| match v {
109            crate::model::discover_connection_profile_request::Target::ConnectionProfile(v) => {
110                std::option::Option::Some(v)
111            }
112            _ => std::option::Option::None,
113        })
114    }
115
116    /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target]
117    /// to hold a `ConnectionProfile`.
118    ///
119    /// Note that all the setters affecting `target` are
120    /// mutually exclusive.
121    ///
122    /// # Example
123    /// ```ignore,no_run
124    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
125    /// use google_cloud_datastream_v1::model::ConnectionProfile;
126    /// let x = DiscoverConnectionProfileRequest::new().set_connection_profile(ConnectionProfile::default()/* use setters */);
127    /// assert!(x.connection_profile().is_some());
128    /// assert!(x.connection_profile_name().is_none());
129    /// ```
130    pub fn set_connection_profile<
131        T: std::convert::Into<std::boxed::Box<crate::model::ConnectionProfile>>,
132    >(
133        mut self,
134        v: T,
135    ) -> Self {
136        self.target = std::option::Option::Some(
137            crate::model::discover_connection_profile_request::Target::ConnectionProfile(v.into()),
138        );
139        self
140    }
141
142    /// The value of [target][crate::model::DiscoverConnectionProfileRequest::target]
143    /// if it holds a `ConnectionProfileName`, `None` if the field is not set or
144    /// holds a different branch.
145    pub fn connection_profile_name(&self) -> std::option::Option<&std::string::String> {
146        #[allow(unreachable_patterns)]
147        self.target.as_ref().and_then(|v| match v {
148            crate::model::discover_connection_profile_request::Target::ConnectionProfileName(v) => {
149                std::option::Option::Some(v)
150            }
151            _ => std::option::Option::None,
152        })
153    }
154
155    /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target]
156    /// to hold a `ConnectionProfileName`.
157    ///
158    /// Note that all the setters affecting `target` are
159    /// mutually exclusive.
160    ///
161    /// # Example
162    /// ```ignore,no_run
163    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
164    /// let x = DiscoverConnectionProfileRequest::new().set_connection_profile_name("example");
165    /// assert!(x.connection_profile_name().is_some());
166    /// assert!(x.connection_profile().is_none());
167    /// ```
168    pub fn set_connection_profile_name<T: std::convert::Into<std::string::String>>(
169        mut self,
170        v: T,
171    ) -> Self {
172        self.target = std::option::Option::Some(
173            crate::model::discover_connection_profile_request::Target::ConnectionProfileName(
174                v.into(),
175            ),
176        );
177        self
178    }
179
180    /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy].
181    ///
182    /// Note that all the setters affecting `hierarchy` are mutually
183    /// exclusive.
184    ///
185    /// # Example
186    /// ```ignore,no_run
187    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
188    /// use google_cloud_datastream_v1::model::discover_connection_profile_request::Hierarchy;
189    /// let x = DiscoverConnectionProfileRequest::new().set_hierarchy(Some(Hierarchy::FullHierarchy(true)));
190    /// ```
191    pub fn set_hierarchy<
192        T: std::convert::Into<
193                std::option::Option<crate::model::discover_connection_profile_request::Hierarchy>,
194            >,
195    >(
196        mut self,
197        v: T,
198    ) -> Self {
199        self.hierarchy = v.into();
200        self
201    }
202
203    /// The value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
204    /// if it holds a `FullHierarchy`, `None` if the field is not set or
205    /// holds a different branch.
206    pub fn full_hierarchy(&self) -> std::option::Option<&bool> {
207        #[allow(unreachable_patterns)]
208        self.hierarchy.as_ref().and_then(|v| match v {
209            crate::model::discover_connection_profile_request::Hierarchy::FullHierarchy(v) => {
210                std::option::Option::Some(v)
211            }
212            _ => std::option::Option::None,
213        })
214    }
215
216    /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
217    /// to hold a `FullHierarchy`.
218    ///
219    /// Note that all the setters affecting `hierarchy` are
220    /// mutually exclusive.
221    ///
222    /// # Example
223    /// ```ignore,no_run
224    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
225    /// let x = DiscoverConnectionProfileRequest::new().set_full_hierarchy(true);
226    /// assert!(x.full_hierarchy().is_some());
227    /// assert!(x.hierarchy_depth().is_none());
228    /// ```
229    pub fn set_full_hierarchy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
230        self.hierarchy = std::option::Option::Some(
231            crate::model::discover_connection_profile_request::Hierarchy::FullHierarchy(v.into()),
232        );
233        self
234    }
235
236    /// The value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
237    /// if it holds a `HierarchyDepth`, `None` if the field is not set or
238    /// holds a different branch.
239    pub fn hierarchy_depth(&self) -> std::option::Option<&i32> {
240        #[allow(unreachable_patterns)]
241        self.hierarchy.as_ref().and_then(|v| match v {
242            crate::model::discover_connection_profile_request::Hierarchy::HierarchyDepth(v) => {
243                std::option::Option::Some(v)
244            }
245            _ => std::option::Option::None,
246        })
247    }
248
249    /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
250    /// to hold a `HierarchyDepth`.
251    ///
252    /// Note that all the setters affecting `hierarchy` are
253    /// mutually exclusive.
254    ///
255    /// # Example
256    /// ```ignore,no_run
257    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
258    /// let x = DiscoverConnectionProfileRequest::new().set_hierarchy_depth(42);
259    /// assert!(x.hierarchy_depth().is_some());
260    /// assert!(x.full_hierarchy().is_none());
261    /// ```
262    pub fn set_hierarchy_depth<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
263        self.hierarchy = std::option::Option::Some(
264            crate::model::discover_connection_profile_request::Hierarchy::HierarchyDepth(v.into()),
265        );
266        self
267    }
268
269    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object].
270    ///
271    /// Note that all the setters affecting `data_object` are mutually
272    /// exclusive.
273    ///
274    /// # Example
275    /// ```ignore,no_run
276    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
277    /// use google_cloud_datastream_v1::model::OracleRdbms;
278    /// let x = DiscoverConnectionProfileRequest::new().set_data_object(Some(
279    ///     google_cloud_datastream_v1::model::discover_connection_profile_request::DataObject::OracleRdbms(OracleRdbms::default().into())));
280    /// ```
281    pub fn set_data_object<
282        T: std::convert::Into<
283                std::option::Option<crate::model::discover_connection_profile_request::DataObject>,
284            >,
285    >(
286        mut self,
287        v: T,
288    ) -> Self {
289        self.data_object = v.into();
290        self
291    }
292
293    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
294    /// if it holds a `OracleRdbms`, `None` if the field is not set or
295    /// holds a different branch.
296    pub fn oracle_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
297        #[allow(unreachable_patterns)]
298        self.data_object.as_ref().and_then(|v| match v {
299            crate::model::discover_connection_profile_request::DataObject::OracleRdbms(v) => {
300                std::option::Option::Some(v)
301            }
302            _ => std::option::Option::None,
303        })
304    }
305
306    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
307    /// to hold a `OracleRdbms`.
308    ///
309    /// Note that all the setters affecting `data_object` are
310    /// mutually exclusive.
311    ///
312    /// # Example
313    /// ```ignore,no_run
314    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
315    /// use google_cloud_datastream_v1::model::OracleRdbms;
316    /// let x = DiscoverConnectionProfileRequest::new().set_oracle_rdbms(OracleRdbms::default()/* use setters */);
317    /// assert!(x.oracle_rdbms().is_some());
318    /// assert!(x.mysql_rdbms().is_none());
319    /// assert!(x.postgresql_rdbms().is_none());
320    /// assert!(x.sql_server_rdbms().is_none());
321    /// assert!(x.salesforce_org().is_none());
322    /// assert!(x.mongodb_cluster().is_none());
323    /// ```
324    pub fn set_oracle_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>>(
325        mut self,
326        v: T,
327    ) -> Self {
328        self.data_object = std::option::Option::Some(
329            crate::model::discover_connection_profile_request::DataObject::OracleRdbms(v.into()),
330        );
331        self
332    }
333
334    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
335    /// if it holds a `MysqlRdbms`, `None` if the field is not set or
336    /// holds a different branch.
337    pub fn mysql_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
338        #[allow(unreachable_patterns)]
339        self.data_object.as_ref().and_then(|v| match v {
340            crate::model::discover_connection_profile_request::DataObject::MysqlRdbms(v) => {
341                std::option::Option::Some(v)
342            }
343            _ => std::option::Option::None,
344        })
345    }
346
347    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
348    /// to hold a `MysqlRdbms`.
349    ///
350    /// Note that all the setters affecting `data_object` are
351    /// mutually exclusive.
352    ///
353    /// # Example
354    /// ```ignore,no_run
355    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
356    /// use google_cloud_datastream_v1::model::MysqlRdbms;
357    /// let x = DiscoverConnectionProfileRequest::new().set_mysql_rdbms(MysqlRdbms::default()/* use setters */);
358    /// assert!(x.mysql_rdbms().is_some());
359    /// assert!(x.oracle_rdbms().is_none());
360    /// assert!(x.postgresql_rdbms().is_none());
361    /// assert!(x.sql_server_rdbms().is_none());
362    /// assert!(x.salesforce_org().is_none());
363    /// assert!(x.mongodb_cluster().is_none());
364    /// ```
365    pub fn set_mysql_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>>(
366        mut self,
367        v: T,
368    ) -> Self {
369        self.data_object = std::option::Option::Some(
370            crate::model::discover_connection_profile_request::DataObject::MysqlRdbms(v.into()),
371        );
372        self
373    }
374
375    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
376    /// if it holds a `PostgresqlRdbms`, `None` if the field is not set or
377    /// holds a different branch.
378    pub fn postgresql_rdbms(
379        &self,
380    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
381        #[allow(unreachable_patterns)]
382        self.data_object.as_ref().and_then(|v| match v {
383            crate::model::discover_connection_profile_request::DataObject::PostgresqlRdbms(v) => {
384                std::option::Option::Some(v)
385            }
386            _ => std::option::Option::None,
387        })
388    }
389
390    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
391    /// to hold a `PostgresqlRdbms`.
392    ///
393    /// Note that all the setters affecting `data_object` are
394    /// mutually exclusive.
395    ///
396    /// # Example
397    /// ```ignore,no_run
398    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
399    /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
400    /// let x = DiscoverConnectionProfileRequest::new().set_postgresql_rdbms(PostgresqlRdbms::default()/* use setters */);
401    /// assert!(x.postgresql_rdbms().is_some());
402    /// assert!(x.oracle_rdbms().is_none());
403    /// assert!(x.mysql_rdbms().is_none());
404    /// assert!(x.sql_server_rdbms().is_none());
405    /// assert!(x.salesforce_org().is_none());
406    /// assert!(x.mongodb_cluster().is_none());
407    /// ```
408    pub fn set_postgresql_rdbms<
409        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
410    >(
411        mut self,
412        v: T,
413    ) -> Self {
414        self.data_object = std::option::Option::Some(
415            crate::model::discover_connection_profile_request::DataObject::PostgresqlRdbms(
416                v.into(),
417            ),
418        );
419        self
420    }
421
422    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
423    /// if it holds a `SqlServerRdbms`, `None` if the field is not set or
424    /// holds a different branch.
425    pub fn sql_server_rdbms(
426        &self,
427    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
428        #[allow(unreachable_patterns)]
429        self.data_object.as_ref().and_then(|v| match v {
430            crate::model::discover_connection_profile_request::DataObject::SqlServerRdbms(v) => {
431                std::option::Option::Some(v)
432            }
433            _ => std::option::Option::None,
434        })
435    }
436
437    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
438    /// to hold a `SqlServerRdbms`.
439    ///
440    /// Note that all the setters affecting `data_object` are
441    /// mutually exclusive.
442    ///
443    /// # Example
444    /// ```ignore,no_run
445    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
446    /// use google_cloud_datastream_v1::model::SqlServerRdbms;
447    /// let x = DiscoverConnectionProfileRequest::new().set_sql_server_rdbms(SqlServerRdbms::default()/* use setters */);
448    /// assert!(x.sql_server_rdbms().is_some());
449    /// assert!(x.oracle_rdbms().is_none());
450    /// assert!(x.mysql_rdbms().is_none());
451    /// assert!(x.postgresql_rdbms().is_none());
452    /// assert!(x.salesforce_org().is_none());
453    /// assert!(x.mongodb_cluster().is_none());
454    /// ```
455    pub fn set_sql_server_rdbms<
456        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
457    >(
458        mut self,
459        v: T,
460    ) -> Self {
461        self.data_object = std::option::Option::Some(
462            crate::model::discover_connection_profile_request::DataObject::SqlServerRdbms(v.into()),
463        );
464        self
465    }
466
467    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
468    /// if it holds a `SalesforceOrg`, `None` if the field is not set or
469    /// holds a different branch.
470    pub fn salesforce_org(
471        &self,
472    ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceOrg>> {
473        #[allow(unreachable_patterns)]
474        self.data_object.as_ref().and_then(|v| match v {
475            crate::model::discover_connection_profile_request::DataObject::SalesforceOrg(v) => {
476                std::option::Option::Some(v)
477            }
478            _ => std::option::Option::None,
479        })
480    }
481
482    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
483    /// to hold a `SalesforceOrg`.
484    ///
485    /// Note that all the setters affecting `data_object` are
486    /// mutually exclusive.
487    ///
488    /// # Example
489    /// ```ignore,no_run
490    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
491    /// use google_cloud_datastream_v1::model::SalesforceOrg;
492    /// let x = DiscoverConnectionProfileRequest::new().set_salesforce_org(SalesforceOrg::default()/* use setters */);
493    /// assert!(x.salesforce_org().is_some());
494    /// assert!(x.oracle_rdbms().is_none());
495    /// assert!(x.mysql_rdbms().is_none());
496    /// assert!(x.postgresql_rdbms().is_none());
497    /// assert!(x.sql_server_rdbms().is_none());
498    /// assert!(x.mongodb_cluster().is_none());
499    /// ```
500    pub fn set_salesforce_org<
501        T: std::convert::Into<std::boxed::Box<crate::model::SalesforceOrg>>,
502    >(
503        mut self,
504        v: T,
505    ) -> Self {
506        self.data_object = std::option::Option::Some(
507            crate::model::discover_connection_profile_request::DataObject::SalesforceOrg(v.into()),
508        );
509        self
510    }
511
512    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
513    /// if it holds a `MongodbCluster`, `None` if the field is not set or
514    /// holds a different branch.
515    pub fn mongodb_cluster(
516        &self,
517    ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbCluster>> {
518        #[allow(unreachable_patterns)]
519        self.data_object.as_ref().and_then(|v| match v {
520            crate::model::discover_connection_profile_request::DataObject::MongodbCluster(v) => {
521                std::option::Option::Some(v)
522            }
523            _ => std::option::Option::None,
524        })
525    }
526
527    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
528    /// to hold a `MongodbCluster`.
529    ///
530    /// Note that all the setters affecting `data_object` are
531    /// mutually exclusive.
532    ///
533    /// # Example
534    /// ```ignore,no_run
535    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
536    /// use google_cloud_datastream_v1::model::MongodbCluster;
537    /// let x = DiscoverConnectionProfileRequest::new().set_mongodb_cluster(MongodbCluster::default()/* use setters */);
538    /// assert!(x.mongodb_cluster().is_some());
539    /// assert!(x.oracle_rdbms().is_none());
540    /// assert!(x.mysql_rdbms().is_none());
541    /// assert!(x.postgresql_rdbms().is_none());
542    /// assert!(x.sql_server_rdbms().is_none());
543    /// assert!(x.salesforce_org().is_none());
544    /// ```
545    pub fn set_mongodb_cluster<
546        T: std::convert::Into<std::boxed::Box<crate::model::MongodbCluster>>,
547    >(
548        mut self,
549        v: T,
550    ) -> Self {
551        self.data_object = std::option::Option::Some(
552            crate::model::discover_connection_profile_request::DataObject::MongodbCluster(v.into()),
553        );
554        self
555    }
556}
557
558impl wkt::message::Message for DiscoverConnectionProfileRequest {
559    fn typename() -> &'static str {
560        "type.googleapis.com/google.cloud.datastream.v1.DiscoverConnectionProfileRequest"
561    }
562}
563
564/// Defines additional types related to [DiscoverConnectionProfileRequest].
565pub mod discover_connection_profile_request {
566    #[allow(unused_imports)]
567    use super::*;
568
569    /// The connection profile on which to run discover.
570    #[derive(Clone, Debug, PartialEq)]
571    #[non_exhaustive]
572    pub enum Target {
573        /// An ad-hoc connection profile configuration.
574        ConnectionProfile(std::boxed::Box<crate::model::ConnectionProfile>),
575        /// A reference to an existing connection profile.
576        ConnectionProfileName(std::string::String),
577    }
578
579    /// The depth of the retrieved hierarchy of data objects.
580    #[derive(Clone, Debug, PartialEq)]
581    #[non_exhaustive]
582    pub enum Hierarchy {
583        /// Whether to retrieve the full hierarchy of data objects (TRUE) or only the
584        /// current level (FALSE).
585        FullHierarchy(bool),
586        /// The number of hierarchy levels below the current level to be retrieved.
587        HierarchyDepth(i32),
588    }
589
590    /// The data object to populate with child data objects and metadata.
591    #[derive(Clone, Debug, PartialEq)]
592    #[non_exhaustive]
593    pub enum DataObject {
594        /// Oracle RDBMS to enrich with child data objects and metadata.
595        OracleRdbms(std::boxed::Box<crate::model::OracleRdbms>),
596        /// MySQL RDBMS to enrich with child data objects and metadata.
597        MysqlRdbms(std::boxed::Box<crate::model::MysqlRdbms>),
598        /// PostgreSQL RDBMS to enrich with child data objects and metadata.
599        PostgresqlRdbms(std::boxed::Box<crate::model::PostgresqlRdbms>),
600        /// SQLServer RDBMS to enrich with child data objects and metadata.
601        SqlServerRdbms(std::boxed::Box<crate::model::SqlServerRdbms>),
602        /// Salesforce organization to enrich with child data objects and metadata.
603        SalesforceOrg(std::boxed::Box<crate::model::SalesforceOrg>),
604        /// MongoDB cluster to enrich with child data objects and metadata.
605        MongodbCluster(std::boxed::Box<crate::model::MongodbCluster>),
606    }
607}
608
609/// Response from a discover request.
610#[derive(Clone, Default, PartialEq)]
611#[non_exhaustive]
612pub struct DiscoverConnectionProfileResponse {
613    /// The data object that has been enriched by the discover API call.
614    pub data_object:
615        std::option::Option<crate::model::discover_connection_profile_response::DataObject>,
616
617    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
618}
619
620impl DiscoverConnectionProfileResponse {
621    pub fn new() -> Self {
622        std::default::Default::default()
623    }
624
625    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object].
626    ///
627    /// Note that all the setters affecting `data_object` are mutually
628    /// exclusive.
629    ///
630    /// # Example
631    /// ```ignore,no_run
632    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
633    /// use google_cloud_datastream_v1::model::OracleRdbms;
634    /// let x = DiscoverConnectionProfileResponse::new().set_data_object(Some(
635    ///     google_cloud_datastream_v1::model::discover_connection_profile_response::DataObject::OracleRdbms(OracleRdbms::default().into())));
636    /// ```
637    pub fn set_data_object<
638        T: std::convert::Into<
639                std::option::Option<crate::model::discover_connection_profile_response::DataObject>,
640            >,
641    >(
642        mut self,
643        v: T,
644    ) -> Self {
645        self.data_object = v.into();
646        self
647    }
648
649    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
650    /// if it holds a `OracleRdbms`, `None` if the field is not set or
651    /// holds a different branch.
652    pub fn oracle_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
653        #[allow(unreachable_patterns)]
654        self.data_object.as_ref().and_then(|v| match v {
655            crate::model::discover_connection_profile_response::DataObject::OracleRdbms(v) => {
656                std::option::Option::Some(v)
657            }
658            _ => std::option::Option::None,
659        })
660    }
661
662    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
663    /// to hold a `OracleRdbms`.
664    ///
665    /// Note that all the setters affecting `data_object` are
666    /// mutually exclusive.
667    ///
668    /// # Example
669    /// ```ignore,no_run
670    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
671    /// use google_cloud_datastream_v1::model::OracleRdbms;
672    /// let x = DiscoverConnectionProfileResponse::new().set_oracle_rdbms(OracleRdbms::default()/* use setters */);
673    /// assert!(x.oracle_rdbms().is_some());
674    /// assert!(x.mysql_rdbms().is_none());
675    /// assert!(x.postgresql_rdbms().is_none());
676    /// assert!(x.sql_server_rdbms().is_none());
677    /// assert!(x.salesforce_org().is_none());
678    /// assert!(x.mongodb_cluster().is_none());
679    /// ```
680    pub fn set_oracle_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>>(
681        mut self,
682        v: T,
683    ) -> Self {
684        self.data_object = std::option::Option::Some(
685            crate::model::discover_connection_profile_response::DataObject::OracleRdbms(v.into()),
686        );
687        self
688    }
689
690    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
691    /// if it holds a `MysqlRdbms`, `None` if the field is not set or
692    /// holds a different branch.
693    pub fn mysql_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
694        #[allow(unreachable_patterns)]
695        self.data_object.as_ref().and_then(|v| match v {
696            crate::model::discover_connection_profile_response::DataObject::MysqlRdbms(v) => {
697                std::option::Option::Some(v)
698            }
699            _ => std::option::Option::None,
700        })
701    }
702
703    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
704    /// to hold a `MysqlRdbms`.
705    ///
706    /// Note that all the setters affecting `data_object` are
707    /// mutually exclusive.
708    ///
709    /// # Example
710    /// ```ignore,no_run
711    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
712    /// use google_cloud_datastream_v1::model::MysqlRdbms;
713    /// let x = DiscoverConnectionProfileResponse::new().set_mysql_rdbms(MysqlRdbms::default()/* use setters */);
714    /// assert!(x.mysql_rdbms().is_some());
715    /// assert!(x.oracle_rdbms().is_none());
716    /// assert!(x.postgresql_rdbms().is_none());
717    /// assert!(x.sql_server_rdbms().is_none());
718    /// assert!(x.salesforce_org().is_none());
719    /// assert!(x.mongodb_cluster().is_none());
720    /// ```
721    pub fn set_mysql_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>>(
722        mut self,
723        v: T,
724    ) -> Self {
725        self.data_object = std::option::Option::Some(
726            crate::model::discover_connection_profile_response::DataObject::MysqlRdbms(v.into()),
727        );
728        self
729    }
730
731    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
732    /// if it holds a `PostgresqlRdbms`, `None` if the field is not set or
733    /// holds a different branch.
734    pub fn postgresql_rdbms(
735        &self,
736    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
737        #[allow(unreachable_patterns)]
738        self.data_object.as_ref().and_then(|v| match v {
739            crate::model::discover_connection_profile_response::DataObject::PostgresqlRdbms(v) => {
740                std::option::Option::Some(v)
741            }
742            _ => std::option::Option::None,
743        })
744    }
745
746    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
747    /// to hold a `PostgresqlRdbms`.
748    ///
749    /// Note that all the setters affecting `data_object` are
750    /// mutually exclusive.
751    ///
752    /// # Example
753    /// ```ignore,no_run
754    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
755    /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
756    /// let x = DiscoverConnectionProfileResponse::new().set_postgresql_rdbms(PostgresqlRdbms::default()/* use setters */);
757    /// assert!(x.postgresql_rdbms().is_some());
758    /// assert!(x.oracle_rdbms().is_none());
759    /// assert!(x.mysql_rdbms().is_none());
760    /// assert!(x.sql_server_rdbms().is_none());
761    /// assert!(x.salesforce_org().is_none());
762    /// assert!(x.mongodb_cluster().is_none());
763    /// ```
764    pub fn set_postgresql_rdbms<
765        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
766    >(
767        mut self,
768        v: T,
769    ) -> Self {
770        self.data_object = std::option::Option::Some(
771            crate::model::discover_connection_profile_response::DataObject::PostgresqlRdbms(
772                v.into(),
773            ),
774        );
775        self
776    }
777
778    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
779    /// if it holds a `SqlServerRdbms`, `None` if the field is not set or
780    /// holds a different branch.
781    pub fn sql_server_rdbms(
782        &self,
783    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
784        #[allow(unreachable_patterns)]
785        self.data_object.as_ref().and_then(|v| match v {
786            crate::model::discover_connection_profile_response::DataObject::SqlServerRdbms(v) => {
787                std::option::Option::Some(v)
788            }
789            _ => std::option::Option::None,
790        })
791    }
792
793    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
794    /// to hold a `SqlServerRdbms`.
795    ///
796    /// Note that all the setters affecting `data_object` are
797    /// mutually exclusive.
798    ///
799    /// # Example
800    /// ```ignore,no_run
801    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
802    /// use google_cloud_datastream_v1::model::SqlServerRdbms;
803    /// let x = DiscoverConnectionProfileResponse::new().set_sql_server_rdbms(SqlServerRdbms::default()/* use setters */);
804    /// assert!(x.sql_server_rdbms().is_some());
805    /// assert!(x.oracle_rdbms().is_none());
806    /// assert!(x.mysql_rdbms().is_none());
807    /// assert!(x.postgresql_rdbms().is_none());
808    /// assert!(x.salesforce_org().is_none());
809    /// assert!(x.mongodb_cluster().is_none());
810    /// ```
811    pub fn set_sql_server_rdbms<
812        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
813    >(
814        mut self,
815        v: T,
816    ) -> Self {
817        self.data_object = std::option::Option::Some(
818            crate::model::discover_connection_profile_response::DataObject::SqlServerRdbms(
819                v.into(),
820            ),
821        );
822        self
823    }
824
825    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
826    /// if it holds a `SalesforceOrg`, `None` if the field is not set or
827    /// holds a different branch.
828    pub fn salesforce_org(
829        &self,
830    ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceOrg>> {
831        #[allow(unreachable_patterns)]
832        self.data_object.as_ref().and_then(|v| match v {
833            crate::model::discover_connection_profile_response::DataObject::SalesforceOrg(v) => {
834                std::option::Option::Some(v)
835            }
836            _ => std::option::Option::None,
837        })
838    }
839
840    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
841    /// to hold a `SalesforceOrg`.
842    ///
843    /// Note that all the setters affecting `data_object` are
844    /// mutually exclusive.
845    ///
846    /// # Example
847    /// ```ignore,no_run
848    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
849    /// use google_cloud_datastream_v1::model::SalesforceOrg;
850    /// let x = DiscoverConnectionProfileResponse::new().set_salesforce_org(SalesforceOrg::default()/* use setters */);
851    /// assert!(x.salesforce_org().is_some());
852    /// assert!(x.oracle_rdbms().is_none());
853    /// assert!(x.mysql_rdbms().is_none());
854    /// assert!(x.postgresql_rdbms().is_none());
855    /// assert!(x.sql_server_rdbms().is_none());
856    /// assert!(x.mongodb_cluster().is_none());
857    /// ```
858    pub fn set_salesforce_org<
859        T: std::convert::Into<std::boxed::Box<crate::model::SalesforceOrg>>,
860    >(
861        mut self,
862        v: T,
863    ) -> Self {
864        self.data_object = std::option::Option::Some(
865            crate::model::discover_connection_profile_response::DataObject::SalesforceOrg(v.into()),
866        );
867        self
868    }
869
870    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
871    /// if it holds a `MongodbCluster`, `None` if the field is not set or
872    /// holds a different branch.
873    pub fn mongodb_cluster(
874        &self,
875    ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbCluster>> {
876        #[allow(unreachable_patterns)]
877        self.data_object.as_ref().and_then(|v| match v {
878            crate::model::discover_connection_profile_response::DataObject::MongodbCluster(v) => {
879                std::option::Option::Some(v)
880            }
881            _ => std::option::Option::None,
882        })
883    }
884
885    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
886    /// to hold a `MongodbCluster`.
887    ///
888    /// Note that all the setters affecting `data_object` are
889    /// mutually exclusive.
890    ///
891    /// # Example
892    /// ```ignore,no_run
893    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
894    /// use google_cloud_datastream_v1::model::MongodbCluster;
895    /// let x = DiscoverConnectionProfileResponse::new().set_mongodb_cluster(MongodbCluster::default()/* use setters */);
896    /// assert!(x.mongodb_cluster().is_some());
897    /// assert!(x.oracle_rdbms().is_none());
898    /// assert!(x.mysql_rdbms().is_none());
899    /// assert!(x.postgresql_rdbms().is_none());
900    /// assert!(x.sql_server_rdbms().is_none());
901    /// assert!(x.salesforce_org().is_none());
902    /// ```
903    pub fn set_mongodb_cluster<
904        T: std::convert::Into<std::boxed::Box<crate::model::MongodbCluster>>,
905    >(
906        mut self,
907        v: T,
908    ) -> Self {
909        self.data_object = std::option::Option::Some(
910            crate::model::discover_connection_profile_response::DataObject::MongodbCluster(
911                v.into(),
912            ),
913        );
914        self
915    }
916}
917
918impl wkt::message::Message for DiscoverConnectionProfileResponse {
919    fn typename() -> &'static str {
920        "type.googleapis.com/google.cloud.datastream.v1.DiscoverConnectionProfileResponse"
921    }
922}
923
924/// Defines additional types related to [DiscoverConnectionProfileResponse].
925pub mod discover_connection_profile_response {
926    #[allow(unused_imports)]
927    use super::*;
928
929    /// The data object that has been enriched by the discover API call.
930    #[derive(Clone, Debug, PartialEq)]
931    #[non_exhaustive]
932    pub enum DataObject {
933        /// Enriched Oracle RDBMS object.
934        OracleRdbms(std::boxed::Box<crate::model::OracleRdbms>),
935        /// Enriched MySQL RDBMS object.
936        MysqlRdbms(std::boxed::Box<crate::model::MysqlRdbms>),
937        /// Enriched PostgreSQL RDBMS object.
938        PostgresqlRdbms(std::boxed::Box<crate::model::PostgresqlRdbms>),
939        /// Enriched SQLServer RDBMS object.
940        SqlServerRdbms(std::boxed::Box<crate::model::SqlServerRdbms>),
941        /// Enriched Salesforce organization.
942        SalesforceOrg(std::boxed::Box<crate::model::SalesforceOrg>),
943        /// Enriched MongoDB cluster.
944        MongodbCluster(std::boxed::Box<crate::model::MongodbCluster>),
945    }
946}
947
948/// Request message for 'FetchStaticIps' request.
949#[derive(Clone, Default, PartialEq)]
950#[non_exhaustive]
951pub struct FetchStaticIpsRequest {
952    /// Required. The resource name for the location for which static IPs should be
953    /// returned. Must be in the format `projects/*/locations/*`.
954    pub name: std::string::String,
955
956    /// Maximum number of Ips to return, will likely not be specified.
957    pub page_size: i32,
958
959    /// A page token, received from a previous `ListStaticIps` call.
960    /// will likely not be specified.
961    pub page_token: std::string::String,
962
963    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
964}
965
966impl FetchStaticIpsRequest {
967    pub fn new() -> Self {
968        std::default::Default::default()
969    }
970
971    /// Sets the value of [name][crate::model::FetchStaticIpsRequest::name].
972    ///
973    /// # Example
974    /// ```ignore,no_run
975    /// # use google_cloud_datastream_v1::model::FetchStaticIpsRequest;
976    /// let x = FetchStaticIpsRequest::new().set_name("example");
977    /// ```
978    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
979        self.name = v.into();
980        self
981    }
982
983    /// Sets the value of [page_size][crate::model::FetchStaticIpsRequest::page_size].
984    ///
985    /// # Example
986    /// ```ignore,no_run
987    /// # use google_cloud_datastream_v1::model::FetchStaticIpsRequest;
988    /// let x = FetchStaticIpsRequest::new().set_page_size(42);
989    /// ```
990    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
991        self.page_size = v.into();
992        self
993    }
994
995    /// Sets the value of [page_token][crate::model::FetchStaticIpsRequest::page_token].
996    ///
997    /// # Example
998    /// ```ignore,no_run
999    /// # use google_cloud_datastream_v1::model::FetchStaticIpsRequest;
1000    /// let x = FetchStaticIpsRequest::new().set_page_token("example");
1001    /// ```
1002    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1003        self.page_token = v.into();
1004        self
1005    }
1006}
1007
1008impl wkt::message::Message for FetchStaticIpsRequest {
1009    fn typename() -> &'static str {
1010        "type.googleapis.com/google.cloud.datastream.v1.FetchStaticIpsRequest"
1011    }
1012}
1013
1014/// Response message for a 'FetchStaticIps' response.
1015#[derive(Clone, Default, PartialEq)]
1016#[non_exhaustive]
1017pub struct FetchStaticIpsResponse {
1018    /// list of static ips by account
1019    pub static_ips: std::vec::Vec<std::string::String>,
1020
1021    /// A token that can be sent as `page_token` to retrieve the next page.
1022    /// If this field is omitted, there are no subsequent pages.
1023    pub next_page_token: std::string::String,
1024
1025    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1026}
1027
1028impl FetchStaticIpsResponse {
1029    pub fn new() -> Self {
1030        std::default::Default::default()
1031    }
1032
1033    /// Sets the value of [static_ips][crate::model::FetchStaticIpsResponse::static_ips].
1034    ///
1035    /// # Example
1036    /// ```ignore,no_run
1037    /// # use google_cloud_datastream_v1::model::FetchStaticIpsResponse;
1038    /// let x = FetchStaticIpsResponse::new().set_static_ips(["a", "b", "c"]);
1039    /// ```
1040    pub fn set_static_ips<T, V>(mut self, v: T) -> Self
1041    where
1042        T: std::iter::IntoIterator<Item = V>,
1043        V: std::convert::Into<std::string::String>,
1044    {
1045        use std::iter::Iterator;
1046        self.static_ips = v.into_iter().map(|i| i.into()).collect();
1047        self
1048    }
1049
1050    /// Sets the value of [next_page_token][crate::model::FetchStaticIpsResponse::next_page_token].
1051    ///
1052    /// # Example
1053    /// ```ignore,no_run
1054    /// # use google_cloud_datastream_v1::model::FetchStaticIpsResponse;
1055    /// let x = FetchStaticIpsResponse::new().set_next_page_token("example");
1056    /// ```
1057    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1058        self.next_page_token = v.into();
1059        self
1060    }
1061}
1062
1063impl wkt::message::Message for FetchStaticIpsResponse {
1064    fn typename() -> &'static str {
1065        "type.googleapis.com/google.cloud.datastream.v1.FetchStaticIpsResponse"
1066    }
1067}
1068
1069/// Request message for listing connection profiles.
1070#[derive(Clone, Default, PartialEq)]
1071#[non_exhaustive]
1072pub struct ListConnectionProfilesRequest {
1073    /// Required. The parent that owns the collection of connection profiles.
1074    pub parent: std::string::String,
1075
1076    /// Maximum number of connection profiles to return.
1077    /// If unspecified, at most 50 connection profiles will be returned.
1078    /// The maximum value is 1000; values above 1000 will be coerced to 1000.
1079    pub page_size: i32,
1080
1081    /// Page token received from a previous `ListConnectionProfiles` call.
1082    /// Provide this to retrieve the subsequent page.
1083    ///
1084    /// When paginating, all other parameters provided to `ListConnectionProfiles`
1085    /// must match the call that provided the page token.
1086    pub page_token: std::string::String,
1087
1088    /// Filter request.
1089    pub filter: std::string::String,
1090
1091    /// Order by fields for the result.
1092    pub order_by: std::string::String,
1093
1094    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1095}
1096
1097impl ListConnectionProfilesRequest {
1098    pub fn new() -> Self {
1099        std::default::Default::default()
1100    }
1101
1102    /// Sets the value of [parent][crate::model::ListConnectionProfilesRequest::parent].
1103    ///
1104    /// # Example
1105    /// ```ignore,no_run
1106    /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1107    /// let x = ListConnectionProfilesRequest::new().set_parent("example");
1108    /// ```
1109    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1110        self.parent = v.into();
1111        self
1112    }
1113
1114    /// Sets the value of [page_size][crate::model::ListConnectionProfilesRequest::page_size].
1115    ///
1116    /// # Example
1117    /// ```ignore,no_run
1118    /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1119    /// let x = ListConnectionProfilesRequest::new().set_page_size(42);
1120    /// ```
1121    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1122        self.page_size = v.into();
1123        self
1124    }
1125
1126    /// Sets the value of [page_token][crate::model::ListConnectionProfilesRequest::page_token].
1127    ///
1128    /// # Example
1129    /// ```ignore,no_run
1130    /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1131    /// let x = ListConnectionProfilesRequest::new().set_page_token("example");
1132    /// ```
1133    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1134        self.page_token = v.into();
1135        self
1136    }
1137
1138    /// Sets the value of [filter][crate::model::ListConnectionProfilesRequest::filter].
1139    ///
1140    /// # Example
1141    /// ```ignore,no_run
1142    /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1143    /// let x = ListConnectionProfilesRequest::new().set_filter("example");
1144    /// ```
1145    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1146        self.filter = v.into();
1147        self
1148    }
1149
1150    /// Sets the value of [order_by][crate::model::ListConnectionProfilesRequest::order_by].
1151    ///
1152    /// # Example
1153    /// ```ignore,no_run
1154    /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1155    /// let x = ListConnectionProfilesRequest::new().set_order_by("example");
1156    /// ```
1157    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1158        self.order_by = v.into();
1159        self
1160    }
1161}
1162
1163impl wkt::message::Message for ListConnectionProfilesRequest {
1164    fn typename() -> &'static str {
1165        "type.googleapis.com/google.cloud.datastream.v1.ListConnectionProfilesRequest"
1166    }
1167}
1168
1169/// Response message for listing connection profiles.
1170#[derive(Clone, Default, PartialEq)]
1171#[non_exhaustive]
1172pub struct ListConnectionProfilesResponse {
1173    /// List of connection profiles.
1174    pub connection_profiles: std::vec::Vec<crate::model::ConnectionProfile>,
1175
1176    /// A token, which can be sent as `page_token` to retrieve the next page.
1177    /// If this field is omitted, there are no subsequent pages.
1178    pub next_page_token: std::string::String,
1179
1180    /// Locations that could not be reached.
1181    pub unreachable: std::vec::Vec<std::string::String>,
1182
1183    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1184}
1185
1186impl ListConnectionProfilesResponse {
1187    pub fn new() -> Self {
1188        std::default::Default::default()
1189    }
1190
1191    /// Sets the value of [connection_profiles][crate::model::ListConnectionProfilesResponse::connection_profiles].
1192    ///
1193    /// # Example
1194    /// ```ignore,no_run
1195    /// # use google_cloud_datastream_v1::model::ListConnectionProfilesResponse;
1196    /// use google_cloud_datastream_v1::model::ConnectionProfile;
1197    /// let x = ListConnectionProfilesResponse::new()
1198    ///     .set_connection_profiles([
1199    ///         ConnectionProfile::default()/* use setters */,
1200    ///         ConnectionProfile::default()/* use (different) setters */,
1201    ///     ]);
1202    /// ```
1203    pub fn set_connection_profiles<T, V>(mut self, v: T) -> Self
1204    where
1205        T: std::iter::IntoIterator<Item = V>,
1206        V: std::convert::Into<crate::model::ConnectionProfile>,
1207    {
1208        use std::iter::Iterator;
1209        self.connection_profiles = v.into_iter().map(|i| i.into()).collect();
1210        self
1211    }
1212
1213    /// Sets the value of [next_page_token][crate::model::ListConnectionProfilesResponse::next_page_token].
1214    ///
1215    /// # Example
1216    /// ```ignore,no_run
1217    /// # use google_cloud_datastream_v1::model::ListConnectionProfilesResponse;
1218    /// let x = ListConnectionProfilesResponse::new().set_next_page_token("example");
1219    /// ```
1220    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1221        self.next_page_token = v.into();
1222        self
1223    }
1224
1225    /// Sets the value of [unreachable][crate::model::ListConnectionProfilesResponse::unreachable].
1226    ///
1227    /// # Example
1228    /// ```ignore,no_run
1229    /// # use google_cloud_datastream_v1::model::ListConnectionProfilesResponse;
1230    /// let x = ListConnectionProfilesResponse::new().set_unreachable(["a", "b", "c"]);
1231    /// ```
1232    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1233    where
1234        T: std::iter::IntoIterator<Item = V>,
1235        V: std::convert::Into<std::string::String>,
1236    {
1237        use std::iter::Iterator;
1238        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1239        self
1240    }
1241}
1242
1243impl wkt::message::Message for ListConnectionProfilesResponse {
1244    fn typename() -> &'static str {
1245        "type.googleapis.com/google.cloud.datastream.v1.ListConnectionProfilesResponse"
1246    }
1247}
1248
1249#[doc(hidden)]
1250impl google_cloud_gax::paginator::internal::PageableResponse for ListConnectionProfilesResponse {
1251    type PageItem = crate::model::ConnectionProfile;
1252
1253    fn items(self) -> std::vec::Vec<Self::PageItem> {
1254        self.connection_profiles
1255    }
1256
1257    fn next_page_token(&self) -> std::string::String {
1258        use std::clone::Clone;
1259        self.next_page_token.clone()
1260    }
1261}
1262
1263/// Request message for getting a connection profile.
1264#[derive(Clone, Default, PartialEq)]
1265#[non_exhaustive]
1266pub struct GetConnectionProfileRequest {
1267    /// Required. The name of the connection profile resource to get.
1268    pub name: std::string::String,
1269
1270    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1271}
1272
1273impl GetConnectionProfileRequest {
1274    pub fn new() -> Self {
1275        std::default::Default::default()
1276    }
1277
1278    /// Sets the value of [name][crate::model::GetConnectionProfileRequest::name].
1279    ///
1280    /// # Example
1281    /// ```ignore,no_run
1282    /// # use google_cloud_datastream_v1::model::GetConnectionProfileRequest;
1283    /// let x = GetConnectionProfileRequest::new().set_name("example");
1284    /// ```
1285    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1286        self.name = v.into();
1287        self
1288    }
1289}
1290
1291impl wkt::message::Message for GetConnectionProfileRequest {
1292    fn typename() -> &'static str {
1293        "type.googleapis.com/google.cloud.datastream.v1.GetConnectionProfileRequest"
1294    }
1295}
1296
1297/// Request message for creating a connection profile.
1298#[derive(Clone, Default, PartialEq)]
1299#[non_exhaustive]
1300pub struct CreateConnectionProfileRequest {
1301    /// Required. The parent that owns the collection of ConnectionProfiles.
1302    pub parent: std::string::String,
1303
1304    /// Required. The connection profile identifier.
1305    pub connection_profile_id: std::string::String,
1306
1307    /// Required. The connection profile resource to create.
1308    pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
1309
1310    /// Optional. A request ID to identify requests. Specify a unique request ID
1311    /// so that if you must retry your request, the server will know to ignore
1312    /// the request if it has already been completed. The server will guarantee
1313    /// that for at least 60 minutes since the first request.
1314    ///
1315    /// For example, consider a situation where you make an initial request and the
1316    /// request times out. If you make the request again with the same request ID,
1317    /// the server can check if original operation with the same request ID was
1318    /// received, and if so, will ignore the second request. This prevents clients
1319    /// from accidentally creating duplicate commitments.
1320    ///
1321    /// The request ID must be a valid UUID with the exception that zero UUID is
1322    /// not supported (00000000-0000-0000-0000-000000000000).
1323    pub request_id: std::string::String,
1324
1325    /// Optional. Only validate the connection profile, but don't create any
1326    /// resources. The default is false.
1327    pub validate_only: bool,
1328
1329    /// Optional. Create the connection profile without validating it.
1330    pub force: bool,
1331
1332    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1333}
1334
1335impl CreateConnectionProfileRequest {
1336    pub fn new() -> Self {
1337        std::default::Default::default()
1338    }
1339
1340    /// Sets the value of [parent][crate::model::CreateConnectionProfileRequest::parent].
1341    ///
1342    /// # Example
1343    /// ```ignore,no_run
1344    /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1345    /// let x = CreateConnectionProfileRequest::new().set_parent("example");
1346    /// ```
1347    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1348        self.parent = v.into();
1349        self
1350    }
1351
1352    /// Sets the value of [connection_profile_id][crate::model::CreateConnectionProfileRequest::connection_profile_id].
1353    ///
1354    /// # Example
1355    /// ```ignore,no_run
1356    /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1357    /// let x = CreateConnectionProfileRequest::new().set_connection_profile_id("example");
1358    /// ```
1359    pub fn set_connection_profile_id<T: std::convert::Into<std::string::String>>(
1360        mut self,
1361        v: T,
1362    ) -> Self {
1363        self.connection_profile_id = v.into();
1364        self
1365    }
1366
1367    /// Sets the value of [connection_profile][crate::model::CreateConnectionProfileRequest::connection_profile].
1368    ///
1369    /// # Example
1370    /// ```ignore,no_run
1371    /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1372    /// use google_cloud_datastream_v1::model::ConnectionProfile;
1373    /// let x = CreateConnectionProfileRequest::new().set_connection_profile(ConnectionProfile::default()/* use setters */);
1374    /// ```
1375    pub fn set_connection_profile<T>(mut self, v: T) -> Self
1376    where
1377        T: std::convert::Into<crate::model::ConnectionProfile>,
1378    {
1379        self.connection_profile = std::option::Option::Some(v.into());
1380        self
1381    }
1382
1383    /// Sets or clears the value of [connection_profile][crate::model::CreateConnectionProfileRequest::connection_profile].
1384    ///
1385    /// # Example
1386    /// ```ignore,no_run
1387    /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1388    /// use google_cloud_datastream_v1::model::ConnectionProfile;
1389    /// let x = CreateConnectionProfileRequest::new().set_or_clear_connection_profile(Some(ConnectionProfile::default()/* use setters */));
1390    /// let x = CreateConnectionProfileRequest::new().set_or_clear_connection_profile(None::<ConnectionProfile>);
1391    /// ```
1392    pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
1393    where
1394        T: std::convert::Into<crate::model::ConnectionProfile>,
1395    {
1396        self.connection_profile = v.map(|x| x.into());
1397        self
1398    }
1399
1400    /// Sets the value of [request_id][crate::model::CreateConnectionProfileRequest::request_id].
1401    ///
1402    /// # Example
1403    /// ```ignore,no_run
1404    /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1405    /// let x = CreateConnectionProfileRequest::new().set_request_id("example");
1406    /// ```
1407    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1408        self.request_id = v.into();
1409        self
1410    }
1411
1412    /// Sets the value of [validate_only][crate::model::CreateConnectionProfileRequest::validate_only].
1413    ///
1414    /// # Example
1415    /// ```ignore,no_run
1416    /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1417    /// let x = CreateConnectionProfileRequest::new().set_validate_only(true);
1418    /// ```
1419    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1420        self.validate_only = v.into();
1421        self
1422    }
1423
1424    /// Sets the value of [force][crate::model::CreateConnectionProfileRequest::force].
1425    ///
1426    /// # Example
1427    /// ```ignore,no_run
1428    /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1429    /// let x = CreateConnectionProfileRequest::new().set_force(true);
1430    /// ```
1431    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1432        self.force = v.into();
1433        self
1434    }
1435}
1436
1437impl wkt::message::Message for CreateConnectionProfileRequest {
1438    fn typename() -> &'static str {
1439        "type.googleapis.com/google.cloud.datastream.v1.CreateConnectionProfileRequest"
1440    }
1441}
1442
1443/// Connection profile update message.
1444#[derive(Clone, Default, PartialEq)]
1445#[non_exhaustive]
1446pub struct UpdateConnectionProfileRequest {
1447    /// Optional. Field mask is used to specify the fields to be overwritten in the
1448    /// ConnectionProfile resource by the update.
1449    /// The fields specified in the update_mask are relative to the resource, not
1450    /// the full request. A field will be overwritten if it is in the mask. If the
1451    /// user does not provide a mask then all fields will be overwritten.
1452    pub update_mask: std::option::Option<wkt::FieldMask>,
1453
1454    /// Required. The connection profile to update.
1455    pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
1456
1457    /// Optional. A request ID to identify requests. Specify a unique request ID
1458    /// so that if you must retry your request, the server will know to ignore
1459    /// the request if it has already been completed. The server will guarantee
1460    /// that for at least 60 minutes since the first request.
1461    ///
1462    /// For example, consider a situation where you make an initial request and the
1463    /// request times out. If you make the request again with the same request ID,
1464    /// the server can check if original operation with the same request ID was
1465    /// received, and if so, will ignore the second request. This prevents clients
1466    /// from accidentally creating duplicate commitments.
1467    ///
1468    /// The request ID must be a valid UUID with the exception that zero UUID is
1469    /// not supported (00000000-0000-0000-0000-000000000000).
1470    pub request_id: std::string::String,
1471
1472    /// Optional. Only validate the connection profile, but don't update any
1473    /// resources. The default is false.
1474    pub validate_only: bool,
1475
1476    /// Optional. Update the connection profile without validating it.
1477    pub force: bool,
1478
1479    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1480}
1481
1482impl UpdateConnectionProfileRequest {
1483    pub fn new() -> Self {
1484        std::default::Default::default()
1485    }
1486
1487    /// Sets the value of [update_mask][crate::model::UpdateConnectionProfileRequest::update_mask].
1488    ///
1489    /// # Example
1490    /// ```ignore,no_run
1491    /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1492    /// use wkt::FieldMask;
1493    /// let x = UpdateConnectionProfileRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1494    /// ```
1495    pub fn set_update_mask<T>(mut self, v: T) -> Self
1496    where
1497        T: std::convert::Into<wkt::FieldMask>,
1498    {
1499        self.update_mask = std::option::Option::Some(v.into());
1500        self
1501    }
1502
1503    /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionProfileRequest::update_mask].
1504    ///
1505    /// # Example
1506    /// ```ignore,no_run
1507    /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1508    /// use wkt::FieldMask;
1509    /// let x = UpdateConnectionProfileRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1510    /// let x = UpdateConnectionProfileRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1511    /// ```
1512    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1513    where
1514        T: std::convert::Into<wkt::FieldMask>,
1515    {
1516        self.update_mask = v.map(|x| x.into());
1517        self
1518    }
1519
1520    /// Sets the value of [connection_profile][crate::model::UpdateConnectionProfileRequest::connection_profile].
1521    ///
1522    /// # Example
1523    /// ```ignore,no_run
1524    /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1525    /// use google_cloud_datastream_v1::model::ConnectionProfile;
1526    /// let x = UpdateConnectionProfileRequest::new().set_connection_profile(ConnectionProfile::default()/* use setters */);
1527    /// ```
1528    pub fn set_connection_profile<T>(mut self, v: T) -> Self
1529    where
1530        T: std::convert::Into<crate::model::ConnectionProfile>,
1531    {
1532        self.connection_profile = std::option::Option::Some(v.into());
1533        self
1534    }
1535
1536    /// Sets or clears the value of [connection_profile][crate::model::UpdateConnectionProfileRequest::connection_profile].
1537    ///
1538    /// # Example
1539    /// ```ignore,no_run
1540    /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1541    /// use google_cloud_datastream_v1::model::ConnectionProfile;
1542    /// let x = UpdateConnectionProfileRequest::new().set_or_clear_connection_profile(Some(ConnectionProfile::default()/* use setters */));
1543    /// let x = UpdateConnectionProfileRequest::new().set_or_clear_connection_profile(None::<ConnectionProfile>);
1544    /// ```
1545    pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
1546    where
1547        T: std::convert::Into<crate::model::ConnectionProfile>,
1548    {
1549        self.connection_profile = v.map(|x| x.into());
1550        self
1551    }
1552
1553    /// Sets the value of [request_id][crate::model::UpdateConnectionProfileRequest::request_id].
1554    ///
1555    /// # Example
1556    /// ```ignore,no_run
1557    /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1558    /// let x = UpdateConnectionProfileRequest::new().set_request_id("example");
1559    /// ```
1560    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1561        self.request_id = v.into();
1562        self
1563    }
1564
1565    /// Sets the value of [validate_only][crate::model::UpdateConnectionProfileRequest::validate_only].
1566    ///
1567    /// # Example
1568    /// ```ignore,no_run
1569    /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1570    /// let x = UpdateConnectionProfileRequest::new().set_validate_only(true);
1571    /// ```
1572    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1573        self.validate_only = v.into();
1574        self
1575    }
1576
1577    /// Sets the value of [force][crate::model::UpdateConnectionProfileRequest::force].
1578    ///
1579    /// # Example
1580    /// ```ignore,no_run
1581    /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1582    /// let x = UpdateConnectionProfileRequest::new().set_force(true);
1583    /// ```
1584    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1585        self.force = v.into();
1586        self
1587    }
1588}
1589
1590impl wkt::message::Message for UpdateConnectionProfileRequest {
1591    fn typename() -> &'static str {
1592        "type.googleapis.com/google.cloud.datastream.v1.UpdateConnectionProfileRequest"
1593    }
1594}
1595
1596/// Request message for deleting a connection profile.
1597#[derive(Clone, Default, PartialEq)]
1598#[non_exhaustive]
1599pub struct DeleteConnectionProfileRequest {
1600    /// Required. The name of the connection profile resource to delete.
1601    pub name: std::string::String,
1602
1603    /// Optional. A request ID to identify requests. Specify a unique request ID
1604    /// so that if you must retry your request, the server will know to ignore
1605    /// the request if it has already been completed. The server will guarantee
1606    /// that for at least 60 minutes after the first request.
1607    ///
1608    /// For example, consider a situation where you make an initial request and the
1609    /// request times out. If you make the request again with the same request ID,
1610    /// the server can check if original operation with the same request ID was
1611    /// received, and if so, will ignore the second request. This prevents clients
1612    /// from accidentally creating duplicate commitments.
1613    ///
1614    /// The request ID must be a valid UUID with the exception that zero UUID is
1615    /// not supported (00000000-0000-0000-0000-000000000000).
1616    pub request_id: std::string::String,
1617
1618    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1619}
1620
1621impl DeleteConnectionProfileRequest {
1622    pub fn new() -> Self {
1623        std::default::Default::default()
1624    }
1625
1626    /// Sets the value of [name][crate::model::DeleteConnectionProfileRequest::name].
1627    ///
1628    /// # Example
1629    /// ```ignore,no_run
1630    /// # use google_cloud_datastream_v1::model::DeleteConnectionProfileRequest;
1631    /// let x = DeleteConnectionProfileRequest::new().set_name("example");
1632    /// ```
1633    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1634        self.name = v.into();
1635        self
1636    }
1637
1638    /// Sets the value of [request_id][crate::model::DeleteConnectionProfileRequest::request_id].
1639    ///
1640    /// # Example
1641    /// ```ignore,no_run
1642    /// # use google_cloud_datastream_v1::model::DeleteConnectionProfileRequest;
1643    /// let x = DeleteConnectionProfileRequest::new().set_request_id("example");
1644    /// ```
1645    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1646        self.request_id = v.into();
1647        self
1648    }
1649}
1650
1651impl wkt::message::Message for DeleteConnectionProfileRequest {
1652    fn typename() -> &'static str {
1653        "type.googleapis.com/google.cloud.datastream.v1.DeleteConnectionProfileRequest"
1654    }
1655}
1656
1657/// Request message for listing streams.
1658#[derive(Clone, Default, PartialEq)]
1659#[non_exhaustive]
1660pub struct ListStreamsRequest {
1661    /// Required. The parent that owns the collection of streams.
1662    pub parent: std::string::String,
1663
1664    /// Maximum number of streams to return.
1665    /// If unspecified, at most 50 streams will  be returned. The maximum
1666    /// value is 1000; values above 1000 will be coerced to 1000.
1667    pub page_size: i32,
1668
1669    /// Page token received from a previous `ListStreams` call.
1670    /// Provide this to retrieve the subsequent page.
1671    ///
1672    /// When paginating, all other parameters provided to `ListStreams`
1673    /// must match the call that provided the page token.
1674    pub page_token: std::string::String,
1675
1676    /// Filter request.
1677    pub filter: std::string::String,
1678
1679    /// Order by fields for the result.
1680    pub order_by: std::string::String,
1681
1682    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1683}
1684
1685impl ListStreamsRequest {
1686    pub fn new() -> Self {
1687        std::default::Default::default()
1688    }
1689
1690    /// Sets the value of [parent][crate::model::ListStreamsRequest::parent].
1691    ///
1692    /// # Example
1693    /// ```ignore,no_run
1694    /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1695    /// let x = ListStreamsRequest::new().set_parent("example");
1696    /// ```
1697    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1698        self.parent = v.into();
1699        self
1700    }
1701
1702    /// Sets the value of [page_size][crate::model::ListStreamsRequest::page_size].
1703    ///
1704    /// # Example
1705    /// ```ignore,no_run
1706    /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1707    /// let x = ListStreamsRequest::new().set_page_size(42);
1708    /// ```
1709    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1710        self.page_size = v.into();
1711        self
1712    }
1713
1714    /// Sets the value of [page_token][crate::model::ListStreamsRequest::page_token].
1715    ///
1716    /// # Example
1717    /// ```ignore,no_run
1718    /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1719    /// let x = ListStreamsRequest::new().set_page_token("example");
1720    /// ```
1721    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1722        self.page_token = v.into();
1723        self
1724    }
1725
1726    /// Sets the value of [filter][crate::model::ListStreamsRequest::filter].
1727    ///
1728    /// # Example
1729    /// ```ignore,no_run
1730    /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1731    /// let x = ListStreamsRequest::new().set_filter("example");
1732    /// ```
1733    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1734        self.filter = v.into();
1735        self
1736    }
1737
1738    /// Sets the value of [order_by][crate::model::ListStreamsRequest::order_by].
1739    ///
1740    /// # Example
1741    /// ```ignore,no_run
1742    /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1743    /// let x = ListStreamsRequest::new().set_order_by("example");
1744    /// ```
1745    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1746        self.order_by = v.into();
1747        self
1748    }
1749}
1750
1751impl wkt::message::Message for ListStreamsRequest {
1752    fn typename() -> &'static str {
1753        "type.googleapis.com/google.cloud.datastream.v1.ListStreamsRequest"
1754    }
1755}
1756
1757/// Response message for listing streams.
1758#[derive(Clone, Default, PartialEq)]
1759#[non_exhaustive]
1760pub struct ListStreamsResponse {
1761    /// List of streams
1762    pub streams: std::vec::Vec<crate::model::Stream>,
1763
1764    /// A token, which can be sent as `page_token` to retrieve the next page.
1765    /// If this field is omitted, there are no subsequent pages.
1766    pub next_page_token: std::string::String,
1767
1768    /// Locations that could not be reached.
1769    pub unreachable: std::vec::Vec<std::string::String>,
1770
1771    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1772}
1773
1774impl ListStreamsResponse {
1775    pub fn new() -> Self {
1776        std::default::Default::default()
1777    }
1778
1779    /// Sets the value of [streams][crate::model::ListStreamsResponse::streams].
1780    ///
1781    /// # Example
1782    /// ```ignore,no_run
1783    /// # use google_cloud_datastream_v1::model::ListStreamsResponse;
1784    /// use google_cloud_datastream_v1::model::Stream;
1785    /// let x = ListStreamsResponse::new()
1786    ///     .set_streams([
1787    ///         Stream::default()/* use setters */,
1788    ///         Stream::default()/* use (different) setters */,
1789    ///     ]);
1790    /// ```
1791    pub fn set_streams<T, V>(mut self, v: T) -> Self
1792    where
1793        T: std::iter::IntoIterator<Item = V>,
1794        V: std::convert::Into<crate::model::Stream>,
1795    {
1796        use std::iter::Iterator;
1797        self.streams = v.into_iter().map(|i| i.into()).collect();
1798        self
1799    }
1800
1801    /// Sets the value of [next_page_token][crate::model::ListStreamsResponse::next_page_token].
1802    ///
1803    /// # Example
1804    /// ```ignore,no_run
1805    /// # use google_cloud_datastream_v1::model::ListStreamsResponse;
1806    /// let x = ListStreamsResponse::new().set_next_page_token("example");
1807    /// ```
1808    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1809        self.next_page_token = v.into();
1810        self
1811    }
1812
1813    /// Sets the value of [unreachable][crate::model::ListStreamsResponse::unreachable].
1814    ///
1815    /// # Example
1816    /// ```ignore,no_run
1817    /// # use google_cloud_datastream_v1::model::ListStreamsResponse;
1818    /// let x = ListStreamsResponse::new().set_unreachable(["a", "b", "c"]);
1819    /// ```
1820    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1821    where
1822        T: std::iter::IntoIterator<Item = V>,
1823        V: std::convert::Into<std::string::String>,
1824    {
1825        use std::iter::Iterator;
1826        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1827        self
1828    }
1829}
1830
1831impl wkt::message::Message for ListStreamsResponse {
1832    fn typename() -> &'static str {
1833        "type.googleapis.com/google.cloud.datastream.v1.ListStreamsResponse"
1834    }
1835}
1836
1837#[doc(hidden)]
1838impl google_cloud_gax::paginator::internal::PageableResponse for ListStreamsResponse {
1839    type PageItem = crate::model::Stream;
1840
1841    fn items(self) -> std::vec::Vec<Self::PageItem> {
1842        self.streams
1843    }
1844
1845    fn next_page_token(&self) -> std::string::String {
1846        use std::clone::Clone;
1847        self.next_page_token.clone()
1848    }
1849}
1850
1851/// Request message for getting a stream.
1852#[derive(Clone, Default, PartialEq)]
1853#[non_exhaustive]
1854pub struct GetStreamRequest {
1855    /// Required. The name of the stream resource to get.
1856    pub name: std::string::String,
1857
1858    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1859}
1860
1861impl GetStreamRequest {
1862    pub fn new() -> Self {
1863        std::default::Default::default()
1864    }
1865
1866    /// Sets the value of [name][crate::model::GetStreamRequest::name].
1867    ///
1868    /// # Example
1869    /// ```ignore,no_run
1870    /// # use google_cloud_datastream_v1::model::GetStreamRequest;
1871    /// let x = GetStreamRequest::new().set_name("example");
1872    /// ```
1873    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1874        self.name = v.into();
1875        self
1876    }
1877}
1878
1879impl wkt::message::Message for GetStreamRequest {
1880    fn typename() -> &'static str {
1881        "type.googleapis.com/google.cloud.datastream.v1.GetStreamRequest"
1882    }
1883}
1884
1885/// Request message for creating a stream.
1886#[derive(Clone, Default, PartialEq)]
1887#[non_exhaustive]
1888pub struct CreateStreamRequest {
1889    /// Required. The parent that owns the collection of streams.
1890    pub parent: std::string::String,
1891
1892    /// Required. The stream identifier.
1893    pub stream_id: std::string::String,
1894
1895    /// Required. The stream resource to create.
1896    pub stream: std::option::Option<crate::model::Stream>,
1897
1898    /// Optional. A request ID to identify requests. Specify a unique request ID
1899    /// so that if you must retry your request, the server will know to ignore
1900    /// the request if it has already been completed. The server will guarantee
1901    /// that for at least 60 minutes since the first request.
1902    ///
1903    /// For example, consider a situation where you make an initial request and the
1904    /// request times out. If you make the request again with the same request ID,
1905    /// the server can check if original operation with the same request ID was
1906    /// received, and if so, will ignore the second request. This prevents clients
1907    /// from accidentally creating duplicate commitments.
1908    ///
1909    /// The request ID must be a valid UUID with the exception that zero UUID is
1910    /// not supported (00000000-0000-0000-0000-000000000000).
1911    pub request_id: std::string::String,
1912
1913    /// Optional. Only validate the stream, but don't create any resources.
1914    /// The default is false.
1915    pub validate_only: bool,
1916
1917    /// Optional. Create the stream without validating it.
1918    pub force: bool,
1919
1920    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1921}
1922
1923impl CreateStreamRequest {
1924    pub fn new() -> Self {
1925        std::default::Default::default()
1926    }
1927
1928    /// Sets the value of [parent][crate::model::CreateStreamRequest::parent].
1929    ///
1930    /// # Example
1931    /// ```ignore,no_run
1932    /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
1933    /// let x = CreateStreamRequest::new().set_parent("example");
1934    /// ```
1935    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1936        self.parent = v.into();
1937        self
1938    }
1939
1940    /// Sets the value of [stream_id][crate::model::CreateStreamRequest::stream_id].
1941    ///
1942    /// # Example
1943    /// ```ignore,no_run
1944    /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
1945    /// let x = CreateStreamRequest::new().set_stream_id("example");
1946    /// ```
1947    pub fn set_stream_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1948        self.stream_id = v.into();
1949        self
1950    }
1951
1952    /// Sets the value of [stream][crate::model::CreateStreamRequest::stream].
1953    ///
1954    /// # Example
1955    /// ```ignore,no_run
1956    /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
1957    /// use google_cloud_datastream_v1::model::Stream;
1958    /// let x = CreateStreamRequest::new().set_stream(Stream::default()/* use setters */);
1959    /// ```
1960    pub fn set_stream<T>(mut self, v: T) -> Self
1961    where
1962        T: std::convert::Into<crate::model::Stream>,
1963    {
1964        self.stream = std::option::Option::Some(v.into());
1965        self
1966    }
1967
1968    /// Sets or clears the value of [stream][crate::model::CreateStreamRequest::stream].
1969    ///
1970    /// # Example
1971    /// ```ignore,no_run
1972    /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
1973    /// use google_cloud_datastream_v1::model::Stream;
1974    /// let x = CreateStreamRequest::new().set_or_clear_stream(Some(Stream::default()/* use setters */));
1975    /// let x = CreateStreamRequest::new().set_or_clear_stream(None::<Stream>);
1976    /// ```
1977    pub fn set_or_clear_stream<T>(mut self, v: std::option::Option<T>) -> Self
1978    where
1979        T: std::convert::Into<crate::model::Stream>,
1980    {
1981        self.stream = v.map(|x| x.into());
1982        self
1983    }
1984
1985    /// Sets the value of [request_id][crate::model::CreateStreamRequest::request_id].
1986    ///
1987    /// # Example
1988    /// ```ignore,no_run
1989    /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
1990    /// let x = CreateStreamRequest::new().set_request_id("example");
1991    /// ```
1992    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1993        self.request_id = v.into();
1994        self
1995    }
1996
1997    /// Sets the value of [validate_only][crate::model::CreateStreamRequest::validate_only].
1998    ///
1999    /// # Example
2000    /// ```ignore,no_run
2001    /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
2002    /// let x = CreateStreamRequest::new().set_validate_only(true);
2003    /// ```
2004    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2005        self.validate_only = v.into();
2006        self
2007    }
2008
2009    /// Sets the value of [force][crate::model::CreateStreamRequest::force].
2010    ///
2011    /// # Example
2012    /// ```ignore,no_run
2013    /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
2014    /// let x = CreateStreamRequest::new().set_force(true);
2015    /// ```
2016    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2017        self.force = v.into();
2018        self
2019    }
2020}
2021
2022impl wkt::message::Message for CreateStreamRequest {
2023    fn typename() -> &'static str {
2024        "type.googleapis.com/google.cloud.datastream.v1.CreateStreamRequest"
2025    }
2026}
2027
2028/// Request message for updating a stream.
2029#[derive(Clone, Default, PartialEq)]
2030#[non_exhaustive]
2031pub struct UpdateStreamRequest {
2032    /// Optional. Field mask is used to specify the fields to be overwritten in the
2033    /// stream resource by the update.
2034    /// The fields specified in the update_mask are relative to the resource, not
2035    /// the full request. A field will be overwritten if it is in the mask. If the
2036    /// user does not provide a mask then all fields will be overwritten.
2037    pub update_mask: std::option::Option<wkt::FieldMask>,
2038
2039    /// Required. The stream resource to update.
2040    pub stream: std::option::Option<crate::model::Stream>,
2041
2042    /// Optional. A request ID to identify requests. Specify a unique request ID
2043    /// so that if you must retry your request, the server will know to ignore
2044    /// the request if it has already been completed. The server will guarantee
2045    /// that for at least 60 minutes since the first request.
2046    ///
2047    /// For example, consider a situation where you make an initial request and the
2048    /// request times out. If you make the request again with the same request ID,
2049    /// the server can check if original operation with the same request ID was
2050    /// received, and if so, will ignore the second request. This prevents clients
2051    /// from accidentally creating duplicate commitments.
2052    ///
2053    /// The request ID must be a valid UUID with the exception that zero UUID is
2054    /// not supported (00000000-0000-0000-0000-000000000000).
2055    pub request_id: std::string::String,
2056
2057    /// Optional. Only validate the stream with the changes, without actually
2058    /// updating it. The default is false.
2059    pub validate_only: bool,
2060
2061    /// Optional. Update the stream without validating it.
2062    pub force: bool,
2063
2064    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2065}
2066
2067impl UpdateStreamRequest {
2068    pub fn new() -> Self {
2069        std::default::Default::default()
2070    }
2071
2072    /// Sets the value of [update_mask][crate::model::UpdateStreamRequest::update_mask].
2073    ///
2074    /// # Example
2075    /// ```ignore,no_run
2076    /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2077    /// use wkt::FieldMask;
2078    /// let x = UpdateStreamRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2079    /// ```
2080    pub fn set_update_mask<T>(mut self, v: T) -> Self
2081    where
2082        T: std::convert::Into<wkt::FieldMask>,
2083    {
2084        self.update_mask = std::option::Option::Some(v.into());
2085        self
2086    }
2087
2088    /// Sets or clears the value of [update_mask][crate::model::UpdateStreamRequest::update_mask].
2089    ///
2090    /// # Example
2091    /// ```ignore,no_run
2092    /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2093    /// use wkt::FieldMask;
2094    /// let x = UpdateStreamRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2095    /// let x = UpdateStreamRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2096    /// ```
2097    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2098    where
2099        T: std::convert::Into<wkt::FieldMask>,
2100    {
2101        self.update_mask = v.map(|x| x.into());
2102        self
2103    }
2104
2105    /// Sets the value of [stream][crate::model::UpdateStreamRequest::stream].
2106    ///
2107    /// # Example
2108    /// ```ignore,no_run
2109    /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2110    /// use google_cloud_datastream_v1::model::Stream;
2111    /// let x = UpdateStreamRequest::new().set_stream(Stream::default()/* use setters */);
2112    /// ```
2113    pub fn set_stream<T>(mut self, v: T) -> Self
2114    where
2115        T: std::convert::Into<crate::model::Stream>,
2116    {
2117        self.stream = std::option::Option::Some(v.into());
2118        self
2119    }
2120
2121    /// Sets or clears the value of [stream][crate::model::UpdateStreamRequest::stream].
2122    ///
2123    /// # Example
2124    /// ```ignore,no_run
2125    /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2126    /// use google_cloud_datastream_v1::model::Stream;
2127    /// let x = UpdateStreamRequest::new().set_or_clear_stream(Some(Stream::default()/* use setters */));
2128    /// let x = UpdateStreamRequest::new().set_or_clear_stream(None::<Stream>);
2129    /// ```
2130    pub fn set_or_clear_stream<T>(mut self, v: std::option::Option<T>) -> Self
2131    where
2132        T: std::convert::Into<crate::model::Stream>,
2133    {
2134        self.stream = v.map(|x| x.into());
2135        self
2136    }
2137
2138    /// Sets the value of [request_id][crate::model::UpdateStreamRequest::request_id].
2139    ///
2140    /// # Example
2141    /// ```ignore,no_run
2142    /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2143    /// let x = UpdateStreamRequest::new().set_request_id("example");
2144    /// ```
2145    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2146        self.request_id = v.into();
2147        self
2148    }
2149
2150    /// Sets the value of [validate_only][crate::model::UpdateStreamRequest::validate_only].
2151    ///
2152    /// # Example
2153    /// ```ignore,no_run
2154    /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2155    /// let x = UpdateStreamRequest::new().set_validate_only(true);
2156    /// ```
2157    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2158        self.validate_only = v.into();
2159        self
2160    }
2161
2162    /// Sets the value of [force][crate::model::UpdateStreamRequest::force].
2163    ///
2164    /// # Example
2165    /// ```ignore,no_run
2166    /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2167    /// let x = UpdateStreamRequest::new().set_force(true);
2168    /// ```
2169    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2170        self.force = v.into();
2171        self
2172    }
2173}
2174
2175impl wkt::message::Message for UpdateStreamRequest {
2176    fn typename() -> &'static str {
2177        "type.googleapis.com/google.cloud.datastream.v1.UpdateStreamRequest"
2178    }
2179}
2180
2181/// Request message for deleting a stream.
2182#[derive(Clone, Default, PartialEq)]
2183#[non_exhaustive]
2184pub struct DeleteStreamRequest {
2185    /// Required. The name of the stream resource to delete.
2186    pub name: std::string::String,
2187
2188    /// Optional. A request ID to identify requests. Specify a unique request ID
2189    /// so that if you must retry your request, the server will know to ignore
2190    /// the request if it has already been completed. The server will guarantee
2191    /// that for at least 60 minutes after the first request.
2192    ///
2193    /// For example, consider a situation where you make an initial request and the
2194    /// request times out. If you make the request again with the same request ID,
2195    /// the server can check if original operation with the same request ID was
2196    /// received, and if so, will ignore the second request. This prevents clients
2197    /// from accidentally creating duplicate commitments.
2198    ///
2199    /// The request ID must be a valid UUID with the exception that zero UUID is
2200    /// not supported (00000000-0000-0000-0000-000000000000).
2201    pub request_id: std::string::String,
2202
2203    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2204}
2205
2206impl DeleteStreamRequest {
2207    pub fn new() -> Self {
2208        std::default::Default::default()
2209    }
2210
2211    /// Sets the value of [name][crate::model::DeleteStreamRequest::name].
2212    ///
2213    /// # Example
2214    /// ```ignore,no_run
2215    /// # use google_cloud_datastream_v1::model::DeleteStreamRequest;
2216    /// let x = DeleteStreamRequest::new().set_name("example");
2217    /// ```
2218    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2219        self.name = v.into();
2220        self
2221    }
2222
2223    /// Sets the value of [request_id][crate::model::DeleteStreamRequest::request_id].
2224    ///
2225    /// # Example
2226    /// ```ignore,no_run
2227    /// # use google_cloud_datastream_v1::model::DeleteStreamRequest;
2228    /// let x = DeleteStreamRequest::new().set_request_id("example");
2229    /// ```
2230    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2231        self.request_id = v.into();
2232        self
2233    }
2234}
2235
2236impl wkt::message::Message for DeleteStreamRequest {
2237    fn typename() -> &'static str {
2238        "type.googleapis.com/google.cloud.datastream.v1.DeleteStreamRequest"
2239    }
2240}
2241
2242/// Request message for running a stream.
2243#[derive(Clone, Default, PartialEq)]
2244#[non_exhaustive]
2245pub struct RunStreamRequest {
2246    /// Required. Name of the stream resource to start, in the format:
2247    /// projects/{project_id}/locations/{location}/streams/{stream_name}
2248    pub name: std::string::String,
2249
2250    /// Optional. The CDC strategy of the stream. If not set, the system's default
2251    /// value will be used.
2252    pub cdc_strategy: std::option::Option<crate::model::CdcStrategy>,
2253
2254    /// Optional. Update the stream without validating it.
2255    pub force: bool,
2256
2257    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2258}
2259
2260impl RunStreamRequest {
2261    pub fn new() -> Self {
2262        std::default::Default::default()
2263    }
2264
2265    /// Sets the value of [name][crate::model::RunStreamRequest::name].
2266    ///
2267    /// # Example
2268    /// ```ignore,no_run
2269    /// # use google_cloud_datastream_v1::model::RunStreamRequest;
2270    /// let x = RunStreamRequest::new().set_name("example");
2271    /// ```
2272    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2273        self.name = v.into();
2274        self
2275    }
2276
2277    /// Sets the value of [cdc_strategy][crate::model::RunStreamRequest::cdc_strategy].
2278    ///
2279    /// # Example
2280    /// ```ignore,no_run
2281    /// # use google_cloud_datastream_v1::model::RunStreamRequest;
2282    /// use google_cloud_datastream_v1::model::CdcStrategy;
2283    /// let x = RunStreamRequest::new().set_cdc_strategy(CdcStrategy::default()/* use setters */);
2284    /// ```
2285    pub fn set_cdc_strategy<T>(mut self, v: T) -> Self
2286    where
2287        T: std::convert::Into<crate::model::CdcStrategy>,
2288    {
2289        self.cdc_strategy = std::option::Option::Some(v.into());
2290        self
2291    }
2292
2293    /// Sets or clears the value of [cdc_strategy][crate::model::RunStreamRequest::cdc_strategy].
2294    ///
2295    /// # Example
2296    /// ```ignore,no_run
2297    /// # use google_cloud_datastream_v1::model::RunStreamRequest;
2298    /// use google_cloud_datastream_v1::model::CdcStrategy;
2299    /// let x = RunStreamRequest::new().set_or_clear_cdc_strategy(Some(CdcStrategy::default()/* use setters */));
2300    /// let x = RunStreamRequest::new().set_or_clear_cdc_strategy(None::<CdcStrategy>);
2301    /// ```
2302    pub fn set_or_clear_cdc_strategy<T>(mut self, v: std::option::Option<T>) -> Self
2303    where
2304        T: std::convert::Into<crate::model::CdcStrategy>,
2305    {
2306        self.cdc_strategy = v.map(|x| x.into());
2307        self
2308    }
2309
2310    /// Sets the value of [force][crate::model::RunStreamRequest::force].
2311    ///
2312    /// # Example
2313    /// ```ignore,no_run
2314    /// # use google_cloud_datastream_v1::model::RunStreamRequest;
2315    /// let x = RunStreamRequest::new().set_force(true);
2316    /// ```
2317    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2318        self.force = v.into();
2319        self
2320    }
2321}
2322
2323impl wkt::message::Message for RunStreamRequest {
2324    fn typename() -> &'static str {
2325        "type.googleapis.com/google.cloud.datastream.v1.RunStreamRequest"
2326    }
2327}
2328
2329/// Request for fetching a specific stream object.
2330#[derive(Clone, Default, PartialEq)]
2331#[non_exhaustive]
2332pub struct GetStreamObjectRequest {
2333    /// Required. The name of the stream object resource to get.
2334    pub name: std::string::String,
2335
2336    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2337}
2338
2339impl GetStreamObjectRequest {
2340    pub fn new() -> Self {
2341        std::default::Default::default()
2342    }
2343
2344    /// Sets the value of [name][crate::model::GetStreamObjectRequest::name].
2345    ///
2346    /// # Example
2347    /// ```ignore,no_run
2348    /// # use google_cloud_datastream_v1::model::GetStreamObjectRequest;
2349    /// let x = GetStreamObjectRequest::new().set_name("example");
2350    /// ```
2351    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2352        self.name = v.into();
2353        self
2354    }
2355}
2356
2357impl wkt::message::Message for GetStreamObjectRequest {
2358    fn typename() -> &'static str {
2359        "type.googleapis.com/google.cloud.datastream.v1.GetStreamObjectRequest"
2360    }
2361}
2362
2363/// Request for looking up a specific stream object by its source object
2364/// identifier.
2365#[derive(Clone, Default, PartialEq)]
2366#[non_exhaustive]
2367pub struct LookupStreamObjectRequest {
2368    /// Required. The parent stream that owns the collection of objects.
2369    pub parent: std::string::String,
2370
2371    /// Required. The source object identifier which maps to the stream object.
2372    pub source_object_identifier: std::option::Option<crate::model::SourceObjectIdentifier>,
2373
2374    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2375}
2376
2377impl LookupStreamObjectRequest {
2378    pub fn new() -> Self {
2379        std::default::Default::default()
2380    }
2381
2382    /// Sets the value of [parent][crate::model::LookupStreamObjectRequest::parent].
2383    ///
2384    /// # Example
2385    /// ```ignore,no_run
2386    /// # use google_cloud_datastream_v1::model::LookupStreamObjectRequest;
2387    /// let x = LookupStreamObjectRequest::new().set_parent("example");
2388    /// ```
2389    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2390        self.parent = v.into();
2391        self
2392    }
2393
2394    /// Sets the value of [source_object_identifier][crate::model::LookupStreamObjectRequest::source_object_identifier].
2395    ///
2396    /// # Example
2397    /// ```ignore,no_run
2398    /// # use google_cloud_datastream_v1::model::LookupStreamObjectRequest;
2399    /// use google_cloud_datastream_v1::model::SourceObjectIdentifier;
2400    /// let x = LookupStreamObjectRequest::new().set_source_object_identifier(SourceObjectIdentifier::default()/* use setters */);
2401    /// ```
2402    pub fn set_source_object_identifier<T>(mut self, v: T) -> Self
2403    where
2404        T: std::convert::Into<crate::model::SourceObjectIdentifier>,
2405    {
2406        self.source_object_identifier = std::option::Option::Some(v.into());
2407        self
2408    }
2409
2410    /// Sets or clears the value of [source_object_identifier][crate::model::LookupStreamObjectRequest::source_object_identifier].
2411    ///
2412    /// # Example
2413    /// ```ignore,no_run
2414    /// # use google_cloud_datastream_v1::model::LookupStreamObjectRequest;
2415    /// use google_cloud_datastream_v1::model::SourceObjectIdentifier;
2416    /// let x = LookupStreamObjectRequest::new().set_or_clear_source_object_identifier(Some(SourceObjectIdentifier::default()/* use setters */));
2417    /// let x = LookupStreamObjectRequest::new().set_or_clear_source_object_identifier(None::<SourceObjectIdentifier>);
2418    /// ```
2419    pub fn set_or_clear_source_object_identifier<T>(mut self, v: std::option::Option<T>) -> Self
2420    where
2421        T: std::convert::Into<crate::model::SourceObjectIdentifier>,
2422    {
2423        self.source_object_identifier = v.map(|x| x.into());
2424        self
2425    }
2426}
2427
2428impl wkt::message::Message for LookupStreamObjectRequest {
2429    fn typename() -> &'static str {
2430        "type.googleapis.com/google.cloud.datastream.v1.LookupStreamObjectRequest"
2431    }
2432}
2433
2434/// Request for manually initiating a backfill job for a specific stream object.
2435#[derive(Clone, Default, PartialEq)]
2436#[non_exhaustive]
2437pub struct StartBackfillJobRequest {
2438    /// Required. The name of the stream object resource to start a backfill job
2439    /// for.
2440    pub object: std::string::String,
2441
2442    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2443}
2444
2445impl StartBackfillJobRequest {
2446    pub fn new() -> Self {
2447        std::default::Default::default()
2448    }
2449
2450    /// Sets the value of [object][crate::model::StartBackfillJobRequest::object].
2451    ///
2452    /// # Example
2453    /// ```ignore,no_run
2454    /// # use google_cloud_datastream_v1::model::StartBackfillJobRequest;
2455    /// let x = StartBackfillJobRequest::new().set_object("example");
2456    /// ```
2457    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2458        self.object = v.into();
2459        self
2460    }
2461}
2462
2463impl wkt::message::Message for StartBackfillJobRequest {
2464    fn typename() -> &'static str {
2465        "type.googleapis.com/google.cloud.datastream.v1.StartBackfillJobRequest"
2466    }
2467}
2468
2469/// Response for manually initiating a backfill job for a specific stream object.
2470#[derive(Clone, Default, PartialEq)]
2471#[non_exhaustive]
2472pub struct StartBackfillJobResponse {
2473    /// The stream object resource a backfill job was started for.
2474    pub object: std::option::Option<crate::model::StreamObject>,
2475
2476    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2477}
2478
2479impl StartBackfillJobResponse {
2480    pub fn new() -> Self {
2481        std::default::Default::default()
2482    }
2483
2484    /// Sets the value of [object][crate::model::StartBackfillJobResponse::object].
2485    ///
2486    /// # Example
2487    /// ```ignore,no_run
2488    /// # use google_cloud_datastream_v1::model::StartBackfillJobResponse;
2489    /// use google_cloud_datastream_v1::model::StreamObject;
2490    /// let x = StartBackfillJobResponse::new().set_object(StreamObject::default()/* use setters */);
2491    /// ```
2492    pub fn set_object<T>(mut self, v: T) -> Self
2493    where
2494        T: std::convert::Into<crate::model::StreamObject>,
2495    {
2496        self.object = std::option::Option::Some(v.into());
2497        self
2498    }
2499
2500    /// Sets or clears the value of [object][crate::model::StartBackfillJobResponse::object].
2501    ///
2502    /// # Example
2503    /// ```ignore,no_run
2504    /// # use google_cloud_datastream_v1::model::StartBackfillJobResponse;
2505    /// use google_cloud_datastream_v1::model::StreamObject;
2506    /// let x = StartBackfillJobResponse::new().set_or_clear_object(Some(StreamObject::default()/* use setters */));
2507    /// let x = StartBackfillJobResponse::new().set_or_clear_object(None::<StreamObject>);
2508    /// ```
2509    pub fn set_or_clear_object<T>(mut self, v: std::option::Option<T>) -> Self
2510    where
2511        T: std::convert::Into<crate::model::StreamObject>,
2512    {
2513        self.object = v.map(|x| x.into());
2514        self
2515    }
2516}
2517
2518impl wkt::message::Message for StartBackfillJobResponse {
2519    fn typename() -> &'static str {
2520        "type.googleapis.com/google.cloud.datastream.v1.StartBackfillJobResponse"
2521    }
2522}
2523
2524/// Request for manually stopping a running backfill job for a specific stream
2525/// object.
2526#[derive(Clone, Default, PartialEq)]
2527#[non_exhaustive]
2528pub struct StopBackfillJobRequest {
2529    /// Required. The name of the stream object resource to stop the backfill job
2530    /// for.
2531    pub object: std::string::String,
2532
2533    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2534}
2535
2536impl StopBackfillJobRequest {
2537    pub fn new() -> Self {
2538        std::default::Default::default()
2539    }
2540
2541    /// Sets the value of [object][crate::model::StopBackfillJobRequest::object].
2542    ///
2543    /// # Example
2544    /// ```ignore,no_run
2545    /// # use google_cloud_datastream_v1::model::StopBackfillJobRequest;
2546    /// let x = StopBackfillJobRequest::new().set_object("example");
2547    /// ```
2548    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2549        self.object = v.into();
2550        self
2551    }
2552}
2553
2554impl wkt::message::Message for StopBackfillJobRequest {
2555    fn typename() -> &'static str {
2556        "type.googleapis.com/google.cloud.datastream.v1.StopBackfillJobRequest"
2557    }
2558}
2559
2560/// Response for manually stop a backfill job for a specific stream object.
2561#[derive(Clone, Default, PartialEq)]
2562#[non_exhaustive]
2563pub struct StopBackfillJobResponse {
2564    /// The stream object resource the backfill job was stopped for.
2565    pub object: std::option::Option<crate::model::StreamObject>,
2566
2567    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2568}
2569
2570impl StopBackfillJobResponse {
2571    pub fn new() -> Self {
2572        std::default::Default::default()
2573    }
2574
2575    /// Sets the value of [object][crate::model::StopBackfillJobResponse::object].
2576    ///
2577    /// # Example
2578    /// ```ignore,no_run
2579    /// # use google_cloud_datastream_v1::model::StopBackfillJobResponse;
2580    /// use google_cloud_datastream_v1::model::StreamObject;
2581    /// let x = StopBackfillJobResponse::new().set_object(StreamObject::default()/* use setters */);
2582    /// ```
2583    pub fn set_object<T>(mut self, v: T) -> Self
2584    where
2585        T: std::convert::Into<crate::model::StreamObject>,
2586    {
2587        self.object = std::option::Option::Some(v.into());
2588        self
2589    }
2590
2591    /// Sets or clears the value of [object][crate::model::StopBackfillJobResponse::object].
2592    ///
2593    /// # Example
2594    /// ```ignore,no_run
2595    /// # use google_cloud_datastream_v1::model::StopBackfillJobResponse;
2596    /// use google_cloud_datastream_v1::model::StreamObject;
2597    /// let x = StopBackfillJobResponse::new().set_or_clear_object(Some(StreamObject::default()/* use setters */));
2598    /// let x = StopBackfillJobResponse::new().set_or_clear_object(None::<StreamObject>);
2599    /// ```
2600    pub fn set_or_clear_object<T>(mut self, v: std::option::Option<T>) -> Self
2601    where
2602        T: std::convert::Into<crate::model::StreamObject>,
2603    {
2604        self.object = v.map(|x| x.into());
2605        self
2606    }
2607}
2608
2609impl wkt::message::Message for StopBackfillJobResponse {
2610    fn typename() -> &'static str {
2611        "type.googleapis.com/google.cloud.datastream.v1.StopBackfillJobResponse"
2612    }
2613}
2614
2615/// Request for listing all objects for a specific stream.
2616#[derive(Clone, Default, PartialEq)]
2617#[non_exhaustive]
2618pub struct ListStreamObjectsRequest {
2619    /// Required. The parent stream that owns the collection of objects.
2620    pub parent: std::string::String,
2621
2622    /// Maximum number of objects to return. Default is 50.
2623    /// The maximum value is 1000; values above 1000 will be coerced to 1000.
2624    pub page_size: i32,
2625
2626    /// Page token received from a previous `ListStreamObjectsRequest` call.
2627    /// Provide this to retrieve the subsequent page.
2628    ///
2629    /// When paginating, all other parameters provided to
2630    /// `ListStreamObjectsRequest` must match the call that provided the page
2631    /// token.
2632    pub page_token: std::string::String,
2633
2634    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2635}
2636
2637impl ListStreamObjectsRequest {
2638    pub fn new() -> Self {
2639        std::default::Default::default()
2640    }
2641
2642    /// Sets the value of [parent][crate::model::ListStreamObjectsRequest::parent].
2643    ///
2644    /// # Example
2645    /// ```ignore,no_run
2646    /// # use google_cloud_datastream_v1::model::ListStreamObjectsRequest;
2647    /// let x = ListStreamObjectsRequest::new().set_parent("example");
2648    /// ```
2649    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2650        self.parent = v.into();
2651        self
2652    }
2653
2654    /// Sets the value of [page_size][crate::model::ListStreamObjectsRequest::page_size].
2655    ///
2656    /// # Example
2657    /// ```ignore,no_run
2658    /// # use google_cloud_datastream_v1::model::ListStreamObjectsRequest;
2659    /// let x = ListStreamObjectsRequest::new().set_page_size(42);
2660    /// ```
2661    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2662        self.page_size = v.into();
2663        self
2664    }
2665
2666    /// Sets the value of [page_token][crate::model::ListStreamObjectsRequest::page_token].
2667    ///
2668    /// # Example
2669    /// ```ignore,no_run
2670    /// # use google_cloud_datastream_v1::model::ListStreamObjectsRequest;
2671    /// let x = ListStreamObjectsRequest::new().set_page_token("example");
2672    /// ```
2673    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2674        self.page_token = v.into();
2675        self
2676    }
2677}
2678
2679impl wkt::message::Message for ListStreamObjectsRequest {
2680    fn typename() -> &'static str {
2681        "type.googleapis.com/google.cloud.datastream.v1.ListStreamObjectsRequest"
2682    }
2683}
2684
2685/// Response containing the objects for a stream.
2686#[derive(Clone, Default, PartialEq)]
2687#[non_exhaustive]
2688pub struct ListStreamObjectsResponse {
2689    /// List of stream objects.
2690    pub stream_objects: std::vec::Vec<crate::model::StreamObject>,
2691
2692    /// A token, which can be sent as `page_token` to retrieve the next page.
2693    pub next_page_token: std::string::String,
2694
2695    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2696}
2697
2698impl ListStreamObjectsResponse {
2699    pub fn new() -> Self {
2700        std::default::Default::default()
2701    }
2702
2703    /// Sets the value of [stream_objects][crate::model::ListStreamObjectsResponse::stream_objects].
2704    ///
2705    /// # Example
2706    /// ```ignore,no_run
2707    /// # use google_cloud_datastream_v1::model::ListStreamObjectsResponse;
2708    /// use google_cloud_datastream_v1::model::StreamObject;
2709    /// let x = ListStreamObjectsResponse::new()
2710    ///     .set_stream_objects([
2711    ///         StreamObject::default()/* use setters */,
2712    ///         StreamObject::default()/* use (different) setters */,
2713    ///     ]);
2714    /// ```
2715    pub fn set_stream_objects<T, V>(mut self, v: T) -> Self
2716    where
2717        T: std::iter::IntoIterator<Item = V>,
2718        V: std::convert::Into<crate::model::StreamObject>,
2719    {
2720        use std::iter::Iterator;
2721        self.stream_objects = v.into_iter().map(|i| i.into()).collect();
2722        self
2723    }
2724
2725    /// Sets the value of [next_page_token][crate::model::ListStreamObjectsResponse::next_page_token].
2726    ///
2727    /// # Example
2728    /// ```ignore,no_run
2729    /// # use google_cloud_datastream_v1::model::ListStreamObjectsResponse;
2730    /// let x = ListStreamObjectsResponse::new().set_next_page_token("example");
2731    /// ```
2732    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2733        self.next_page_token = v.into();
2734        self
2735    }
2736}
2737
2738impl wkt::message::Message for ListStreamObjectsResponse {
2739    fn typename() -> &'static str {
2740        "type.googleapis.com/google.cloud.datastream.v1.ListStreamObjectsResponse"
2741    }
2742}
2743
2744#[doc(hidden)]
2745impl google_cloud_gax::paginator::internal::PageableResponse for ListStreamObjectsResponse {
2746    type PageItem = crate::model::StreamObject;
2747
2748    fn items(self) -> std::vec::Vec<Self::PageItem> {
2749        self.stream_objects
2750    }
2751
2752    fn next_page_token(&self) -> std::string::String {
2753        use std::clone::Clone;
2754        self.next_page_token.clone()
2755    }
2756}
2757
2758/// Represents the metadata of the long-running operation.
2759#[derive(Clone, Default, PartialEq)]
2760#[non_exhaustive]
2761pub struct OperationMetadata {
2762    /// Output only. The time the operation was created.
2763    pub create_time: std::option::Option<wkt::Timestamp>,
2764
2765    /// Output only. The time the operation finished running.
2766    pub end_time: std::option::Option<wkt::Timestamp>,
2767
2768    /// Output only. Server-defined resource path for the target of the operation.
2769    pub target: std::string::String,
2770
2771    /// Output only. Name of the verb executed by the operation.
2772    pub verb: std::string::String,
2773
2774    /// Output only. Human-readable status of the operation, if any.
2775    pub status_message: std::string::String,
2776
2777    /// Output only. Identifies whether the user has requested cancellation
2778    /// of the operation. Operations that have successfully been cancelled
2779    /// have
2780    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
2781    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
2782    /// corresponding to `Code.CANCELLED`.
2783    ///
2784    /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
2785    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
2786    pub requested_cancellation: bool,
2787
2788    /// Output only. API version used to start the operation.
2789    pub api_version: std::string::String,
2790
2791    /// Output only. Results of executed validations if there are any.
2792    pub validation_result: std::option::Option<crate::model::ValidationResult>,
2793
2794    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2795}
2796
2797impl OperationMetadata {
2798    pub fn new() -> Self {
2799        std::default::Default::default()
2800    }
2801
2802    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
2803    ///
2804    /// # Example
2805    /// ```ignore,no_run
2806    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2807    /// use wkt::Timestamp;
2808    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
2809    /// ```
2810    pub fn set_create_time<T>(mut self, v: T) -> Self
2811    where
2812        T: std::convert::Into<wkt::Timestamp>,
2813    {
2814        self.create_time = std::option::Option::Some(v.into());
2815        self
2816    }
2817
2818    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
2819    ///
2820    /// # Example
2821    /// ```ignore,no_run
2822    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2823    /// use wkt::Timestamp;
2824    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2825    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
2826    /// ```
2827    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2828    where
2829        T: std::convert::Into<wkt::Timestamp>,
2830    {
2831        self.create_time = v.map(|x| x.into());
2832        self
2833    }
2834
2835    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
2836    ///
2837    /// # Example
2838    /// ```ignore,no_run
2839    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2840    /// use wkt::Timestamp;
2841    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
2842    /// ```
2843    pub fn set_end_time<T>(mut self, v: T) -> Self
2844    where
2845        T: std::convert::Into<wkt::Timestamp>,
2846    {
2847        self.end_time = std::option::Option::Some(v.into());
2848        self
2849    }
2850
2851    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
2852    ///
2853    /// # Example
2854    /// ```ignore,no_run
2855    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2856    /// use wkt::Timestamp;
2857    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
2858    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
2859    /// ```
2860    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2861    where
2862        T: std::convert::Into<wkt::Timestamp>,
2863    {
2864        self.end_time = v.map(|x| x.into());
2865        self
2866    }
2867
2868    /// Sets the value of [target][crate::model::OperationMetadata::target].
2869    ///
2870    /// # Example
2871    /// ```ignore,no_run
2872    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2873    /// let x = OperationMetadata::new().set_target("example");
2874    /// ```
2875    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2876        self.target = v.into();
2877        self
2878    }
2879
2880    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
2881    ///
2882    /// # Example
2883    /// ```ignore,no_run
2884    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2885    /// let x = OperationMetadata::new().set_verb("example");
2886    /// ```
2887    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2888        self.verb = v.into();
2889        self
2890    }
2891
2892    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
2893    ///
2894    /// # Example
2895    /// ```ignore,no_run
2896    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2897    /// let x = OperationMetadata::new().set_status_message("example");
2898    /// ```
2899    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2900        self.status_message = v.into();
2901        self
2902    }
2903
2904    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
2905    ///
2906    /// # Example
2907    /// ```ignore,no_run
2908    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2909    /// let x = OperationMetadata::new().set_requested_cancellation(true);
2910    /// ```
2911    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2912        self.requested_cancellation = v.into();
2913        self
2914    }
2915
2916    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
2917    ///
2918    /// # Example
2919    /// ```ignore,no_run
2920    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2921    /// let x = OperationMetadata::new().set_api_version("example");
2922    /// ```
2923    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2924        self.api_version = v.into();
2925        self
2926    }
2927
2928    /// Sets the value of [validation_result][crate::model::OperationMetadata::validation_result].
2929    ///
2930    /// # Example
2931    /// ```ignore,no_run
2932    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2933    /// use google_cloud_datastream_v1::model::ValidationResult;
2934    /// let x = OperationMetadata::new().set_validation_result(ValidationResult::default()/* use setters */);
2935    /// ```
2936    pub fn set_validation_result<T>(mut self, v: T) -> Self
2937    where
2938        T: std::convert::Into<crate::model::ValidationResult>,
2939    {
2940        self.validation_result = std::option::Option::Some(v.into());
2941        self
2942    }
2943
2944    /// Sets or clears the value of [validation_result][crate::model::OperationMetadata::validation_result].
2945    ///
2946    /// # Example
2947    /// ```ignore,no_run
2948    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2949    /// use google_cloud_datastream_v1::model::ValidationResult;
2950    /// let x = OperationMetadata::new().set_or_clear_validation_result(Some(ValidationResult::default()/* use setters */));
2951    /// let x = OperationMetadata::new().set_or_clear_validation_result(None::<ValidationResult>);
2952    /// ```
2953    pub fn set_or_clear_validation_result<T>(mut self, v: std::option::Option<T>) -> Self
2954    where
2955        T: std::convert::Into<crate::model::ValidationResult>,
2956    {
2957        self.validation_result = v.map(|x| x.into());
2958        self
2959    }
2960}
2961
2962impl wkt::message::Message for OperationMetadata {
2963    fn typename() -> &'static str {
2964        "type.googleapis.com/google.cloud.datastream.v1.OperationMetadata"
2965    }
2966}
2967
2968/// Request for creating a private connection.
2969#[derive(Clone, Default, PartialEq)]
2970#[non_exhaustive]
2971pub struct CreatePrivateConnectionRequest {
2972    /// Required. The parent that owns the collection of PrivateConnections.
2973    pub parent: std::string::String,
2974
2975    /// Required. The private connectivity identifier.
2976    pub private_connection_id: std::string::String,
2977
2978    /// Required. The Private Connectivity resource to create.
2979    pub private_connection: std::option::Option<crate::model::PrivateConnection>,
2980
2981    /// Optional. A request ID to identify requests. Specify a unique request ID
2982    /// so that if you must retry your request, the server will know to ignore
2983    /// the request if it has already been completed. The server will guarantee
2984    /// that for at least 60 minutes since the first request.
2985    ///
2986    /// For example, consider a situation where you make an initial request and the
2987    /// request times out. If you make the request again with the same request ID,
2988    /// the server can check if original operation with the same request ID was
2989    /// received, and if so, will ignore the second request. This prevents clients
2990    /// from accidentally creating duplicate commitments.
2991    ///
2992    /// The request ID must be a valid UUID with the exception that zero UUID is
2993    /// not supported (00000000-0000-0000-0000-000000000000).
2994    pub request_id: std::string::String,
2995
2996    /// Optional. If set to true, will skip validations.
2997    pub force: bool,
2998
2999    /// Optional. When supplied with PSC Interface config, will get/create the
3000    /// tenant project required for the customer to allow list and won't actually
3001    /// create the private connection.
3002    pub validate_only: bool,
3003
3004    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3005}
3006
3007impl CreatePrivateConnectionRequest {
3008    pub fn new() -> Self {
3009        std::default::Default::default()
3010    }
3011
3012    /// Sets the value of [parent][crate::model::CreatePrivateConnectionRequest::parent].
3013    ///
3014    /// # Example
3015    /// ```ignore,no_run
3016    /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3017    /// let x = CreatePrivateConnectionRequest::new().set_parent("example");
3018    /// ```
3019    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3020        self.parent = v.into();
3021        self
3022    }
3023
3024    /// Sets the value of [private_connection_id][crate::model::CreatePrivateConnectionRequest::private_connection_id].
3025    ///
3026    /// # Example
3027    /// ```ignore,no_run
3028    /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3029    /// let x = CreatePrivateConnectionRequest::new().set_private_connection_id("example");
3030    /// ```
3031    pub fn set_private_connection_id<T: std::convert::Into<std::string::String>>(
3032        mut self,
3033        v: T,
3034    ) -> Self {
3035        self.private_connection_id = v.into();
3036        self
3037    }
3038
3039    /// Sets the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
3040    ///
3041    /// # Example
3042    /// ```ignore,no_run
3043    /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3044    /// use google_cloud_datastream_v1::model::PrivateConnection;
3045    /// let x = CreatePrivateConnectionRequest::new().set_private_connection(PrivateConnection::default()/* use setters */);
3046    /// ```
3047    pub fn set_private_connection<T>(mut self, v: T) -> Self
3048    where
3049        T: std::convert::Into<crate::model::PrivateConnection>,
3050    {
3051        self.private_connection = std::option::Option::Some(v.into());
3052        self
3053    }
3054
3055    /// Sets or clears the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
3056    ///
3057    /// # Example
3058    /// ```ignore,no_run
3059    /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3060    /// use google_cloud_datastream_v1::model::PrivateConnection;
3061    /// let x = CreatePrivateConnectionRequest::new().set_or_clear_private_connection(Some(PrivateConnection::default()/* use setters */));
3062    /// let x = CreatePrivateConnectionRequest::new().set_or_clear_private_connection(None::<PrivateConnection>);
3063    /// ```
3064    pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
3065    where
3066        T: std::convert::Into<crate::model::PrivateConnection>,
3067    {
3068        self.private_connection = v.map(|x| x.into());
3069        self
3070    }
3071
3072    /// Sets the value of [request_id][crate::model::CreatePrivateConnectionRequest::request_id].
3073    ///
3074    /// # Example
3075    /// ```ignore,no_run
3076    /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3077    /// let x = CreatePrivateConnectionRequest::new().set_request_id("example");
3078    /// ```
3079    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3080        self.request_id = v.into();
3081        self
3082    }
3083
3084    /// Sets the value of [force][crate::model::CreatePrivateConnectionRequest::force].
3085    ///
3086    /// # Example
3087    /// ```ignore,no_run
3088    /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3089    /// let x = CreatePrivateConnectionRequest::new().set_force(true);
3090    /// ```
3091    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3092        self.force = v.into();
3093        self
3094    }
3095
3096    /// Sets the value of [validate_only][crate::model::CreatePrivateConnectionRequest::validate_only].
3097    ///
3098    /// # Example
3099    /// ```ignore,no_run
3100    /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3101    /// let x = CreatePrivateConnectionRequest::new().set_validate_only(true);
3102    /// ```
3103    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3104        self.validate_only = v.into();
3105        self
3106    }
3107}
3108
3109impl wkt::message::Message for CreatePrivateConnectionRequest {
3110    fn typename() -> &'static str {
3111        "type.googleapis.com/google.cloud.datastream.v1.CreatePrivateConnectionRequest"
3112    }
3113}
3114
3115/// Request for listing private connections.
3116#[derive(Clone, Default, PartialEq)]
3117#[non_exhaustive]
3118pub struct ListPrivateConnectionsRequest {
3119    /// Required. The parent that owns the collection of private connectivity
3120    /// configurations.
3121    pub parent: std::string::String,
3122
3123    /// Maximum number of private connectivity configurations to return.
3124    /// If unspecified, at most 50 private connectivity configurations that will be
3125    /// returned. The maximum value is 1000; values above 1000 will be coerced to
3126    /// 1000.
3127    pub page_size: i32,
3128
3129    /// Page token received from a previous `ListPrivateConnections` call.
3130    /// Provide this to retrieve the subsequent page.
3131    ///
3132    /// When paginating, all other parameters provided to
3133    /// `ListPrivateConnections` must match the call that provided the page
3134    /// token.
3135    pub page_token: std::string::String,
3136
3137    /// Filter request.
3138    pub filter: std::string::String,
3139
3140    /// Order by fields for the result.
3141    pub order_by: std::string::String,
3142
3143    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3144}
3145
3146impl ListPrivateConnectionsRequest {
3147    pub fn new() -> Self {
3148        std::default::Default::default()
3149    }
3150
3151    /// Sets the value of [parent][crate::model::ListPrivateConnectionsRequest::parent].
3152    ///
3153    /// # Example
3154    /// ```ignore,no_run
3155    /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3156    /// let x = ListPrivateConnectionsRequest::new().set_parent("example");
3157    /// ```
3158    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3159        self.parent = v.into();
3160        self
3161    }
3162
3163    /// Sets the value of [page_size][crate::model::ListPrivateConnectionsRequest::page_size].
3164    ///
3165    /// # Example
3166    /// ```ignore,no_run
3167    /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3168    /// let x = ListPrivateConnectionsRequest::new().set_page_size(42);
3169    /// ```
3170    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3171        self.page_size = v.into();
3172        self
3173    }
3174
3175    /// Sets the value of [page_token][crate::model::ListPrivateConnectionsRequest::page_token].
3176    ///
3177    /// # Example
3178    /// ```ignore,no_run
3179    /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3180    /// let x = ListPrivateConnectionsRequest::new().set_page_token("example");
3181    /// ```
3182    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3183        self.page_token = v.into();
3184        self
3185    }
3186
3187    /// Sets the value of [filter][crate::model::ListPrivateConnectionsRequest::filter].
3188    ///
3189    /// # Example
3190    /// ```ignore,no_run
3191    /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3192    /// let x = ListPrivateConnectionsRequest::new().set_filter("example");
3193    /// ```
3194    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3195        self.filter = v.into();
3196        self
3197    }
3198
3199    /// Sets the value of [order_by][crate::model::ListPrivateConnectionsRequest::order_by].
3200    ///
3201    /// # Example
3202    /// ```ignore,no_run
3203    /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3204    /// let x = ListPrivateConnectionsRequest::new().set_order_by("example");
3205    /// ```
3206    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3207        self.order_by = v.into();
3208        self
3209    }
3210}
3211
3212impl wkt::message::Message for ListPrivateConnectionsRequest {
3213    fn typename() -> &'static str {
3214        "type.googleapis.com/google.cloud.datastream.v1.ListPrivateConnectionsRequest"
3215    }
3216}
3217
3218/// Response containing a list of private connection configurations.
3219#[derive(Clone, Default, PartialEq)]
3220#[non_exhaustive]
3221pub struct ListPrivateConnectionsResponse {
3222    /// List of private connectivity configurations.
3223    pub private_connections: std::vec::Vec<crate::model::PrivateConnection>,
3224
3225    /// A token, which can be sent as `page_token` to retrieve the next page.
3226    /// If this field is omitted, there are no subsequent pages.
3227    pub next_page_token: std::string::String,
3228
3229    /// Locations that could not be reached.
3230    pub unreachable: std::vec::Vec<std::string::String>,
3231
3232    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3233}
3234
3235impl ListPrivateConnectionsResponse {
3236    pub fn new() -> Self {
3237        std::default::Default::default()
3238    }
3239
3240    /// Sets the value of [private_connections][crate::model::ListPrivateConnectionsResponse::private_connections].
3241    ///
3242    /// # Example
3243    /// ```ignore,no_run
3244    /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsResponse;
3245    /// use google_cloud_datastream_v1::model::PrivateConnection;
3246    /// let x = ListPrivateConnectionsResponse::new()
3247    ///     .set_private_connections([
3248    ///         PrivateConnection::default()/* use setters */,
3249    ///         PrivateConnection::default()/* use (different) setters */,
3250    ///     ]);
3251    /// ```
3252    pub fn set_private_connections<T, V>(mut self, v: T) -> Self
3253    where
3254        T: std::iter::IntoIterator<Item = V>,
3255        V: std::convert::Into<crate::model::PrivateConnection>,
3256    {
3257        use std::iter::Iterator;
3258        self.private_connections = v.into_iter().map(|i| i.into()).collect();
3259        self
3260    }
3261
3262    /// Sets the value of [next_page_token][crate::model::ListPrivateConnectionsResponse::next_page_token].
3263    ///
3264    /// # Example
3265    /// ```ignore,no_run
3266    /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsResponse;
3267    /// let x = ListPrivateConnectionsResponse::new().set_next_page_token("example");
3268    /// ```
3269    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3270        self.next_page_token = v.into();
3271        self
3272    }
3273
3274    /// Sets the value of [unreachable][crate::model::ListPrivateConnectionsResponse::unreachable].
3275    ///
3276    /// # Example
3277    /// ```ignore,no_run
3278    /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsResponse;
3279    /// let x = ListPrivateConnectionsResponse::new().set_unreachable(["a", "b", "c"]);
3280    /// ```
3281    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3282    where
3283        T: std::iter::IntoIterator<Item = V>,
3284        V: std::convert::Into<std::string::String>,
3285    {
3286        use std::iter::Iterator;
3287        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3288        self
3289    }
3290}
3291
3292impl wkt::message::Message for ListPrivateConnectionsResponse {
3293    fn typename() -> &'static str {
3294        "type.googleapis.com/google.cloud.datastream.v1.ListPrivateConnectionsResponse"
3295    }
3296}
3297
3298#[doc(hidden)]
3299impl google_cloud_gax::paginator::internal::PageableResponse for ListPrivateConnectionsResponse {
3300    type PageItem = crate::model::PrivateConnection;
3301
3302    fn items(self) -> std::vec::Vec<Self::PageItem> {
3303        self.private_connections
3304    }
3305
3306    fn next_page_token(&self) -> std::string::String {
3307        use std::clone::Clone;
3308        self.next_page_token.clone()
3309    }
3310}
3311
3312/// Request to delete a private connection.
3313#[derive(Clone, Default, PartialEq)]
3314#[non_exhaustive]
3315pub struct DeletePrivateConnectionRequest {
3316    /// Required. The name of the private connectivity configuration to delete.
3317    pub name: std::string::String,
3318
3319    /// Optional. A request ID to identify requests. Specify a unique request ID
3320    /// so that if you must retry your request, the server will know to ignore
3321    /// the request if it has already been completed. The server will guarantee
3322    /// that for at least 60 minutes after the first request.
3323    ///
3324    /// For example, consider a situation where you make an initial request and the
3325    /// request times out. If you make the request again with the same request ID,
3326    /// the server can check if original operation with the same request ID was
3327    /// received, and if so, will ignore the second request. This prevents clients
3328    /// from accidentally creating duplicate commitments.
3329    ///
3330    /// The request ID must be a valid UUID with the exception that zero UUID is
3331    /// not supported (00000000-0000-0000-0000-000000000000).
3332    pub request_id: std::string::String,
3333
3334    /// Optional. If set to true, any child routes that belong to this
3335    /// PrivateConnection will also be deleted.
3336    pub force: bool,
3337
3338    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3339}
3340
3341impl DeletePrivateConnectionRequest {
3342    pub fn new() -> Self {
3343        std::default::Default::default()
3344    }
3345
3346    /// Sets the value of [name][crate::model::DeletePrivateConnectionRequest::name].
3347    ///
3348    /// # Example
3349    /// ```ignore,no_run
3350    /// # use google_cloud_datastream_v1::model::DeletePrivateConnectionRequest;
3351    /// let x = DeletePrivateConnectionRequest::new().set_name("example");
3352    /// ```
3353    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3354        self.name = v.into();
3355        self
3356    }
3357
3358    /// Sets the value of [request_id][crate::model::DeletePrivateConnectionRequest::request_id].
3359    ///
3360    /// # Example
3361    /// ```ignore,no_run
3362    /// # use google_cloud_datastream_v1::model::DeletePrivateConnectionRequest;
3363    /// let x = DeletePrivateConnectionRequest::new().set_request_id("example");
3364    /// ```
3365    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3366        self.request_id = v.into();
3367        self
3368    }
3369
3370    /// Sets the value of [force][crate::model::DeletePrivateConnectionRequest::force].
3371    ///
3372    /// # Example
3373    /// ```ignore,no_run
3374    /// # use google_cloud_datastream_v1::model::DeletePrivateConnectionRequest;
3375    /// let x = DeletePrivateConnectionRequest::new().set_force(true);
3376    /// ```
3377    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3378        self.force = v.into();
3379        self
3380    }
3381}
3382
3383impl wkt::message::Message for DeletePrivateConnectionRequest {
3384    fn typename() -> &'static str {
3385        "type.googleapis.com/google.cloud.datastream.v1.DeletePrivateConnectionRequest"
3386    }
3387}
3388
3389/// Request to get a private connection configuration.
3390#[derive(Clone, Default, PartialEq)]
3391#[non_exhaustive]
3392pub struct GetPrivateConnectionRequest {
3393    /// Required. The name of the  private connectivity configuration to get.
3394    pub name: std::string::String,
3395
3396    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3397}
3398
3399impl GetPrivateConnectionRequest {
3400    pub fn new() -> Self {
3401        std::default::Default::default()
3402    }
3403
3404    /// Sets the value of [name][crate::model::GetPrivateConnectionRequest::name].
3405    ///
3406    /// # Example
3407    /// ```ignore,no_run
3408    /// # use google_cloud_datastream_v1::model::GetPrivateConnectionRequest;
3409    /// let x = GetPrivateConnectionRequest::new().set_name("example");
3410    /// ```
3411    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3412        self.name = v.into();
3413        self
3414    }
3415}
3416
3417impl wkt::message::Message for GetPrivateConnectionRequest {
3418    fn typename() -> &'static str {
3419        "type.googleapis.com/google.cloud.datastream.v1.GetPrivateConnectionRequest"
3420    }
3421}
3422
3423/// Route creation request.
3424#[derive(Clone, Default, PartialEq)]
3425#[non_exhaustive]
3426pub struct CreateRouteRequest {
3427    /// Required. The parent that owns the collection of Routes.
3428    pub parent: std::string::String,
3429
3430    /// Required. The Route identifier.
3431    pub route_id: std::string::String,
3432
3433    /// Required. The Route resource to create.
3434    pub route: std::option::Option<crate::model::Route>,
3435
3436    /// Optional. A request ID to identify requests. Specify a unique request ID
3437    /// so that if you must retry your request, the server will know to ignore
3438    /// the request if it has already been completed. The server will guarantee
3439    /// that for at least 60 minutes since the first request.
3440    ///
3441    /// For example, consider a situation where you make an initial request and the
3442    /// request times out. If you make the request again with the same request ID,
3443    /// the server can check if original operation with the same request ID was
3444    /// received, and if so, will ignore the second request. This prevents clients
3445    /// from accidentally creating duplicate commitments.
3446    ///
3447    /// The request ID must be a valid UUID with the exception that zero UUID is
3448    /// not supported (00000000-0000-0000-0000-000000000000).
3449    pub request_id: std::string::String,
3450
3451    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3452}
3453
3454impl CreateRouteRequest {
3455    pub fn new() -> Self {
3456        std::default::Default::default()
3457    }
3458
3459    /// Sets the value of [parent][crate::model::CreateRouteRequest::parent].
3460    ///
3461    /// # Example
3462    /// ```ignore,no_run
3463    /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3464    /// let x = CreateRouteRequest::new().set_parent("example");
3465    /// ```
3466    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3467        self.parent = v.into();
3468        self
3469    }
3470
3471    /// Sets the value of [route_id][crate::model::CreateRouteRequest::route_id].
3472    ///
3473    /// # Example
3474    /// ```ignore,no_run
3475    /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3476    /// let x = CreateRouteRequest::new().set_route_id("example");
3477    /// ```
3478    pub fn set_route_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3479        self.route_id = v.into();
3480        self
3481    }
3482
3483    /// Sets the value of [route][crate::model::CreateRouteRequest::route].
3484    ///
3485    /// # Example
3486    /// ```ignore,no_run
3487    /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3488    /// use google_cloud_datastream_v1::model::Route;
3489    /// let x = CreateRouteRequest::new().set_route(Route::default()/* use setters */);
3490    /// ```
3491    pub fn set_route<T>(mut self, v: T) -> Self
3492    where
3493        T: std::convert::Into<crate::model::Route>,
3494    {
3495        self.route = std::option::Option::Some(v.into());
3496        self
3497    }
3498
3499    /// Sets or clears the value of [route][crate::model::CreateRouteRequest::route].
3500    ///
3501    /// # Example
3502    /// ```ignore,no_run
3503    /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3504    /// use google_cloud_datastream_v1::model::Route;
3505    /// let x = CreateRouteRequest::new().set_or_clear_route(Some(Route::default()/* use setters */));
3506    /// let x = CreateRouteRequest::new().set_or_clear_route(None::<Route>);
3507    /// ```
3508    pub fn set_or_clear_route<T>(mut self, v: std::option::Option<T>) -> Self
3509    where
3510        T: std::convert::Into<crate::model::Route>,
3511    {
3512        self.route = v.map(|x| x.into());
3513        self
3514    }
3515
3516    /// Sets the value of [request_id][crate::model::CreateRouteRequest::request_id].
3517    ///
3518    /// # Example
3519    /// ```ignore,no_run
3520    /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3521    /// let x = CreateRouteRequest::new().set_request_id("example");
3522    /// ```
3523    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3524        self.request_id = v.into();
3525        self
3526    }
3527}
3528
3529impl wkt::message::Message for CreateRouteRequest {
3530    fn typename() -> &'static str {
3531        "type.googleapis.com/google.cloud.datastream.v1.CreateRouteRequest"
3532    }
3533}
3534
3535/// Route list request.
3536#[derive(Clone, Default, PartialEq)]
3537#[non_exhaustive]
3538pub struct ListRoutesRequest {
3539    /// Required. The parent that owns the collection of Routess.
3540    pub parent: std::string::String,
3541
3542    /// Maximum number of Routes to return. The service may return
3543    /// fewer than this value. If unspecified, at most 50 Routes
3544    /// will be returned. The maximum value is 1000; values above 1000 will be
3545    /// coerced to 1000.
3546    pub page_size: i32,
3547
3548    /// Page token received from a previous `ListRoutes` call.
3549    /// Provide this to retrieve the subsequent page.
3550    ///
3551    /// When paginating, all other parameters provided to
3552    /// `ListRoutes` must match the call that provided the page
3553    /// token.
3554    pub page_token: std::string::String,
3555
3556    /// Filter request.
3557    pub filter: std::string::String,
3558
3559    /// Order by fields for the result.
3560    pub order_by: std::string::String,
3561
3562    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3563}
3564
3565impl ListRoutesRequest {
3566    pub fn new() -> Self {
3567        std::default::Default::default()
3568    }
3569
3570    /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
3571    ///
3572    /// # Example
3573    /// ```ignore,no_run
3574    /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3575    /// let x = ListRoutesRequest::new().set_parent("example");
3576    /// ```
3577    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3578        self.parent = v.into();
3579        self
3580    }
3581
3582    /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
3583    ///
3584    /// # Example
3585    /// ```ignore,no_run
3586    /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3587    /// let x = ListRoutesRequest::new().set_page_size(42);
3588    /// ```
3589    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3590        self.page_size = v.into();
3591        self
3592    }
3593
3594    /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
3595    ///
3596    /// # Example
3597    /// ```ignore,no_run
3598    /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3599    /// let x = ListRoutesRequest::new().set_page_token("example");
3600    /// ```
3601    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3602        self.page_token = v.into();
3603        self
3604    }
3605
3606    /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
3607    ///
3608    /// # Example
3609    /// ```ignore,no_run
3610    /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3611    /// let x = ListRoutesRequest::new().set_filter("example");
3612    /// ```
3613    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3614        self.filter = v.into();
3615        self
3616    }
3617
3618    /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
3619    ///
3620    /// # Example
3621    /// ```ignore,no_run
3622    /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3623    /// let x = ListRoutesRequest::new().set_order_by("example");
3624    /// ```
3625    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3626        self.order_by = v.into();
3627        self
3628    }
3629}
3630
3631impl wkt::message::Message for ListRoutesRequest {
3632    fn typename() -> &'static str {
3633        "type.googleapis.com/google.cloud.datastream.v1.ListRoutesRequest"
3634    }
3635}
3636
3637/// Route list response.
3638#[derive(Clone, Default, PartialEq)]
3639#[non_exhaustive]
3640pub struct ListRoutesResponse {
3641    /// List of Routes.
3642    pub routes: std::vec::Vec<crate::model::Route>,
3643
3644    /// A token, which can be sent as `page_token` to retrieve the next page.
3645    /// If this field is omitted, there are no subsequent pages.
3646    pub next_page_token: std::string::String,
3647
3648    /// Locations that could not be reached.
3649    pub unreachable: std::vec::Vec<std::string::String>,
3650
3651    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3652}
3653
3654impl ListRoutesResponse {
3655    pub fn new() -> Self {
3656        std::default::Default::default()
3657    }
3658
3659    /// Sets the value of [routes][crate::model::ListRoutesResponse::routes].
3660    ///
3661    /// # Example
3662    /// ```ignore,no_run
3663    /// # use google_cloud_datastream_v1::model::ListRoutesResponse;
3664    /// use google_cloud_datastream_v1::model::Route;
3665    /// let x = ListRoutesResponse::new()
3666    ///     .set_routes([
3667    ///         Route::default()/* use setters */,
3668    ///         Route::default()/* use (different) setters */,
3669    ///     ]);
3670    /// ```
3671    pub fn set_routes<T, V>(mut self, v: T) -> Self
3672    where
3673        T: std::iter::IntoIterator<Item = V>,
3674        V: std::convert::Into<crate::model::Route>,
3675    {
3676        use std::iter::Iterator;
3677        self.routes = v.into_iter().map(|i| i.into()).collect();
3678        self
3679    }
3680
3681    /// Sets the value of [next_page_token][crate::model::ListRoutesResponse::next_page_token].
3682    ///
3683    /// # Example
3684    /// ```ignore,no_run
3685    /// # use google_cloud_datastream_v1::model::ListRoutesResponse;
3686    /// let x = ListRoutesResponse::new().set_next_page_token("example");
3687    /// ```
3688    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3689        self.next_page_token = v.into();
3690        self
3691    }
3692
3693    /// Sets the value of [unreachable][crate::model::ListRoutesResponse::unreachable].
3694    ///
3695    /// # Example
3696    /// ```ignore,no_run
3697    /// # use google_cloud_datastream_v1::model::ListRoutesResponse;
3698    /// let x = ListRoutesResponse::new().set_unreachable(["a", "b", "c"]);
3699    /// ```
3700    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3701    where
3702        T: std::iter::IntoIterator<Item = V>,
3703        V: std::convert::Into<std::string::String>,
3704    {
3705        use std::iter::Iterator;
3706        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3707        self
3708    }
3709}
3710
3711impl wkt::message::Message for ListRoutesResponse {
3712    fn typename() -> &'static str {
3713        "type.googleapis.com/google.cloud.datastream.v1.ListRoutesResponse"
3714    }
3715}
3716
3717#[doc(hidden)]
3718impl google_cloud_gax::paginator::internal::PageableResponse for ListRoutesResponse {
3719    type PageItem = crate::model::Route;
3720
3721    fn items(self) -> std::vec::Vec<Self::PageItem> {
3722        self.routes
3723    }
3724
3725    fn next_page_token(&self) -> std::string::String {
3726        use std::clone::Clone;
3727        self.next_page_token.clone()
3728    }
3729}
3730
3731/// Route deletion request.
3732#[derive(Clone, Default, PartialEq)]
3733#[non_exhaustive]
3734pub struct DeleteRouteRequest {
3735    /// Required. The name of the Route resource to delete.
3736    pub name: std::string::String,
3737
3738    /// Optional. A request ID to identify requests. Specify a unique request ID
3739    /// so that if you must retry your request, the server will know to ignore
3740    /// the request if it has already been completed. The server will guarantee
3741    /// that for at least 60 minutes after the first request.
3742    ///
3743    /// For example, consider a situation where you make an initial request and the
3744    /// request times out. If you make the request again with the same request ID,
3745    /// the server can check if original operation with the same request ID was
3746    /// received, and if so, will ignore the second request. This prevents clients
3747    /// from accidentally creating duplicate commitments.
3748    ///
3749    /// The request ID must be a valid UUID with the exception that zero UUID is
3750    /// not supported (00000000-0000-0000-0000-000000000000).
3751    pub request_id: std::string::String,
3752
3753    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3754}
3755
3756impl DeleteRouteRequest {
3757    pub fn new() -> Self {
3758        std::default::Default::default()
3759    }
3760
3761    /// Sets the value of [name][crate::model::DeleteRouteRequest::name].
3762    ///
3763    /// # Example
3764    /// ```ignore,no_run
3765    /// # use google_cloud_datastream_v1::model::DeleteRouteRequest;
3766    /// let x = DeleteRouteRequest::new().set_name("example");
3767    /// ```
3768    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3769        self.name = v.into();
3770        self
3771    }
3772
3773    /// Sets the value of [request_id][crate::model::DeleteRouteRequest::request_id].
3774    ///
3775    /// # Example
3776    /// ```ignore,no_run
3777    /// # use google_cloud_datastream_v1::model::DeleteRouteRequest;
3778    /// let x = DeleteRouteRequest::new().set_request_id("example");
3779    /// ```
3780    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3781        self.request_id = v.into();
3782        self
3783    }
3784}
3785
3786impl wkt::message::Message for DeleteRouteRequest {
3787    fn typename() -> &'static str {
3788        "type.googleapis.com/google.cloud.datastream.v1.DeleteRouteRequest"
3789    }
3790}
3791
3792/// Route get request.
3793#[derive(Clone, Default, PartialEq)]
3794#[non_exhaustive]
3795pub struct GetRouteRequest {
3796    /// Required. The name of the Route resource to get.
3797    pub name: std::string::String,
3798
3799    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3800}
3801
3802impl GetRouteRequest {
3803    pub fn new() -> Self {
3804        std::default::Default::default()
3805    }
3806
3807    /// Sets the value of [name][crate::model::GetRouteRequest::name].
3808    ///
3809    /// # Example
3810    /// ```ignore,no_run
3811    /// # use google_cloud_datastream_v1::model::GetRouteRequest;
3812    /// let x = GetRouteRequest::new().set_name("example");
3813    /// ```
3814    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3815        self.name = v.into();
3816        self
3817    }
3818}
3819
3820impl wkt::message::Message for GetRouteRequest {
3821    fn typename() -> &'static str {
3822        "type.googleapis.com/google.cloud.datastream.v1.GetRouteRequest"
3823    }
3824}
3825
3826/// Oracle database profile.
3827#[derive(Clone, Default, PartialEq)]
3828#[non_exhaustive]
3829pub struct OracleProfile {
3830    /// Required. Hostname for the Oracle connection.
3831    pub hostname: std::string::String,
3832
3833    /// Port for the Oracle connection, default value is 1521.
3834    pub port: i32,
3835
3836    /// Required. Username for the Oracle connection.
3837    pub username: std::string::String,
3838
3839    /// Optional. Password for the Oracle connection. Mutually exclusive with the
3840    /// `secret_manager_stored_password` field.
3841    pub password: std::string::String,
3842
3843    /// Required. Database for the Oracle connection.
3844    pub database_service: std::string::String,
3845
3846    /// Connection string attributes
3847    pub connection_attributes: std::collections::HashMap<std::string::String, std::string::String>,
3848
3849    /// Optional. SSL configuration for the Oracle connection.
3850    pub oracle_ssl_config: std::option::Option<crate::model::OracleSslConfig>,
3851
3852    /// Optional. Configuration for Oracle ASM connection.
3853    pub oracle_asm_config: std::option::Option<crate::model::OracleAsmConfig>,
3854
3855    /// Optional. A reference to a Secret Manager resource name storing the Oracle
3856    /// connection password. Mutually exclusive with the `password` field.
3857    pub secret_manager_stored_password: std::string::String,
3858
3859    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3860}
3861
3862impl OracleProfile {
3863    pub fn new() -> Self {
3864        std::default::Default::default()
3865    }
3866
3867    /// Sets the value of [hostname][crate::model::OracleProfile::hostname].
3868    ///
3869    /// # Example
3870    /// ```ignore,no_run
3871    /// # use google_cloud_datastream_v1::model::OracleProfile;
3872    /// let x = OracleProfile::new().set_hostname("example");
3873    /// ```
3874    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3875        self.hostname = v.into();
3876        self
3877    }
3878
3879    /// Sets the value of [port][crate::model::OracleProfile::port].
3880    ///
3881    /// # Example
3882    /// ```ignore,no_run
3883    /// # use google_cloud_datastream_v1::model::OracleProfile;
3884    /// let x = OracleProfile::new().set_port(42);
3885    /// ```
3886    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3887        self.port = v.into();
3888        self
3889    }
3890
3891    /// Sets the value of [username][crate::model::OracleProfile::username].
3892    ///
3893    /// # Example
3894    /// ```ignore,no_run
3895    /// # use google_cloud_datastream_v1::model::OracleProfile;
3896    /// let x = OracleProfile::new().set_username("example");
3897    /// ```
3898    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3899        self.username = v.into();
3900        self
3901    }
3902
3903    /// Sets the value of [password][crate::model::OracleProfile::password].
3904    ///
3905    /// # Example
3906    /// ```ignore,no_run
3907    /// # use google_cloud_datastream_v1::model::OracleProfile;
3908    /// let x = OracleProfile::new().set_password("example");
3909    /// ```
3910    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3911        self.password = v.into();
3912        self
3913    }
3914
3915    /// Sets the value of [database_service][crate::model::OracleProfile::database_service].
3916    ///
3917    /// # Example
3918    /// ```ignore,no_run
3919    /// # use google_cloud_datastream_v1::model::OracleProfile;
3920    /// let x = OracleProfile::new().set_database_service("example");
3921    /// ```
3922    pub fn set_database_service<T: std::convert::Into<std::string::String>>(
3923        mut self,
3924        v: T,
3925    ) -> Self {
3926        self.database_service = v.into();
3927        self
3928    }
3929
3930    /// Sets the value of [connection_attributes][crate::model::OracleProfile::connection_attributes].
3931    ///
3932    /// # Example
3933    /// ```ignore,no_run
3934    /// # use google_cloud_datastream_v1::model::OracleProfile;
3935    /// let x = OracleProfile::new().set_connection_attributes([
3936    ///     ("key0", "abc"),
3937    ///     ("key1", "xyz"),
3938    /// ]);
3939    /// ```
3940    pub fn set_connection_attributes<T, K, V>(mut self, v: T) -> Self
3941    where
3942        T: std::iter::IntoIterator<Item = (K, V)>,
3943        K: std::convert::Into<std::string::String>,
3944        V: std::convert::Into<std::string::String>,
3945    {
3946        use std::iter::Iterator;
3947        self.connection_attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3948        self
3949    }
3950
3951    /// Sets the value of [oracle_ssl_config][crate::model::OracleProfile::oracle_ssl_config].
3952    ///
3953    /// # Example
3954    /// ```ignore,no_run
3955    /// # use google_cloud_datastream_v1::model::OracleProfile;
3956    /// use google_cloud_datastream_v1::model::OracleSslConfig;
3957    /// let x = OracleProfile::new().set_oracle_ssl_config(OracleSslConfig::default()/* use setters */);
3958    /// ```
3959    pub fn set_oracle_ssl_config<T>(mut self, v: T) -> Self
3960    where
3961        T: std::convert::Into<crate::model::OracleSslConfig>,
3962    {
3963        self.oracle_ssl_config = std::option::Option::Some(v.into());
3964        self
3965    }
3966
3967    /// Sets or clears the value of [oracle_ssl_config][crate::model::OracleProfile::oracle_ssl_config].
3968    ///
3969    /// # Example
3970    /// ```ignore,no_run
3971    /// # use google_cloud_datastream_v1::model::OracleProfile;
3972    /// use google_cloud_datastream_v1::model::OracleSslConfig;
3973    /// let x = OracleProfile::new().set_or_clear_oracle_ssl_config(Some(OracleSslConfig::default()/* use setters */));
3974    /// let x = OracleProfile::new().set_or_clear_oracle_ssl_config(None::<OracleSslConfig>);
3975    /// ```
3976    pub fn set_or_clear_oracle_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
3977    where
3978        T: std::convert::Into<crate::model::OracleSslConfig>,
3979    {
3980        self.oracle_ssl_config = v.map(|x| x.into());
3981        self
3982    }
3983
3984    /// Sets the value of [oracle_asm_config][crate::model::OracleProfile::oracle_asm_config].
3985    ///
3986    /// # Example
3987    /// ```ignore,no_run
3988    /// # use google_cloud_datastream_v1::model::OracleProfile;
3989    /// use google_cloud_datastream_v1::model::OracleAsmConfig;
3990    /// let x = OracleProfile::new().set_oracle_asm_config(OracleAsmConfig::default()/* use setters */);
3991    /// ```
3992    pub fn set_oracle_asm_config<T>(mut self, v: T) -> Self
3993    where
3994        T: std::convert::Into<crate::model::OracleAsmConfig>,
3995    {
3996        self.oracle_asm_config = std::option::Option::Some(v.into());
3997        self
3998    }
3999
4000    /// Sets or clears the value of [oracle_asm_config][crate::model::OracleProfile::oracle_asm_config].
4001    ///
4002    /// # Example
4003    /// ```ignore,no_run
4004    /// # use google_cloud_datastream_v1::model::OracleProfile;
4005    /// use google_cloud_datastream_v1::model::OracleAsmConfig;
4006    /// let x = OracleProfile::new().set_or_clear_oracle_asm_config(Some(OracleAsmConfig::default()/* use setters */));
4007    /// let x = OracleProfile::new().set_or_clear_oracle_asm_config(None::<OracleAsmConfig>);
4008    /// ```
4009    pub fn set_or_clear_oracle_asm_config<T>(mut self, v: std::option::Option<T>) -> Self
4010    where
4011        T: std::convert::Into<crate::model::OracleAsmConfig>,
4012    {
4013        self.oracle_asm_config = v.map(|x| x.into());
4014        self
4015    }
4016
4017    /// Sets the value of [secret_manager_stored_password][crate::model::OracleProfile::secret_manager_stored_password].
4018    ///
4019    /// # Example
4020    /// ```ignore,no_run
4021    /// # use google_cloud_datastream_v1::model::OracleProfile;
4022    /// let x = OracleProfile::new().set_secret_manager_stored_password("example");
4023    /// ```
4024    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4025        mut self,
4026        v: T,
4027    ) -> Self {
4028        self.secret_manager_stored_password = v.into();
4029        self
4030    }
4031}
4032
4033impl wkt::message::Message for OracleProfile {
4034    fn typename() -> &'static str {
4035        "type.googleapis.com/google.cloud.datastream.v1.OracleProfile"
4036    }
4037}
4038
4039/// Configuration for Oracle Automatic Storage Management (ASM) connection.
4040#[derive(Clone, Default, PartialEq)]
4041#[non_exhaustive]
4042pub struct OracleAsmConfig {
4043    /// Required. Hostname for the Oracle ASM connection.
4044    pub hostname: std::string::String,
4045
4046    /// Required. Port for the Oracle ASM connection.
4047    pub port: i32,
4048
4049    /// Required. Username for the Oracle ASM connection.
4050    pub username: std::string::String,
4051
4052    /// Optional. Password for the Oracle ASM connection. Mutually exclusive with
4053    /// the `secret_manager_stored_password` field.
4054    pub password: std::string::String,
4055
4056    /// Required. ASM service name for the Oracle ASM connection.
4057    pub asm_service: std::string::String,
4058
4059    /// Optional. Connection string attributes
4060    pub connection_attributes: std::collections::HashMap<std::string::String, std::string::String>,
4061
4062    /// Optional. SSL configuration for the Oracle connection.
4063    pub oracle_ssl_config: std::option::Option<crate::model::OracleSslConfig>,
4064
4065    /// Optional. A reference to a Secret Manager resource name storing the Oracle
4066    /// ASM connection password. Mutually exclusive with the `password` field.
4067    pub secret_manager_stored_password: std::string::String,
4068
4069    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4070}
4071
4072impl OracleAsmConfig {
4073    pub fn new() -> Self {
4074        std::default::Default::default()
4075    }
4076
4077    /// Sets the value of [hostname][crate::model::OracleAsmConfig::hostname].
4078    ///
4079    /// # Example
4080    /// ```ignore,no_run
4081    /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4082    /// let x = OracleAsmConfig::new().set_hostname("example");
4083    /// ```
4084    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4085        self.hostname = v.into();
4086        self
4087    }
4088
4089    /// Sets the value of [port][crate::model::OracleAsmConfig::port].
4090    ///
4091    /// # Example
4092    /// ```ignore,no_run
4093    /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4094    /// let x = OracleAsmConfig::new().set_port(42);
4095    /// ```
4096    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4097        self.port = v.into();
4098        self
4099    }
4100
4101    /// Sets the value of [username][crate::model::OracleAsmConfig::username].
4102    ///
4103    /// # Example
4104    /// ```ignore,no_run
4105    /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4106    /// let x = OracleAsmConfig::new().set_username("example");
4107    /// ```
4108    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4109        self.username = v.into();
4110        self
4111    }
4112
4113    /// Sets the value of [password][crate::model::OracleAsmConfig::password].
4114    ///
4115    /// # Example
4116    /// ```ignore,no_run
4117    /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4118    /// let x = OracleAsmConfig::new().set_password("example");
4119    /// ```
4120    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4121        self.password = v.into();
4122        self
4123    }
4124
4125    /// Sets the value of [asm_service][crate::model::OracleAsmConfig::asm_service].
4126    ///
4127    /// # Example
4128    /// ```ignore,no_run
4129    /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4130    /// let x = OracleAsmConfig::new().set_asm_service("example");
4131    /// ```
4132    pub fn set_asm_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4133        self.asm_service = v.into();
4134        self
4135    }
4136
4137    /// Sets the value of [connection_attributes][crate::model::OracleAsmConfig::connection_attributes].
4138    ///
4139    /// # Example
4140    /// ```ignore,no_run
4141    /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4142    /// let x = OracleAsmConfig::new().set_connection_attributes([
4143    ///     ("key0", "abc"),
4144    ///     ("key1", "xyz"),
4145    /// ]);
4146    /// ```
4147    pub fn set_connection_attributes<T, K, V>(mut self, v: T) -> Self
4148    where
4149        T: std::iter::IntoIterator<Item = (K, V)>,
4150        K: std::convert::Into<std::string::String>,
4151        V: std::convert::Into<std::string::String>,
4152    {
4153        use std::iter::Iterator;
4154        self.connection_attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4155        self
4156    }
4157
4158    /// Sets the value of [oracle_ssl_config][crate::model::OracleAsmConfig::oracle_ssl_config].
4159    ///
4160    /// # Example
4161    /// ```ignore,no_run
4162    /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4163    /// use google_cloud_datastream_v1::model::OracleSslConfig;
4164    /// let x = OracleAsmConfig::new().set_oracle_ssl_config(OracleSslConfig::default()/* use setters */);
4165    /// ```
4166    pub fn set_oracle_ssl_config<T>(mut self, v: T) -> Self
4167    where
4168        T: std::convert::Into<crate::model::OracleSslConfig>,
4169    {
4170        self.oracle_ssl_config = std::option::Option::Some(v.into());
4171        self
4172    }
4173
4174    /// Sets or clears the value of [oracle_ssl_config][crate::model::OracleAsmConfig::oracle_ssl_config].
4175    ///
4176    /// # Example
4177    /// ```ignore,no_run
4178    /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4179    /// use google_cloud_datastream_v1::model::OracleSslConfig;
4180    /// let x = OracleAsmConfig::new().set_or_clear_oracle_ssl_config(Some(OracleSslConfig::default()/* use setters */));
4181    /// let x = OracleAsmConfig::new().set_or_clear_oracle_ssl_config(None::<OracleSslConfig>);
4182    /// ```
4183    pub fn set_or_clear_oracle_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
4184    where
4185        T: std::convert::Into<crate::model::OracleSslConfig>,
4186    {
4187        self.oracle_ssl_config = v.map(|x| x.into());
4188        self
4189    }
4190
4191    /// Sets the value of [secret_manager_stored_password][crate::model::OracleAsmConfig::secret_manager_stored_password].
4192    ///
4193    /// # Example
4194    /// ```ignore,no_run
4195    /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4196    /// let x = OracleAsmConfig::new().set_secret_manager_stored_password("example");
4197    /// ```
4198    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4199        mut self,
4200        v: T,
4201    ) -> Self {
4202        self.secret_manager_stored_password = v.into();
4203        self
4204    }
4205}
4206
4207impl wkt::message::Message for OracleAsmConfig {
4208    fn typename() -> &'static str {
4209        "type.googleapis.com/google.cloud.datastream.v1.OracleAsmConfig"
4210    }
4211}
4212
4213/// MySQL database profile.
4214#[derive(Clone, Default, PartialEq)]
4215#[non_exhaustive]
4216pub struct MysqlProfile {
4217    /// Required. Hostname for the MySQL connection.
4218    pub hostname: std::string::String,
4219
4220    /// Port for the MySQL connection, default value is 3306.
4221    pub port: i32,
4222
4223    /// Required. Username for the MySQL connection.
4224    pub username: std::string::String,
4225
4226    /// Optional. Input only. Password for the MySQL connection. Mutually exclusive
4227    /// with the `secret_manager_stored_password` field.
4228    pub password: std::string::String,
4229
4230    /// SSL configuration for the MySQL connection.
4231    pub ssl_config: std::option::Option<crate::model::MysqlSslConfig>,
4232
4233    /// Optional. A reference to a Secret Manager resource name storing the MySQL
4234    /// connection password. Mutually exclusive with the `password` field.
4235    pub secret_manager_stored_password: std::string::String,
4236
4237    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4238}
4239
4240impl MysqlProfile {
4241    pub fn new() -> Self {
4242        std::default::Default::default()
4243    }
4244
4245    /// Sets the value of [hostname][crate::model::MysqlProfile::hostname].
4246    ///
4247    /// # Example
4248    /// ```ignore,no_run
4249    /// # use google_cloud_datastream_v1::model::MysqlProfile;
4250    /// let x = MysqlProfile::new().set_hostname("example");
4251    /// ```
4252    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4253        self.hostname = v.into();
4254        self
4255    }
4256
4257    /// Sets the value of [port][crate::model::MysqlProfile::port].
4258    ///
4259    /// # Example
4260    /// ```ignore,no_run
4261    /// # use google_cloud_datastream_v1::model::MysqlProfile;
4262    /// let x = MysqlProfile::new().set_port(42);
4263    /// ```
4264    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4265        self.port = v.into();
4266        self
4267    }
4268
4269    /// Sets the value of [username][crate::model::MysqlProfile::username].
4270    ///
4271    /// # Example
4272    /// ```ignore,no_run
4273    /// # use google_cloud_datastream_v1::model::MysqlProfile;
4274    /// let x = MysqlProfile::new().set_username("example");
4275    /// ```
4276    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4277        self.username = v.into();
4278        self
4279    }
4280
4281    /// Sets the value of [password][crate::model::MysqlProfile::password].
4282    ///
4283    /// # Example
4284    /// ```ignore,no_run
4285    /// # use google_cloud_datastream_v1::model::MysqlProfile;
4286    /// let x = MysqlProfile::new().set_password("example");
4287    /// ```
4288    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4289        self.password = v.into();
4290        self
4291    }
4292
4293    /// Sets the value of [ssl_config][crate::model::MysqlProfile::ssl_config].
4294    ///
4295    /// # Example
4296    /// ```ignore,no_run
4297    /// # use google_cloud_datastream_v1::model::MysqlProfile;
4298    /// use google_cloud_datastream_v1::model::MysqlSslConfig;
4299    /// let x = MysqlProfile::new().set_ssl_config(MysqlSslConfig::default()/* use setters */);
4300    /// ```
4301    pub fn set_ssl_config<T>(mut self, v: T) -> Self
4302    where
4303        T: std::convert::Into<crate::model::MysqlSslConfig>,
4304    {
4305        self.ssl_config = std::option::Option::Some(v.into());
4306        self
4307    }
4308
4309    /// Sets or clears the value of [ssl_config][crate::model::MysqlProfile::ssl_config].
4310    ///
4311    /// # Example
4312    /// ```ignore,no_run
4313    /// # use google_cloud_datastream_v1::model::MysqlProfile;
4314    /// use google_cloud_datastream_v1::model::MysqlSslConfig;
4315    /// let x = MysqlProfile::new().set_or_clear_ssl_config(Some(MysqlSslConfig::default()/* use setters */));
4316    /// let x = MysqlProfile::new().set_or_clear_ssl_config(None::<MysqlSslConfig>);
4317    /// ```
4318    pub fn set_or_clear_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
4319    where
4320        T: std::convert::Into<crate::model::MysqlSslConfig>,
4321    {
4322        self.ssl_config = v.map(|x| x.into());
4323        self
4324    }
4325
4326    /// Sets the value of [secret_manager_stored_password][crate::model::MysqlProfile::secret_manager_stored_password].
4327    ///
4328    /// # Example
4329    /// ```ignore,no_run
4330    /// # use google_cloud_datastream_v1::model::MysqlProfile;
4331    /// let x = MysqlProfile::new().set_secret_manager_stored_password("example");
4332    /// ```
4333    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4334        mut self,
4335        v: T,
4336    ) -> Self {
4337        self.secret_manager_stored_password = v.into();
4338        self
4339    }
4340}
4341
4342impl wkt::message::Message for MysqlProfile {
4343    fn typename() -> &'static str {
4344        "type.googleapis.com/google.cloud.datastream.v1.MysqlProfile"
4345    }
4346}
4347
4348/// PostgreSQL database profile.
4349#[derive(Clone, Default, PartialEq)]
4350#[non_exhaustive]
4351pub struct PostgresqlProfile {
4352    /// Required. Hostname for the PostgreSQL connection.
4353    pub hostname: std::string::String,
4354
4355    /// Port for the PostgreSQL connection, default value is 5432.
4356    pub port: i32,
4357
4358    /// Required. Username for the PostgreSQL connection.
4359    pub username: std::string::String,
4360
4361    /// Optional. Password for the PostgreSQL connection. Mutually exclusive with
4362    /// the `secret_manager_stored_password` field.
4363    pub password: std::string::String,
4364
4365    /// Required. Database for the PostgreSQL connection.
4366    pub database: std::string::String,
4367
4368    /// Optional. A reference to a Secret Manager resource name storing the
4369    /// PostgreSQL connection password. Mutually exclusive with the `password`
4370    /// field.
4371    pub secret_manager_stored_password: std::string::String,
4372
4373    /// Optional. SSL configuration for the PostgreSQL connection.
4374    /// In case PostgresqlSslConfig is not set, the connection will use the default
4375    /// SSL mode, which is `prefer` (i.e. this mode will only use encryption if
4376    /// enabled from database side, otherwise will use unencrypted communication)
4377    pub ssl_config: std::option::Option<crate::model::PostgresqlSslConfig>,
4378
4379    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4380}
4381
4382impl PostgresqlProfile {
4383    pub fn new() -> Self {
4384        std::default::Default::default()
4385    }
4386
4387    /// Sets the value of [hostname][crate::model::PostgresqlProfile::hostname].
4388    ///
4389    /// # Example
4390    /// ```ignore,no_run
4391    /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4392    /// let x = PostgresqlProfile::new().set_hostname("example");
4393    /// ```
4394    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4395        self.hostname = v.into();
4396        self
4397    }
4398
4399    /// Sets the value of [port][crate::model::PostgresqlProfile::port].
4400    ///
4401    /// # Example
4402    /// ```ignore,no_run
4403    /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4404    /// let x = PostgresqlProfile::new().set_port(42);
4405    /// ```
4406    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4407        self.port = v.into();
4408        self
4409    }
4410
4411    /// Sets the value of [username][crate::model::PostgresqlProfile::username].
4412    ///
4413    /// # Example
4414    /// ```ignore,no_run
4415    /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4416    /// let x = PostgresqlProfile::new().set_username("example");
4417    /// ```
4418    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4419        self.username = v.into();
4420        self
4421    }
4422
4423    /// Sets the value of [password][crate::model::PostgresqlProfile::password].
4424    ///
4425    /// # Example
4426    /// ```ignore,no_run
4427    /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4428    /// let x = PostgresqlProfile::new().set_password("example");
4429    /// ```
4430    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4431        self.password = v.into();
4432        self
4433    }
4434
4435    /// Sets the value of [database][crate::model::PostgresqlProfile::database].
4436    ///
4437    /// # Example
4438    /// ```ignore,no_run
4439    /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4440    /// let x = PostgresqlProfile::new().set_database("example");
4441    /// ```
4442    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4443        self.database = v.into();
4444        self
4445    }
4446
4447    /// Sets the value of [secret_manager_stored_password][crate::model::PostgresqlProfile::secret_manager_stored_password].
4448    ///
4449    /// # Example
4450    /// ```ignore,no_run
4451    /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4452    /// let x = PostgresqlProfile::new().set_secret_manager_stored_password("example");
4453    /// ```
4454    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4455        mut self,
4456        v: T,
4457    ) -> Self {
4458        self.secret_manager_stored_password = v.into();
4459        self
4460    }
4461
4462    /// Sets the value of [ssl_config][crate::model::PostgresqlProfile::ssl_config].
4463    ///
4464    /// # Example
4465    /// ```ignore,no_run
4466    /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4467    /// use google_cloud_datastream_v1::model::PostgresqlSslConfig;
4468    /// let x = PostgresqlProfile::new().set_ssl_config(PostgresqlSslConfig::default()/* use setters */);
4469    /// ```
4470    pub fn set_ssl_config<T>(mut self, v: T) -> Self
4471    where
4472        T: std::convert::Into<crate::model::PostgresqlSslConfig>,
4473    {
4474        self.ssl_config = std::option::Option::Some(v.into());
4475        self
4476    }
4477
4478    /// Sets or clears the value of [ssl_config][crate::model::PostgresqlProfile::ssl_config].
4479    ///
4480    /// # Example
4481    /// ```ignore,no_run
4482    /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4483    /// use google_cloud_datastream_v1::model::PostgresqlSslConfig;
4484    /// let x = PostgresqlProfile::new().set_or_clear_ssl_config(Some(PostgresqlSslConfig::default()/* use setters */));
4485    /// let x = PostgresqlProfile::new().set_or_clear_ssl_config(None::<PostgresqlSslConfig>);
4486    /// ```
4487    pub fn set_or_clear_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
4488    where
4489        T: std::convert::Into<crate::model::PostgresqlSslConfig>,
4490    {
4491        self.ssl_config = v.map(|x| x.into());
4492        self
4493    }
4494}
4495
4496impl wkt::message::Message for PostgresqlProfile {
4497    fn typename() -> &'static str {
4498        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlProfile"
4499    }
4500}
4501
4502/// SQLServer database profile.
4503#[derive(Clone, Default, PartialEq)]
4504#[non_exhaustive]
4505pub struct SqlServerProfile {
4506    /// Required. Hostname for the SQLServer connection.
4507    pub hostname: std::string::String,
4508
4509    /// Port for the SQLServer connection, default value is 1433.
4510    pub port: i32,
4511
4512    /// Required. Username for the SQLServer connection.
4513    pub username: std::string::String,
4514
4515    /// Optional. Password for the SQLServer connection. Mutually exclusive with
4516    /// the `secret_manager_stored_password` field.
4517    pub password: std::string::String,
4518
4519    /// Required. Database for the SQLServer connection.
4520    pub database: std::string::String,
4521
4522    /// Optional. A reference to a Secret Manager resource name storing the
4523    /// SQLServer connection password. Mutually exclusive with the `password`
4524    /// field.
4525    pub secret_manager_stored_password: std::string::String,
4526
4527    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4528}
4529
4530impl SqlServerProfile {
4531    pub fn new() -> Self {
4532        std::default::Default::default()
4533    }
4534
4535    /// Sets the value of [hostname][crate::model::SqlServerProfile::hostname].
4536    ///
4537    /// # Example
4538    /// ```ignore,no_run
4539    /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4540    /// let x = SqlServerProfile::new().set_hostname("example");
4541    /// ```
4542    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4543        self.hostname = v.into();
4544        self
4545    }
4546
4547    /// Sets the value of [port][crate::model::SqlServerProfile::port].
4548    ///
4549    /// # Example
4550    /// ```ignore,no_run
4551    /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4552    /// let x = SqlServerProfile::new().set_port(42);
4553    /// ```
4554    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4555        self.port = v.into();
4556        self
4557    }
4558
4559    /// Sets the value of [username][crate::model::SqlServerProfile::username].
4560    ///
4561    /// # Example
4562    /// ```ignore,no_run
4563    /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4564    /// let x = SqlServerProfile::new().set_username("example");
4565    /// ```
4566    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4567        self.username = v.into();
4568        self
4569    }
4570
4571    /// Sets the value of [password][crate::model::SqlServerProfile::password].
4572    ///
4573    /// # Example
4574    /// ```ignore,no_run
4575    /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4576    /// let x = SqlServerProfile::new().set_password("example");
4577    /// ```
4578    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4579        self.password = v.into();
4580        self
4581    }
4582
4583    /// Sets the value of [database][crate::model::SqlServerProfile::database].
4584    ///
4585    /// # Example
4586    /// ```ignore,no_run
4587    /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4588    /// let x = SqlServerProfile::new().set_database("example");
4589    /// ```
4590    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4591        self.database = v.into();
4592        self
4593    }
4594
4595    /// Sets the value of [secret_manager_stored_password][crate::model::SqlServerProfile::secret_manager_stored_password].
4596    ///
4597    /// # Example
4598    /// ```ignore,no_run
4599    /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4600    /// let x = SqlServerProfile::new().set_secret_manager_stored_password("example");
4601    /// ```
4602    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4603        mut self,
4604        v: T,
4605    ) -> Self {
4606        self.secret_manager_stored_password = v.into();
4607        self
4608    }
4609}
4610
4611impl wkt::message::Message for SqlServerProfile {
4612    fn typename() -> &'static str {
4613        "type.googleapis.com/google.cloud.datastream.v1.SqlServerProfile"
4614    }
4615}
4616
4617/// Salesforce profile
4618#[derive(Clone, Default, PartialEq)]
4619#[non_exhaustive]
4620pub struct SalesforceProfile {
4621    /// Required. Domain endpoint for the Salesforce connection.
4622    pub domain: std::string::String,
4623
4624    /// Credentials for Salesforce connection.
4625    pub credentials: std::option::Option<crate::model::salesforce_profile::Credentials>,
4626
4627    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4628}
4629
4630impl SalesforceProfile {
4631    pub fn new() -> Self {
4632        std::default::Default::default()
4633    }
4634
4635    /// Sets the value of [domain][crate::model::SalesforceProfile::domain].
4636    ///
4637    /// # Example
4638    /// ```ignore,no_run
4639    /// # use google_cloud_datastream_v1::model::SalesforceProfile;
4640    /// let x = SalesforceProfile::new().set_domain("example");
4641    /// ```
4642    pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4643        self.domain = v.into();
4644        self
4645    }
4646
4647    /// Sets the value of [credentials][crate::model::SalesforceProfile::credentials].
4648    ///
4649    /// Note that all the setters affecting `credentials` are mutually
4650    /// exclusive.
4651    ///
4652    /// # Example
4653    /// ```ignore,no_run
4654    /// # use google_cloud_datastream_v1::model::SalesforceProfile;
4655    /// use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4656    /// let x = SalesforceProfile::new().set_credentials(Some(
4657    ///     google_cloud_datastream_v1::model::salesforce_profile::Credentials::UserCredentials(UserCredentials::default().into())));
4658    /// ```
4659    pub fn set_credentials<
4660        T: std::convert::Into<std::option::Option<crate::model::salesforce_profile::Credentials>>,
4661    >(
4662        mut self,
4663        v: T,
4664    ) -> Self {
4665        self.credentials = v.into();
4666        self
4667    }
4668
4669    /// The value of [credentials][crate::model::SalesforceProfile::credentials]
4670    /// if it holds a `UserCredentials`, `None` if the field is not set or
4671    /// holds a different branch.
4672    pub fn user_credentials(
4673        &self,
4674    ) -> std::option::Option<&std::boxed::Box<crate::model::salesforce_profile::UserCredentials>>
4675    {
4676        #[allow(unreachable_patterns)]
4677        self.credentials.as_ref().and_then(|v| match v {
4678            crate::model::salesforce_profile::Credentials::UserCredentials(v) => {
4679                std::option::Option::Some(v)
4680            }
4681            _ => std::option::Option::None,
4682        })
4683    }
4684
4685    /// Sets the value of [credentials][crate::model::SalesforceProfile::credentials]
4686    /// to hold a `UserCredentials`.
4687    ///
4688    /// Note that all the setters affecting `credentials` are
4689    /// mutually exclusive.
4690    ///
4691    /// # Example
4692    /// ```ignore,no_run
4693    /// # use google_cloud_datastream_v1::model::SalesforceProfile;
4694    /// use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4695    /// let x = SalesforceProfile::new().set_user_credentials(UserCredentials::default()/* use setters */);
4696    /// assert!(x.user_credentials().is_some());
4697    /// assert!(x.oauth2_client_credentials().is_none());
4698    /// ```
4699    pub fn set_user_credentials<
4700        T: std::convert::Into<std::boxed::Box<crate::model::salesforce_profile::UserCredentials>>,
4701    >(
4702        mut self,
4703        v: T,
4704    ) -> Self {
4705        self.credentials = std::option::Option::Some(
4706            crate::model::salesforce_profile::Credentials::UserCredentials(v.into()),
4707        );
4708        self
4709    }
4710
4711    /// The value of [credentials][crate::model::SalesforceProfile::credentials]
4712    /// if it holds a `Oauth2ClientCredentials`, `None` if the field is not set or
4713    /// holds a different branch.
4714    pub fn oauth2_client_credentials(
4715        &self,
4716    ) -> std::option::Option<
4717        &std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>,
4718    > {
4719        #[allow(unreachable_patterns)]
4720        self.credentials.as_ref().and_then(|v| match v {
4721            crate::model::salesforce_profile::Credentials::Oauth2ClientCredentials(v) => {
4722                std::option::Option::Some(v)
4723            }
4724            _ => std::option::Option::None,
4725        })
4726    }
4727
4728    /// Sets the value of [credentials][crate::model::SalesforceProfile::credentials]
4729    /// to hold a `Oauth2ClientCredentials`.
4730    ///
4731    /// Note that all the setters affecting `credentials` are
4732    /// mutually exclusive.
4733    ///
4734    /// # Example
4735    /// ```ignore,no_run
4736    /// # use google_cloud_datastream_v1::model::SalesforceProfile;
4737    /// use google_cloud_datastream_v1::model::salesforce_profile::Oauth2ClientCredentials;
4738    /// let x = SalesforceProfile::new().set_oauth2_client_credentials(Oauth2ClientCredentials::default()/* use setters */);
4739    /// assert!(x.oauth2_client_credentials().is_some());
4740    /// assert!(x.user_credentials().is_none());
4741    /// ```
4742    pub fn set_oauth2_client_credentials<
4743        T: std::convert::Into<
4744                std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>,
4745            >,
4746    >(
4747        mut self,
4748        v: T,
4749    ) -> Self {
4750        self.credentials = std::option::Option::Some(
4751            crate::model::salesforce_profile::Credentials::Oauth2ClientCredentials(v.into()),
4752        );
4753        self
4754    }
4755}
4756
4757impl wkt::message::Message for SalesforceProfile {
4758    fn typename() -> &'static str {
4759        "type.googleapis.com/google.cloud.datastream.v1.SalesforceProfile"
4760    }
4761}
4762
4763/// Defines additional types related to [SalesforceProfile].
4764pub mod salesforce_profile {
4765    #[allow(unused_imports)]
4766    use super::*;
4767
4768    /// Username-password credentials.
4769    #[derive(Clone, Default, PartialEq)]
4770    #[non_exhaustive]
4771    pub struct UserCredentials {
4772        /// Required. Username for the Salesforce connection.
4773        pub username: std::string::String,
4774
4775        /// Optional. Password for the Salesforce connection.
4776        /// Mutually exclusive with the `secret_manager_stored_password` field.
4777        pub password: std::string::String,
4778
4779        /// Optional. Security token for the Salesforce connection.
4780        /// Mutually exclusive with the `secret_manager_stored_security_token` field.
4781        pub security_token: std::string::String,
4782
4783        /// Optional. A reference to a Secret Manager resource name storing the
4784        /// Salesforce connection's password. Mutually exclusive with the `password`
4785        /// field.
4786        pub secret_manager_stored_password: std::string::String,
4787
4788        /// Optional. A reference to a Secret Manager resource name storing the
4789        /// Salesforce connection's security token. Mutually exclusive with the
4790        /// `security_token` field.
4791        pub secret_manager_stored_security_token: std::string::String,
4792
4793        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4794    }
4795
4796    impl UserCredentials {
4797        pub fn new() -> Self {
4798            std::default::Default::default()
4799        }
4800
4801        /// Sets the value of [username][crate::model::salesforce_profile::UserCredentials::username].
4802        ///
4803        /// # Example
4804        /// ```ignore,no_run
4805        /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4806        /// let x = UserCredentials::new().set_username("example");
4807        /// ```
4808        pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4809            self.username = v.into();
4810            self
4811        }
4812
4813        /// Sets the value of [password][crate::model::salesforce_profile::UserCredentials::password].
4814        ///
4815        /// # Example
4816        /// ```ignore,no_run
4817        /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4818        /// let x = UserCredentials::new().set_password("example");
4819        /// ```
4820        pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4821            self.password = v.into();
4822            self
4823        }
4824
4825        /// Sets the value of [security_token][crate::model::salesforce_profile::UserCredentials::security_token].
4826        ///
4827        /// # Example
4828        /// ```ignore,no_run
4829        /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4830        /// let x = UserCredentials::new().set_security_token("example");
4831        /// ```
4832        pub fn set_security_token<T: std::convert::Into<std::string::String>>(
4833            mut self,
4834            v: T,
4835        ) -> Self {
4836            self.security_token = v.into();
4837            self
4838        }
4839
4840        /// Sets the value of [secret_manager_stored_password][crate::model::salesforce_profile::UserCredentials::secret_manager_stored_password].
4841        ///
4842        /// # Example
4843        /// ```ignore,no_run
4844        /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4845        /// let x = UserCredentials::new().set_secret_manager_stored_password("example");
4846        /// ```
4847        pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4848            mut self,
4849            v: T,
4850        ) -> Self {
4851            self.secret_manager_stored_password = v.into();
4852            self
4853        }
4854
4855        /// Sets the value of [secret_manager_stored_security_token][crate::model::salesforce_profile::UserCredentials::secret_manager_stored_security_token].
4856        ///
4857        /// # Example
4858        /// ```ignore,no_run
4859        /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4860        /// let x = UserCredentials::new().set_secret_manager_stored_security_token("example");
4861        /// ```
4862        pub fn set_secret_manager_stored_security_token<
4863            T: std::convert::Into<std::string::String>,
4864        >(
4865            mut self,
4866            v: T,
4867        ) -> Self {
4868            self.secret_manager_stored_security_token = v.into();
4869            self
4870        }
4871    }
4872
4873    impl wkt::message::Message for UserCredentials {
4874        fn typename() -> &'static str {
4875            "type.googleapis.com/google.cloud.datastream.v1.SalesforceProfile.UserCredentials"
4876        }
4877    }
4878
4879    /// OAuth2 Client Credentials.
4880    #[derive(Clone, Default, PartialEq)]
4881    #[non_exhaustive]
4882    pub struct Oauth2ClientCredentials {
4883        /// Required. Client ID for Salesforce OAuth2 Client Credentials.
4884        pub client_id: std::string::String,
4885
4886        /// Optional. Client secret for Salesforce OAuth2 Client Credentials.
4887        /// Mutually exclusive with the `secret_manager_stored_client_secret` field.
4888        pub client_secret: std::string::String,
4889
4890        /// Optional. A reference to a Secret Manager resource name storing the
4891        /// Salesforce OAuth2 client_secret. Mutually exclusive with the
4892        /// `client_secret` field.
4893        pub secret_manager_stored_client_secret: std::string::String,
4894
4895        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4896    }
4897
4898    impl Oauth2ClientCredentials {
4899        pub fn new() -> Self {
4900            std::default::Default::default()
4901        }
4902
4903        /// Sets the value of [client_id][crate::model::salesforce_profile::Oauth2ClientCredentials::client_id].
4904        ///
4905        /// # Example
4906        /// ```ignore,no_run
4907        /// # use google_cloud_datastream_v1::model::salesforce_profile::Oauth2ClientCredentials;
4908        /// let x = Oauth2ClientCredentials::new().set_client_id("example");
4909        /// ```
4910        pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4911            self.client_id = v.into();
4912            self
4913        }
4914
4915        /// Sets the value of [client_secret][crate::model::salesforce_profile::Oauth2ClientCredentials::client_secret].
4916        ///
4917        /// # Example
4918        /// ```ignore,no_run
4919        /// # use google_cloud_datastream_v1::model::salesforce_profile::Oauth2ClientCredentials;
4920        /// let x = Oauth2ClientCredentials::new().set_client_secret("example");
4921        /// ```
4922        pub fn set_client_secret<T: std::convert::Into<std::string::String>>(
4923            mut self,
4924            v: T,
4925        ) -> Self {
4926            self.client_secret = v.into();
4927            self
4928        }
4929
4930        /// Sets the value of [secret_manager_stored_client_secret][crate::model::salesforce_profile::Oauth2ClientCredentials::secret_manager_stored_client_secret].
4931        ///
4932        /// # Example
4933        /// ```ignore,no_run
4934        /// # use google_cloud_datastream_v1::model::salesforce_profile::Oauth2ClientCredentials;
4935        /// let x = Oauth2ClientCredentials::new().set_secret_manager_stored_client_secret("example");
4936        /// ```
4937        pub fn set_secret_manager_stored_client_secret<
4938            T: std::convert::Into<std::string::String>,
4939        >(
4940            mut self,
4941            v: T,
4942        ) -> Self {
4943            self.secret_manager_stored_client_secret = v.into();
4944            self
4945        }
4946    }
4947
4948    impl wkt::message::Message for Oauth2ClientCredentials {
4949        fn typename() -> &'static str {
4950            "type.googleapis.com/google.cloud.datastream.v1.SalesforceProfile.Oauth2ClientCredentials"
4951        }
4952    }
4953
4954    /// Credentials for Salesforce connection.
4955    #[derive(Clone, Debug, PartialEq)]
4956    #[non_exhaustive]
4957    pub enum Credentials {
4958        /// User-password authentication.
4959        UserCredentials(std::boxed::Box<crate::model::salesforce_profile::UserCredentials>),
4960        /// Connected app authentication.
4961        Oauth2ClientCredentials(
4962            std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>,
4963        ),
4964    }
4965}
4966
4967/// MongoDB profile.
4968#[derive(Clone, Default, PartialEq)]
4969#[non_exhaustive]
4970pub struct MongodbProfile {
4971    /// Required. List of host addresses for a MongoDB cluster.
4972    /// For SRV connection format, this list must contain exactly one DNS host
4973    /// without a port. For Standard connection format, this list must contain all
4974    /// the required hosts in the cluster with their respective ports.
4975    pub host_addresses: std::vec::Vec<crate::model::HostAddress>,
4976
4977    /// Optional. Name of the replica set. Only needed for self hosted replica set
4978    /// type MongoDB cluster. For SRV connection format, this field must be empty.
4979    /// For Standard connection format, this field must be specified.
4980    pub replica_set: std::string::String,
4981
4982    /// Required. Username for the MongoDB connection.
4983    pub username: std::string::String,
4984
4985    /// Optional. Password for the MongoDB connection. Mutually exclusive with the
4986    /// `secret_manager_stored_password` field.
4987    pub password: std::string::String,
4988
4989    /// Optional. A reference to a Secret Manager resource name storing the
4990    /// SQLServer connection password. Mutually exclusive with the `password`
4991    /// field.
4992    pub secret_manager_stored_password: std::string::String,
4993
4994    /// Optional. SSL configuration for the MongoDB connection.
4995    pub ssl_config: std::option::Option<crate::model::MongodbSslConfig>,
4996
4997    /// MongoDB connection format.
4998    /// Must specify either srv_connection_format or standard_connection_format.
4999    pub mongodb_connection_format:
5000        std::option::Option<crate::model::mongodb_profile::MongodbConnectionFormat>,
5001
5002    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5003}
5004
5005impl MongodbProfile {
5006    pub fn new() -> Self {
5007        std::default::Default::default()
5008    }
5009
5010    /// Sets the value of [host_addresses][crate::model::MongodbProfile::host_addresses].
5011    ///
5012    /// # Example
5013    /// ```ignore,no_run
5014    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5015    /// use google_cloud_datastream_v1::model::HostAddress;
5016    /// let x = MongodbProfile::new()
5017    ///     .set_host_addresses([
5018    ///         HostAddress::default()/* use setters */,
5019    ///         HostAddress::default()/* use (different) setters */,
5020    ///     ]);
5021    /// ```
5022    pub fn set_host_addresses<T, V>(mut self, v: T) -> Self
5023    where
5024        T: std::iter::IntoIterator<Item = V>,
5025        V: std::convert::Into<crate::model::HostAddress>,
5026    {
5027        use std::iter::Iterator;
5028        self.host_addresses = v.into_iter().map(|i| i.into()).collect();
5029        self
5030    }
5031
5032    /// Sets the value of [replica_set][crate::model::MongodbProfile::replica_set].
5033    ///
5034    /// # Example
5035    /// ```ignore,no_run
5036    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5037    /// let x = MongodbProfile::new().set_replica_set("example");
5038    /// ```
5039    pub fn set_replica_set<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5040        self.replica_set = v.into();
5041        self
5042    }
5043
5044    /// Sets the value of [username][crate::model::MongodbProfile::username].
5045    ///
5046    /// # Example
5047    /// ```ignore,no_run
5048    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5049    /// let x = MongodbProfile::new().set_username("example");
5050    /// ```
5051    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5052        self.username = v.into();
5053        self
5054    }
5055
5056    /// Sets the value of [password][crate::model::MongodbProfile::password].
5057    ///
5058    /// # Example
5059    /// ```ignore,no_run
5060    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5061    /// let x = MongodbProfile::new().set_password("example");
5062    /// ```
5063    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5064        self.password = v.into();
5065        self
5066    }
5067
5068    /// Sets the value of [secret_manager_stored_password][crate::model::MongodbProfile::secret_manager_stored_password].
5069    ///
5070    /// # Example
5071    /// ```ignore,no_run
5072    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5073    /// let x = MongodbProfile::new().set_secret_manager_stored_password("example");
5074    /// ```
5075    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
5076        mut self,
5077        v: T,
5078    ) -> Self {
5079        self.secret_manager_stored_password = v.into();
5080        self
5081    }
5082
5083    /// Sets the value of [ssl_config][crate::model::MongodbProfile::ssl_config].
5084    ///
5085    /// # Example
5086    /// ```ignore,no_run
5087    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5088    /// use google_cloud_datastream_v1::model::MongodbSslConfig;
5089    /// let x = MongodbProfile::new().set_ssl_config(MongodbSslConfig::default()/* use setters */);
5090    /// ```
5091    pub fn set_ssl_config<T>(mut self, v: T) -> Self
5092    where
5093        T: std::convert::Into<crate::model::MongodbSslConfig>,
5094    {
5095        self.ssl_config = std::option::Option::Some(v.into());
5096        self
5097    }
5098
5099    /// Sets or clears the value of [ssl_config][crate::model::MongodbProfile::ssl_config].
5100    ///
5101    /// # Example
5102    /// ```ignore,no_run
5103    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5104    /// use google_cloud_datastream_v1::model::MongodbSslConfig;
5105    /// let x = MongodbProfile::new().set_or_clear_ssl_config(Some(MongodbSslConfig::default()/* use setters */));
5106    /// let x = MongodbProfile::new().set_or_clear_ssl_config(None::<MongodbSslConfig>);
5107    /// ```
5108    pub fn set_or_clear_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
5109    where
5110        T: std::convert::Into<crate::model::MongodbSslConfig>,
5111    {
5112        self.ssl_config = v.map(|x| x.into());
5113        self
5114    }
5115
5116    /// Sets the value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format].
5117    ///
5118    /// Note that all the setters affecting `mongodb_connection_format` are mutually
5119    /// exclusive.
5120    ///
5121    /// # Example
5122    /// ```ignore,no_run
5123    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5124    /// use google_cloud_datastream_v1::model::SrvConnectionFormat;
5125    /// let x = MongodbProfile::new().set_mongodb_connection_format(Some(
5126    ///     google_cloud_datastream_v1::model::mongodb_profile::MongodbConnectionFormat::SrvConnectionFormat(SrvConnectionFormat::default().into())));
5127    /// ```
5128    pub fn set_mongodb_connection_format<
5129        T: std::convert::Into<
5130                std::option::Option<crate::model::mongodb_profile::MongodbConnectionFormat>,
5131            >,
5132    >(
5133        mut self,
5134        v: T,
5135    ) -> Self {
5136        self.mongodb_connection_format = v.into();
5137        self
5138    }
5139
5140    /// The value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
5141    /// if it holds a `SrvConnectionFormat`, `None` if the field is not set or
5142    /// holds a different branch.
5143    pub fn srv_connection_format(
5144        &self,
5145    ) -> std::option::Option<&std::boxed::Box<crate::model::SrvConnectionFormat>> {
5146        #[allow(unreachable_patterns)]
5147        self.mongodb_connection_format
5148            .as_ref()
5149            .and_then(|v| match v {
5150                crate::model::mongodb_profile::MongodbConnectionFormat::SrvConnectionFormat(v) => {
5151                    std::option::Option::Some(v)
5152                }
5153                _ => std::option::Option::None,
5154            })
5155    }
5156
5157    /// Sets the value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
5158    /// to hold a `SrvConnectionFormat`.
5159    ///
5160    /// Note that all the setters affecting `mongodb_connection_format` are
5161    /// mutually exclusive.
5162    ///
5163    /// # Example
5164    /// ```ignore,no_run
5165    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5166    /// use google_cloud_datastream_v1::model::SrvConnectionFormat;
5167    /// let x = MongodbProfile::new().set_srv_connection_format(SrvConnectionFormat::default()/* use setters */);
5168    /// assert!(x.srv_connection_format().is_some());
5169    /// assert!(x.standard_connection_format().is_none());
5170    /// ```
5171    pub fn set_srv_connection_format<
5172        T: std::convert::Into<std::boxed::Box<crate::model::SrvConnectionFormat>>,
5173    >(
5174        mut self,
5175        v: T,
5176    ) -> Self {
5177        self.mongodb_connection_format = std::option::Option::Some(
5178            crate::model::mongodb_profile::MongodbConnectionFormat::SrvConnectionFormat(v.into()),
5179        );
5180        self
5181    }
5182
5183    /// The value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
5184    /// if it holds a `StandardConnectionFormat`, `None` if the field is not set or
5185    /// holds a different branch.
5186    pub fn standard_connection_format(
5187        &self,
5188    ) -> std::option::Option<&std::boxed::Box<crate::model::StandardConnectionFormat>> {
5189        #[allow(unreachable_patterns)]
5190        self.mongodb_connection_format.as_ref().and_then(|v| match v {
5191            crate::model::mongodb_profile::MongodbConnectionFormat::StandardConnectionFormat(v) => std::option::Option::Some(v),
5192            _ => std::option::Option::None,
5193        })
5194    }
5195
5196    /// Sets the value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
5197    /// to hold a `StandardConnectionFormat`.
5198    ///
5199    /// Note that all the setters affecting `mongodb_connection_format` are
5200    /// mutually exclusive.
5201    ///
5202    /// # Example
5203    /// ```ignore,no_run
5204    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5205    /// use google_cloud_datastream_v1::model::StandardConnectionFormat;
5206    /// let x = MongodbProfile::new().set_standard_connection_format(StandardConnectionFormat::default()/* use setters */);
5207    /// assert!(x.standard_connection_format().is_some());
5208    /// assert!(x.srv_connection_format().is_none());
5209    /// ```
5210    pub fn set_standard_connection_format<
5211        T: std::convert::Into<std::boxed::Box<crate::model::StandardConnectionFormat>>,
5212    >(
5213        mut self,
5214        v: T,
5215    ) -> Self {
5216        self.mongodb_connection_format = std::option::Option::Some(
5217            crate::model::mongodb_profile::MongodbConnectionFormat::StandardConnectionFormat(
5218                v.into(),
5219            ),
5220        );
5221        self
5222    }
5223}
5224
5225impl wkt::message::Message for MongodbProfile {
5226    fn typename() -> &'static str {
5227        "type.googleapis.com/google.cloud.datastream.v1.MongodbProfile"
5228    }
5229}
5230
5231/// Defines additional types related to [MongodbProfile].
5232pub mod mongodb_profile {
5233    #[allow(unused_imports)]
5234    use super::*;
5235
5236    /// MongoDB connection format.
5237    /// Must specify either srv_connection_format or standard_connection_format.
5238    #[derive(Clone, Debug, PartialEq)]
5239    #[non_exhaustive]
5240    pub enum MongodbConnectionFormat {
5241        /// Srv connection format.
5242        SrvConnectionFormat(std::boxed::Box<crate::model::SrvConnectionFormat>),
5243        /// Standard connection format.
5244        StandardConnectionFormat(std::boxed::Box<crate::model::StandardConnectionFormat>),
5245    }
5246}
5247
5248/// A HostAddress represents a transport end point, which is the combination
5249/// of an IP address or hostname and a port number.
5250#[derive(Clone, Default, PartialEq)]
5251#[non_exhaustive]
5252pub struct HostAddress {
5253    /// Required. Hostname for the connection.
5254    pub hostname: std::string::String,
5255
5256    /// Optional. Port for the connection.
5257    pub port: i32,
5258
5259    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5260}
5261
5262impl HostAddress {
5263    pub fn new() -> Self {
5264        std::default::Default::default()
5265    }
5266
5267    /// Sets the value of [hostname][crate::model::HostAddress::hostname].
5268    ///
5269    /// # Example
5270    /// ```ignore,no_run
5271    /// # use google_cloud_datastream_v1::model::HostAddress;
5272    /// let x = HostAddress::new().set_hostname("example");
5273    /// ```
5274    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5275        self.hostname = v.into();
5276        self
5277    }
5278
5279    /// Sets the value of [port][crate::model::HostAddress::port].
5280    ///
5281    /// # Example
5282    /// ```ignore,no_run
5283    /// # use google_cloud_datastream_v1::model::HostAddress;
5284    /// let x = HostAddress::new().set_port(42);
5285    /// ```
5286    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5287        self.port = v.into();
5288        self
5289    }
5290}
5291
5292impl wkt::message::Message for HostAddress {
5293    fn typename() -> &'static str {
5294        "type.googleapis.com/google.cloud.datastream.v1.HostAddress"
5295    }
5296}
5297
5298/// Srv connection format.
5299#[derive(Clone, Default, PartialEq)]
5300#[non_exhaustive]
5301pub struct SrvConnectionFormat {
5302    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5303}
5304
5305impl SrvConnectionFormat {
5306    pub fn new() -> Self {
5307        std::default::Default::default()
5308    }
5309}
5310
5311impl wkt::message::Message for SrvConnectionFormat {
5312    fn typename() -> &'static str {
5313        "type.googleapis.com/google.cloud.datastream.v1.SrvConnectionFormat"
5314    }
5315}
5316
5317/// Standard connection format.
5318#[derive(Clone, Default, PartialEq)]
5319#[non_exhaustive]
5320pub struct StandardConnectionFormat {
5321    /// Optional. Specifies whether the client connects directly to the host[:port]
5322    /// in the connection URI.
5323    pub direct_connection: bool,
5324
5325    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5326}
5327
5328impl StandardConnectionFormat {
5329    pub fn new() -> Self {
5330        std::default::Default::default()
5331    }
5332
5333    /// Sets the value of [direct_connection][crate::model::StandardConnectionFormat::direct_connection].
5334    ///
5335    /// # Example
5336    /// ```ignore,no_run
5337    /// # use google_cloud_datastream_v1::model::StandardConnectionFormat;
5338    /// let x = StandardConnectionFormat::new().set_direct_connection(true);
5339    /// ```
5340    pub fn set_direct_connection<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5341        self.direct_connection = v.into();
5342        self
5343    }
5344}
5345
5346impl wkt::message::Message for StandardConnectionFormat {
5347    fn typename() -> &'static str {
5348        "type.googleapis.com/google.cloud.datastream.v1.StandardConnectionFormat"
5349    }
5350}
5351
5352/// Cloud Storage bucket profile.
5353#[derive(Clone, Default, PartialEq)]
5354#[non_exhaustive]
5355pub struct GcsProfile {
5356    /// Required. The Cloud Storage bucket name.
5357    pub bucket: std::string::String,
5358
5359    /// The root path inside the Cloud Storage bucket.
5360    pub root_path: std::string::String,
5361
5362    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5363}
5364
5365impl GcsProfile {
5366    pub fn new() -> Self {
5367        std::default::Default::default()
5368    }
5369
5370    /// Sets the value of [bucket][crate::model::GcsProfile::bucket].
5371    ///
5372    /// # Example
5373    /// ```ignore,no_run
5374    /// # use google_cloud_datastream_v1::model::GcsProfile;
5375    /// let x = GcsProfile::new().set_bucket("example");
5376    /// ```
5377    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5378        self.bucket = v.into();
5379        self
5380    }
5381
5382    /// Sets the value of [root_path][crate::model::GcsProfile::root_path].
5383    ///
5384    /// # Example
5385    /// ```ignore,no_run
5386    /// # use google_cloud_datastream_v1::model::GcsProfile;
5387    /// let x = GcsProfile::new().set_root_path("example");
5388    /// ```
5389    pub fn set_root_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5390        self.root_path = v.into();
5391        self
5392    }
5393}
5394
5395impl wkt::message::Message for GcsProfile {
5396    fn typename() -> &'static str {
5397        "type.googleapis.com/google.cloud.datastream.v1.GcsProfile"
5398    }
5399}
5400
5401/// BigQuery warehouse profile.
5402#[derive(Clone, Default, PartialEq)]
5403#[non_exhaustive]
5404pub struct BigQueryProfile {
5405    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5406}
5407
5408impl BigQueryProfile {
5409    pub fn new() -> Self {
5410        std::default::Default::default()
5411    }
5412}
5413
5414impl wkt::message::Message for BigQueryProfile {
5415    fn typename() -> &'static str {
5416        "type.googleapis.com/google.cloud.datastream.v1.BigQueryProfile"
5417    }
5418}
5419
5420/// Static IP address connectivity. Used when the source database is configured
5421/// to allow incoming connections from the Datastream public IP addresses
5422/// for the region specified in the connection profile.
5423#[derive(Clone, Default, PartialEq)]
5424#[non_exhaustive]
5425pub struct StaticServiceIpConnectivity {
5426    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5427}
5428
5429impl StaticServiceIpConnectivity {
5430    pub fn new() -> Self {
5431        std::default::Default::default()
5432    }
5433}
5434
5435impl wkt::message::Message for StaticServiceIpConnectivity {
5436    fn typename() -> &'static str {
5437        "type.googleapis.com/google.cloud.datastream.v1.StaticServiceIpConnectivity"
5438    }
5439}
5440
5441/// Forward SSH Tunnel connectivity.
5442#[derive(Clone, Default, PartialEq)]
5443#[non_exhaustive]
5444pub struct ForwardSshTunnelConnectivity {
5445    /// Required. Hostname for the SSH tunnel.
5446    pub hostname: std::string::String,
5447
5448    /// Required. Username for the SSH tunnel.
5449    pub username: std::string::String,
5450
5451    /// Port for the SSH tunnel, default value is 22.
5452    pub port: i32,
5453
5454    pub authentication_method:
5455        std::option::Option<crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod>,
5456
5457    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5458}
5459
5460impl ForwardSshTunnelConnectivity {
5461    pub fn new() -> Self {
5462        std::default::Default::default()
5463    }
5464
5465    /// Sets the value of [hostname][crate::model::ForwardSshTunnelConnectivity::hostname].
5466    ///
5467    /// # Example
5468    /// ```ignore,no_run
5469    /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5470    /// let x = ForwardSshTunnelConnectivity::new().set_hostname("example");
5471    /// ```
5472    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5473        self.hostname = v.into();
5474        self
5475    }
5476
5477    /// Sets the value of [username][crate::model::ForwardSshTunnelConnectivity::username].
5478    ///
5479    /// # Example
5480    /// ```ignore,no_run
5481    /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5482    /// let x = ForwardSshTunnelConnectivity::new().set_username("example");
5483    /// ```
5484    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5485        self.username = v.into();
5486        self
5487    }
5488
5489    /// Sets the value of [port][crate::model::ForwardSshTunnelConnectivity::port].
5490    ///
5491    /// # Example
5492    /// ```ignore,no_run
5493    /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5494    /// let x = ForwardSshTunnelConnectivity::new().set_port(42);
5495    /// ```
5496    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5497        self.port = v.into();
5498        self
5499    }
5500
5501    /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method].
5502    ///
5503    /// Note that all the setters affecting `authentication_method` are mutually
5504    /// exclusive.
5505    ///
5506    /// # Example
5507    /// ```ignore,no_run
5508    /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5509    /// use google_cloud_datastream_v1::model::forward_ssh_tunnel_connectivity::AuthenticationMethod;
5510    /// let x = ForwardSshTunnelConnectivity::new().set_authentication_method(Some(AuthenticationMethod::Password("example".to_string())));
5511    /// ```
5512    pub fn set_authentication_method<
5513        T: std::convert::Into<
5514                std::option::Option<
5515                    crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod,
5516                >,
5517            >,
5518    >(
5519        mut self,
5520        v: T,
5521    ) -> Self {
5522        self.authentication_method = v.into();
5523        self
5524    }
5525
5526    /// The value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
5527    /// if it holds a `Password`, `None` if the field is not set or
5528    /// holds a different branch.
5529    pub fn password(&self) -> std::option::Option<&std::string::String> {
5530        #[allow(unreachable_patterns)]
5531        self.authentication_method.as_ref().and_then(|v| match v {
5532            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::Password(v) => {
5533                std::option::Option::Some(v)
5534            }
5535            _ => std::option::Option::None,
5536        })
5537    }
5538
5539    /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
5540    /// to hold a `Password`.
5541    ///
5542    /// Note that all the setters affecting `authentication_method` are
5543    /// mutually exclusive.
5544    ///
5545    /// # Example
5546    /// ```ignore,no_run
5547    /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5548    /// let x = ForwardSshTunnelConnectivity::new().set_password("example");
5549    /// assert!(x.password().is_some());
5550    /// assert!(x.private_key().is_none());
5551    /// ```
5552    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5553        self.authentication_method = std::option::Option::Some(
5554            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::Password(v.into()),
5555        );
5556        self
5557    }
5558
5559    /// The value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
5560    /// if it holds a `PrivateKey`, `None` if the field is not set or
5561    /// holds a different branch.
5562    pub fn private_key(&self) -> std::option::Option<&std::string::String> {
5563        #[allow(unreachable_patterns)]
5564        self.authentication_method.as_ref().and_then(|v| match v {
5565            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::PrivateKey(v) => {
5566                std::option::Option::Some(v)
5567            }
5568            _ => std::option::Option::None,
5569        })
5570    }
5571
5572    /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
5573    /// to hold a `PrivateKey`.
5574    ///
5575    /// Note that all the setters affecting `authentication_method` are
5576    /// mutually exclusive.
5577    ///
5578    /// # Example
5579    /// ```ignore,no_run
5580    /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5581    /// let x = ForwardSshTunnelConnectivity::new().set_private_key("example");
5582    /// assert!(x.private_key().is_some());
5583    /// assert!(x.password().is_none());
5584    /// ```
5585    pub fn set_private_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5586        self.authentication_method = std::option::Option::Some(
5587            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::PrivateKey(
5588                v.into(),
5589            ),
5590        );
5591        self
5592    }
5593}
5594
5595impl wkt::message::Message for ForwardSshTunnelConnectivity {
5596    fn typename() -> &'static str {
5597        "type.googleapis.com/google.cloud.datastream.v1.ForwardSshTunnelConnectivity"
5598    }
5599}
5600
5601/// Defines additional types related to [ForwardSshTunnelConnectivity].
5602pub mod forward_ssh_tunnel_connectivity {
5603    #[allow(unused_imports)]
5604    use super::*;
5605
5606    #[derive(Clone, Debug, PartialEq)]
5607    #[non_exhaustive]
5608    pub enum AuthenticationMethod {
5609        /// Input only. SSH password.
5610        Password(std::string::String),
5611        /// Input only. SSH private key.
5612        PrivateKey(std::string::String),
5613    }
5614}
5615
5616/// The VPC Peering configuration is used to create VPC peering between
5617/// Datastream and the consumer's VPC.
5618#[derive(Clone, Default, PartialEq)]
5619#[non_exhaustive]
5620pub struct VpcPeeringConfig {
5621    /// Required. Fully qualified name of the VPC that Datastream will peer to.
5622    /// Format: `projects/{project}/global/{networks}/{name}`
5623    pub vpc: std::string::String,
5624
5625    /// Required. A free subnet for peering. (CIDR of /29)
5626    pub subnet: std::string::String,
5627
5628    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5629}
5630
5631impl VpcPeeringConfig {
5632    pub fn new() -> Self {
5633        std::default::Default::default()
5634    }
5635
5636    /// Sets the value of [vpc][crate::model::VpcPeeringConfig::vpc].
5637    ///
5638    /// # Example
5639    /// ```ignore,no_run
5640    /// # use google_cloud_datastream_v1::model::VpcPeeringConfig;
5641    /// let x = VpcPeeringConfig::new().set_vpc("example");
5642    /// ```
5643    pub fn set_vpc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5644        self.vpc = v.into();
5645        self
5646    }
5647
5648    /// Sets the value of [subnet][crate::model::VpcPeeringConfig::subnet].
5649    ///
5650    /// # Example
5651    /// ```ignore,no_run
5652    /// # use google_cloud_datastream_v1::model::VpcPeeringConfig;
5653    /// let x = VpcPeeringConfig::new().set_subnet("example");
5654    /// ```
5655    pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5656        self.subnet = v.into();
5657        self
5658    }
5659}
5660
5661impl wkt::message::Message for VpcPeeringConfig {
5662    fn typename() -> &'static str {
5663        "type.googleapis.com/google.cloud.datastream.v1.VpcPeeringConfig"
5664    }
5665}
5666
5667/// The PSC Interface configuration is used to create PSC Interface between
5668/// Datastream and the consumer's PSC.
5669#[derive(Clone, Default, PartialEq)]
5670#[non_exhaustive]
5671pub struct PscInterfaceConfig {
5672    /// Required. Fully qualified name of the Network Attachment that Datastream
5673    /// will connect to. Format:
5674    /// `projects/{project}/regions/{region}/networkAttachments/{name}`
5675    pub network_attachment: std::string::String,
5676
5677    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5678}
5679
5680impl PscInterfaceConfig {
5681    pub fn new() -> Self {
5682        std::default::Default::default()
5683    }
5684
5685    /// Sets the value of [network_attachment][crate::model::PscInterfaceConfig::network_attachment].
5686    ///
5687    /// # Example
5688    /// ```ignore,no_run
5689    /// # use google_cloud_datastream_v1::model::PscInterfaceConfig;
5690    /// let x = PscInterfaceConfig::new().set_network_attachment("example");
5691    /// ```
5692    pub fn set_network_attachment<T: std::convert::Into<std::string::String>>(
5693        mut self,
5694        v: T,
5695    ) -> Self {
5696        self.network_attachment = v.into();
5697        self
5698    }
5699}
5700
5701impl wkt::message::Message for PscInterfaceConfig {
5702    fn typename() -> &'static str {
5703        "type.googleapis.com/google.cloud.datastream.v1.PscInterfaceConfig"
5704    }
5705}
5706
5707/// The PrivateConnection resource is used to establish private connectivity
5708/// between Datastream and a customer's network.
5709#[derive(Clone, Default, PartialEq)]
5710#[non_exhaustive]
5711pub struct PrivateConnection {
5712    /// Output only. Identifier. The resource's name.
5713    pub name: std::string::String,
5714
5715    /// Output only. The create time of the resource.
5716    pub create_time: std::option::Option<wkt::Timestamp>,
5717
5718    /// Output only. The update time of the resource.
5719    pub update_time: std::option::Option<wkt::Timestamp>,
5720
5721    /// Labels.
5722    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5723
5724    /// Required. Display name.
5725    pub display_name: std::string::String,
5726
5727    /// Output only. The state of the Private Connection.
5728    pub state: crate::model::private_connection::State,
5729
5730    /// Output only. In case of error, the details of the error in a user-friendly
5731    /// format.
5732    pub error: std::option::Option<crate::model::Error>,
5733
5734    /// Output only. Reserved for future use.
5735    pub satisfies_pzs: std::option::Option<bool>,
5736
5737    /// Output only. Reserved for future use.
5738    pub satisfies_pzi: std::option::Option<bool>,
5739
5740    /// VPC Peering Config.
5741    pub vpc_peering_config: std::option::Option<crate::model::VpcPeeringConfig>,
5742
5743    /// PSC Interface Config.
5744    pub psc_interface_config: std::option::Option<crate::model::PscInterfaceConfig>,
5745
5746    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5747}
5748
5749impl PrivateConnection {
5750    pub fn new() -> Self {
5751        std::default::Default::default()
5752    }
5753
5754    /// Sets the value of [name][crate::model::PrivateConnection::name].
5755    ///
5756    /// # Example
5757    /// ```ignore,no_run
5758    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5759    /// let x = PrivateConnection::new().set_name("example");
5760    /// ```
5761    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5762        self.name = v.into();
5763        self
5764    }
5765
5766    /// Sets the value of [create_time][crate::model::PrivateConnection::create_time].
5767    ///
5768    /// # Example
5769    /// ```ignore,no_run
5770    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5771    /// use wkt::Timestamp;
5772    /// let x = PrivateConnection::new().set_create_time(Timestamp::default()/* use setters */);
5773    /// ```
5774    pub fn set_create_time<T>(mut self, v: T) -> Self
5775    where
5776        T: std::convert::Into<wkt::Timestamp>,
5777    {
5778        self.create_time = std::option::Option::Some(v.into());
5779        self
5780    }
5781
5782    /// Sets or clears the value of [create_time][crate::model::PrivateConnection::create_time].
5783    ///
5784    /// # Example
5785    /// ```ignore,no_run
5786    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5787    /// use wkt::Timestamp;
5788    /// let x = PrivateConnection::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5789    /// let x = PrivateConnection::new().set_or_clear_create_time(None::<Timestamp>);
5790    /// ```
5791    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5792    where
5793        T: std::convert::Into<wkt::Timestamp>,
5794    {
5795        self.create_time = v.map(|x| x.into());
5796        self
5797    }
5798
5799    /// Sets the value of [update_time][crate::model::PrivateConnection::update_time].
5800    ///
5801    /// # Example
5802    /// ```ignore,no_run
5803    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5804    /// use wkt::Timestamp;
5805    /// let x = PrivateConnection::new().set_update_time(Timestamp::default()/* use setters */);
5806    /// ```
5807    pub fn set_update_time<T>(mut self, v: T) -> Self
5808    where
5809        T: std::convert::Into<wkt::Timestamp>,
5810    {
5811        self.update_time = std::option::Option::Some(v.into());
5812        self
5813    }
5814
5815    /// Sets or clears the value of [update_time][crate::model::PrivateConnection::update_time].
5816    ///
5817    /// # Example
5818    /// ```ignore,no_run
5819    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5820    /// use wkt::Timestamp;
5821    /// let x = PrivateConnection::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5822    /// let x = PrivateConnection::new().set_or_clear_update_time(None::<Timestamp>);
5823    /// ```
5824    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5825    where
5826        T: std::convert::Into<wkt::Timestamp>,
5827    {
5828        self.update_time = v.map(|x| x.into());
5829        self
5830    }
5831
5832    /// Sets the value of [labels][crate::model::PrivateConnection::labels].
5833    ///
5834    /// # Example
5835    /// ```ignore,no_run
5836    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5837    /// let x = PrivateConnection::new().set_labels([
5838    ///     ("key0", "abc"),
5839    ///     ("key1", "xyz"),
5840    /// ]);
5841    /// ```
5842    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5843    where
5844        T: std::iter::IntoIterator<Item = (K, V)>,
5845        K: std::convert::Into<std::string::String>,
5846        V: std::convert::Into<std::string::String>,
5847    {
5848        use std::iter::Iterator;
5849        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5850        self
5851    }
5852
5853    /// Sets the value of [display_name][crate::model::PrivateConnection::display_name].
5854    ///
5855    /// # Example
5856    /// ```ignore,no_run
5857    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5858    /// let x = PrivateConnection::new().set_display_name("example");
5859    /// ```
5860    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5861        self.display_name = v.into();
5862        self
5863    }
5864
5865    /// Sets the value of [state][crate::model::PrivateConnection::state].
5866    ///
5867    /// # Example
5868    /// ```ignore,no_run
5869    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5870    /// use google_cloud_datastream_v1::model::private_connection::State;
5871    /// let x0 = PrivateConnection::new().set_state(State::Creating);
5872    /// let x1 = PrivateConnection::new().set_state(State::Created);
5873    /// let x2 = PrivateConnection::new().set_state(State::Failed);
5874    /// ```
5875    pub fn set_state<T: std::convert::Into<crate::model::private_connection::State>>(
5876        mut self,
5877        v: T,
5878    ) -> Self {
5879        self.state = v.into();
5880        self
5881    }
5882
5883    /// Sets the value of [error][crate::model::PrivateConnection::error].
5884    ///
5885    /// # Example
5886    /// ```ignore,no_run
5887    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5888    /// use google_cloud_datastream_v1::model::Error;
5889    /// let x = PrivateConnection::new().set_error(Error::default()/* use setters */);
5890    /// ```
5891    pub fn set_error<T>(mut self, v: T) -> Self
5892    where
5893        T: std::convert::Into<crate::model::Error>,
5894    {
5895        self.error = std::option::Option::Some(v.into());
5896        self
5897    }
5898
5899    /// Sets or clears the value of [error][crate::model::PrivateConnection::error].
5900    ///
5901    /// # Example
5902    /// ```ignore,no_run
5903    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5904    /// use google_cloud_datastream_v1::model::Error;
5905    /// let x = PrivateConnection::new().set_or_clear_error(Some(Error::default()/* use setters */));
5906    /// let x = PrivateConnection::new().set_or_clear_error(None::<Error>);
5907    /// ```
5908    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
5909    where
5910        T: std::convert::Into<crate::model::Error>,
5911    {
5912        self.error = v.map(|x| x.into());
5913        self
5914    }
5915
5916    /// Sets the value of [satisfies_pzs][crate::model::PrivateConnection::satisfies_pzs].
5917    ///
5918    /// # Example
5919    /// ```ignore,no_run
5920    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5921    /// let x = PrivateConnection::new().set_satisfies_pzs(true);
5922    /// ```
5923    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
5924    where
5925        T: std::convert::Into<bool>,
5926    {
5927        self.satisfies_pzs = std::option::Option::Some(v.into());
5928        self
5929    }
5930
5931    /// Sets or clears the value of [satisfies_pzs][crate::model::PrivateConnection::satisfies_pzs].
5932    ///
5933    /// # Example
5934    /// ```ignore,no_run
5935    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5936    /// let x = PrivateConnection::new().set_or_clear_satisfies_pzs(Some(false));
5937    /// let x = PrivateConnection::new().set_or_clear_satisfies_pzs(None::<bool>);
5938    /// ```
5939    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
5940    where
5941        T: std::convert::Into<bool>,
5942    {
5943        self.satisfies_pzs = v.map(|x| x.into());
5944        self
5945    }
5946
5947    /// Sets the value of [satisfies_pzi][crate::model::PrivateConnection::satisfies_pzi].
5948    ///
5949    /// # Example
5950    /// ```ignore,no_run
5951    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5952    /// let x = PrivateConnection::new().set_satisfies_pzi(true);
5953    /// ```
5954    pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
5955    where
5956        T: std::convert::Into<bool>,
5957    {
5958        self.satisfies_pzi = std::option::Option::Some(v.into());
5959        self
5960    }
5961
5962    /// Sets or clears the value of [satisfies_pzi][crate::model::PrivateConnection::satisfies_pzi].
5963    ///
5964    /// # Example
5965    /// ```ignore,no_run
5966    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5967    /// let x = PrivateConnection::new().set_or_clear_satisfies_pzi(Some(false));
5968    /// let x = PrivateConnection::new().set_or_clear_satisfies_pzi(None::<bool>);
5969    /// ```
5970    pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
5971    where
5972        T: std::convert::Into<bool>,
5973    {
5974        self.satisfies_pzi = v.map(|x| x.into());
5975        self
5976    }
5977
5978    /// Sets the value of [vpc_peering_config][crate::model::PrivateConnection::vpc_peering_config].
5979    ///
5980    /// # Example
5981    /// ```ignore,no_run
5982    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5983    /// use google_cloud_datastream_v1::model::VpcPeeringConfig;
5984    /// let x = PrivateConnection::new().set_vpc_peering_config(VpcPeeringConfig::default()/* use setters */);
5985    /// ```
5986    pub fn set_vpc_peering_config<T>(mut self, v: T) -> Self
5987    where
5988        T: std::convert::Into<crate::model::VpcPeeringConfig>,
5989    {
5990        self.vpc_peering_config = std::option::Option::Some(v.into());
5991        self
5992    }
5993
5994    /// Sets or clears the value of [vpc_peering_config][crate::model::PrivateConnection::vpc_peering_config].
5995    ///
5996    /// # Example
5997    /// ```ignore,no_run
5998    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5999    /// use google_cloud_datastream_v1::model::VpcPeeringConfig;
6000    /// let x = PrivateConnection::new().set_or_clear_vpc_peering_config(Some(VpcPeeringConfig::default()/* use setters */));
6001    /// let x = PrivateConnection::new().set_or_clear_vpc_peering_config(None::<VpcPeeringConfig>);
6002    /// ```
6003    pub fn set_or_clear_vpc_peering_config<T>(mut self, v: std::option::Option<T>) -> Self
6004    where
6005        T: std::convert::Into<crate::model::VpcPeeringConfig>,
6006    {
6007        self.vpc_peering_config = v.map(|x| x.into());
6008        self
6009    }
6010
6011    /// Sets the value of [psc_interface_config][crate::model::PrivateConnection::psc_interface_config].
6012    ///
6013    /// # Example
6014    /// ```ignore,no_run
6015    /// # use google_cloud_datastream_v1::model::PrivateConnection;
6016    /// use google_cloud_datastream_v1::model::PscInterfaceConfig;
6017    /// let x = PrivateConnection::new().set_psc_interface_config(PscInterfaceConfig::default()/* use setters */);
6018    /// ```
6019    pub fn set_psc_interface_config<T>(mut self, v: T) -> Self
6020    where
6021        T: std::convert::Into<crate::model::PscInterfaceConfig>,
6022    {
6023        self.psc_interface_config = std::option::Option::Some(v.into());
6024        self
6025    }
6026
6027    /// Sets or clears the value of [psc_interface_config][crate::model::PrivateConnection::psc_interface_config].
6028    ///
6029    /// # Example
6030    /// ```ignore,no_run
6031    /// # use google_cloud_datastream_v1::model::PrivateConnection;
6032    /// use google_cloud_datastream_v1::model::PscInterfaceConfig;
6033    /// let x = PrivateConnection::new().set_or_clear_psc_interface_config(Some(PscInterfaceConfig::default()/* use setters */));
6034    /// let x = PrivateConnection::new().set_or_clear_psc_interface_config(None::<PscInterfaceConfig>);
6035    /// ```
6036    pub fn set_or_clear_psc_interface_config<T>(mut self, v: std::option::Option<T>) -> Self
6037    where
6038        T: std::convert::Into<crate::model::PscInterfaceConfig>,
6039    {
6040        self.psc_interface_config = v.map(|x| x.into());
6041        self
6042    }
6043}
6044
6045impl wkt::message::Message for PrivateConnection {
6046    fn typename() -> &'static str {
6047        "type.googleapis.com/google.cloud.datastream.v1.PrivateConnection"
6048    }
6049}
6050
6051/// Defines additional types related to [PrivateConnection].
6052pub mod private_connection {
6053    #[allow(unused_imports)]
6054    use super::*;
6055
6056    /// Private Connection state.
6057    ///
6058    /// # Working with unknown values
6059    ///
6060    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6061    /// additional enum variants at any time. Adding new variants is not considered
6062    /// a breaking change. Applications should write their code in anticipation of:
6063    ///
6064    /// - New values appearing in future releases of the client library, **and**
6065    /// - New values received dynamically, without application changes.
6066    ///
6067    /// Please consult the [Working with enums] section in the user guide for some
6068    /// guidelines.
6069    ///
6070    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6071    #[derive(Clone, Debug, PartialEq)]
6072    #[non_exhaustive]
6073    pub enum State {
6074        /// Unspecified state.
6075        Unspecified,
6076        /// The private connection is in creation state - creating resources.
6077        Creating,
6078        /// The private connection has been created with all of its resources.
6079        Created,
6080        /// The private connection creation has failed.
6081        Failed,
6082        /// The private connection is being deleted.
6083        Deleting,
6084        /// Delete request has failed, resource is in invalid state.
6085        FailedToDelete,
6086        /// If set, the enum was initialized with an unknown value.
6087        ///
6088        /// Applications can examine the value using [State::value] or
6089        /// [State::name].
6090        UnknownValue(state::UnknownValue),
6091    }
6092
6093    #[doc(hidden)]
6094    pub mod state {
6095        #[allow(unused_imports)]
6096        use super::*;
6097        #[derive(Clone, Debug, PartialEq)]
6098        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6099    }
6100
6101    impl State {
6102        /// Gets the enum value.
6103        ///
6104        /// Returns `None` if the enum contains an unknown value deserialized from
6105        /// the string representation of enums.
6106        pub fn value(&self) -> std::option::Option<i32> {
6107            match self {
6108                Self::Unspecified => std::option::Option::Some(0),
6109                Self::Creating => std::option::Option::Some(1),
6110                Self::Created => std::option::Option::Some(2),
6111                Self::Failed => std::option::Option::Some(3),
6112                Self::Deleting => std::option::Option::Some(4),
6113                Self::FailedToDelete => std::option::Option::Some(5),
6114                Self::UnknownValue(u) => u.0.value(),
6115            }
6116        }
6117
6118        /// Gets the enum value as a string.
6119        ///
6120        /// Returns `None` if the enum contains an unknown value deserialized from
6121        /// the integer representation of enums.
6122        pub fn name(&self) -> std::option::Option<&str> {
6123            match self {
6124                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6125                Self::Creating => std::option::Option::Some("CREATING"),
6126                Self::Created => std::option::Option::Some("CREATED"),
6127                Self::Failed => std::option::Option::Some("FAILED"),
6128                Self::Deleting => std::option::Option::Some("DELETING"),
6129                Self::FailedToDelete => std::option::Option::Some("FAILED_TO_DELETE"),
6130                Self::UnknownValue(u) => u.0.name(),
6131            }
6132        }
6133    }
6134
6135    impl std::default::Default for State {
6136        fn default() -> Self {
6137            use std::convert::From;
6138            Self::from(0)
6139        }
6140    }
6141
6142    impl std::fmt::Display for State {
6143        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6144            wkt::internal::display_enum(f, self.name(), self.value())
6145        }
6146    }
6147
6148    impl std::convert::From<i32> for State {
6149        fn from(value: i32) -> Self {
6150            match value {
6151                0 => Self::Unspecified,
6152                1 => Self::Creating,
6153                2 => Self::Created,
6154                3 => Self::Failed,
6155                4 => Self::Deleting,
6156                5 => Self::FailedToDelete,
6157                _ => Self::UnknownValue(state::UnknownValue(
6158                    wkt::internal::UnknownEnumValue::Integer(value),
6159                )),
6160            }
6161        }
6162    }
6163
6164    impl std::convert::From<&str> for State {
6165        fn from(value: &str) -> Self {
6166            use std::string::ToString;
6167            match value {
6168                "STATE_UNSPECIFIED" => Self::Unspecified,
6169                "CREATING" => Self::Creating,
6170                "CREATED" => Self::Created,
6171                "FAILED" => Self::Failed,
6172                "DELETING" => Self::Deleting,
6173                "FAILED_TO_DELETE" => Self::FailedToDelete,
6174                _ => Self::UnknownValue(state::UnknownValue(
6175                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6176                )),
6177            }
6178        }
6179    }
6180
6181    impl serde::ser::Serialize for State {
6182        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6183        where
6184            S: serde::Serializer,
6185        {
6186            match self {
6187                Self::Unspecified => serializer.serialize_i32(0),
6188                Self::Creating => serializer.serialize_i32(1),
6189                Self::Created => serializer.serialize_i32(2),
6190                Self::Failed => serializer.serialize_i32(3),
6191                Self::Deleting => serializer.serialize_i32(4),
6192                Self::FailedToDelete => serializer.serialize_i32(5),
6193                Self::UnknownValue(u) => u.0.serialize(serializer),
6194            }
6195        }
6196    }
6197
6198    impl<'de> serde::de::Deserialize<'de> for State {
6199        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6200        where
6201            D: serde::Deserializer<'de>,
6202        {
6203            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6204                ".google.cloud.datastream.v1.PrivateConnection.State",
6205            ))
6206        }
6207    }
6208}
6209
6210/// Private Connectivity
6211#[derive(Clone, Default, PartialEq)]
6212#[non_exhaustive]
6213pub struct PrivateConnectivity {
6214    /// Required. A reference to a private connection resource.
6215    /// Format: `projects/{project}/locations/{location}/privateConnections/{name}`
6216    pub private_connection: std::string::String,
6217
6218    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6219}
6220
6221impl PrivateConnectivity {
6222    pub fn new() -> Self {
6223        std::default::Default::default()
6224    }
6225
6226    /// Sets the value of [private_connection][crate::model::PrivateConnectivity::private_connection].
6227    ///
6228    /// # Example
6229    /// ```ignore,no_run
6230    /// # use google_cloud_datastream_v1::model::PrivateConnectivity;
6231    /// let x = PrivateConnectivity::new().set_private_connection("example");
6232    /// ```
6233    pub fn set_private_connection<T: std::convert::Into<std::string::String>>(
6234        mut self,
6235        v: T,
6236    ) -> Self {
6237        self.private_connection = v.into();
6238        self
6239    }
6240}
6241
6242impl wkt::message::Message for PrivateConnectivity {
6243    fn typename() -> &'static str {
6244        "type.googleapis.com/google.cloud.datastream.v1.PrivateConnectivity"
6245    }
6246}
6247
6248/// The route resource is the child of the private connection resource,
6249/// used for defining a route for a private connection.
6250#[derive(Clone, Default, PartialEq)]
6251#[non_exhaustive]
6252pub struct Route {
6253    /// Output only. Identifier. The resource's name.
6254    pub name: std::string::String,
6255
6256    /// Output only. The create time of the resource.
6257    pub create_time: std::option::Option<wkt::Timestamp>,
6258
6259    /// Output only. The update time of the resource.
6260    pub update_time: std::option::Option<wkt::Timestamp>,
6261
6262    /// Labels.
6263    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6264
6265    /// Required. Display name.
6266    pub display_name: std::string::String,
6267
6268    /// Required. Destination address for connection
6269    pub destination_address: std::string::String,
6270
6271    /// Destination port for connection
6272    pub destination_port: i32,
6273
6274    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6275}
6276
6277impl Route {
6278    pub fn new() -> Self {
6279        std::default::Default::default()
6280    }
6281
6282    /// Sets the value of [name][crate::model::Route::name].
6283    ///
6284    /// # Example
6285    /// ```ignore,no_run
6286    /// # use google_cloud_datastream_v1::model::Route;
6287    /// let x = Route::new().set_name("example");
6288    /// ```
6289    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6290        self.name = v.into();
6291        self
6292    }
6293
6294    /// Sets the value of [create_time][crate::model::Route::create_time].
6295    ///
6296    /// # Example
6297    /// ```ignore,no_run
6298    /// # use google_cloud_datastream_v1::model::Route;
6299    /// use wkt::Timestamp;
6300    /// let x = Route::new().set_create_time(Timestamp::default()/* use setters */);
6301    /// ```
6302    pub fn set_create_time<T>(mut self, v: T) -> Self
6303    where
6304        T: std::convert::Into<wkt::Timestamp>,
6305    {
6306        self.create_time = std::option::Option::Some(v.into());
6307        self
6308    }
6309
6310    /// Sets or clears the value of [create_time][crate::model::Route::create_time].
6311    ///
6312    /// # Example
6313    /// ```ignore,no_run
6314    /// # use google_cloud_datastream_v1::model::Route;
6315    /// use wkt::Timestamp;
6316    /// let x = Route::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6317    /// let x = Route::new().set_or_clear_create_time(None::<Timestamp>);
6318    /// ```
6319    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6320    where
6321        T: std::convert::Into<wkt::Timestamp>,
6322    {
6323        self.create_time = v.map(|x| x.into());
6324        self
6325    }
6326
6327    /// Sets the value of [update_time][crate::model::Route::update_time].
6328    ///
6329    /// # Example
6330    /// ```ignore,no_run
6331    /// # use google_cloud_datastream_v1::model::Route;
6332    /// use wkt::Timestamp;
6333    /// let x = Route::new().set_update_time(Timestamp::default()/* use setters */);
6334    /// ```
6335    pub fn set_update_time<T>(mut self, v: T) -> Self
6336    where
6337        T: std::convert::Into<wkt::Timestamp>,
6338    {
6339        self.update_time = std::option::Option::Some(v.into());
6340        self
6341    }
6342
6343    /// Sets or clears the value of [update_time][crate::model::Route::update_time].
6344    ///
6345    /// # Example
6346    /// ```ignore,no_run
6347    /// # use google_cloud_datastream_v1::model::Route;
6348    /// use wkt::Timestamp;
6349    /// let x = Route::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6350    /// let x = Route::new().set_or_clear_update_time(None::<Timestamp>);
6351    /// ```
6352    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6353    where
6354        T: std::convert::Into<wkt::Timestamp>,
6355    {
6356        self.update_time = v.map(|x| x.into());
6357        self
6358    }
6359
6360    /// Sets the value of [labels][crate::model::Route::labels].
6361    ///
6362    /// # Example
6363    /// ```ignore,no_run
6364    /// # use google_cloud_datastream_v1::model::Route;
6365    /// let x = Route::new().set_labels([
6366    ///     ("key0", "abc"),
6367    ///     ("key1", "xyz"),
6368    /// ]);
6369    /// ```
6370    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6371    where
6372        T: std::iter::IntoIterator<Item = (K, V)>,
6373        K: std::convert::Into<std::string::String>,
6374        V: std::convert::Into<std::string::String>,
6375    {
6376        use std::iter::Iterator;
6377        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6378        self
6379    }
6380
6381    /// Sets the value of [display_name][crate::model::Route::display_name].
6382    ///
6383    /// # Example
6384    /// ```ignore,no_run
6385    /// # use google_cloud_datastream_v1::model::Route;
6386    /// let x = Route::new().set_display_name("example");
6387    /// ```
6388    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6389        self.display_name = v.into();
6390        self
6391    }
6392
6393    /// Sets the value of [destination_address][crate::model::Route::destination_address].
6394    ///
6395    /// # Example
6396    /// ```ignore,no_run
6397    /// # use google_cloud_datastream_v1::model::Route;
6398    /// let x = Route::new().set_destination_address("example");
6399    /// ```
6400    pub fn set_destination_address<T: std::convert::Into<std::string::String>>(
6401        mut self,
6402        v: T,
6403    ) -> Self {
6404        self.destination_address = v.into();
6405        self
6406    }
6407
6408    /// Sets the value of [destination_port][crate::model::Route::destination_port].
6409    ///
6410    /// # Example
6411    /// ```ignore,no_run
6412    /// # use google_cloud_datastream_v1::model::Route;
6413    /// let x = Route::new().set_destination_port(42);
6414    /// ```
6415    pub fn set_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6416        self.destination_port = v.into();
6417        self
6418    }
6419}
6420
6421impl wkt::message::Message for Route {
6422    fn typename() -> &'static str {
6423        "type.googleapis.com/google.cloud.datastream.v1.Route"
6424    }
6425}
6426
6427/// MongoDB SSL configuration information.
6428#[derive(Clone, Default, PartialEq)]
6429#[non_exhaustive]
6430pub struct MongodbSslConfig {
6431    /// Optional. Input only. PEM-encoded private key associated with the Client
6432    /// Certificate. If this field is used then the 'client_certificate' and the
6433    /// 'ca_certificate' fields are mandatory.
6434    pub client_key: std::string::String,
6435
6436    /// Output only. Indicates whether the client_key field is set.
6437    pub client_key_set: bool,
6438
6439    /// Optional. Input only. PEM-encoded certificate that will be used by the
6440    /// replica to authenticate against the source database server. If this field
6441    /// is used then the 'client_key' and the 'ca_certificate' fields are
6442    /// mandatory.
6443    pub client_certificate: std::string::String,
6444
6445    /// Output only. Indicates whether the client_certificate field is set.
6446    pub client_certificate_set: bool,
6447
6448    /// Optional. Input only. PEM-encoded certificate of the CA that signed the
6449    /// source database server's certificate.
6450    pub ca_certificate: std::string::String,
6451
6452    /// Output only. Indicates whether the ca_certificate field is set.
6453    pub ca_certificate_set: bool,
6454
6455    /// Optional. Input only. A reference to a Secret Manager resource name storing
6456    /// the PEM-encoded private key associated with the Client Certificate. If this
6457    /// field is used then the 'client_certificate' and the 'ca_certificate' fields
6458    /// are mandatory. Mutually exclusive with the `client_key` field.
6459    pub secret_manager_stored_client_key: std::string::String,
6460
6461    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6462}
6463
6464impl MongodbSslConfig {
6465    pub fn new() -> Self {
6466        std::default::Default::default()
6467    }
6468
6469    /// Sets the value of [client_key][crate::model::MongodbSslConfig::client_key].
6470    ///
6471    /// # Example
6472    /// ```ignore,no_run
6473    /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6474    /// let x = MongodbSslConfig::new().set_client_key("example");
6475    /// ```
6476    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6477        self.client_key = v.into();
6478        self
6479    }
6480
6481    /// Sets the value of [client_key_set][crate::model::MongodbSslConfig::client_key_set].
6482    ///
6483    /// # Example
6484    /// ```ignore,no_run
6485    /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6486    /// let x = MongodbSslConfig::new().set_client_key_set(true);
6487    /// ```
6488    pub fn set_client_key_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6489        self.client_key_set = v.into();
6490        self
6491    }
6492
6493    /// Sets the value of [client_certificate][crate::model::MongodbSslConfig::client_certificate].
6494    ///
6495    /// # Example
6496    /// ```ignore,no_run
6497    /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6498    /// let x = MongodbSslConfig::new().set_client_certificate("example");
6499    /// ```
6500    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
6501        mut self,
6502        v: T,
6503    ) -> Self {
6504        self.client_certificate = v.into();
6505        self
6506    }
6507
6508    /// Sets the value of [client_certificate_set][crate::model::MongodbSslConfig::client_certificate_set].
6509    ///
6510    /// # Example
6511    /// ```ignore,no_run
6512    /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6513    /// let x = MongodbSslConfig::new().set_client_certificate_set(true);
6514    /// ```
6515    pub fn set_client_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6516        self.client_certificate_set = v.into();
6517        self
6518    }
6519
6520    /// Sets the value of [ca_certificate][crate::model::MongodbSslConfig::ca_certificate].
6521    ///
6522    /// # Example
6523    /// ```ignore,no_run
6524    /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6525    /// let x = MongodbSslConfig::new().set_ca_certificate("example");
6526    /// ```
6527    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6528        self.ca_certificate = v.into();
6529        self
6530    }
6531
6532    /// Sets the value of [ca_certificate_set][crate::model::MongodbSslConfig::ca_certificate_set].
6533    ///
6534    /// # Example
6535    /// ```ignore,no_run
6536    /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6537    /// let x = MongodbSslConfig::new().set_ca_certificate_set(true);
6538    /// ```
6539    pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6540        self.ca_certificate_set = v.into();
6541        self
6542    }
6543
6544    /// Sets the value of [secret_manager_stored_client_key][crate::model::MongodbSslConfig::secret_manager_stored_client_key].
6545    ///
6546    /// # Example
6547    /// ```ignore,no_run
6548    /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6549    /// let x = MongodbSslConfig::new().set_secret_manager_stored_client_key("example");
6550    /// ```
6551    pub fn set_secret_manager_stored_client_key<T: std::convert::Into<std::string::String>>(
6552        mut self,
6553        v: T,
6554    ) -> Self {
6555        self.secret_manager_stored_client_key = v.into();
6556        self
6557    }
6558}
6559
6560impl wkt::message::Message for MongodbSslConfig {
6561    fn typename() -> &'static str {
6562        "type.googleapis.com/google.cloud.datastream.v1.MongodbSslConfig"
6563    }
6564}
6565
6566/// MySQL SSL configuration information.
6567#[derive(Clone, Default, PartialEq)]
6568#[non_exhaustive]
6569pub struct MysqlSslConfig {
6570    /// Optional. Input only. PEM-encoded private key associated with the Client
6571    /// Certificate. If this field is used then the 'client_certificate' and the
6572    /// 'ca_certificate' fields are mandatory.
6573    pub client_key: std::string::String,
6574
6575    /// Output only. Indicates whether the client_key field is set.
6576    pub client_key_set: bool,
6577
6578    /// Optional. Input only. PEM-encoded certificate that will be used by the
6579    /// replica to authenticate against the source database server. If this field
6580    /// is used then the 'client_key' and the 'ca_certificate' fields are
6581    /// mandatory.
6582    pub client_certificate: std::string::String,
6583
6584    /// Output only. Indicates whether the client_certificate field is set.
6585    pub client_certificate_set: bool,
6586
6587    /// Input only. PEM-encoded certificate of the CA that signed the source
6588    /// database server's certificate.
6589    pub ca_certificate: std::string::String,
6590
6591    /// Output only. Indicates whether the ca_certificate field is set.
6592    pub ca_certificate_set: bool,
6593
6594    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6595}
6596
6597impl MysqlSslConfig {
6598    pub fn new() -> Self {
6599        std::default::Default::default()
6600    }
6601
6602    /// Sets the value of [client_key][crate::model::MysqlSslConfig::client_key].
6603    ///
6604    /// # Example
6605    /// ```ignore,no_run
6606    /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6607    /// let x = MysqlSslConfig::new().set_client_key("example");
6608    /// ```
6609    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6610        self.client_key = v.into();
6611        self
6612    }
6613
6614    /// Sets the value of [client_key_set][crate::model::MysqlSslConfig::client_key_set].
6615    ///
6616    /// # Example
6617    /// ```ignore,no_run
6618    /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6619    /// let x = MysqlSslConfig::new().set_client_key_set(true);
6620    /// ```
6621    pub fn set_client_key_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6622        self.client_key_set = v.into();
6623        self
6624    }
6625
6626    /// Sets the value of [client_certificate][crate::model::MysqlSslConfig::client_certificate].
6627    ///
6628    /// # Example
6629    /// ```ignore,no_run
6630    /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6631    /// let x = MysqlSslConfig::new().set_client_certificate("example");
6632    /// ```
6633    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
6634        mut self,
6635        v: T,
6636    ) -> Self {
6637        self.client_certificate = v.into();
6638        self
6639    }
6640
6641    /// Sets the value of [client_certificate_set][crate::model::MysqlSslConfig::client_certificate_set].
6642    ///
6643    /// # Example
6644    /// ```ignore,no_run
6645    /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6646    /// let x = MysqlSslConfig::new().set_client_certificate_set(true);
6647    /// ```
6648    pub fn set_client_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6649        self.client_certificate_set = v.into();
6650        self
6651    }
6652
6653    /// Sets the value of [ca_certificate][crate::model::MysqlSslConfig::ca_certificate].
6654    ///
6655    /// # Example
6656    /// ```ignore,no_run
6657    /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6658    /// let x = MysqlSslConfig::new().set_ca_certificate("example");
6659    /// ```
6660    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6661        self.ca_certificate = v.into();
6662        self
6663    }
6664
6665    /// Sets the value of [ca_certificate_set][crate::model::MysqlSslConfig::ca_certificate_set].
6666    ///
6667    /// # Example
6668    /// ```ignore,no_run
6669    /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6670    /// let x = MysqlSslConfig::new().set_ca_certificate_set(true);
6671    /// ```
6672    pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6673        self.ca_certificate_set = v.into();
6674        self
6675    }
6676}
6677
6678impl wkt::message::Message for MysqlSslConfig {
6679    fn typename() -> &'static str {
6680        "type.googleapis.com/google.cloud.datastream.v1.MysqlSslConfig"
6681    }
6682}
6683
6684/// Oracle SSL configuration information.
6685#[derive(Clone, Default, PartialEq)]
6686#[non_exhaustive]
6687pub struct OracleSslConfig {
6688    /// Input only. PEM-encoded certificate of the CA that signed the source
6689    /// database server's certificate.
6690    pub ca_certificate: std::string::String,
6691
6692    /// Output only. Indicates whether the ca_certificate field has been set for
6693    /// this Connection-Profile.
6694    pub ca_certificate_set: bool,
6695
6696    /// Optional. The distinguished name (DN) mentioned in the server
6697    /// certificate. This corresponds to SSL_SERVER_CERT_DN sqlnet parameter.
6698    /// Refer
6699    /// <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>
6700    /// If this field is not provided, the DN matching is not enforced.
6701    pub server_certificate_distinguished_name: std::string::String,
6702
6703    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6704}
6705
6706impl OracleSslConfig {
6707    pub fn new() -> Self {
6708        std::default::Default::default()
6709    }
6710
6711    /// Sets the value of [ca_certificate][crate::model::OracleSslConfig::ca_certificate].
6712    ///
6713    /// # Example
6714    /// ```ignore,no_run
6715    /// # use google_cloud_datastream_v1::model::OracleSslConfig;
6716    /// let x = OracleSslConfig::new().set_ca_certificate("example");
6717    /// ```
6718    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6719        self.ca_certificate = v.into();
6720        self
6721    }
6722
6723    /// Sets the value of [ca_certificate_set][crate::model::OracleSslConfig::ca_certificate_set].
6724    ///
6725    /// # Example
6726    /// ```ignore,no_run
6727    /// # use google_cloud_datastream_v1::model::OracleSslConfig;
6728    /// let x = OracleSslConfig::new().set_ca_certificate_set(true);
6729    /// ```
6730    pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6731        self.ca_certificate_set = v.into();
6732        self
6733    }
6734
6735    /// Sets the value of [server_certificate_distinguished_name][crate::model::OracleSslConfig::server_certificate_distinguished_name].
6736    ///
6737    /// # Example
6738    /// ```ignore,no_run
6739    /// # use google_cloud_datastream_v1::model::OracleSslConfig;
6740    /// let x = OracleSslConfig::new().set_server_certificate_distinguished_name("example");
6741    /// ```
6742    pub fn set_server_certificate_distinguished_name<T: std::convert::Into<std::string::String>>(
6743        mut self,
6744        v: T,
6745    ) -> Self {
6746        self.server_certificate_distinguished_name = v.into();
6747        self
6748    }
6749}
6750
6751impl wkt::message::Message for OracleSslConfig {
6752    fn typename() -> &'static str {
6753        "type.googleapis.com/google.cloud.datastream.v1.OracleSslConfig"
6754    }
6755}
6756
6757/// PostgreSQL SSL configuration information.
6758#[derive(Clone, Default, PartialEq)]
6759#[non_exhaustive]
6760pub struct PostgresqlSslConfig {
6761    /// The encryption settings available for PostgreSQL connection profiles.
6762    /// This captures various SSL mode supported by PostgreSQL, which includes
6763    /// TLS encryption with server verification, TLS encryption with both server
6764    /// and client verification and no TLS encryption.
6765    pub encryption_setting:
6766        std::option::Option<crate::model::postgresql_ssl_config::EncryptionSetting>,
6767
6768    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6769}
6770
6771impl PostgresqlSslConfig {
6772    pub fn new() -> Self {
6773        std::default::Default::default()
6774    }
6775
6776    /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting].
6777    ///
6778    /// Note that all the setters affecting `encryption_setting` are mutually
6779    /// exclusive.
6780    ///
6781    /// # Example
6782    /// ```ignore,no_run
6783    /// # use google_cloud_datastream_v1::model::PostgresqlSslConfig;
6784    /// use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerVerification;
6785    /// let x = PostgresqlSslConfig::new().set_encryption_setting(Some(
6786    ///     google_cloud_datastream_v1::model::postgresql_ssl_config::EncryptionSetting::ServerVerification(ServerVerification::default().into())));
6787    /// ```
6788    pub fn set_encryption_setting<
6789        T: std::convert::Into<
6790                std::option::Option<crate::model::postgresql_ssl_config::EncryptionSetting>,
6791            >,
6792    >(
6793        mut self,
6794        v: T,
6795    ) -> Self {
6796        self.encryption_setting = v.into();
6797        self
6798    }
6799
6800    /// The value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
6801    /// if it holds a `ServerVerification`, `None` if the field is not set or
6802    /// holds a different branch.
6803    pub fn server_verification(
6804        &self,
6805    ) -> std::option::Option<
6806        &std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
6807    > {
6808        #[allow(unreachable_patterns)]
6809        self.encryption_setting.as_ref().and_then(|v| match v {
6810            crate::model::postgresql_ssl_config::EncryptionSetting::ServerVerification(v) => {
6811                std::option::Option::Some(v)
6812            }
6813            _ => std::option::Option::None,
6814        })
6815    }
6816
6817    /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
6818    /// to hold a `ServerVerification`.
6819    ///
6820    /// Note that all the setters affecting `encryption_setting` are
6821    /// mutually exclusive.
6822    ///
6823    /// # Example
6824    /// ```ignore,no_run
6825    /// # use google_cloud_datastream_v1::model::PostgresqlSslConfig;
6826    /// use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerVerification;
6827    /// let x = PostgresqlSslConfig::new().set_server_verification(ServerVerification::default()/* use setters */);
6828    /// assert!(x.server_verification().is_some());
6829    /// assert!(x.server_and_client_verification().is_none());
6830    /// ```
6831    pub fn set_server_verification<
6832        T: std::convert::Into<
6833                std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
6834            >,
6835    >(
6836        mut self,
6837        v: T,
6838    ) -> Self {
6839        self.encryption_setting = std::option::Option::Some(
6840            crate::model::postgresql_ssl_config::EncryptionSetting::ServerVerification(v.into()),
6841        );
6842        self
6843    }
6844
6845    /// The value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
6846    /// if it holds a `ServerAndClientVerification`, `None` if the field is not set or
6847    /// holds a different branch.
6848    pub fn server_and_client_verification(
6849        &self,
6850    ) -> std::option::Option<
6851        &std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
6852    > {
6853        #[allow(unreachable_patterns)]
6854        self.encryption_setting.as_ref().and_then(|v| match v {
6855            crate::model::postgresql_ssl_config::EncryptionSetting::ServerAndClientVerification(
6856                v,
6857            ) => std::option::Option::Some(v),
6858            _ => std::option::Option::None,
6859        })
6860    }
6861
6862    /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
6863    /// to hold a `ServerAndClientVerification`.
6864    ///
6865    /// Note that all the setters affecting `encryption_setting` are
6866    /// mutually exclusive.
6867    ///
6868    /// # Example
6869    /// ```ignore,no_run
6870    /// # use google_cloud_datastream_v1::model::PostgresqlSslConfig;
6871    /// use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
6872    /// let x = PostgresqlSslConfig::new().set_server_and_client_verification(ServerAndClientVerification::default()/* use setters */);
6873    /// assert!(x.server_and_client_verification().is_some());
6874    /// assert!(x.server_verification().is_none());
6875    /// ```
6876    pub fn set_server_and_client_verification<
6877        T: std::convert::Into<
6878                std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
6879            >,
6880    >(
6881        mut self,
6882        v: T,
6883    ) -> Self {
6884        self.encryption_setting = std::option::Option::Some(
6885            crate::model::postgresql_ssl_config::EncryptionSetting::ServerAndClientVerification(
6886                v.into(),
6887            ),
6888        );
6889        self
6890    }
6891}
6892
6893impl wkt::message::Message for PostgresqlSslConfig {
6894    fn typename() -> &'static str {
6895        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig"
6896    }
6897}
6898
6899/// Defines additional types related to [PostgresqlSslConfig].
6900pub mod postgresql_ssl_config {
6901    #[allow(unused_imports)]
6902    use super::*;
6903
6904    /// Message represents the option where Datastream will enforce the encryption
6905    /// and authenticate the server identity. ca_certificate must be set if user
6906    /// selects this option.
6907    #[derive(Clone, Default, PartialEq)]
6908    #[non_exhaustive]
6909    pub struct ServerVerification {
6910        /// Required. Input only. PEM-encoded server root CA certificate.
6911        pub ca_certificate: std::string::String,
6912
6913        /// Optional. The hostname mentioned in the Subject or SAN extension of the
6914        /// server certificate. If this field is not provided, the hostname in the
6915        /// server certificate is not validated.
6916        pub server_certificate_hostname: std::string::String,
6917
6918        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6919    }
6920
6921    impl ServerVerification {
6922        pub fn new() -> Self {
6923            std::default::Default::default()
6924        }
6925
6926        /// Sets the value of [ca_certificate][crate::model::postgresql_ssl_config::ServerVerification::ca_certificate].
6927        ///
6928        /// # Example
6929        /// ```ignore,no_run
6930        /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerVerification;
6931        /// let x = ServerVerification::new().set_ca_certificate("example");
6932        /// ```
6933        pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(
6934            mut self,
6935            v: T,
6936        ) -> Self {
6937            self.ca_certificate = v.into();
6938            self
6939        }
6940
6941        /// Sets the value of [server_certificate_hostname][crate::model::postgresql_ssl_config::ServerVerification::server_certificate_hostname].
6942        ///
6943        /// # Example
6944        /// ```ignore,no_run
6945        /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerVerification;
6946        /// let x = ServerVerification::new().set_server_certificate_hostname("example");
6947        /// ```
6948        pub fn set_server_certificate_hostname<T: std::convert::Into<std::string::String>>(
6949            mut self,
6950            v: T,
6951        ) -> Self {
6952            self.server_certificate_hostname = v.into();
6953            self
6954        }
6955    }
6956
6957    impl wkt::message::Message for ServerVerification {
6958        fn typename() -> &'static str {
6959            "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig.ServerVerification"
6960        }
6961    }
6962
6963    /// Message represents the option where Datastream will enforce the encryption
6964    /// and authenticate the server identity as well as the client identity.
6965    /// ca_certificate, client_certificate and client_key must be set if user
6966    /// selects this option.
6967    #[derive(Clone, Default, PartialEq)]
6968    #[non_exhaustive]
6969    pub struct ServerAndClientVerification {
6970        /// Required. Input only. PEM-encoded certificate used by the source database
6971        /// to authenticate the client identity (i.e., the Datastream's identity).
6972        /// This certificate is signed by either a root certificate trusted by the
6973        /// server or one or more intermediate certificates (which is stored with the
6974        /// leaf certificate) to link the this certificate to the trusted root
6975        /// certificate.
6976        pub client_certificate: std::string::String,
6977
6978        /// Optional. Input only. PEM-encoded private key associated with the client
6979        /// certificate. This value will be used during the SSL/TLS handshake,
6980        /// allowing the PostgreSQL server to authenticate the client's identity,
6981        /// i.e. identity of the Datastream.
6982        pub client_key: std::string::String,
6983
6984        /// Required. Input only. PEM-encoded server root CA certificate.
6985        pub ca_certificate: std::string::String,
6986
6987        /// Optional. The hostname mentioned in the Subject or SAN extension of the
6988        /// server certificate. If this field is not provided, the hostname in the
6989        /// server certificate is not validated.
6990        pub server_certificate_hostname: std::string::String,
6991
6992        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6993    }
6994
6995    impl ServerAndClientVerification {
6996        pub fn new() -> Self {
6997            std::default::Default::default()
6998        }
6999
7000        /// Sets the value of [client_certificate][crate::model::postgresql_ssl_config::ServerAndClientVerification::client_certificate].
7001        ///
7002        /// # Example
7003        /// ```ignore,no_run
7004        /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
7005        /// let x = ServerAndClientVerification::new().set_client_certificate("example");
7006        /// ```
7007        pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
7008            mut self,
7009            v: T,
7010        ) -> Self {
7011            self.client_certificate = v.into();
7012            self
7013        }
7014
7015        /// Sets the value of [client_key][crate::model::postgresql_ssl_config::ServerAndClientVerification::client_key].
7016        ///
7017        /// # Example
7018        /// ```ignore,no_run
7019        /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
7020        /// let x = ServerAndClientVerification::new().set_client_key("example");
7021        /// ```
7022        pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7023            self.client_key = v.into();
7024            self
7025        }
7026
7027        /// Sets the value of [ca_certificate][crate::model::postgresql_ssl_config::ServerAndClientVerification::ca_certificate].
7028        ///
7029        /// # Example
7030        /// ```ignore,no_run
7031        /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
7032        /// let x = ServerAndClientVerification::new().set_ca_certificate("example");
7033        /// ```
7034        pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(
7035            mut self,
7036            v: T,
7037        ) -> Self {
7038            self.ca_certificate = v.into();
7039            self
7040        }
7041
7042        /// Sets the value of [server_certificate_hostname][crate::model::postgresql_ssl_config::ServerAndClientVerification::server_certificate_hostname].
7043        ///
7044        /// # Example
7045        /// ```ignore,no_run
7046        /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
7047        /// let x = ServerAndClientVerification::new().set_server_certificate_hostname("example");
7048        /// ```
7049        pub fn set_server_certificate_hostname<T: std::convert::Into<std::string::String>>(
7050            mut self,
7051            v: T,
7052        ) -> Self {
7053            self.server_certificate_hostname = v.into();
7054            self
7055        }
7056    }
7057
7058    impl wkt::message::Message for ServerAndClientVerification {
7059        fn typename() -> &'static str {
7060            "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig.ServerAndClientVerification"
7061        }
7062    }
7063
7064    /// The encryption settings available for PostgreSQL connection profiles.
7065    /// This captures various SSL mode supported by PostgreSQL, which includes
7066    /// TLS encryption with server verification, TLS encryption with both server
7067    /// and client verification and no TLS encryption.
7068    #[derive(Clone, Debug, PartialEq)]
7069    #[non_exhaustive]
7070    pub enum EncryptionSetting {
7071        ///  If this field is set, the communication will be encrypted with TLS
7072        /// encryption and the server identity will be authenticated.
7073        ServerVerification(
7074            std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
7075        ),
7076        /// If this field is set, the communication will be encrypted with TLS
7077        /// encryption and both the server identity and the client identity will be
7078        /// authenticated.
7079        ServerAndClientVerification(
7080            std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
7081        ),
7082    }
7083}
7084
7085/// A set of reusable connection configurations to be used as a source or
7086/// destination for a stream.
7087#[derive(Clone, Default, PartialEq)]
7088#[non_exhaustive]
7089pub struct ConnectionProfile {
7090    /// Output only. Identifier. The resource's name.
7091    pub name: std::string::String,
7092
7093    /// Output only. The create time of the resource.
7094    pub create_time: std::option::Option<wkt::Timestamp>,
7095
7096    /// Output only. The update time of the resource.
7097    pub update_time: std::option::Option<wkt::Timestamp>,
7098
7099    /// Labels.
7100    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7101
7102    /// Required. Display name.
7103    pub display_name: std::string::String,
7104
7105    /// Output only. Reserved for future use.
7106    pub satisfies_pzs: std::option::Option<bool>,
7107
7108    /// Output only. Reserved for future use.
7109    pub satisfies_pzi: std::option::Option<bool>,
7110
7111    /// Connection configuration for the ConnectionProfile.
7112    pub profile: std::option::Option<crate::model::connection_profile::Profile>,
7113
7114    /// Connectivity options used to establish a connection to the profile.
7115    pub connectivity: std::option::Option<crate::model::connection_profile::Connectivity>,
7116
7117    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7118}
7119
7120impl ConnectionProfile {
7121    pub fn new() -> Self {
7122        std::default::Default::default()
7123    }
7124
7125    /// Sets the value of [name][crate::model::ConnectionProfile::name].
7126    ///
7127    /// # Example
7128    /// ```ignore,no_run
7129    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7130    /// let x = ConnectionProfile::new().set_name("example");
7131    /// ```
7132    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7133        self.name = v.into();
7134        self
7135    }
7136
7137    /// Sets the value of [create_time][crate::model::ConnectionProfile::create_time].
7138    ///
7139    /// # Example
7140    /// ```ignore,no_run
7141    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7142    /// use wkt::Timestamp;
7143    /// let x = ConnectionProfile::new().set_create_time(Timestamp::default()/* use setters */);
7144    /// ```
7145    pub fn set_create_time<T>(mut self, v: T) -> Self
7146    where
7147        T: std::convert::Into<wkt::Timestamp>,
7148    {
7149        self.create_time = std::option::Option::Some(v.into());
7150        self
7151    }
7152
7153    /// Sets or clears the value of [create_time][crate::model::ConnectionProfile::create_time].
7154    ///
7155    /// # Example
7156    /// ```ignore,no_run
7157    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7158    /// use wkt::Timestamp;
7159    /// let x = ConnectionProfile::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7160    /// let x = ConnectionProfile::new().set_or_clear_create_time(None::<Timestamp>);
7161    /// ```
7162    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7163    where
7164        T: std::convert::Into<wkt::Timestamp>,
7165    {
7166        self.create_time = v.map(|x| x.into());
7167        self
7168    }
7169
7170    /// Sets the value of [update_time][crate::model::ConnectionProfile::update_time].
7171    ///
7172    /// # Example
7173    /// ```ignore,no_run
7174    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7175    /// use wkt::Timestamp;
7176    /// let x = ConnectionProfile::new().set_update_time(Timestamp::default()/* use setters */);
7177    /// ```
7178    pub fn set_update_time<T>(mut self, v: T) -> Self
7179    where
7180        T: std::convert::Into<wkt::Timestamp>,
7181    {
7182        self.update_time = std::option::Option::Some(v.into());
7183        self
7184    }
7185
7186    /// Sets or clears the value of [update_time][crate::model::ConnectionProfile::update_time].
7187    ///
7188    /// # Example
7189    /// ```ignore,no_run
7190    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7191    /// use wkt::Timestamp;
7192    /// let x = ConnectionProfile::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7193    /// let x = ConnectionProfile::new().set_or_clear_update_time(None::<Timestamp>);
7194    /// ```
7195    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7196    where
7197        T: std::convert::Into<wkt::Timestamp>,
7198    {
7199        self.update_time = v.map(|x| x.into());
7200        self
7201    }
7202
7203    /// Sets the value of [labels][crate::model::ConnectionProfile::labels].
7204    ///
7205    /// # Example
7206    /// ```ignore,no_run
7207    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7208    /// let x = ConnectionProfile::new().set_labels([
7209    ///     ("key0", "abc"),
7210    ///     ("key1", "xyz"),
7211    /// ]);
7212    /// ```
7213    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7214    where
7215        T: std::iter::IntoIterator<Item = (K, V)>,
7216        K: std::convert::Into<std::string::String>,
7217        V: std::convert::Into<std::string::String>,
7218    {
7219        use std::iter::Iterator;
7220        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7221        self
7222    }
7223
7224    /// Sets the value of [display_name][crate::model::ConnectionProfile::display_name].
7225    ///
7226    /// # Example
7227    /// ```ignore,no_run
7228    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7229    /// let x = ConnectionProfile::new().set_display_name("example");
7230    /// ```
7231    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7232        self.display_name = v.into();
7233        self
7234    }
7235
7236    /// Sets the value of [satisfies_pzs][crate::model::ConnectionProfile::satisfies_pzs].
7237    ///
7238    /// # Example
7239    /// ```ignore,no_run
7240    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7241    /// let x = ConnectionProfile::new().set_satisfies_pzs(true);
7242    /// ```
7243    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
7244    where
7245        T: std::convert::Into<bool>,
7246    {
7247        self.satisfies_pzs = std::option::Option::Some(v.into());
7248        self
7249    }
7250
7251    /// Sets or clears the value of [satisfies_pzs][crate::model::ConnectionProfile::satisfies_pzs].
7252    ///
7253    /// # Example
7254    /// ```ignore,no_run
7255    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7256    /// let x = ConnectionProfile::new().set_or_clear_satisfies_pzs(Some(false));
7257    /// let x = ConnectionProfile::new().set_or_clear_satisfies_pzs(None::<bool>);
7258    /// ```
7259    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
7260    where
7261        T: std::convert::Into<bool>,
7262    {
7263        self.satisfies_pzs = v.map(|x| x.into());
7264        self
7265    }
7266
7267    /// Sets the value of [satisfies_pzi][crate::model::ConnectionProfile::satisfies_pzi].
7268    ///
7269    /// # Example
7270    /// ```ignore,no_run
7271    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7272    /// let x = ConnectionProfile::new().set_satisfies_pzi(true);
7273    /// ```
7274    pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
7275    where
7276        T: std::convert::Into<bool>,
7277    {
7278        self.satisfies_pzi = std::option::Option::Some(v.into());
7279        self
7280    }
7281
7282    /// Sets or clears the value of [satisfies_pzi][crate::model::ConnectionProfile::satisfies_pzi].
7283    ///
7284    /// # Example
7285    /// ```ignore,no_run
7286    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7287    /// let x = ConnectionProfile::new().set_or_clear_satisfies_pzi(Some(false));
7288    /// let x = ConnectionProfile::new().set_or_clear_satisfies_pzi(None::<bool>);
7289    /// ```
7290    pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
7291    where
7292        T: std::convert::Into<bool>,
7293    {
7294        self.satisfies_pzi = v.map(|x| x.into());
7295        self
7296    }
7297
7298    /// Sets the value of [profile][crate::model::ConnectionProfile::profile].
7299    ///
7300    /// Note that all the setters affecting `profile` are mutually
7301    /// exclusive.
7302    ///
7303    /// # Example
7304    /// ```ignore,no_run
7305    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7306    /// use google_cloud_datastream_v1::model::OracleProfile;
7307    /// let x = ConnectionProfile::new().set_profile(Some(
7308    ///     google_cloud_datastream_v1::model::connection_profile::Profile::OracleProfile(OracleProfile::default().into())));
7309    /// ```
7310    pub fn set_profile<
7311        T: std::convert::Into<std::option::Option<crate::model::connection_profile::Profile>>,
7312    >(
7313        mut self,
7314        v: T,
7315    ) -> Self {
7316        self.profile = v.into();
7317        self
7318    }
7319
7320    /// The value of [profile][crate::model::ConnectionProfile::profile]
7321    /// if it holds a `OracleProfile`, `None` if the field is not set or
7322    /// holds a different branch.
7323    pub fn oracle_profile(
7324        &self,
7325    ) -> std::option::Option<&std::boxed::Box<crate::model::OracleProfile>> {
7326        #[allow(unreachable_patterns)]
7327        self.profile.as_ref().and_then(|v| match v {
7328            crate::model::connection_profile::Profile::OracleProfile(v) => {
7329                std::option::Option::Some(v)
7330            }
7331            _ => std::option::Option::None,
7332        })
7333    }
7334
7335    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7336    /// to hold a `OracleProfile`.
7337    ///
7338    /// Note that all the setters affecting `profile` are
7339    /// mutually exclusive.
7340    ///
7341    /// # Example
7342    /// ```ignore,no_run
7343    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7344    /// use google_cloud_datastream_v1::model::OracleProfile;
7345    /// let x = ConnectionProfile::new().set_oracle_profile(OracleProfile::default()/* use setters */);
7346    /// assert!(x.oracle_profile().is_some());
7347    /// assert!(x.gcs_profile().is_none());
7348    /// assert!(x.mysql_profile().is_none());
7349    /// assert!(x.bigquery_profile().is_none());
7350    /// assert!(x.postgresql_profile().is_none());
7351    /// assert!(x.sql_server_profile().is_none());
7352    /// assert!(x.salesforce_profile().is_none());
7353    /// assert!(x.mongodb_profile().is_none());
7354    /// ```
7355    pub fn set_oracle_profile<
7356        T: std::convert::Into<std::boxed::Box<crate::model::OracleProfile>>,
7357    >(
7358        mut self,
7359        v: T,
7360    ) -> Self {
7361        self.profile = std::option::Option::Some(
7362            crate::model::connection_profile::Profile::OracleProfile(v.into()),
7363        );
7364        self
7365    }
7366
7367    /// The value of [profile][crate::model::ConnectionProfile::profile]
7368    /// if it holds a `GcsProfile`, `None` if the field is not set or
7369    /// holds a different branch.
7370    pub fn gcs_profile(&self) -> std::option::Option<&std::boxed::Box<crate::model::GcsProfile>> {
7371        #[allow(unreachable_patterns)]
7372        self.profile.as_ref().and_then(|v| match v {
7373            crate::model::connection_profile::Profile::GcsProfile(v) => {
7374                std::option::Option::Some(v)
7375            }
7376            _ => std::option::Option::None,
7377        })
7378    }
7379
7380    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7381    /// to hold a `GcsProfile`.
7382    ///
7383    /// Note that all the setters affecting `profile` are
7384    /// mutually exclusive.
7385    ///
7386    /// # Example
7387    /// ```ignore,no_run
7388    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7389    /// use google_cloud_datastream_v1::model::GcsProfile;
7390    /// let x = ConnectionProfile::new().set_gcs_profile(GcsProfile::default()/* use setters */);
7391    /// assert!(x.gcs_profile().is_some());
7392    /// assert!(x.oracle_profile().is_none());
7393    /// assert!(x.mysql_profile().is_none());
7394    /// assert!(x.bigquery_profile().is_none());
7395    /// assert!(x.postgresql_profile().is_none());
7396    /// assert!(x.sql_server_profile().is_none());
7397    /// assert!(x.salesforce_profile().is_none());
7398    /// assert!(x.mongodb_profile().is_none());
7399    /// ```
7400    pub fn set_gcs_profile<T: std::convert::Into<std::boxed::Box<crate::model::GcsProfile>>>(
7401        mut self,
7402        v: T,
7403    ) -> Self {
7404        self.profile = std::option::Option::Some(
7405            crate::model::connection_profile::Profile::GcsProfile(v.into()),
7406        );
7407        self
7408    }
7409
7410    /// The value of [profile][crate::model::ConnectionProfile::profile]
7411    /// if it holds a `MysqlProfile`, `None` if the field is not set or
7412    /// holds a different branch.
7413    pub fn mysql_profile(
7414        &self,
7415    ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlProfile>> {
7416        #[allow(unreachable_patterns)]
7417        self.profile.as_ref().and_then(|v| match v {
7418            crate::model::connection_profile::Profile::MysqlProfile(v) => {
7419                std::option::Option::Some(v)
7420            }
7421            _ => std::option::Option::None,
7422        })
7423    }
7424
7425    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7426    /// to hold a `MysqlProfile`.
7427    ///
7428    /// Note that all the setters affecting `profile` are
7429    /// mutually exclusive.
7430    ///
7431    /// # Example
7432    /// ```ignore,no_run
7433    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7434    /// use google_cloud_datastream_v1::model::MysqlProfile;
7435    /// let x = ConnectionProfile::new().set_mysql_profile(MysqlProfile::default()/* use setters */);
7436    /// assert!(x.mysql_profile().is_some());
7437    /// assert!(x.oracle_profile().is_none());
7438    /// assert!(x.gcs_profile().is_none());
7439    /// assert!(x.bigquery_profile().is_none());
7440    /// assert!(x.postgresql_profile().is_none());
7441    /// assert!(x.sql_server_profile().is_none());
7442    /// assert!(x.salesforce_profile().is_none());
7443    /// assert!(x.mongodb_profile().is_none());
7444    /// ```
7445    pub fn set_mysql_profile<T: std::convert::Into<std::boxed::Box<crate::model::MysqlProfile>>>(
7446        mut self,
7447        v: T,
7448    ) -> Self {
7449        self.profile = std::option::Option::Some(
7450            crate::model::connection_profile::Profile::MysqlProfile(v.into()),
7451        );
7452        self
7453    }
7454
7455    /// The value of [profile][crate::model::ConnectionProfile::profile]
7456    /// if it holds a `BigqueryProfile`, `None` if the field is not set or
7457    /// holds a different branch.
7458    pub fn bigquery_profile(
7459        &self,
7460    ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryProfile>> {
7461        #[allow(unreachable_patterns)]
7462        self.profile.as_ref().and_then(|v| match v {
7463            crate::model::connection_profile::Profile::BigqueryProfile(v) => {
7464                std::option::Option::Some(v)
7465            }
7466            _ => std::option::Option::None,
7467        })
7468    }
7469
7470    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7471    /// to hold a `BigqueryProfile`.
7472    ///
7473    /// Note that all the setters affecting `profile` are
7474    /// mutually exclusive.
7475    ///
7476    /// # Example
7477    /// ```ignore,no_run
7478    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7479    /// use google_cloud_datastream_v1::model::BigQueryProfile;
7480    /// let x = ConnectionProfile::new().set_bigquery_profile(BigQueryProfile::default()/* use setters */);
7481    /// assert!(x.bigquery_profile().is_some());
7482    /// assert!(x.oracle_profile().is_none());
7483    /// assert!(x.gcs_profile().is_none());
7484    /// assert!(x.mysql_profile().is_none());
7485    /// assert!(x.postgresql_profile().is_none());
7486    /// assert!(x.sql_server_profile().is_none());
7487    /// assert!(x.salesforce_profile().is_none());
7488    /// assert!(x.mongodb_profile().is_none());
7489    /// ```
7490    pub fn set_bigquery_profile<
7491        T: std::convert::Into<std::boxed::Box<crate::model::BigQueryProfile>>,
7492    >(
7493        mut self,
7494        v: T,
7495    ) -> Self {
7496        self.profile = std::option::Option::Some(
7497            crate::model::connection_profile::Profile::BigqueryProfile(v.into()),
7498        );
7499        self
7500    }
7501
7502    /// The value of [profile][crate::model::ConnectionProfile::profile]
7503    /// if it holds a `PostgresqlProfile`, `None` if the field is not set or
7504    /// holds a different branch.
7505    pub fn postgresql_profile(
7506        &self,
7507    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlProfile>> {
7508        #[allow(unreachable_patterns)]
7509        self.profile.as_ref().and_then(|v| match v {
7510            crate::model::connection_profile::Profile::PostgresqlProfile(v) => {
7511                std::option::Option::Some(v)
7512            }
7513            _ => std::option::Option::None,
7514        })
7515    }
7516
7517    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7518    /// to hold a `PostgresqlProfile`.
7519    ///
7520    /// Note that all the setters affecting `profile` are
7521    /// mutually exclusive.
7522    ///
7523    /// # Example
7524    /// ```ignore,no_run
7525    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7526    /// use google_cloud_datastream_v1::model::PostgresqlProfile;
7527    /// let x = ConnectionProfile::new().set_postgresql_profile(PostgresqlProfile::default()/* use setters */);
7528    /// assert!(x.postgresql_profile().is_some());
7529    /// assert!(x.oracle_profile().is_none());
7530    /// assert!(x.gcs_profile().is_none());
7531    /// assert!(x.mysql_profile().is_none());
7532    /// assert!(x.bigquery_profile().is_none());
7533    /// assert!(x.sql_server_profile().is_none());
7534    /// assert!(x.salesforce_profile().is_none());
7535    /// assert!(x.mongodb_profile().is_none());
7536    /// ```
7537    pub fn set_postgresql_profile<
7538        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlProfile>>,
7539    >(
7540        mut self,
7541        v: T,
7542    ) -> Self {
7543        self.profile = std::option::Option::Some(
7544            crate::model::connection_profile::Profile::PostgresqlProfile(v.into()),
7545        );
7546        self
7547    }
7548
7549    /// The value of [profile][crate::model::ConnectionProfile::profile]
7550    /// if it holds a `SqlServerProfile`, `None` if the field is not set or
7551    /// holds a different branch.
7552    pub fn sql_server_profile(
7553        &self,
7554    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerProfile>> {
7555        #[allow(unreachable_patterns)]
7556        self.profile.as_ref().and_then(|v| match v {
7557            crate::model::connection_profile::Profile::SqlServerProfile(v) => {
7558                std::option::Option::Some(v)
7559            }
7560            _ => std::option::Option::None,
7561        })
7562    }
7563
7564    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7565    /// to hold a `SqlServerProfile`.
7566    ///
7567    /// Note that all the setters affecting `profile` are
7568    /// mutually exclusive.
7569    ///
7570    /// # Example
7571    /// ```ignore,no_run
7572    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7573    /// use google_cloud_datastream_v1::model::SqlServerProfile;
7574    /// let x = ConnectionProfile::new().set_sql_server_profile(SqlServerProfile::default()/* use setters */);
7575    /// assert!(x.sql_server_profile().is_some());
7576    /// assert!(x.oracle_profile().is_none());
7577    /// assert!(x.gcs_profile().is_none());
7578    /// assert!(x.mysql_profile().is_none());
7579    /// assert!(x.bigquery_profile().is_none());
7580    /// assert!(x.postgresql_profile().is_none());
7581    /// assert!(x.salesforce_profile().is_none());
7582    /// assert!(x.mongodb_profile().is_none());
7583    /// ```
7584    pub fn set_sql_server_profile<
7585        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerProfile>>,
7586    >(
7587        mut self,
7588        v: T,
7589    ) -> Self {
7590        self.profile = std::option::Option::Some(
7591            crate::model::connection_profile::Profile::SqlServerProfile(v.into()),
7592        );
7593        self
7594    }
7595
7596    /// The value of [profile][crate::model::ConnectionProfile::profile]
7597    /// if it holds a `SalesforceProfile`, `None` if the field is not set or
7598    /// holds a different branch.
7599    pub fn salesforce_profile(
7600        &self,
7601    ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceProfile>> {
7602        #[allow(unreachable_patterns)]
7603        self.profile.as_ref().and_then(|v| match v {
7604            crate::model::connection_profile::Profile::SalesforceProfile(v) => {
7605                std::option::Option::Some(v)
7606            }
7607            _ => std::option::Option::None,
7608        })
7609    }
7610
7611    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7612    /// to hold a `SalesforceProfile`.
7613    ///
7614    /// Note that all the setters affecting `profile` are
7615    /// mutually exclusive.
7616    ///
7617    /// # Example
7618    /// ```ignore,no_run
7619    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7620    /// use google_cloud_datastream_v1::model::SalesforceProfile;
7621    /// let x = ConnectionProfile::new().set_salesforce_profile(SalesforceProfile::default()/* use setters */);
7622    /// assert!(x.salesforce_profile().is_some());
7623    /// assert!(x.oracle_profile().is_none());
7624    /// assert!(x.gcs_profile().is_none());
7625    /// assert!(x.mysql_profile().is_none());
7626    /// assert!(x.bigquery_profile().is_none());
7627    /// assert!(x.postgresql_profile().is_none());
7628    /// assert!(x.sql_server_profile().is_none());
7629    /// assert!(x.mongodb_profile().is_none());
7630    /// ```
7631    pub fn set_salesforce_profile<
7632        T: std::convert::Into<std::boxed::Box<crate::model::SalesforceProfile>>,
7633    >(
7634        mut self,
7635        v: T,
7636    ) -> Self {
7637        self.profile = std::option::Option::Some(
7638            crate::model::connection_profile::Profile::SalesforceProfile(v.into()),
7639        );
7640        self
7641    }
7642
7643    /// The value of [profile][crate::model::ConnectionProfile::profile]
7644    /// if it holds a `MongodbProfile`, `None` if the field is not set or
7645    /// holds a different branch.
7646    pub fn mongodb_profile(
7647        &self,
7648    ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbProfile>> {
7649        #[allow(unreachable_patterns)]
7650        self.profile.as_ref().and_then(|v| match v {
7651            crate::model::connection_profile::Profile::MongodbProfile(v) => {
7652                std::option::Option::Some(v)
7653            }
7654            _ => std::option::Option::None,
7655        })
7656    }
7657
7658    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7659    /// to hold a `MongodbProfile`.
7660    ///
7661    /// Note that all the setters affecting `profile` are
7662    /// mutually exclusive.
7663    ///
7664    /// # Example
7665    /// ```ignore,no_run
7666    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7667    /// use google_cloud_datastream_v1::model::MongodbProfile;
7668    /// let x = ConnectionProfile::new().set_mongodb_profile(MongodbProfile::default()/* use setters */);
7669    /// assert!(x.mongodb_profile().is_some());
7670    /// assert!(x.oracle_profile().is_none());
7671    /// assert!(x.gcs_profile().is_none());
7672    /// assert!(x.mysql_profile().is_none());
7673    /// assert!(x.bigquery_profile().is_none());
7674    /// assert!(x.postgresql_profile().is_none());
7675    /// assert!(x.sql_server_profile().is_none());
7676    /// assert!(x.salesforce_profile().is_none());
7677    /// ```
7678    pub fn set_mongodb_profile<
7679        T: std::convert::Into<std::boxed::Box<crate::model::MongodbProfile>>,
7680    >(
7681        mut self,
7682        v: T,
7683    ) -> Self {
7684        self.profile = std::option::Option::Some(
7685            crate::model::connection_profile::Profile::MongodbProfile(v.into()),
7686        );
7687        self
7688    }
7689
7690    /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity].
7691    ///
7692    /// Note that all the setters affecting `connectivity` are mutually
7693    /// exclusive.
7694    ///
7695    /// # Example
7696    /// ```ignore,no_run
7697    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7698    /// use google_cloud_datastream_v1::model::StaticServiceIpConnectivity;
7699    /// let x = ConnectionProfile::new().set_connectivity(Some(
7700    ///     google_cloud_datastream_v1::model::connection_profile::Connectivity::StaticServiceIpConnectivity(StaticServiceIpConnectivity::default().into())));
7701    /// ```
7702    pub fn set_connectivity<
7703        T: std::convert::Into<std::option::Option<crate::model::connection_profile::Connectivity>>,
7704    >(
7705        mut self,
7706        v: T,
7707    ) -> Self {
7708        self.connectivity = v.into();
7709        self
7710    }
7711
7712    /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
7713    /// if it holds a `StaticServiceIpConnectivity`, `None` if the field is not set or
7714    /// holds a different branch.
7715    pub fn static_service_ip_connectivity(
7716        &self,
7717    ) -> std::option::Option<&std::boxed::Box<crate::model::StaticServiceIpConnectivity>> {
7718        #[allow(unreachable_patterns)]
7719        self.connectivity.as_ref().and_then(|v| match v {
7720            crate::model::connection_profile::Connectivity::StaticServiceIpConnectivity(v) => {
7721                std::option::Option::Some(v)
7722            }
7723            _ => std::option::Option::None,
7724        })
7725    }
7726
7727    /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
7728    /// to hold a `StaticServiceIpConnectivity`.
7729    ///
7730    /// Note that all the setters affecting `connectivity` are
7731    /// mutually exclusive.
7732    ///
7733    /// # Example
7734    /// ```ignore,no_run
7735    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7736    /// use google_cloud_datastream_v1::model::StaticServiceIpConnectivity;
7737    /// let x = ConnectionProfile::new().set_static_service_ip_connectivity(StaticServiceIpConnectivity::default()/* use setters */);
7738    /// assert!(x.static_service_ip_connectivity().is_some());
7739    /// assert!(x.forward_ssh_connectivity().is_none());
7740    /// assert!(x.private_connectivity().is_none());
7741    /// ```
7742    pub fn set_static_service_ip_connectivity<
7743        T: std::convert::Into<std::boxed::Box<crate::model::StaticServiceIpConnectivity>>,
7744    >(
7745        mut self,
7746        v: T,
7747    ) -> Self {
7748        self.connectivity = std::option::Option::Some(
7749            crate::model::connection_profile::Connectivity::StaticServiceIpConnectivity(v.into()),
7750        );
7751        self
7752    }
7753
7754    /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
7755    /// if it holds a `ForwardSshConnectivity`, `None` if the field is not set or
7756    /// holds a different branch.
7757    pub fn forward_ssh_connectivity(
7758        &self,
7759    ) -> std::option::Option<&std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>> {
7760        #[allow(unreachable_patterns)]
7761        self.connectivity.as_ref().and_then(|v| match v {
7762            crate::model::connection_profile::Connectivity::ForwardSshConnectivity(v) => {
7763                std::option::Option::Some(v)
7764            }
7765            _ => std::option::Option::None,
7766        })
7767    }
7768
7769    /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
7770    /// to hold a `ForwardSshConnectivity`.
7771    ///
7772    /// Note that all the setters affecting `connectivity` are
7773    /// mutually exclusive.
7774    ///
7775    /// # Example
7776    /// ```ignore,no_run
7777    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7778    /// use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
7779    /// let x = ConnectionProfile::new().set_forward_ssh_connectivity(ForwardSshTunnelConnectivity::default()/* use setters */);
7780    /// assert!(x.forward_ssh_connectivity().is_some());
7781    /// assert!(x.static_service_ip_connectivity().is_none());
7782    /// assert!(x.private_connectivity().is_none());
7783    /// ```
7784    pub fn set_forward_ssh_connectivity<
7785        T: std::convert::Into<std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>>,
7786    >(
7787        mut self,
7788        v: T,
7789    ) -> Self {
7790        self.connectivity = std::option::Option::Some(
7791            crate::model::connection_profile::Connectivity::ForwardSshConnectivity(v.into()),
7792        );
7793        self
7794    }
7795
7796    /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
7797    /// if it holds a `PrivateConnectivity`, `None` if the field is not set or
7798    /// holds a different branch.
7799    pub fn private_connectivity(
7800        &self,
7801    ) -> std::option::Option<&std::boxed::Box<crate::model::PrivateConnectivity>> {
7802        #[allow(unreachable_patterns)]
7803        self.connectivity.as_ref().and_then(|v| match v {
7804            crate::model::connection_profile::Connectivity::PrivateConnectivity(v) => {
7805                std::option::Option::Some(v)
7806            }
7807            _ => std::option::Option::None,
7808        })
7809    }
7810
7811    /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
7812    /// to hold a `PrivateConnectivity`.
7813    ///
7814    /// Note that all the setters affecting `connectivity` are
7815    /// mutually exclusive.
7816    ///
7817    /// # Example
7818    /// ```ignore,no_run
7819    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7820    /// use google_cloud_datastream_v1::model::PrivateConnectivity;
7821    /// let x = ConnectionProfile::new().set_private_connectivity(PrivateConnectivity::default()/* use setters */);
7822    /// assert!(x.private_connectivity().is_some());
7823    /// assert!(x.static_service_ip_connectivity().is_none());
7824    /// assert!(x.forward_ssh_connectivity().is_none());
7825    /// ```
7826    pub fn set_private_connectivity<
7827        T: std::convert::Into<std::boxed::Box<crate::model::PrivateConnectivity>>,
7828    >(
7829        mut self,
7830        v: T,
7831    ) -> Self {
7832        self.connectivity = std::option::Option::Some(
7833            crate::model::connection_profile::Connectivity::PrivateConnectivity(v.into()),
7834        );
7835        self
7836    }
7837}
7838
7839impl wkt::message::Message for ConnectionProfile {
7840    fn typename() -> &'static str {
7841        "type.googleapis.com/google.cloud.datastream.v1.ConnectionProfile"
7842    }
7843}
7844
7845/// Defines additional types related to [ConnectionProfile].
7846pub mod connection_profile {
7847    #[allow(unused_imports)]
7848    use super::*;
7849
7850    /// Connection configuration for the ConnectionProfile.
7851    #[derive(Clone, Debug, PartialEq)]
7852    #[non_exhaustive]
7853    pub enum Profile {
7854        /// Oracle ConnectionProfile configuration.
7855        OracleProfile(std::boxed::Box<crate::model::OracleProfile>),
7856        /// Cloud Storage ConnectionProfile configuration.
7857        GcsProfile(std::boxed::Box<crate::model::GcsProfile>),
7858        /// MySQL ConnectionProfile configuration.
7859        MysqlProfile(std::boxed::Box<crate::model::MysqlProfile>),
7860        /// BigQuery Connection Profile configuration.
7861        BigqueryProfile(std::boxed::Box<crate::model::BigQueryProfile>),
7862        /// PostgreSQL Connection Profile configuration.
7863        PostgresqlProfile(std::boxed::Box<crate::model::PostgresqlProfile>),
7864        /// SQLServer Connection Profile configuration.
7865        SqlServerProfile(std::boxed::Box<crate::model::SqlServerProfile>),
7866        /// Salesforce Connection Profile configuration.
7867        SalesforceProfile(std::boxed::Box<crate::model::SalesforceProfile>),
7868        /// MongoDB Connection Profile configuration.
7869        MongodbProfile(std::boxed::Box<crate::model::MongodbProfile>),
7870    }
7871
7872    /// Connectivity options used to establish a connection to the profile.
7873    #[derive(Clone, Debug, PartialEq)]
7874    #[non_exhaustive]
7875    pub enum Connectivity {
7876        /// Static Service IP connectivity.
7877        StaticServiceIpConnectivity(std::boxed::Box<crate::model::StaticServiceIpConnectivity>),
7878        /// Forward SSH tunnel connectivity.
7879        ForwardSshConnectivity(std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>),
7880        /// Private connectivity.
7881        PrivateConnectivity(std::boxed::Box<crate::model::PrivateConnectivity>),
7882    }
7883}
7884
7885/// Oracle Column.
7886#[derive(Clone, Default, PartialEq)]
7887#[non_exhaustive]
7888pub struct OracleColumn {
7889    /// Column name.
7890    pub column: std::string::String,
7891
7892    /// The Oracle data type.
7893    pub data_type: std::string::String,
7894
7895    /// Column length.
7896    pub length: i32,
7897
7898    /// Column precision.
7899    pub precision: i32,
7900
7901    /// Column scale.
7902    pub scale: i32,
7903
7904    /// Column encoding.
7905    pub encoding: std::string::String,
7906
7907    /// Whether or not the column represents a primary key.
7908    pub primary_key: bool,
7909
7910    /// Whether or not the column can accept a null value.
7911    pub nullable: bool,
7912
7913    /// The ordinal position of the column in the table.
7914    pub ordinal_position: i32,
7915
7916    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7917}
7918
7919impl OracleColumn {
7920    pub fn new() -> Self {
7921        std::default::Default::default()
7922    }
7923
7924    /// Sets the value of [column][crate::model::OracleColumn::column].
7925    ///
7926    /// # Example
7927    /// ```ignore,no_run
7928    /// # use google_cloud_datastream_v1::model::OracleColumn;
7929    /// let x = OracleColumn::new().set_column("example");
7930    /// ```
7931    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7932        self.column = v.into();
7933        self
7934    }
7935
7936    /// Sets the value of [data_type][crate::model::OracleColumn::data_type].
7937    ///
7938    /// # Example
7939    /// ```ignore,no_run
7940    /// # use google_cloud_datastream_v1::model::OracleColumn;
7941    /// let x = OracleColumn::new().set_data_type("example");
7942    /// ```
7943    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7944        self.data_type = v.into();
7945        self
7946    }
7947
7948    /// Sets the value of [length][crate::model::OracleColumn::length].
7949    ///
7950    /// # Example
7951    /// ```ignore,no_run
7952    /// # use google_cloud_datastream_v1::model::OracleColumn;
7953    /// let x = OracleColumn::new().set_length(42);
7954    /// ```
7955    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7956        self.length = v.into();
7957        self
7958    }
7959
7960    /// Sets the value of [precision][crate::model::OracleColumn::precision].
7961    ///
7962    /// # Example
7963    /// ```ignore,no_run
7964    /// # use google_cloud_datastream_v1::model::OracleColumn;
7965    /// let x = OracleColumn::new().set_precision(42);
7966    /// ```
7967    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7968        self.precision = v.into();
7969        self
7970    }
7971
7972    /// Sets the value of [scale][crate::model::OracleColumn::scale].
7973    ///
7974    /// # Example
7975    /// ```ignore,no_run
7976    /// # use google_cloud_datastream_v1::model::OracleColumn;
7977    /// let x = OracleColumn::new().set_scale(42);
7978    /// ```
7979    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7980        self.scale = v.into();
7981        self
7982    }
7983
7984    /// Sets the value of [encoding][crate::model::OracleColumn::encoding].
7985    ///
7986    /// # Example
7987    /// ```ignore,no_run
7988    /// # use google_cloud_datastream_v1::model::OracleColumn;
7989    /// let x = OracleColumn::new().set_encoding("example");
7990    /// ```
7991    pub fn set_encoding<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7992        self.encoding = v.into();
7993        self
7994    }
7995
7996    /// Sets the value of [primary_key][crate::model::OracleColumn::primary_key].
7997    ///
7998    /// # Example
7999    /// ```ignore,no_run
8000    /// # use google_cloud_datastream_v1::model::OracleColumn;
8001    /// let x = OracleColumn::new().set_primary_key(true);
8002    /// ```
8003    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8004        self.primary_key = v.into();
8005        self
8006    }
8007
8008    /// Sets the value of [nullable][crate::model::OracleColumn::nullable].
8009    ///
8010    /// # Example
8011    /// ```ignore,no_run
8012    /// # use google_cloud_datastream_v1::model::OracleColumn;
8013    /// let x = OracleColumn::new().set_nullable(true);
8014    /// ```
8015    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8016        self.nullable = v.into();
8017        self
8018    }
8019
8020    /// Sets the value of [ordinal_position][crate::model::OracleColumn::ordinal_position].
8021    ///
8022    /// # Example
8023    /// ```ignore,no_run
8024    /// # use google_cloud_datastream_v1::model::OracleColumn;
8025    /// let x = OracleColumn::new().set_ordinal_position(42);
8026    /// ```
8027    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8028        self.ordinal_position = v.into();
8029        self
8030    }
8031}
8032
8033impl wkt::message::Message for OracleColumn {
8034    fn typename() -> &'static str {
8035        "type.googleapis.com/google.cloud.datastream.v1.OracleColumn"
8036    }
8037}
8038
8039/// Oracle table.
8040#[derive(Clone, Default, PartialEq)]
8041#[non_exhaustive]
8042pub struct OracleTable {
8043    /// Table name.
8044    pub table: std::string::String,
8045
8046    /// Oracle columns in the schema.
8047    /// When unspecified as part of include/exclude objects, includes/excludes
8048    /// everything.
8049    pub oracle_columns: std::vec::Vec<crate::model::OracleColumn>,
8050
8051    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8052}
8053
8054impl OracleTable {
8055    pub fn new() -> Self {
8056        std::default::Default::default()
8057    }
8058
8059    /// Sets the value of [table][crate::model::OracleTable::table].
8060    ///
8061    /// # Example
8062    /// ```ignore,no_run
8063    /// # use google_cloud_datastream_v1::model::OracleTable;
8064    /// let x = OracleTable::new().set_table("example");
8065    /// ```
8066    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8067        self.table = v.into();
8068        self
8069    }
8070
8071    /// Sets the value of [oracle_columns][crate::model::OracleTable::oracle_columns].
8072    ///
8073    /// # Example
8074    /// ```ignore,no_run
8075    /// # use google_cloud_datastream_v1::model::OracleTable;
8076    /// use google_cloud_datastream_v1::model::OracleColumn;
8077    /// let x = OracleTable::new()
8078    ///     .set_oracle_columns([
8079    ///         OracleColumn::default()/* use setters */,
8080    ///         OracleColumn::default()/* use (different) setters */,
8081    ///     ]);
8082    /// ```
8083    pub fn set_oracle_columns<T, V>(mut self, v: T) -> Self
8084    where
8085        T: std::iter::IntoIterator<Item = V>,
8086        V: std::convert::Into<crate::model::OracleColumn>,
8087    {
8088        use std::iter::Iterator;
8089        self.oracle_columns = v.into_iter().map(|i| i.into()).collect();
8090        self
8091    }
8092}
8093
8094impl wkt::message::Message for OracleTable {
8095    fn typename() -> &'static str {
8096        "type.googleapis.com/google.cloud.datastream.v1.OracleTable"
8097    }
8098}
8099
8100/// Oracle schema.
8101#[derive(Clone, Default, PartialEq)]
8102#[non_exhaustive]
8103pub struct OracleSchema {
8104    /// Schema name.
8105    pub schema: std::string::String,
8106
8107    /// Tables in the schema.
8108    pub oracle_tables: std::vec::Vec<crate::model::OracleTable>,
8109
8110    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8111}
8112
8113impl OracleSchema {
8114    pub fn new() -> Self {
8115        std::default::Default::default()
8116    }
8117
8118    /// Sets the value of [schema][crate::model::OracleSchema::schema].
8119    ///
8120    /// # Example
8121    /// ```ignore,no_run
8122    /// # use google_cloud_datastream_v1::model::OracleSchema;
8123    /// let x = OracleSchema::new().set_schema("example");
8124    /// ```
8125    pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8126        self.schema = v.into();
8127        self
8128    }
8129
8130    /// Sets the value of [oracle_tables][crate::model::OracleSchema::oracle_tables].
8131    ///
8132    /// # Example
8133    /// ```ignore,no_run
8134    /// # use google_cloud_datastream_v1::model::OracleSchema;
8135    /// use google_cloud_datastream_v1::model::OracleTable;
8136    /// let x = OracleSchema::new()
8137    ///     .set_oracle_tables([
8138    ///         OracleTable::default()/* use setters */,
8139    ///         OracleTable::default()/* use (different) setters */,
8140    ///     ]);
8141    /// ```
8142    pub fn set_oracle_tables<T, V>(mut self, v: T) -> Self
8143    where
8144        T: std::iter::IntoIterator<Item = V>,
8145        V: std::convert::Into<crate::model::OracleTable>,
8146    {
8147        use std::iter::Iterator;
8148        self.oracle_tables = v.into_iter().map(|i| i.into()).collect();
8149        self
8150    }
8151}
8152
8153impl wkt::message::Message for OracleSchema {
8154    fn typename() -> &'static str {
8155        "type.googleapis.com/google.cloud.datastream.v1.OracleSchema"
8156    }
8157}
8158
8159/// Oracle database structure.
8160#[derive(Clone, Default, PartialEq)]
8161#[non_exhaustive]
8162pub struct OracleRdbms {
8163    /// Oracle schemas/databases in the database server.
8164    pub oracle_schemas: std::vec::Vec<crate::model::OracleSchema>,
8165
8166    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8167}
8168
8169impl OracleRdbms {
8170    pub fn new() -> Self {
8171        std::default::Default::default()
8172    }
8173
8174    /// Sets the value of [oracle_schemas][crate::model::OracleRdbms::oracle_schemas].
8175    ///
8176    /// # Example
8177    /// ```ignore,no_run
8178    /// # use google_cloud_datastream_v1::model::OracleRdbms;
8179    /// use google_cloud_datastream_v1::model::OracleSchema;
8180    /// let x = OracleRdbms::new()
8181    ///     .set_oracle_schemas([
8182    ///         OracleSchema::default()/* use setters */,
8183    ///         OracleSchema::default()/* use (different) setters */,
8184    ///     ]);
8185    /// ```
8186    pub fn set_oracle_schemas<T, V>(mut self, v: T) -> Self
8187    where
8188        T: std::iter::IntoIterator<Item = V>,
8189        V: std::convert::Into<crate::model::OracleSchema>,
8190    {
8191        use std::iter::Iterator;
8192        self.oracle_schemas = v.into_iter().map(|i| i.into()).collect();
8193        self
8194    }
8195}
8196
8197impl wkt::message::Message for OracleRdbms {
8198    fn typename() -> &'static str {
8199        "type.googleapis.com/google.cloud.datastream.v1.OracleRdbms"
8200    }
8201}
8202
8203/// Oracle data source configuration
8204#[derive(Clone, Default, PartialEq)]
8205#[non_exhaustive]
8206pub struct OracleSourceConfig {
8207    /// Oracle objects to include in the stream.
8208    pub include_objects: std::option::Option<crate::model::OracleRdbms>,
8209
8210    /// Oracle objects to exclude from the stream.
8211    pub exclude_objects: std::option::Option<crate::model::OracleRdbms>,
8212
8213    /// Maximum number of concurrent CDC tasks. The number should be non-negative.
8214    /// If not set (or set to 0), the system's default value is used.
8215    pub max_concurrent_cdc_tasks: i32,
8216
8217    /// Maximum number of concurrent backfill tasks. The number should be
8218    /// non-negative. If not set (or set to 0), the system's default value is used.
8219    pub max_concurrent_backfill_tasks: i32,
8220
8221    /// The configuration for handle Oracle large objects.
8222    pub large_objects_handling:
8223        std::option::Option<crate::model::oracle_source_config::LargeObjectsHandling>,
8224
8225    /// Configuration to select the CDC method.
8226    pub cdc_method: std::option::Option<crate::model::oracle_source_config::CdcMethod>,
8227
8228    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8229}
8230
8231impl OracleSourceConfig {
8232    pub fn new() -> Self {
8233        std::default::Default::default()
8234    }
8235
8236    /// Sets the value of [include_objects][crate::model::OracleSourceConfig::include_objects].
8237    ///
8238    /// # Example
8239    /// ```ignore,no_run
8240    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8241    /// use google_cloud_datastream_v1::model::OracleRdbms;
8242    /// let x = OracleSourceConfig::new().set_include_objects(OracleRdbms::default()/* use setters */);
8243    /// ```
8244    pub fn set_include_objects<T>(mut self, v: T) -> Self
8245    where
8246        T: std::convert::Into<crate::model::OracleRdbms>,
8247    {
8248        self.include_objects = std::option::Option::Some(v.into());
8249        self
8250    }
8251
8252    /// Sets or clears the value of [include_objects][crate::model::OracleSourceConfig::include_objects].
8253    ///
8254    /// # Example
8255    /// ```ignore,no_run
8256    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8257    /// use google_cloud_datastream_v1::model::OracleRdbms;
8258    /// let x = OracleSourceConfig::new().set_or_clear_include_objects(Some(OracleRdbms::default()/* use setters */));
8259    /// let x = OracleSourceConfig::new().set_or_clear_include_objects(None::<OracleRdbms>);
8260    /// ```
8261    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
8262    where
8263        T: std::convert::Into<crate::model::OracleRdbms>,
8264    {
8265        self.include_objects = v.map(|x| x.into());
8266        self
8267    }
8268
8269    /// Sets the value of [exclude_objects][crate::model::OracleSourceConfig::exclude_objects].
8270    ///
8271    /// # Example
8272    /// ```ignore,no_run
8273    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8274    /// use google_cloud_datastream_v1::model::OracleRdbms;
8275    /// let x = OracleSourceConfig::new().set_exclude_objects(OracleRdbms::default()/* use setters */);
8276    /// ```
8277    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
8278    where
8279        T: std::convert::Into<crate::model::OracleRdbms>,
8280    {
8281        self.exclude_objects = std::option::Option::Some(v.into());
8282        self
8283    }
8284
8285    /// Sets or clears the value of [exclude_objects][crate::model::OracleSourceConfig::exclude_objects].
8286    ///
8287    /// # Example
8288    /// ```ignore,no_run
8289    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8290    /// use google_cloud_datastream_v1::model::OracleRdbms;
8291    /// let x = OracleSourceConfig::new().set_or_clear_exclude_objects(Some(OracleRdbms::default()/* use setters */));
8292    /// let x = OracleSourceConfig::new().set_or_clear_exclude_objects(None::<OracleRdbms>);
8293    /// ```
8294    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
8295    where
8296        T: std::convert::Into<crate::model::OracleRdbms>,
8297    {
8298        self.exclude_objects = v.map(|x| x.into());
8299        self
8300    }
8301
8302    /// Sets the value of [max_concurrent_cdc_tasks][crate::model::OracleSourceConfig::max_concurrent_cdc_tasks].
8303    ///
8304    /// # Example
8305    /// ```ignore,no_run
8306    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8307    /// let x = OracleSourceConfig::new().set_max_concurrent_cdc_tasks(42);
8308    /// ```
8309    pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8310        self.max_concurrent_cdc_tasks = v.into();
8311        self
8312    }
8313
8314    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::OracleSourceConfig::max_concurrent_backfill_tasks].
8315    ///
8316    /// # Example
8317    /// ```ignore,no_run
8318    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8319    /// let x = OracleSourceConfig::new().set_max_concurrent_backfill_tasks(42);
8320    /// ```
8321    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8322        self.max_concurrent_backfill_tasks = v.into();
8323        self
8324    }
8325
8326    /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling].
8327    ///
8328    /// Note that all the setters affecting `large_objects_handling` are mutually
8329    /// exclusive.
8330    ///
8331    /// # Example
8332    /// ```ignore,no_run
8333    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8334    /// use google_cloud_datastream_v1::model::oracle_source_config::DropLargeObjects;
8335    /// let x = OracleSourceConfig::new().set_large_objects_handling(Some(
8336    ///     google_cloud_datastream_v1::model::oracle_source_config::LargeObjectsHandling::DropLargeObjects(DropLargeObjects::default().into())));
8337    /// ```
8338    pub fn set_large_objects_handling<
8339        T: std::convert::Into<
8340                std::option::Option<crate::model::oracle_source_config::LargeObjectsHandling>,
8341            >,
8342    >(
8343        mut self,
8344        v: T,
8345    ) -> Self {
8346        self.large_objects_handling = v.into();
8347        self
8348    }
8349
8350    /// The value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
8351    /// if it holds a `DropLargeObjects`, `None` if the field is not set or
8352    /// holds a different branch.
8353    pub fn drop_large_objects(
8354        &self,
8355    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>>
8356    {
8357        #[allow(unreachable_patterns)]
8358        self.large_objects_handling.as_ref().and_then(|v| match v {
8359            crate::model::oracle_source_config::LargeObjectsHandling::DropLargeObjects(v) => {
8360                std::option::Option::Some(v)
8361            }
8362            _ => std::option::Option::None,
8363        })
8364    }
8365
8366    /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
8367    /// to hold a `DropLargeObjects`.
8368    ///
8369    /// Note that all the setters affecting `large_objects_handling` are
8370    /// mutually exclusive.
8371    ///
8372    /// # Example
8373    /// ```ignore,no_run
8374    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8375    /// use google_cloud_datastream_v1::model::oracle_source_config::DropLargeObjects;
8376    /// let x = OracleSourceConfig::new().set_drop_large_objects(DropLargeObjects::default()/* use setters */);
8377    /// assert!(x.drop_large_objects().is_some());
8378    /// assert!(x.stream_large_objects().is_none());
8379    /// ```
8380    pub fn set_drop_large_objects<
8381        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>>,
8382    >(
8383        mut self,
8384        v: T,
8385    ) -> Self {
8386        self.large_objects_handling = std::option::Option::Some(
8387            crate::model::oracle_source_config::LargeObjectsHandling::DropLargeObjects(v.into()),
8388        );
8389        self
8390    }
8391
8392    /// The value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
8393    /// if it holds a `StreamLargeObjects`, `None` if the field is not set or
8394    /// holds a different branch.
8395    pub fn stream_large_objects(
8396        &self,
8397    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>>
8398    {
8399        #[allow(unreachable_patterns)]
8400        self.large_objects_handling.as_ref().and_then(|v| match v {
8401            crate::model::oracle_source_config::LargeObjectsHandling::StreamLargeObjects(v) => {
8402                std::option::Option::Some(v)
8403            }
8404            _ => std::option::Option::None,
8405        })
8406    }
8407
8408    /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
8409    /// to hold a `StreamLargeObjects`.
8410    ///
8411    /// Note that all the setters affecting `large_objects_handling` are
8412    /// mutually exclusive.
8413    ///
8414    /// # Example
8415    /// ```ignore,no_run
8416    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8417    /// use google_cloud_datastream_v1::model::oracle_source_config::StreamLargeObjects;
8418    /// let x = OracleSourceConfig::new().set_stream_large_objects(StreamLargeObjects::default()/* use setters */);
8419    /// assert!(x.stream_large_objects().is_some());
8420    /// assert!(x.drop_large_objects().is_none());
8421    /// ```
8422    pub fn set_stream_large_objects<
8423        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>>,
8424    >(
8425        mut self,
8426        v: T,
8427    ) -> Self {
8428        self.large_objects_handling = std::option::Option::Some(
8429            crate::model::oracle_source_config::LargeObjectsHandling::StreamLargeObjects(v.into()),
8430        );
8431        self
8432    }
8433
8434    /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method].
8435    ///
8436    /// Note that all the setters affecting `cdc_method` are mutually
8437    /// exclusive.
8438    ///
8439    /// # Example
8440    /// ```ignore,no_run
8441    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8442    /// use google_cloud_datastream_v1::model::oracle_source_config::LogMiner;
8443    /// let x = OracleSourceConfig::new().set_cdc_method(Some(
8444    ///     google_cloud_datastream_v1::model::oracle_source_config::CdcMethod::LogMiner(LogMiner::default().into())));
8445    /// ```
8446    pub fn set_cdc_method<
8447        T: std::convert::Into<std::option::Option<crate::model::oracle_source_config::CdcMethod>>,
8448    >(
8449        mut self,
8450        v: T,
8451    ) -> Self {
8452        self.cdc_method = v.into();
8453        self
8454    }
8455
8456    /// The value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
8457    /// if it holds a `LogMiner`, `None` if the field is not set or
8458    /// holds a different branch.
8459    pub fn log_miner(
8460        &self,
8461    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::LogMiner>> {
8462        #[allow(unreachable_patterns)]
8463        self.cdc_method.as_ref().and_then(|v| match v {
8464            crate::model::oracle_source_config::CdcMethod::LogMiner(v) => {
8465                std::option::Option::Some(v)
8466            }
8467            _ => std::option::Option::None,
8468        })
8469    }
8470
8471    /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
8472    /// to hold a `LogMiner`.
8473    ///
8474    /// Note that all the setters affecting `cdc_method` are
8475    /// mutually exclusive.
8476    ///
8477    /// # Example
8478    /// ```ignore,no_run
8479    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8480    /// use google_cloud_datastream_v1::model::oracle_source_config::LogMiner;
8481    /// let x = OracleSourceConfig::new().set_log_miner(LogMiner::default()/* use setters */);
8482    /// assert!(x.log_miner().is_some());
8483    /// assert!(x.binary_log_parser().is_none());
8484    /// ```
8485    pub fn set_log_miner<
8486        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::LogMiner>>,
8487    >(
8488        mut self,
8489        v: T,
8490    ) -> Self {
8491        self.cdc_method = std::option::Option::Some(
8492            crate::model::oracle_source_config::CdcMethod::LogMiner(v.into()),
8493        );
8494        self
8495    }
8496
8497    /// The value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
8498    /// if it holds a `BinaryLogParser`, `None` if the field is not set or
8499    /// holds a different branch.
8500    pub fn binary_log_parser(
8501        &self,
8502    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>>
8503    {
8504        #[allow(unreachable_patterns)]
8505        self.cdc_method.as_ref().and_then(|v| match v {
8506            crate::model::oracle_source_config::CdcMethod::BinaryLogParser(v) => {
8507                std::option::Option::Some(v)
8508            }
8509            _ => std::option::Option::None,
8510        })
8511    }
8512
8513    /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
8514    /// to hold a `BinaryLogParser`.
8515    ///
8516    /// Note that all the setters affecting `cdc_method` are
8517    /// mutually exclusive.
8518    ///
8519    /// # Example
8520    /// ```ignore,no_run
8521    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8522    /// use google_cloud_datastream_v1::model::oracle_source_config::BinaryLogParser;
8523    /// let x = OracleSourceConfig::new().set_binary_log_parser(BinaryLogParser::default()/* use setters */);
8524    /// assert!(x.binary_log_parser().is_some());
8525    /// assert!(x.log_miner().is_none());
8526    /// ```
8527    pub fn set_binary_log_parser<
8528        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>>,
8529    >(
8530        mut self,
8531        v: T,
8532    ) -> Self {
8533        self.cdc_method = std::option::Option::Some(
8534            crate::model::oracle_source_config::CdcMethod::BinaryLogParser(v.into()),
8535        );
8536        self
8537    }
8538}
8539
8540impl wkt::message::Message for OracleSourceConfig {
8541    fn typename() -> &'static str {
8542        "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig"
8543    }
8544}
8545
8546/// Defines additional types related to [OracleSourceConfig].
8547pub mod oracle_source_config {
8548    #[allow(unused_imports)]
8549    use super::*;
8550
8551    /// Configuration to drop large object values.
8552    #[derive(Clone, Default, PartialEq)]
8553    #[non_exhaustive]
8554    pub struct DropLargeObjects {
8555        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8556    }
8557
8558    impl DropLargeObjects {
8559        pub fn new() -> Self {
8560            std::default::Default::default()
8561        }
8562    }
8563
8564    impl wkt::message::Message for DropLargeObjects {
8565        fn typename() -> &'static str {
8566            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.DropLargeObjects"
8567        }
8568    }
8569
8570    /// Configuration to stream large object values.
8571    #[derive(Clone, Default, PartialEq)]
8572    #[non_exhaustive]
8573    pub struct StreamLargeObjects {
8574        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8575    }
8576
8577    impl StreamLargeObjects {
8578        pub fn new() -> Self {
8579            std::default::Default::default()
8580        }
8581    }
8582
8583    impl wkt::message::Message for StreamLargeObjects {
8584        fn typename() -> &'static str {
8585            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.StreamLargeObjects"
8586        }
8587    }
8588
8589    /// Configuration to use LogMiner CDC method.
8590    #[derive(Clone, Default, PartialEq)]
8591    #[non_exhaustive]
8592    pub struct LogMiner {
8593        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8594    }
8595
8596    impl LogMiner {
8597        pub fn new() -> Self {
8598            std::default::Default::default()
8599        }
8600    }
8601
8602    impl wkt::message::Message for LogMiner {
8603        fn typename() -> &'static str {
8604            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.LogMiner"
8605        }
8606    }
8607
8608    /// Configuration to use Binary Log Parser CDC technique.
8609    #[derive(Clone, Default, PartialEq)]
8610    #[non_exhaustive]
8611    pub struct BinaryLogParser {
8612        /// Configuration to specify how the log file should be accessed.
8613        pub log_file_access: std::option::Option<
8614            crate::model::oracle_source_config::binary_log_parser::LogFileAccess,
8615        >,
8616
8617        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8618    }
8619
8620    impl BinaryLogParser {
8621        pub fn new() -> Self {
8622            std::default::Default::default()
8623        }
8624
8625        /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access].
8626        ///
8627        /// Note that all the setters affecting `log_file_access` are mutually
8628        /// exclusive.
8629        ///
8630        /// # Example
8631        /// ```ignore,no_run
8632        /// # use google_cloud_datastream_v1::model::oracle_source_config::BinaryLogParser;
8633        /// use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess;
8634        /// let x = BinaryLogParser::new().set_log_file_access(Some(
8635        ///     google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::LogFileAccess::OracleAsmLogFileAccess(OracleAsmLogFileAccess::default().into())));
8636        /// ```
8637        pub fn set_log_file_access<
8638            T: std::convert::Into<
8639                    std::option::Option<
8640                        crate::model::oracle_source_config::binary_log_parser::LogFileAccess,
8641                    >,
8642                >,
8643        >(
8644            mut self,
8645            v: T,
8646        ) -> Self {
8647            self.log_file_access = v.into();
8648            self
8649        }
8650
8651        /// The value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
8652        /// if it holds a `OracleAsmLogFileAccess`, `None` if the field is not set or
8653        /// holds a different branch.
8654        pub fn oracle_asm_log_file_access(
8655            &self,
8656        ) -> std::option::Option<
8657            &std::boxed::Box<
8658                crate::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess,
8659            >,
8660        > {
8661            #[allow(unreachable_patterns)]
8662            self.log_file_access.as_ref().and_then(|v| match v {
8663                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::OracleAsmLogFileAccess(v) => std::option::Option::Some(v),
8664                _ => std::option::Option::None,
8665            })
8666        }
8667
8668        /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
8669        /// to hold a `OracleAsmLogFileAccess`.
8670        ///
8671        /// Note that all the setters affecting `log_file_access` are
8672        /// mutually exclusive.
8673        ///
8674        /// # Example
8675        /// ```ignore,no_run
8676        /// # use google_cloud_datastream_v1::model::oracle_source_config::BinaryLogParser;
8677        /// use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess;
8678        /// let x = BinaryLogParser::new().set_oracle_asm_log_file_access(OracleAsmLogFileAccess::default()/* use setters */);
8679        /// assert!(x.oracle_asm_log_file_access().is_some());
8680        /// assert!(x.log_file_directories().is_none());
8681        /// ```
8682        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{
8683            self.log_file_access = std::option::Option::Some(
8684                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::OracleAsmLogFileAccess(
8685                    v.into()
8686                )
8687            );
8688            self
8689        }
8690
8691        /// The value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
8692        /// if it holds a `LogFileDirectories`, `None` if the field is not set or
8693        /// holds a different branch.
8694        pub fn log_file_directories(
8695            &self,
8696        ) -> std::option::Option<
8697            &std::boxed::Box<
8698                crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
8699            >,
8700        > {
8701            #[allow(unreachable_patterns)]
8702            self.log_file_access.as_ref().and_then(|v| match v {
8703                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::LogFileDirectories(v) => std::option::Option::Some(v),
8704                _ => std::option::Option::None,
8705            })
8706        }
8707
8708        /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
8709        /// to hold a `LogFileDirectories`.
8710        ///
8711        /// Note that all the setters affecting `log_file_access` are
8712        /// mutually exclusive.
8713        ///
8714        /// # Example
8715        /// ```ignore,no_run
8716        /// # use google_cloud_datastream_v1::model::oracle_source_config::BinaryLogParser;
8717        /// use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::LogFileDirectories;
8718        /// let x = BinaryLogParser::new().set_log_file_directories(LogFileDirectories::default()/* use setters */);
8719        /// assert!(x.log_file_directories().is_some());
8720        /// assert!(x.oracle_asm_log_file_access().is_none());
8721        /// ```
8722        pub fn set_log_file_directories<
8723            T: std::convert::Into<
8724                    std::boxed::Box<
8725                        crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
8726                    >,
8727                >,
8728        >(
8729            mut self,
8730            v: T,
8731        ) -> Self {
8732            self.log_file_access = std::option::Option::Some(
8733                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::LogFileDirectories(
8734                    v.into()
8735                )
8736            );
8737            self
8738        }
8739    }
8740
8741    impl wkt::message::Message for BinaryLogParser {
8742        fn typename() -> &'static str {
8743            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser"
8744        }
8745    }
8746
8747    /// Defines additional types related to [BinaryLogParser].
8748    pub mod binary_log_parser {
8749        #[allow(unused_imports)]
8750        use super::*;
8751
8752        /// Configuration to use Oracle ASM to access the log files.
8753        #[derive(Clone, Default, PartialEq)]
8754        #[non_exhaustive]
8755        pub struct OracleAsmLogFileAccess {
8756            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8757        }
8758
8759        impl OracleAsmLogFileAccess {
8760            pub fn new() -> Self {
8761                std::default::Default::default()
8762            }
8763        }
8764
8765        impl wkt::message::Message for OracleAsmLogFileAccess {
8766            fn typename() -> &'static str {
8767                "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser.OracleAsmLogFileAccess"
8768            }
8769        }
8770
8771        /// Configuration to specify the Oracle directories to access the log files.
8772        #[derive(Clone, Default, PartialEq)]
8773        #[non_exhaustive]
8774        pub struct LogFileDirectories {
8775            /// Required. Oracle directory for online logs.
8776            pub online_log_directory: std::string::String,
8777
8778            /// Required. Oracle directory for archived logs.
8779            pub archived_log_directory: std::string::String,
8780
8781            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8782        }
8783
8784        impl LogFileDirectories {
8785            pub fn new() -> Self {
8786                std::default::Default::default()
8787            }
8788
8789            /// Sets the value of [online_log_directory][crate::model::oracle_source_config::binary_log_parser::LogFileDirectories::online_log_directory].
8790            ///
8791            /// # Example
8792            /// ```ignore,no_run
8793            /// # use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::LogFileDirectories;
8794            /// let x = LogFileDirectories::new().set_online_log_directory("example");
8795            /// ```
8796            pub fn set_online_log_directory<T: std::convert::Into<std::string::String>>(
8797                mut self,
8798                v: T,
8799            ) -> Self {
8800                self.online_log_directory = v.into();
8801                self
8802            }
8803
8804            /// Sets the value of [archived_log_directory][crate::model::oracle_source_config::binary_log_parser::LogFileDirectories::archived_log_directory].
8805            ///
8806            /// # Example
8807            /// ```ignore,no_run
8808            /// # use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::LogFileDirectories;
8809            /// let x = LogFileDirectories::new().set_archived_log_directory("example");
8810            /// ```
8811            pub fn set_archived_log_directory<T: std::convert::Into<std::string::String>>(
8812                mut self,
8813                v: T,
8814            ) -> Self {
8815                self.archived_log_directory = v.into();
8816                self
8817            }
8818        }
8819
8820        impl wkt::message::Message for LogFileDirectories {
8821            fn typename() -> &'static str {
8822                "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser.LogFileDirectories"
8823            }
8824        }
8825
8826        /// Configuration to specify how the log file should be accessed.
8827        #[derive(Clone, Debug, PartialEq)]
8828        #[non_exhaustive]
8829        pub enum LogFileAccess {
8830            /// Use Oracle ASM.
8831            OracleAsmLogFileAccess(
8832                std::boxed::Box<
8833                    crate::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess,
8834                >,
8835            ),
8836            /// Use Oracle directories.
8837            LogFileDirectories(
8838                std::boxed::Box<
8839                    crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
8840                >,
8841            ),
8842        }
8843    }
8844
8845    /// The configuration for handle Oracle large objects.
8846    #[derive(Clone, Debug, PartialEq)]
8847    #[non_exhaustive]
8848    pub enum LargeObjectsHandling {
8849        /// Drop large object values.
8850        DropLargeObjects(std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>),
8851        /// Stream large object values.
8852        StreamLargeObjects(std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>),
8853    }
8854
8855    /// Configuration to select the CDC method.
8856    #[derive(Clone, Debug, PartialEq)]
8857    #[non_exhaustive]
8858    pub enum CdcMethod {
8859        /// Use LogMiner.
8860        LogMiner(std::boxed::Box<crate::model::oracle_source_config::LogMiner>),
8861        /// Use Binary Log Parser.
8862        BinaryLogParser(std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>),
8863    }
8864}
8865
8866/// PostgreSQL Column.
8867#[derive(Clone, Default, PartialEq)]
8868#[non_exhaustive]
8869pub struct PostgresqlColumn {
8870    /// Column name.
8871    pub column: std::string::String,
8872
8873    /// The PostgreSQL data type.
8874    pub data_type: std::string::String,
8875
8876    /// Column length.
8877    pub length: i32,
8878
8879    /// Column precision.
8880    pub precision: i32,
8881
8882    /// Column scale.
8883    pub scale: i32,
8884
8885    /// Whether or not the column represents a primary key.
8886    pub primary_key: bool,
8887
8888    /// Whether or not the column can accept a null value.
8889    pub nullable: bool,
8890
8891    /// The ordinal position of the column in the table.
8892    pub ordinal_position: i32,
8893
8894    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8895}
8896
8897impl PostgresqlColumn {
8898    pub fn new() -> Self {
8899        std::default::Default::default()
8900    }
8901
8902    /// Sets the value of [column][crate::model::PostgresqlColumn::column].
8903    ///
8904    /// # Example
8905    /// ```ignore,no_run
8906    /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
8907    /// let x = PostgresqlColumn::new().set_column("example");
8908    /// ```
8909    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8910        self.column = v.into();
8911        self
8912    }
8913
8914    /// Sets the value of [data_type][crate::model::PostgresqlColumn::data_type].
8915    ///
8916    /// # Example
8917    /// ```ignore,no_run
8918    /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
8919    /// let x = PostgresqlColumn::new().set_data_type("example");
8920    /// ```
8921    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8922        self.data_type = v.into();
8923        self
8924    }
8925
8926    /// Sets the value of [length][crate::model::PostgresqlColumn::length].
8927    ///
8928    /// # Example
8929    /// ```ignore,no_run
8930    /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
8931    /// let x = PostgresqlColumn::new().set_length(42);
8932    /// ```
8933    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8934        self.length = v.into();
8935        self
8936    }
8937
8938    /// Sets the value of [precision][crate::model::PostgresqlColumn::precision].
8939    ///
8940    /// # Example
8941    /// ```ignore,no_run
8942    /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
8943    /// let x = PostgresqlColumn::new().set_precision(42);
8944    /// ```
8945    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8946        self.precision = v.into();
8947        self
8948    }
8949
8950    /// Sets the value of [scale][crate::model::PostgresqlColumn::scale].
8951    ///
8952    /// # Example
8953    /// ```ignore,no_run
8954    /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
8955    /// let x = PostgresqlColumn::new().set_scale(42);
8956    /// ```
8957    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8958        self.scale = v.into();
8959        self
8960    }
8961
8962    /// Sets the value of [primary_key][crate::model::PostgresqlColumn::primary_key].
8963    ///
8964    /// # Example
8965    /// ```ignore,no_run
8966    /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
8967    /// let x = PostgresqlColumn::new().set_primary_key(true);
8968    /// ```
8969    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8970        self.primary_key = v.into();
8971        self
8972    }
8973
8974    /// Sets the value of [nullable][crate::model::PostgresqlColumn::nullable].
8975    ///
8976    /// # Example
8977    /// ```ignore,no_run
8978    /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
8979    /// let x = PostgresqlColumn::new().set_nullable(true);
8980    /// ```
8981    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8982        self.nullable = v.into();
8983        self
8984    }
8985
8986    /// Sets the value of [ordinal_position][crate::model::PostgresqlColumn::ordinal_position].
8987    ///
8988    /// # Example
8989    /// ```ignore,no_run
8990    /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
8991    /// let x = PostgresqlColumn::new().set_ordinal_position(42);
8992    /// ```
8993    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8994        self.ordinal_position = v.into();
8995        self
8996    }
8997}
8998
8999impl wkt::message::Message for PostgresqlColumn {
9000    fn typename() -> &'static str {
9001        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlColumn"
9002    }
9003}
9004
9005/// PostgreSQL table.
9006#[derive(Clone, Default, PartialEq)]
9007#[non_exhaustive]
9008pub struct PostgresqlTable {
9009    /// Table name.
9010    pub table: std::string::String,
9011
9012    /// PostgreSQL columns in the schema.
9013    /// When unspecified as part of include/exclude objects,
9014    /// includes/excludes everything.
9015    pub postgresql_columns: std::vec::Vec<crate::model::PostgresqlColumn>,
9016
9017    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9018}
9019
9020impl PostgresqlTable {
9021    pub fn new() -> Self {
9022        std::default::Default::default()
9023    }
9024
9025    /// Sets the value of [table][crate::model::PostgresqlTable::table].
9026    ///
9027    /// # Example
9028    /// ```ignore,no_run
9029    /// # use google_cloud_datastream_v1::model::PostgresqlTable;
9030    /// let x = PostgresqlTable::new().set_table("example");
9031    /// ```
9032    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9033        self.table = v.into();
9034        self
9035    }
9036
9037    /// Sets the value of [postgresql_columns][crate::model::PostgresqlTable::postgresql_columns].
9038    ///
9039    /// # Example
9040    /// ```ignore,no_run
9041    /// # use google_cloud_datastream_v1::model::PostgresqlTable;
9042    /// use google_cloud_datastream_v1::model::PostgresqlColumn;
9043    /// let x = PostgresqlTable::new()
9044    ///     .set_postgresql_columns([
9045    ///         PostgresqlColumn::default()/* use setters */,
9046    ///         PostgresqlColumn::default()/* use (different) setters */,
9047    ///     ]);
9048    /// ```
9049    pub fn set_postgresql_columns<T, V>(mut self, v: T) -> Self
9050    where
9051        T: std::iter::IntoIterator<Item = V>,
9052        V: std::convert::Into<crate::model::PostgresqlColumn>,
9053    {
9054        use std::iter::Iterator;
9055        self.postgresql_columns = v.into_iter().map(|i| i.into()).collect();
9056        self
9057    }
9058}
9059
9060impl wkt::message::Message for PostgresqlTable {
9061    fn typename() -> &'static str {
9062        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlTable"
9063    }
9064}
9065
9066/// PostgreSQL schema.
9067#[derive(Clone, Default, PartialEq)]
9068#[non_exhaustive]
9069pub struct PostgresqlSchema {
9070    /// Schema name.
9071    pub schema: std::string::String,
9072
9073    /// Tables in the schema.
9074    pub postgresql_tables: std::vec::Vec<crate::model::PostgresqlTable>,
9075
9076    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9077}
9078
9079impl PostgresqlSchema {
9080    pub fn new() -> Self {
9081        std::default::Default::default()
9082    }
9083
9084    /// Sets the value of [schema][crate::model::PostgresqlSchema::schema].
9085    ///
9086    /// # Example
9087    /// ```ignore,no_run
9088    /// # use google_cloud_datastream_v1::model::PostgresqlSchema;
9089    /// let x = PostgresqlSchema::new().set_schema("example");
9090    /// ```
9091    pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9092        self.schema = v.into();
9093        self
9094    }
9095
9096    /// Sets the value of [postgresql_tables][crate::model::PostgresqlSchema::postgresql_tables].
9097    ///
9098    /// # Example
9099    /// ```ignore,no_run
9100    /// # use google_cloud_datastream_v1::model::PostgresqlSchema;
9101    /// use google_cloud_datastream_v1::model::PostgresqlTable;
9102    /// let x = PostgresqlSchema::new()
9103    ///     .set_postgresql_tables([
9104    ///         PostgresqlTable::default()/* use setters */,
9105    ///         PostgresqlTable::default()/* use (different) setters */,
9106    ///     ]);
9107    /// ```
9108    pub fn set_postgresql_tables<T, V>(mut self, v: T) -> Self
9109    where
9110        T: std::iter::IntoIterator<Item = V>,
9111        V: std::convert::Into<crate::model::PostgresqlTable>,
9112    {
9113        use std::iter::Iterator;
9114        self.postgresql_tables = v.into_iter().map(|i| i.into()).collect();
9115        self
9116    }
9117}
9118
9119impl wkt::message::Message for PostgresqlSchema {
9120    fn typename() -> &'static str {
9121        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSchema"
9122    }
9123}
9124
9125/// PostgreSQL database structure.
9126#[derive(Clone, Default, PartialEq)]
9127#[non_exhaustive]
9128pub struct PostgresqlRdbms {
9129    /// PostgreSQL schemas in the database server.
9130    pub postgresql_schemas: std::vec::Vec<crate::model::PostgresqlSchema>,
9131
9132    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9133}
9134
9135impl PostgresqlRdbms {
9136    pub fn new() -> Self {
9137        std::default::Default::default()
9138    }
9139
9140    /// Sets the value of [postgresql_schemas][crate::model::PostgresqlRdbms::postgresql_schemas].
9141    ///
9142    /// # Example
9143    /// ```ignore,no_run
9144    /// # use google_cloud_datastream_v1::model::PostgresqlRdbms;
9145    /// use google_cloud_datastream_v1::model::PostgresqlSchema;
9146    /// let x = PostgresqlRdbms::new()
9147    ///     .set_postgresql_schemas([
9148    ///         PostgresqlSchema::default()/* use setters */,
9149    ///         PostgresqlSchema::default()/* use (different) setters */,
9150    ///     ]);
9151    /// ```
9152    pub fn set_postgresql_schemas<T, V>(mut self, v: T) -> Self
9153    where
9154        T: std::iter::IntoIterator<Item = V>,
9155        V: std::convert::Into<crate::model::PostgresqlSchema>,
9156    {
9157        use std::iter::Iterator;
9158        self.postgresql_schemas = v.into_iter().map(|i| i.into()).collect();
9159        self
9160    }
9161}
9162
9163impl wkt::message::Message for PostgresqlRdbms {
9164    fn typename() -> &'static str {
9165        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlRdbms"
9166    }
9167}
9168
9169/// PostgreSQL data source configuration
9170#[derive(Clone, Default, PartialEq)]
9171#[non_exhaustive]
9172pub struct PostgresqlSourceConfig {
9173    /// PostgreSQL objects to include in the stream.
9174    pub include_objects: std::option::Option<crate::model::PostgresqlRdbms>,
9175
9176    /// PostgreSQL objects to exclude from the stream.
9177    pub exclude_objects: std::option::Option<crate::model::PostgresqlRdbms>,
9178
9179    /// Required. Immutable. The name of the logical replication slot that's
9180    /// configured with the pgoutput plugin.
9181    pub replication_slot: std::string::String,
9182
9183    /// Required. The name of the publication that includes the set of all tables
9184    /// that are defined in the stream's include_objects.
9185    pub publication: std::string::String,
9186
9187    /// Maximum number of concurrent backfill tasks. The number should be non
9188    /// negative. If not set (or set to 0), the system's default value will be
9189    /// used.
9190    pub max_concurrent_backfill_tasks: i32,
9191
9192    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9193}
9194
9195impl PostgresqlSourceConfig {
9196    pub fn new() -> Self {
9197        std::default::Default::default()
9198    }
9199
9200    /// Sets the value of [include_objects][crate::model::PostgresqlSourceConfig::include_objects].
9201    ///
9202    /// # Example
9203    /// ```ignore,no_run
9204    /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9205    /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
9206    /// let x = PostgresqlSourceConfig::new().set_include_objects(PostgresqlRdbms::default()/* use setters */);
9207    /// ```
9208    pub fn set_include_objects<T>(mut self, v: T) -> Self
9209    where
9210        T: std::convert::Into<crate::model::PostgresqlRdbms>,
9211    {
9212        self.include_objects = std::option::Option::Some(v.into());
9213        self
9214    }
9215
9216    /// Sets or clears the value of [include_objects][crate::model::PostgresqlSourceConfig::include_objects].
9217    ///
9218    /// # Example
9219    /// ```ignore,no_run
9220    /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9221    /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
9222    /// let x = PostgresqlSourceConfig::new().set_or_clear_include_objects(Some(PostgresqlRdbms::default()/* use setters */));
9223    /// let x = PostgresqlSourceConfig::new().set_or_clear_include_objects(None::<PostgresqlRdbms>);
9224    /// ```
9225    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
9226    where
9227        T: std::convert::Into<crate::model::PostgresqlRdbms>,
9228    {
9229        self.include_objects = v.map(|x| x.into());
9230        self
9231    }
9232
9233    /// Sets the value of [exclude_objects][crate::model::PostgresqlSourceConfig::exclude_objects].
9234    ///
9235    /// # Example
9236    /// ```ignore,no_run
9237    /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9238    /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
9239    /// let x = PostgresqlSourceConfig::new().set_exclude_objects(PostgresqlRdbms::default()/* use setters */);
9240    /// ```
9241    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
9242    where
9243        T: std::convert::Into<crate::model::PostgresqlRdbms>,
9244    {
9245        self.exclude_objects = std::option::Option::Some(v.into());
9246        self
9247    }
9248
9249    /// Sets or clears the value of [exclude_objects][crate::model::PostgresqlSourceConfig::exclude_objects].
9250    ///
9251    /// # Example
9252    /// ```ignore,no_run
9253    /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9254    /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
9255    /// let x = PostgresqlSourceConfig::new().set_or_clear_exclude_objects(Some(PostgresqlRdbms::default()/* use setters */));
9256    /// let x = PostgresqlSourceConfig::new().set_or_clear_exclude_objects(None::<PostgresqlRdbms>);
9257    /// ```
9258    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
9259    where
9260        T: std::convert::Into<crate::model::PostgresqlRdbms>,
9261    {
9262        self.exclude_objects = v.map(|x| x.into());
9263        self
9264    }
9265
9266    /// Sets the value of [replication_slot][crate::model::PostgresqlSourceConfig::replication_slot].
9267    ///
9268    /// # Example
9269    /// ```ignore,no_run
9270    /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9271    /// let x = PostgresqlSourceConfig::new().set_replication_slot("example");
9272    /// ```
9273    pub fn set_replication_slot<T: std::convert::Into<std::string::String>>(
9274        mut self,
9275        v: T,
9276    ) -> Self {
9277        self.replication_slot = v.into();
9278        self
9279    }
9280
9281    /// Sets the value of [publication][crate::model::PostgresqlSourceConfig::publication].
9282    ///
9283    /// # Example
9284    /// ```ignore,no_run
9285    /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9286    /// let x = PostgresqlSourceConfig::new().set_publication("example");
9287    /// ```
9288    pub fn set_publication<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9289        self.publication = v.into();
9290        self
9291    }
9292
9293    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::PostgresqlSourceConfig::max_concurrent_backfill_tasks].
9294    ///
9295    /// # Example
9296    /// ```ignore,no_run
9297    /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9298    /// let x = PostgresqlSourceConfig::new().set_max_concurrent_backfill_tasks(42);
9299    /// ```
9300    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9301        self.max_concurrent_backfill_tasks = v.into();
9302        self
9303    }
9304}
9305
9306impl wkt::message::Message for PostgresqlSourceConfig {
9307    fn typename() -> &'static str {
9308        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSourceConfig"
9309    }
9310}
9311
9312/// SQLServer Column.
9313#[derive(Clone, Default, PartialEq)]
9314#[non_exhaustive]
9315pub struct SqlServerColumn {
9316    /// Column name.
9317    pub column: std::string::String,
9318
9319    /// The SQLServer data type.
9320    pub data_type: std::string::String,
9321
9322    /// Column length.
9323    pub length: i32,
9324
9325    /// Column precision.
9326    pub precision: i32,
9327
9328    /// Column scale.
9329    pub scale: i32,
9330
9331    /// Whether or not the column represents a primary key.
9332    pub primary_key: bool,
9333
9334    /// Whether or not the column can accept a null value.
9335    pub nullable: bool,
9336
9337    /// The ordinal position of the column in the table.
9338    pub ordinal_position: i32,
9339
9340    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9341}
9342
9343impl SqlServerColumn {
9344    pub fn new() -> Self {
9345        std::default::Default::default()
9346    }
9347
9348    /// Sets the value of [column][crate::model::SqlServerColumn::column].
9349    ///
9350    /// # Example
9351    /// ```ignore,no_run
9352    /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9353    /// let x = SqlServerColumn::new().set_column("example");
9354    /// ```
9355    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9356        self.column = v.into();
9357        self
9358    }
9359
9360    /// Sets the value of [data_type][crate::model::SqlServerColumn::data_type].
9361    ///
9362    /// # Example
9363    /// ```ignore,no_run
9364    /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9365    /// let x = SqlServerColumn::new().set_data_type("example");
9366    /// ```
9367    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9368        self.data_type = v.into();
9369        self
9370    }
9371
9372    /// Sets the value of [length][crate::model::SqlServerColumn::length].
9373    ///
9374    /// # Example
9375    /// ```ignore,no_run
9376    /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9377    /// let x = SqlServerColumn::new().set_length(42);
9378    /// ```
9379    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9380        self.length = v.into();
9381        self
9382    }
9383
9384    /// Sets the value of [precision][crate::model::SqlServerColumn::precision].
9385    ///
9386    /// # Example
9387    /// ```ignore,no_run
9388    /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9389    /// let x = SqlServerColumn::new().set_precision(42);
9390    /// ```
9391    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9392        self.precision = v.into();
9393        self
9394    }
9395
9396    /// Sets the value of [scale][crate::model::SqlServerColumn::scale].
9397    ///
9398    /// # Example
9399    /// ```ignore,no_run
9400    /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9401    /// let x = SqlServerColumn::new().set_scale(42);
9402    /// ```
9403    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9404        self.scale = v.into();
9405        self
9406    }
9407
9408    /// Sets the value of [primary_key][crate::model::SqlServerColumn::primary_key].
9409    ///
9410    /// # Example
9411    /// ```ignore,no_run
9412    /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9413    /// let x = SqlServerColumn::new().set_primary_key(true);
9414    /// ```
9415    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9416        self.primary_key = v.into();
9417        self
9418    }
9419
9420    /// Sets the value of [nullable][crate::model::SqlServerColumn::nullable].
9421    ///
9422    /// # Example
9423    /// ```ignore,no_run
9424    /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9425    /// let x = SqlServerColumn::new().set_nullable(true);
9426    /// ```
9427    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9428        self.nullable = v.into();
9429        self
9430    }
9431
9432    /// Sets the value of [ordinal_position][crate::model::SqlServerColumn::ordinal_position].
9433    ///
9434    /// # Example
9435    /// ```ignore,no_run
9436    /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9437    /// let x = SqlServerColumn::new().set_ordinal_position(42);
9438    /// ```
9439    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9440        self.ordinal_position = v.into();
9441        self
9442    }
9443}
9444
9445impl wkt::message::Message for SqlServerColumn {
9446    fn typename() -> &'static str {
9447        "type.googleapis.com/google.cloud.datastream.v1.SqlServerColumn"
9448    }
9449}
9450
9451/// SQLServer table.
9452#[derive(Clone, Default, PartialEq)]
9453#[non_exhaustive]
9454pub struct SqlServerTable {
9455    /// Table name.
9456    pub table: std::string::String,
9457
9458    /// SQLServer columns in the schema.
9459    /// When unspecified as part of include/exclude objects,
9460    /// includes/excludes everything.
9461    pub columns: std::vec::Vec<crate::model::SqlServerColumn>,
9462
9463    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9464}
9465
9466impl SqlServerTable {
9467    pub fn new() -> Self {
9468        std::default::Default::default()
9469    }
9470
9471    /// Sets the value of [table][crate::model::SqlServerTable::table].
9472    ///
9473    /// # Example
9474    /// ```ignore,no_run
9475    /// # use google_cloud_datastream_v1::model::SqlServerTable;
9476    /// let x = SqlServerTable::new().set_table("example");
9477    /// ```
9478    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9479        self.table = v.into();
9480        self
9481    }
9482
9483    /// Sets the value of [columns][crate::model::SqlServerTable::columns].
9484    ///
9485    /// # Example
9486    /// ```ignore,no_run
9487    /// # use google_cloud_datastream_v1::model::SqlServerTable;
9488    /// use google_cloud_datastream_v1::model::SqlServerColumn;
9489    /// let x = SqlServerTable::new()
9490    ///     .set_columns([
9491    ///         SqlServerColumn::default()/* use setters */,
9492    ///         SqlServerColumn::default()/* use (different) setters */,
9493    ///     ]);
9494    /// ```
9495    pub fn set_columns<T, V>(mut self, v: T) -> Self
9496    where
9497        T: std::iter::IntoIterator<Item = V>,
9498        V: std::convert::Into<crate::model::SqlServerColumn>,
9499    {
9500        use std::iter::Iterator;
9501        self.columns = v.into_iter().map(|i| i.into()).collect();
9502        self
9503    }
9504}
9505
9506impl wkt::message::Message for SqlServerTable {
9507    fn typename() -> &'static str {
9508        "type.googleapis.com/google.cloud.datastream.v1.SqlServerTable"
9509    }
9510}
9511
9512/// SQLServer schema.
9513#[derive(Clone, Default, PartialEq)]
9514#[non_exhaustive]
9515pub struct SqlServerSchema {
9516    /// Schema name.
9517    pub schema: std::string::String,
9518
9519    /// Tables in the schema.
9520    pub tables: std::vec::Vec<crate::model::SqlServerTable>,
9521
9522    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9523}
9524
9525impl SqlServerSchema {
9526    pub fn new() -> Self {
9527        std::default::Default::default()
9528    }
9529
9530    /// Sets the value of [schema][crate::model::SqlServerSchema::schema].
9531    ///
9532    /// # Example
9533    /// ```ignore,no_run
9534    /// # use google_cloud_datastream_v1::model::SqlServerSchema;
9535    /// let x = SqlServerSchema::new().set_schema("example");
9536    /// ```
9537    pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9538        self.schema = v.into();
9539        self
9540    }
9541
9542    /// Sets the value of [tables][crate::model::SqlServerSchema::tables].
9543    ///
9544    /// # Example
9545    /// ```ignore,no_run
9546    /// # use google_cloud_datastream_v1::model::SqlServerSchema;
9547    /// use google_cloud_datastream_v1::model::SqlServerTable;
9548    /// let x = SqlServerSchema::new()
9549    ///     .set_tables([
9550    ///         SqlServerTable::default()/* use setters */,
9551    ///         SqlServerTable::default()/* use (different) setters */,
9552    ///     ]);
9553    /// ```
9554    pub fn set_tables<T, V>(mut self, v: T) -> Self
9555    where
9556        T: std::iter::IntoIterator<Item = V>,
9557        V: std::convert::Into<crate::model::SqlServerTable>,
9558    {
9559        use std::iter::Iterator;
9560        self.tables = v.into_iter().map(|i| i.into()).collect();
9561        self
9562    }
9563}
9564
9565impl wkt::message::Message for SqlServerSchema {
9566    fn typename() -> &'static str {
9567        "type.googleapis.com/google.cloud.datastream.v1.SqlServerSchema"
9568    }
9569}
9570
9571/// SQLServer database structure.
9572#[derive(Clone, Default, PartialEq)]
9573#[non_exhaustive]
9574pub struct SqlServerRdbms {
9575    /// SQLServer schemas in the database server.
9576    pub schemas: std::vec::Vec<crate::model::SqlServerSchema>,
9577
9578    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9579}
9580
9581impl SqlServerRdbms {
9582    pub fn new() -> Self {
9583        std::default::Default::default()
9584    }
9585
9586    /// Sets the value of [schemas][crate::model::SqlServerRdbms::schemas].
9587    ///
9588    /// # Example
9589    /// ```ignore,no_run
9590    /// # use google_cloud_datastream_v1::model::SqlServerRdbms;
9591    /// use google_cloud_datastream_v1::model::SqlServerSchema;
9592    /// let x = SqlServerRdbms::new()
9593    ///     .set_schemas([
9594    ///         SqlServerSchema::default()/* use setters */,
9595    ///         SqlServerSchema::default()/* use (different) setters */,
9596    ///     ]);
9597    /// ```
9598    pub fn set_schemas<T, V>(mut self, v: T) -> Self
9599    where
9600        T: std::iter::IntoIterator<Item = V>,
9601        V: std::convert::Into<crate::model::SqlServerSchema>,
9602    {
9603        use std::iter::Iterator;
9604        self.schemas = v.into_iter().map(|i| i.into()).collect();
9605        self
9606    }
9607}
9608
9609impl wkt::message::Message for SqlServerRdbms {
9610    fn typename() -> &'static str {
9611        "type.googleapis.com/google.cloud.datastream.v1.SqlServerRdbms"
9612    }
9613}
9614
9615/// SQLServer data source configuration
9616#[derive(Clone, Default, PartialEq)]
9617#[non_exhaustive]
9618pub struct SqlServerSourceConfig {
9619    /// SQLServer objects to include in the stream.
9620    pub include_objects: std::option::Option<crate::model::SqlServerRdbms>,
9621
9622    /// SQLServer objects to exclude from the stream.
9623    pub exclude_objects: std::option::Option<crate::model::SqlServerRdbms>,
9624
9625    /// Max concurrent CDC tasks.
9626    pub max_concurrent_cdc_tasks: i32,
9627
9628    /// Max concurrent backfill tasks.
9629    pub max_concurrent_backfill_tasks: i32,
9630
9631    /// Configuration to select the CDC read method for the stream.
9632    pub cdc_method: std::option::Option<crate::model::sql_server_source_config::CdcMethod>,
9633
9634    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9635}
9636
9637impl SqlServerSourceConfig {
9638    pub fn new() -> Self {
9639        std::default::Default::default()
9640    }
9641
9642    /// Sets the value of [include_objects][crate::model::SqlServerSourceConfig::include_objects].
9643    ///
9644    /// # Example
9645    /// ```ignore,no_run
9646    /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9647    /// use google_cloud_datastream_v1::model::SqlServerRdbms;
9648    /// let x = SqlServerSourceConfig::new().set_include_objects(SqlServerRdbms::default()/* use setters */);
9649    /// ```
9650    pub fn set_include_objects<T>(mut self, v: T) -> Self
9651    where
9652        T: std::convert::Into<crate::model::SqlServerRdbms>,
9653    {
9654        self.include_objects = std::option::Option::Some(v.into());
9655        self
9656    }
9657
9658    /// Sets or clears the value of [include_objects][crate::model::SqlServerSourceConfig::include_objects].
9659    ///
9660    /// # Example
9661    /// ```ignore,no_run
9662    /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9663    /// use google_cloud_datastream_v1::model::SqlServerRdbms;
9664    /// let x = SqlServerSourceConfig::new().set_or_clear_include_objects(Some(SqlServerRdbms::default()/* use setters */));
9665    /// let x = SqlServerSourceConfig::new().set_or_clear_include_objects(None::<SqlServerRdbms>);
9666    /// ```
9667    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
9668    where
9669        T: std::convert::Into<crate::model::SqlServerRdbms>,
9670    {
9671        self.include_objects = v.map(|x| x.into());
9672        self
9673    }
9674
9675    /// Sets the value of [exclude_objects][crate::model::SqlServerSourceConfig::exclude_objects].
9676    ///
9677    /// # Example
9678    /// ```ignore,no_run
9679    /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9680    /// use google_cloud_datastream_v1::model::SqlServerRdbms;
9681    /// let x = SqlServerSourceConfig::new().set_exclude_objects(SqlServerRdbms::default()/* use setters */);
9682    /// ```
9683    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
9684    where
9685        T: std::convert::Into<crate::model::SqlServerRdbms>,
9686    {
9687        self.exclude_objects = std::option::Option::Some(v.into());
9688        self
9689    }
9690
9691    /// Sets or clears the value of [exclude_objects][crate::model::SqlServerSourceConfig::exclude_objects].
9692    ///
9693    /// # Example
9694    /// ```ignore,no_run
9695    /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9696    /// use google_cloud_datastream_v1::model::SqlServerRdbms;
9697    /// let x = SqlServerSourceConfig::new().set_or_clear_exclude_objects(Some(SqlServerRdbms::default()/* use setters */));
9698    /// let x = SqlServerSourceConfig::new().set_or_clear_exclude_objects(None::<SqlServerRdbms>);
9699    /// ```
9700    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
9701    where
9702        T: std::convert::Into<crate::model::SqlServerRdbms>,
9703    {
9704        self.exclude_objects = v.map(|x| x.into());
9705        self
9706    }
9707
9708    /// Sets the value of [max_concurrent_cdc_tasks][crate::model::SqlServerSourceConfig::max_concurrent_cdc_tasks].
9709    ///
9710    /// # Example
9711    /// ```ignore,no_run
9712    /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9713    /// let x = SqlServerSourceConfig::new().set_max_concurrent_cdc_tasks(42);
9714    /// ```
9715    pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9716        self.max_concurrent_cdc_tasks = v.into();
9717        self
9718    }
9719
9720    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::SqlServerSourceConfig::max_concurrent_backfill_tasks].
9721    ///
9722    /// # Example
9723    /// ```ignore,no_run
9724    /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9725    /// let x = SqlServerSourceConfig::new().set_max_concurrent_backfill_tasks(42);
9726    /// ```
9727    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9728        self.max_concurrent_backfill_tasks = v.into();
9729        self
9730    }
9731
9732    /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method].
9733    ///
9734    /// Note that all the setters affecting `cdc_method` are mutually
9735    /// exclusive.
9736    ///
9737    /// # Example
9738    /// ```ignore,no_run
9739    /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9740    /// use google_cloud_datastream_v1::model::SqlServerTransactionLogs;
9741    /// let x = SqlServerSourceConfig::new().set_cdc_method(Some(
9742    ///     google_cloud_datastream_v1::model::sql_server_source_config::CdcMethod::TransactionLogs(SqlServerTransactionLogs::default().into())));
9743    /// ```
9744    pub fn set_cdc_method<
9745        T: std::convert::Into<std::option::Option<crate::model::sql_server_source_config::CdcMethod>>,
9746    >(
9747        mut self,
9748        v: T,
9749    ) -> Self {
9750        self.cdc_method = v.into();
9751        self
9752    }
9753
9754    /// The value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
9755    /// if it holds a `TransactionLogs`, `None` if the field is not set or
9756    /// holds a different branch.
9757    pub fn transaction_logs(
9758        &self,
9759    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerTransactionLogs>> {
9760        #[allow(unreachable_patterns)]
9761        self.cdc_method.as_ref().and_then(|v| match v {
9762            crate::model::sql_server_source_config::CdcMethod::TransactionLogs(v) => {
9763                std::option::Option::Some(v)
9764            }
9765            _ => std::option::Option::None,
9766        })
9767    }
9768
9769    /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
9770    /// to hold a `TransactionLogs`.
9771    ///
9772    /// Note that all the setters affecting `cdc_method` are
9773    /// mutually exclusive.
9774    ///
9775    /// # Example
9776    /// ```ignore,no_run
9777    /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9778    /// use google_cloud_datastream_v1::model::SqlServerTransactionLogs;
9779    /// let x = SqlServerSourceConfig::new().set_transaction_logs(SqlServerTransactionLogs::default()/* use setters */);
9780    /// assert!(x.transaction_logs().is_some());
9781    /// assert!(x.change_tables().is_none());
9782    /// ```
9783    pub fn set_transaction_logs<
9784        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerTransactionLogs>>,
9785    >(
9786        mut self,
9787        v: T,
9788    ) -> Self {
9789        self.cdc_method = std::option::Option::Some(
9790            crate::model::sql_server_source_config::CdcMethod::TransactionLogs(v.into()),
9791        );
9792        self
9793    }
9794
9795    /// The value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
9796    /// if it holds a `ChangeTables`, `None` if the field is not set or
9797    /// holds a different branch.
9798    pub fn change_tables(
9799        &self,
9800    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerChangeTables>> {
9801        #[allow(unreachable_patterns)]
9802        self.cdc_method.as_ref().and_then(|v| match v {
9803            crate::model::sql_server_source_config::CdcMethod::ChangeTables(v) => {
9804                std::option::Option::Some(v)
9805            }
9806            _ => std::option::Option::None,
9807        })
9808    }
9809
9810    /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
9811    /// to hold a `ChangeTables`.
9812    ///
9813    /// Note that all the setters affecting `cdc_method` are
9814    /// mutually exclusive.
9815    ///
9816    /// # Example
9817    /// ```ignore,no_run
9818    /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9819    /// use google_cloud_datastream_v1::model::SqlServerChangeTables;
9820    /// let x = SqlServerSourceConfig::new().set_change_tables(SqlServerChangeTables::default()/* use setters */);
9821    /// assert!(x.change_tables().is_some());
9822    /// assert!(x.transaction_logs().is_none());
9823    /// ```
9824    pub fn set_change_tables<
9825        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerChangeTables>>,
9826    >(
9827        mut self,
9828        v: T,
9829    ) -> Self {
9830        self.cdc_method = std::option::Option::Some(
9831            crate::model::sql_server_source_config::CdcMethod::ChangeTables(v.into()),
9832        );
9833        self
9834    }
9835}
9836
9837impl wkt::message::Message for SqlServerSourceConfig {
9838    fn typename() -> &'static str {
9839        "type.googleapis.com/google.cloud.datastream.v1.SqlServerSourceConfig"
9840    }
9841}
9842
9843/// Defines additional types related to [SqlServerSourceConfig].
9844pub mod sql_server_source_config {
9845    #[allow(unused_imports)]
9846    use super::*;
9847
9848    /// Configuration to select the CDC read method for the stream.
9849    #[derive(Clone, Debug, PartialEq)]
9850    #[non_exhaustive]
9851    pub enum CdcMethod {
9852        /// CDC reader reads from transaction logs.
9853        TransactionLogs(std::boxed::Box<crate::model::SqlServerTransactionLogs>),
9854        /// CDC reader reads from change tables.
9855        ChangeTables(std::boxed::Box<crate::model::SqlServerChangeTables>),
9856    }
9857}
9858
9859/// Configuration to use Transaction Logs CDC read method.
9860#[derive(Clone, Default, PartialEq)]
9861#[non_exhaustive]
9862pub struct SqlServerTransactionLogs {
9863    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9864}
9865
9866impl SqlServerTransactionLogs {
9867    pub fn new() -> Self {
9868        std::default::Default::default()
9869    }
9870}
9871
9872impl wkt::message::Message for SqlServerTransactionLogs {
9873    fn typename() -> &'static str {
9874        "type.googleapis.com/google.cloud.datastream.v1.SqlServerTransactionLogs"
9875    }
9876}
9877
9878/// Configuration to use Change Tables CDC read method.
9879#[derive(Clone, Default, PartialEq)]
9880#[non_exhaustive]
9881pub struct SqlServerChangeTables {
9882    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9883}
9884
9885impl SqlServerChangeTables {
9886    pub fn new() -> Self {
9887        std::default::Default::default()
9888    }
9889}
9890
9891impl wkt::message::Message for SqlServerChangeTables {
9892    fn typename() -> &'static str {
9893        "type.googleapis.com/google.cloud.datastream.v1.SqlServerChangeTables"
9894    }
9895}
9896
9897/// MySQL Column.
9898#[derive(Clone, Default, PartialEq)]
9899#[non_exhaustive]
9900pub struct MysqlColumn {
9901    /// Column name.
9902    pub column: std::string::String,
9903
9904    /// The MySQL data type. Full data types list can be found here:
9905    /// <https://dev.mysql.com/doc/refman/8.0/en/data-types.html>
9906    pub data_type: std::string::String,
9907
9908    /// Column length.
9909    pub length: i32,
9910
9911    /// Column collation.
9912    pub collation: std::string::String,
9913
9914    /// Whether or not the column represents a primary key.
9915    pub primary_key: bool,
9916
9917    /// Whether or not the column can accept a null value.
9918    pub nullable: bool,
9919
9920    /// The ordinal position of the column in the table.
9921    pub ordinal_position: i32,
9922
9923    /// Column precision.
9924    pub precision: i32,
9925
9926    /// Column scale.
9927    pub scale: i32,
9928
9929    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9930}
9931
9932impl MysqlColumn {
9933    pub fn new() -> Self {
9934        std::default::Default::default()
9935    }
9936
9937    /// Sets the value of [column][crate::model::MysqlColumn::column].
9938    ///
9939    /// # Example
9940    /// ```ignore,no_run
9941    /// # use google_cloud_datastream_v1::model::MysqlColumn;
9942    /// let x = MysqlColumn::new().set_column("example");
9943    /// ```
9944    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9945        self.column = v.into();
9946        self
9947    }
9948
9949    /// Sets the value of [data_type][crate::model::MysqlColumn::data_type].
9950    ///
9951    /// # Example
9952    /// ```ignore,no_run
9953    /// # use google_cloud_datastream_v1::model::MysqlColumn;
9954    /// let x = MysqlColumn::new().set_data_type("example");
9955    /// ```
9956    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9957        self.data_type = v.into();
9958        self
9959    }
9960
9961    /// Sets the value of [length][crate::model::MysqlColumn::length].
9962    ///
9963    /// # Example
9964    /// ```ignore,no_run
9965    /// # use google_cloud_datastream_v1::model::MysqlColumn;
9966    /// let x = MysqlColumn::new().set_length(42);
9967    /// ```
9968    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9969        self.length = v.into();
9970        self
9971    }
9972
9973    /// Sets the value of [collation][crate::model::MysqlColumn::collation].
9974    ///
9975    /// # Example
9976    /// ```ignore,no_run
9977    /// # use google_cloud_datastream_v1::model::MysqlColumn;
9978    /// let x = MysqlColumn::new().set_collation("example");
9979    /// ```
9980    pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9981        self.collation = v.into();
9982        self
9983    }
9984
9985    /// Sets the value of [primary_key][crate::model::MysqlColumn::primary_key].
9986    ///
9987    /// # Example
9988    /// ```ignore,no_run
9989    /// # use google_cloud_datastream_v1::model::MysqlColumn;
9990    /// let x = MysqlColumn::new().set_primary_key(true);
9991    /// ```
9992    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9993        self.primary_key = v.into();
9994        self
9995    }
9996
9997    /// Sets the value of [nullable][crate::model::MysqlColumn::nullable].
9998    ///
9999    /// # Example
10000    /// ```ignore,no_run
10001    /// # use google_cloud_datastream_v1::model::MysqlColumn;
10002    /// let x = MysqlColumn::new().set_nullable(true);
10003    /// ```
10004    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10005        self.nullable = v.into();
10006        self
10007    }
10008
10009    /// Sets the value of [ordinal_position][crate::model::MysqlColumn::ordinal_position].
10010    ///
10011    /// # Example
10012    /// ```ignore,no_run
10013    /// # use google_cloud_datastream_v1::model::MysqlColumn;
10014    /// let x = MysqlColumn::new().set_ordinal_position(42);
10015    /// ```
10016    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10017        self.ordinal_position = v.into();
10018        self
10019    }
10020
10021    /// Sets the value of [precision][crate::model::MysqlColumn::precision].
10022    ///
10023    /// # Example
10024    /// ```ignore,no_run
10025    /// # use google_cloud_datastream_v1::model::MysqlColumn;
10026    /// let x = MysqlColumn::new().set_precision(42);
10027    /// ```
10028    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10029        self.precision = v.into();
10030        self
10031    }
10032
10033    /// Sets the value of [scale][crate::model::MysqlColumn::scale].
10034    ///
10035    /// # Example
10036    /// ```ignore,no_run
10037    /// # use google_cloud_datastream_v1::model::MysqlColumn;
10038    /// let x = MysqlColumn::new().set_scale(42);
10039    /// ```
10040    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10041        self.scale = v.into();
10042        self
10043    }
10044}
10045
10046impl wkt::message::Message for MysqlColumn {
10047    fn typename() -> &'static str {
10048        "type.googleapis.com/google.cloud.datastream.v1.MysqlColumn"
10049    }
10050}
10051
10052/// MySQL table.
10053#[derive(Clone, Default, PartialEq)]
10054#[non_exhaustive]
10055pub struct MysqlTable {
10056    /// Table name.
10057    pub table: std::string::String,
10058
10059    /// MySQL columns in the database.
10060    /// When unspecified as part of include/exclude objects, includes/excludes
10061    /// everything.
10062    pub mysql_columns: std::vec::Vec<crate::model::MysqlColumn>,
10063
10064    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10065}
10066
10067impl MysqlTable {
10068    pub fn new() -> Self {
10069        std::default::Default::default()
10070    }
10071
10072    /// Sets the value of [table][crate::model::MysqlTable::table].
10073    ///
10074    /// # Example
10075    /// ```ignore,no_run
10076    /// # use google_cloud_datastream_v1::model::MysqlTable;
10077    /// let x = MysqlTable::new().set_table("example");
10078    /// ```
10079    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10080        self.table = v.into();
10081        self
10082    }
10083
10084    /// Sets the value of [mysql_columns][crate::model::MysqlTable::mysql_columns].
10085    ///
10086    /// # Example
10087    /// ```ignore,no_run
10088    /// # use google_cloud_datastream_v1::model::MysqlTable;
10089    /// use google_cloud_datastream_v1::model::MysqlColumn;
10090    /// let x = MysqlTable::new()
10091    ///     .set_mysql_columns([
10092    ///         MysqlColumn::default()/* use setters */,
10093    ///         MysqlColumn::default()/* use (different) setters */,
10094    ///     ]);
10095    /// ```
10096    pub fn set_mysql_columns<T, V>(mut self, v: T) -> Self
10097    where
10098        T: std::iter::IntoIterator<Item = V>,
10099        V: std::convert::Into<crate::model::MysqlColumn>,
10100    {
10101        use std::iter::Iterator;
10102        self.mysql_columns = v.into_iter().map(|i| i.into()).collect();
10103        self
10104    }
10105}
10106
10107impl wkt::message::Message for MysqlTable {
10108    fn typename() -> &'static str {
10109        "type.googleapis.com/google.cloud.datastream.v1.MysqlTable"
10110    }
10111}
10112
10113/// MySQL database.
10114#[derive(Clone, Default, PartialEq)]
10115#[non_exhaustive]
10116pub struct MysqlDatabase {
10117    /// Database name.
10118    pub database: std::string::String,
10119
10120    /// Tables in the database.
10121    pub mysql_tables: std::vec::Vec<crate::model::MysqlTable>,
10122
10123    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10124}
10125
10126impl MysqlDatabase {
10127    pub fn new() -> Self {
10128        std::default::Default::default()
10129    }
10130
10131    /// Sets the value of [database][crate::model::MysqlDatabase::database].
10132    ///
10133    /// # Example
10134    /// ```ignore,no_run
10135    /// # use google_cloud_datastream_v1::model::MysqlDatabase;
10136    /// let x = MysqlDatabase::new().set_database("example");
10137    /// ```
10138    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10139        self.database = v.into();
10140        self
10141    }
10142
10143    /// Sets the value of [mysql_tables][crate::model::MysqlDatabase::mysql_tables].
10144    ///
10145    /// # Example
10146    /// ```ignore,no_run
10147    /// # use google_cloud_datastream_v1::model::MysqlDatabase;
10148    /// use google_cloud_datastream_v1::model::MysqlTable;
10149    /// let x = MysqlDatabase::new()
10150    ///     .set_mysql_tables([
10151    ///         MysqlTable::default()/* use setters */,
10152    ///         MysqlTable::default()/* use (different) setters */,
10153    ///     ]);
10154    /// ```
10155    pub fn set_mysql_tables<T, V>(mut self, v: T) -> Self
10156    where
10157        T: std::iter::IntoIterator<Item = V>,
10158        V: std::convert::Into<crate::model::MysqlTable>,
10159    {
10160        use std::iter::Iterator;
10161        self.mysql_tables = v.into_iter().map(|i| i.into()).collect();
10162        self
10163    }
10164}
10165
10166impl wkt::message::Message for MysqlDatabase {
10167    fn typename() -> &'static str {
10168        "type.googleapis.com/google.cloud.datastream.v1.MysqlDatabase"
10169    }
10170}
10171
10172/// MySQL database structure
10173#[derive(Clone, Default, PartialEq)]
10174#[non_exhaustive]
10175pub struct MysqlRdbms {
10176    /// Mysql databases on the server
10177    pub mysql_databases: std::vec::Vec<crate::model::MysqlDatabase>,
10178
10179    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10180}
10181
10182impl MysqlRdbms {
10183    pub fn new() -> Self {
10184        std::default::Default::default()
10185    }
10186
10187    /// Sets the value of [mysql_databases][crate::model::MysqlRdbms::mysql_databases].
10188    ///
10189    /// # Example
10190    /// ```ignore,no_run
10191    /// # use google_cloud_datastream_v1::model::MysqlRdbms;
10192    /// use google_cloud_datastream_v1::model::MysqlDatabase;
10193    /// let x = MysqlRdbms::new()
10194    ///     .set_mysql_databases([
10195    ///         MysqlDatabase::default()/* use setters */,
10196    ///         MysqlDatabase::default()/* use (different) setters */,
10197    ///     ]);
10198    /// ```
10199    pub fn set_mysql_databases<T, V>(mut self, v: T) -> Self
10200    where
10201        T: std::iter::IntoIterator<Item = V>,
10202        V: std::convert::Into<crate::model::MysqlDatabase>,
10203    {
10204        use std::iter::Iterator;
10205        self.mysql_databases = v.into_iter().map(|i| i.into()).collect();
10206        self
10207    }
10208}
10209
10210impl wkt::message::Message for MysqlRdbms {
10211    fn typename() -> &'static str {
10212        "type.googleapis.com/google.cloud.datastream.v1.MysqlRdbms"
10213    }
10214}
10215
10216/// MySQL source configuration
10217#[derive(Clone, Default, PartialEq)]
10218#[non_exhaustive]
10219pub struct MysqlSourceConfig {
10220    /// MySQL objects to retrieve from the source.
10221    pub include_objects: std::option::Option<crate::model::MysqlRdbms>,
10222
10223    /// MySQL objects to exclude from the stream.
10224    pub exclude_objects: std::option::Option<crate::model::MysqlRdbms>,
10225
10226    /// Maximum number of concurrent CDC tasks. The number should be non negative.
10227    /// If not set (or set to 0), the system's default value will be used.
10228    pub max_concurrent_cdc_tasks: i32,
10229
10230    /// Maximum number of concurrent backfill tasks. The number should be non
10231    /// negative. If not set (or set to 0), the system's default value will be
10232    /// used.
10233    pub max_concurrent_backfill_tasks: i32,
10234
10235    /// The CDC method to use for the stream.
10236    pub cdc_method: std::option::Option<crate::model::mysql_source_config::CdcMethod>,
10237
10238    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10239}
10240
10241impl MysqlSourceConfig {
10242    pub fn new() -> Self {
10243        std::default::Default::default()
10244    }
10245
10246    /// Sets the value of [include_objects][crate::model::MysqlSourceConfig::include_objects].
10247    ///
10248    /// # Example
10249    /// ```ignore,no_run
10250    /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10251    /// use google_cloud_datastream_v1::model::MysqlRdbms;
10252    /// let x = MysqlSourceConfig::new().set_include_objects(MysqlRdbms::default()/* use setters */);
10253    /// ```
10254    pub fn set_include_objects<T>(mut self, v: T) -> Self
10255    where
10256        T: std::convert::Into<crate::model::MysqlRdbms>,
10257    {
10258        self.include_objects = std::option::Option::Some(v.into());
10259        self
10260    }
10261
10262    /// Sets or clears the value of [include_objects][crate::model::MysqlSourceConfig::include_objects].
10263    ///
10264    /// # Example
10265    /// ```ignore,no_run
10266    /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10267    /// use google_cloud_datastream_v1::model::MysqlRdbms;
10268    /// let x = MysqlSourceConfig::new().set_or_clear_include_objects(Some(MysqlRdbms::default()/* use setters */));
10269    /// let x = MysqlSourceConfig::new().set_or_clear_include_objects(None::<MysqlRdbms>);
10270    /// ```
10271    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
10272    where
10273        T: std::convert::Into<crate::model::MysqlRdbms>,
10274    {
10275        self.include_objects = v.map(|x| x.into());
10276        self
10277    }
10278
10279    /// Sets the value of [exclude_objects][crate::model::MysqlSourceConfig::exclude_objects].
10280    ///
10281    /// # Example
10282    /// ```ignore,no_run
10283    /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10284    /// use google_cloud_datastream_v1::model::MysqlRdbms;
10285    /// let x = MysqlSourceConfig::new().set_exclude_objects(MysqlRdbms::default()/* use setters */);
10286    /// ```
10287    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
10288    where
10289        T: std::convert::Into<crate::model::MysqlRdbms>,
10290    {
10291        self.exclude_objects = std::option::Option::Some(v.into());
10292        self
10293    }
10294
10295    /// Sets or clears the value of [exclude_objects][crate::model::MysqlSourceConfig::exclude_objects].
10296    ///
10297    /// # Example
10298    /// ```ignore,no_run
10299    /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10300    /// use google_cloud_datastream_v1::model::MysqlRdbms;
10301    /// let x = MysqlSourceConfig::new().set_or_clear_exclude_objects(Some(MysqlRdbms::default()/* use setters */));
10302    /// let x = MysqlSourceConfig::new().set_or_clear_exclude_objects(None::<MysqlRdbms>);
10303    /// ```
10304    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
10305    where
10306        T: std::convert::Into<crate::model::MysqlRdbms>,
10307    {
10308        self.exclude_objects = v.map(|x| x.into());
10309        self
10310    }
10311
10312    /// Sets the value of [max_concurrent_cdc_tasks][crate::model::MysqlSourceConfig::max_concurrent_cdc_tasks].
10313    ///
10314    /// # Example
10315    /// ```ignore,no_run
10316    /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10317    /// let x = MysqlSourceConfig::new().set_max_concurrent_cdc_tasks(42);
10318    /// ```
10319    pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10320        self.max_concurrent_cdc_tasks = v.into();
10321        self
10322    }
10323
10324    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::MysqlSourceConfig::max_concurrent_backfill_tasks].
10325    ///
10326    /// # Example
10327    /// ```ignore,no_run
10328    /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10329    /// let x = MysqlSourceConfig::new().set_max_concurrent_backfill_tasks(42);
10330    /// ```
10331    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10332        self.max_concurrent_backfill_tasks = v.into();
10333        self
10334    }
10335
10336    /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method].
10337    ///
10338    /// Note that all the setters affecting `cdc_method` are mutually
10339    /// exclusive.
10340    ///
10341    /// # Example
10342    /// ```ignore,no_run
10343    /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10344    /// use google_cloud_datastream_v1::model::mysql_source_config::BinaryLogPosition;
10345    /// let x = MysqlSourceConfig::new().set_cdc_method(Some(
10346    ///     google_cloud_datastream_v1::model::mysql_source_config::CdcMethod::BinaryLogPosition(BinaryLogPosition::default().into())));
10347    /// ```
10348    pub fn set_cdc_method<
10349        T: std::convert::Into<std::option::Option<crate::model::mysql_source_config::CdcMethod>>,
10350    >(
10351        mut self,
10352        v: T,
10353    ) -> Self {
10354        self.cdc_method = v.into();
10355        self
10356    }
10357
10358    /// The value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
10359    /// if it holds a `BinaryLogPosition`, `None` if the field is not set or
10360    /// holds a different branch.
10361    pub fn binary_log_position(
10362        &self,
10363    ) -> std::option::Option<&std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>>
10364    {
10365        #[allow(unreachable_patterns)]
10366        self.cdc_method.as_ref().and_then(|v| match v {
10367            crate::model::mysql_source_config::CdcMethod::BinaryLogPosition(v) => {
10368                std::option::Option::Some(v)
10369            }
10370            _ => std::option::Option::None,
10371        })
10372    }
10373
10374    /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
10375    /// to hold a `BinaryLogPosition`.
10376    ///
10377    /// Note that all the setters affecting `cdc_method` are
10378    /// mutually exclusive.
10379    ///
10380    /// # Example
10381    /// ```ignore,no_run
10382    /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10383    /// use google_cloud_datastream_v1::model::mysql_source_config::BinaryLogPosition;
10384    /// let x = MysqlSourceConfig::new().set_binary_log_position(BinaryLogPosition::default()/* use setters */);
10385    /// assert!(x.binary_log_position().is_some());
10386    /// assert!(x.gtid().is_none());
10387    /// ```
10388    pub fn set_binary_log_position<
10389        T: std::convert::Into<std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>>,
10390    >(
10391        mut self,
10392        v: T,
10393    ) -> Self {
10394        self.cdc_method = std::option::Option::Some(
10395            crate::model::mysql_source_config::CdcMethod::BinaryLogPosition(v.into()),
10396        );
10397        self
10398    }
10399
10400    /// The value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
10401    /// if it holds a `Gtid`, `None` if the field is not set or
10402    /// holds a different branch.
10403    pub fn gtid(
10404        &self,
10405    ) -> std::option::Option<&std::boxed::Box<crate::model::mysql_source_config::Gtid>> {
10406        #[allow(unreachable_patterns)]
10407        self.cdc_method.as_ref().and_then(|v| match v {
10408            crate::model::mysql_source_config::CdcMethod::Gtid(v) => std::option::Option::Some(v),
10409            _ => std::option::Option::None,
10410        })
10411    }
10412
10413    /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
10414    /// to hold a `Gtid`.
10415    ///
10416    /// Note that all the setters affecting `cdc_method` are
10417    /// mutually exclusive.
10418    ///
10419    /// # Example
10420    /// ```ignore,no_run
10421    /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10422    /// use google_cloud_datastream_v1::model::mysql_source_config::Gtid;
10423    /// let x = MysqlSourceConfig::new().set_gtid(Gtid::default()/* use setters */);
10424    /// assert!(x.gtid().is_some());
10425    /// assert!(x.binary_log_position().is_none());
10426    /// ```
10427    pub fn set_gtid<
10428        T: std::convert::Into<std::boxed::Box<crate::model::mysql_source_config::Gtid>>,
10429    >(
10430        mut self,
10431        v: T,
10432    ) -> Self {
10433        self.cdc_method =
10434            std::option::Option::Some(crate::model::mysql_source_config::CdcMethod::Gtid(v.into()));
10435        self
10436    }
10437}
10438
10439impl wkt::message::Message for MysqlSourceConfig {
10440    fn typename() -> &'static str {
10441        "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig"
10442    }
10443}
10444
10445/// Defines additional types related to [MysqlSourceConfig].
10446pub mod mysql_source_config {
10447    #[allow(unused_imports)]
10448    use super::*;
10449
10450    /// Use Binary log position based replication.
10451    #[derive(Clone, Default, PartialEq)]
10452    #[non_exhaustive]
10453    pub struct BinaryLogPosition {
10454        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10455    }
10456
10457    impl BinaryLogPosition {
10458        pub fn new() -> Self {
10459            std::default::Default::default()
10460        }
10461    }
10462
10463    impl wkt::message::Message for BinaryLogPosition {
10464        fn typename() -> &'static str {
10465            "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig.BinaryLogPosition"
10466        }
10467    }
10468
10469    /// Use GTID based replication.
10470    #[derive(Clone, Default, PartialEq)]
10471    #[non_exhaustive]
10472    pub struct Gtid {
10473        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10474    }
10475
10476    impl Gtid {
10477        pub fn new() -> Self {
10478            std::default::Default::default()
10479        }
10480    }
10481
10482    impl wkt::message::Message for Gtid {
10483        fn typename() -> &'static str {
10484            "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig.Gtid"
10485        }
10486    }
10487
10488    /// The CDC method to use for the stream.
10489    #[derive(Clone, Debug, PartialEq)]
10490    #[non_exhaustive]
10491    pub enum CdcMethod {
10492        /// Use Binary log position based replication.
10493        BinaryLogPosition(std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>),
10494        /// Use GTID based replication.
10495        Gtid(std::boxed::Box<crate::model::mysql_source_config::Gtid>),
10496    }
10497}
10498
10499/// Salesforce source configuration
10500#[derive(Clone, Default, PartialEq)]
10501#[non_exhaustive]
10502pub struct SalesforceSourceConfig {
10503    /// Salesforce objects to retrieve from the source.
10504    pub include_objects: std::option::Option<crate::model::SalesforceOrg>,
10505
10506    /// Salesforce objects to exclude from the stream.
10507    pub exclude_objects: std::option::Option<crate::model::SalesforceOrg>,
10508
10509    /// Required. Salesforce objects polling interval. The interval at which new
10510    /// changes will be polled for each object. The duration must be between 5
10511    /// minutes and 24 hours.
10512    pub polling_interval: std::option::Option<wkt::Duration>,
10513
10514    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10515}
10516
10517impl SalesforceSourceConfig {
10518    pub fn new() -> Self {
10519        std::default::Default::default()
10520    }
10521
10522    /// Sets the value of [include_objects][crate::model::SalesforceSourceConfig::include_objects].
10523    ///
10524    /// # Example
10525    /// ```ignore,no_run
10526    /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10527    /// use google_cloud_datastream_v1::model::SalesforceOrg;
10528    /// let x = SalesforceSourceConfig::new().set_include_objects(SalesforceOrg::default()/* use setters */);
10529    /// ```
10530    pub fn set_include_objects<T>(mut self, v: T) -> Self
10531    where
10532        T: std::convert::Into<crate::model::SalesforceOrg>,
10533    {
10534        self.include_objects = std::option::Option::Some(v.into());
10535        self
10536    }
10537
10538    /// Sets or clears the value of [include_objects][crate::model::SalesforceSourceConfig::include_objects].
10539    ///
10540    /// # Example
10541    /// ```ignore,no_run
10542    /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10543    /// use google_cloud_datastream_v1::model::SalesforceOrg;
10544    /// let x = SalesforceSourceConfig::new().set_or_clear_include_objects(Some(SalesforceOrg::default()/* use setters */));
10545    /// let x = SalesforceSourceConfig::new().set_or_clear_include_objects(None::<SalesforceOrg>);
10546    /// ```
10547    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
10548    where
10549        T: std::convert::Into<crate::model::SalesforceOrg>,
10550    {
10551        self.include_objects = v.map(|x| x.into());
10552        self
10553    }
10554
10555    /// Sets the value of [exclude_objects][crate::model::SalesforceSourceConfig::exclude_objects].
10556    ///
10557    /// # Example
10558    /// ```ignore,no_run
10559    /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10560    /// use google_cloud_datastream_v1::model::SalesforceOrg;
10561    /// let x = SalesforceSourceConfig::new().set_exclude_objects(SalesforceOrg::default()/* use setters */);
10562    /// ```
10563    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
10564    where
10565        T: std::convert::Into<crate::model::SalesforceOrg>,
10566    {
10567        self.exclude_objects = std::option::Option::Some(v.into());
10568        self
10569    }
10570
10571    /// Sets or clears the value of [exclude_objects][crate::model::SalesforceSourceConfig::exclude_objects].
10572    ///
10573    /// # Example
10574    /// ```ignore,no_run
10575    /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10576    /// use google_cloud_datastream_v1::model::SalesforceOrg;
10577    /// let x = SalesforceSourceConfig::new().set_or_clear_exclude_objects(Some(SalesforceOrg::default()/* use setters */));
10578    /// let x = SalesforceSourceConfig::new().set_or_clear_exclude_objects(None::<SalesforceOrg>);
10579    /// ```
10580    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
10581    where
10582        T: std::convert::Into<crate::model::SalesforceOrg>,
10583    {
10584        self.exclude_objects = v.map(|x| x.into());
10585        self
10586    }
10587
10588    /// Sets the value of [polling_interval][crate::model::SalesforceSourceConfig::polling_interval].
10589    ///
10590    /// # Example
10591    /// ```ignore,no_run
10592    /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10593    /// use wkt::Duration;
10594    /// let x = SalesforceSourceConfig::new().set_polling_interval(Duration::default()/* use setters */);
10595    /// ```
10596    pub fn set_polling_interval<T>(mut self, v: T) -> Self
10597    where
10598        T: std::convert::Into<wkt::Duration>,
10599    {
10600        self.polling_interval = std::option::Option::Some(v.into());
10601        self
10602    }
10603
10604    /// Sets or clears the value of [polling_interval][crate::model::SalesforceSourceConfig::polling_interval].
10605    ///
10606    /// # Example
10607    /// ```ignore,no_run
10608    /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10609    /// use wkt::Duration;
10610    /// let x = SalesforceSourceConfig::new().set_or_clear_polling_interval(Some(Duration::default()/* use setters */));
10611    /// let x = SalesforceSourceConfig::new().set_or_clear_polling_interval(None::<Duration>);
10612    /// ```
10613    pub fn set_or_clear_polling_interval<T>(mut self, v: std::option::Option<T>) -> Self
10614    where
10615        T: std::convert::Into<wkt::Duration>,
10616    {
10617        self.polling_interval = v.map(|x| x.into());
10618        self
10619    }
10620}
10621
10622impl wkt::message::Message for SalesforceSourceConfig {
10623    fn typename() -> &'static str {
10624        "type.googleapis.com/google.cloud.datastream.v1.SalesforceSourceConfig"
10625    }
10626}
10627
10628/// Salesforce organization structure.
10629#[derive(Clone, Default, PartialEq)]
10630#[non_exhaustive]
10631pub struct SalesforceOrg {
10632    /// Salesforce objects in the database server.
10633    pub objects: std::vec::Vec<crate::model::SalesforceObject>,
10634
10635    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10636}
10637
10638impl SalesforceOrg {
10639    pub fn new() -> Self {
10640        std::default::Default::default()
10641    }
10642
10643    /// Sets the value of [objects][crate::model::SalesforceOrg::objects].
10644    ///
10645    /// # Example
10646    /// ```ignore,no_run
10647    /// # use google_cloud_datastream_v1::model::SalesforceOrg;
10648    /// use google_cloud_datastream_v1::model::SalesforceObject;
10649    /// let x = SalesforceOrg::new()
10650    ///     .set_objects([
10651    ///         SalesforceObject::default()/* use setters */,
10652    ///         SalesforceObject::default()/* use (different) setters */,
10653    ///     ]);
10654    /// ```
10655    pub fn set_objects<T, V>(mut self, v: T) -> Self
10656    where
10657        T: std::iter::IntoIterator<Item = V>,
10658        V: std::convert::Into<crate::model::SalesforceObject>,
10659    {
10660        use std::iter::Iterator;
10661        self.objects = v.into_iter().map(|i| i.into()).collect();
10662        self
10663    }
10664}
10665
10666impl wkt::message::Message for SalesforceOrg {
10667    fn typename() -> &'static str {
10668        "type.googleapis.com/google.cloud.datastream.v1.SalesforceOrg"
10669    }
10670}
10671
10672/// Salesforce object.
10673#[derive(Clone, Default, PartialEq)]
10674#[non_exhaustive]
10675pub struct SalesforceObject {
10676    /// Object name.
10677    pub object_name: std::string::String,
10678
10679    /// Salesforce fields.
10680    /// When unspecified as part of include objects,
10681    /// includes everything, when unspecified as part of exclude objects,
10682    /// excludes nothing.
10683    pub fields: std::vec::Vec<crate::model::SalesforceField>,
10684
10685    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10686}
10687
10688impl SalesforceObject {
10689    pub fn new() -> Self {
10690        std::default::Default::default()
10691    }
10692
10693    /// Sets the value of [object_name][crate::model::SalesforceObject::object_name].
10694    ///
10695    /// # Example
10696    /// ```ignore,no_run
10697    /// # use google_cloud_datastream_v1::model::SalesforceObject;
10698    /// let x = SalesforceObject::new().set_object_name("example");
10699    /// ```
10700    pub fn set_object_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10701        self.object_name = v.into();
10702        self
10703    }
10704
10705    /// Sets the value of [fields][crate::model::SalesforceObject::fields].
10706    ///
10707    /// # Example
10708    /// ```ignore,no_run
10709    /// # use google_cloud_datastream_v1::model::SalesforceObject;
10710    /// use google_cloud_datastream_v1::model::SalesforceField;
10711    /// let x = SalesforceObject::new()
10712    ///     .set_fields([
10713    ///         SalesforceField::default()/* use setters */,
10714    ///         SalesforceField::default()/* use (different) setters */,
10715    ///     ]);
10716    /// ```
10717    pub fn set_fields<T, V>(mut self, v: T) -> Self
10718    where
10719        T: std::iter::IntoIterator<Item = V>,
10720        V: std::convert::Into<crate::model::SalesforceField>,
10721    {
10722        use std::iter::Iterator;
10723        self.fields = v.into_iter().map(|i| i.into()).collect();
10724        self
10725    }
10726}
10727
10728impl wkt::message::Message for SalesforceObject {
10729    fn typename() -> &'static str {
10730        "type.googleapis.com/google.cloud.datastream.v1.SalesforceObject"
10731    }
10732}
10733
10734/// Salesforce field.
10735#[derive(Clone, Default, PartialEq)]
10736#[non_exhaustive]
10737pub struct SalesforceField {
10738    /// Field name.
10739    pub name: std::string::String,
10740
10741    /// The data type.
10742    pub data_type: std::string::String,
10743
10744    /// Indicates whether the field can accept nil values.
10745    pub nillable: bool,
10746
10747    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10748}
10749
10750impl SalesforceField {
10751    pub fn new() -> Self {
10752        std::default::Default::default()
10753    }
10754
10755    /// Sets the value of [name][crate::model::SalesforceField::name].
10756    ///
10757    /// # Example
10758    /// ```ignore,no_run
10759    /// # use google_cloud_datastream_v1::model::SalesforceField;
10760    /// let x = SalesforceField::new().set_name("example");
10761    /// ```
10762    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10763        self.name = v.into();
10764        self
10765    }
10766
10767    /// Sets the value of [data_type][crate::model::SalesforceField::data_type].
10768    ///
10769    /// # Example
10770    /// ```ignore,no_run
10771    /// # use google_cloud_datastream_v1::model::SalesforceField;
10772    /// let x = SalesforceField::new().set_data_type("example");
10773    /// ```
10774    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10775        self.data_type = v.into();
10776        self
10777    }
10778
10779    /// Sets the value of [nillable][crate::model::SalesforceField::nillable].
10780    ///
10781    /// # Example
10782    /// ```ignore,no_run
10783    /// # use google_cloud_datastream_v1::model::SalesforceField;
10784    /// let x = SalesforceField::new().set_nillable(true);
10785    /// ```
10786    pub fn set_nillable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10787        self.nillable = v.into();
10788        self
10789    }
10790}
10791
10792impl wkt::message::Message for SalesforceField {
10793    fn typename() -> &'static str {
10794        "type.googleapis.com/google.cloud.datastream.v1.SalesforceField"
10795    }
10796}
10797
10798/// MongoDB source configuration.
10799#[derive(Clone, Default, PartialEq)]
10800#[non_exhaustive]
10801pub struct MongodbSourceConfig {
10802    /// MongoDB collections to include in the stream.
10803    pub include_objects: std::option::Option<crate::model::MongodbCluster>,
10804
10805    /// MongoDB collections to exclude from the stream.
10806    pub exclude_objects: std::option::Option<crate::model::MongodbCluster>,
10807
10808    /// Optional. Maximum number of concurrent backfill tasks. The number should be
10809    /// non-negative and less than or equal to 50. If not set (or set to 0), the
10810    /// system's default value is used
10811    pub max_concurrent_backfill_tasks: i32,
10812
10813    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10814}
10815
10816impl MongodbSourceConfig {
10817    pub fn new() -> Self {
10818        std::default::Default::default()
10819    }
10820
10821    /// Sets the value of [include_objects][crate::model::MongodbSourceConfig::include_objects].
10822    ///
10823    /// # Example
10824    /// ```ignore,no_run
10825    /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
10826    /// use google_cloud_datastream_v1::model::MongodbCluster;
10827    /// let x = MongodbSourceConfig::new().set_include_objects(MongodbCluster::default()/* use setters */);
10828    /// ```
10829    pub fn set_include_objects<T>(mut self, v: T) -> Self
10830    where
10831        T: std::convert::Into<crate::model::MongodbCluster>,
10832    {
10833        self.include_objects = std::option::Option::Some(v.into());
10834        self
10835    }
10836
10837    /// Sets or clears the value of [include_objects][crate::model::MongodbSourceConfig::include_objects].
10838    ///
10839    /// # Example
10840    /// ```ignore,no_run
10841    /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
10842    /// use google_cloud_datastream_v1::model::MongodbCluster;
10843    /// let x = MongodbSourceConfig::new().set_or_clear_include_objects(Some(MongodbCluster::default()/* use setters */));
10844    /// let x = MongodbSourceConfig::new().set_or_clear_include_objects(None::<MongodbCluster>);
10845    /// ```
10846    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
10847    where
10848        T: std::convert::Into<crate::model::MongodbCluster>,
10849    {
10850        self.include_objects = v.map(|x| x.into());
10851        self
10852    }
10853
10854    /// Sets the value of [exclude_objects][crate::model::MongodbSourceConfig::exclude_objects].
10855    ///
10856    /// # Example
10857    /// ```ignore,no_run
10858    /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
10859    /// use google_cloud_datastream_v1::model::MongodbCluster;
10860    /// let x = MongodbSourceConfig::new().set_exclude_objects(MongodbCluster::default()/* use setters */);
10861    /// ```
10862    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
10863    where
10864        T: std::convert::Into<crate::model::MongodbCluster>,
10865    {
10866        self.exclude_objects = std::option::Option::Some(v.into());
10867        self
10868    }
10869
10870    /// Sets or clears the value of [exclude_objects][crate::model::MongodbSourceConfig::exclude_objects].
10871    ///
10872    /// # Example
10873    /// ```ignore,no_run
10874    /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
10875    /// use google_cloud_datastream_v1::model::MongodbCluster;
10876    /// let x = MongodbSourceConfig::new().set_or_clear_exclude_objects(Some(MongodbCluster::default()/* use setters */));
10877    /// let x = MongodbSourceConfig::new().set_or_clear_exclude_objects(None::<MongodbCluster>);
10878    /// ```
10879    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
10880    where
10881        T: std::convert::Into<crate::model::MongodbCluster>,
10882    {
10883        self.exclude_objects = v.map(|x| x.into());
10884        self
10885    }
10886
10887    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::MongodbSourceConfig::max_concurrent_backfill_tasks].
10888    ///
10889    /// # Example
10890    /// ```ignore,no_run
10891    /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
10892    /// let x = MongodbSourceConfig::new().set_max_concurrent_backfill_tasks(42);
10893    /// ```
10894    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10895        self.max_concurrent_backfill_tasks = v.into();
10896        self
10897    }
10898}
10899
10900impl wkt::message::Message for MongodbSourceConfig {
10901    fn typename() -> &'static str {
10902        "type.googleapis.com/google.cloud.datastream.v1.MongodbSourceConfig"
10903    }
10904}
10905
10906/// MongoDB Cluster structure.
10907#[derive(Clone, Default, PartialEq)]
10908#[non_exhaustive]
10909pub struct MongodbCluster {
10910    /// MongoDB databases in the cluster.
10911    pub databases: std::vec::Vec<crate::model::MongodbDatabase>,
10912
10913    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10914}
10915
10916impl MongodbCluster {
10917    pub fn new() -> Self {
10918        std::default::Default::default()
10919    }
10920
10921    /// Sets the value of [databases][crate::model::MongodbCluster::databases].
10922    ///
10923    /// # Example
10924    /// ```ignore,no_run
10925    /// # use google_cloud_datastream_v1::model::MongodbCluster;
10926    /// use google_cloud_datastream_v1::model::MongodbDatabase;
10927    /// let x = MongodbCluster::new()
10928    ///     .set_databases([
10929    ///         MongodbDatabase::default()/* use setters */,
10930    ///         MongodbDatabase::default()/* use (different) setters */,
10931    ///     ]);
10932    /// ```
10933    pub fn set_databases<T, V>(mut self, v: T) -> Self
10934    where
10935        T: std::iter::IntoIterator<Item = V>,
10936        V: std::convert::Into<crate::model::MongodbDatabase>,
10937    {
10938        use std::iter::Iterator;
10939        self.databases = v.into_iter().map(|i| i.into()).collect();
10940        self
10941    }
10942}
10943
10944impl wkt::message::Message for MongodbCluster {
10945    fn typename() -> &'static str {
10946        "type.googleapis.com/google.cloud.datastream.v1.MongodbCluster"
10947    }
10948}
10949
10950/// MongoDB Database.
10951#[derive(Clone, Default, PartialEq)]
10952#[non_exhaustive]
10953pub struct MongodbDatabase {
10954    /// Database name.
10955    pub database: std::string::String,
10956
10957    /// Collections in the database.
10958    pub collections: std::vec::Vec<crate::model::MongodbCollection>,
10959
10960    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10961}
10962
10963impl MongodbDatabase {
10964    pub fn new() -> Self {
10965        std::default::Default::default()
10966    }
10967
10968    /// Sets the value of [database][crate::model::MongodbDatabase::database].
10969    ///
10970    /// # Example
10971    /// ```ignore,no_run
10972    /// # use google_cloud_datastream_v1::model::MongodbDatabase;
10973    /// let x = MongodbDatabase::new().set_database("example");
10974    /// ```
10975    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10976        self.database = v.into();
10977        self
10978    }
10979
10980    /// Sets the value of [collections][crate::model::MongodbDatabase::collections].
10981    ///
10982    /// # Example
10983    /// ```ignore,no_run
10984    /// # use google_cloud_datastream_v1::model::MongodbDatabase;
10985    /// use google_cloud_datastream_v1::model::MongodbCollection;
10986    /// let x = MongodbDatabase::new()
10987    ///     .set_collections([
10988    ///         MongodbCollection::default()/* use setters */,
10989    ///         MongodbCollection::default()/* use (different) setters */,
10990    ///     ]);
10991    /// ```
10992    pub fn set_collections<T, V>(mut self, v: T) -> Self
10993    where
10994        T: std::iter::IntoIterator<Item = V>,
10995        V: std::convert::Into<crate::model::MongodbCollection>,
10996    {
10997        use std::iter::Iterator;
10998        self.collections = v.into_iter().map(|i| i.into()).collect();
10999        self
11000    }
11001}
11002
11003impl wkt::message::Message for MongodbDatabase {
11004    fn typename() -> &'static str {
11005        "type.googleapis.com/google.cloud.datastream.v1.MongodbDatabase"
11006    }
11007}
11008
11009/// MongoDB Collection.
11010#[derive(Clone, Default, PartialEq)]
11011#[non_exhaustive]
11012pub struct MongodbCollection {
11013    /// Collection name.
11014    pub collection: std::string::String,
11015
11016    /// Fields in the collection.
11017    pub fields: std::vec::Vec<crate::model::MongodbField>,
11018
11019    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11020}
11021
11022impl MongodbCollection {
11023    pub fn new() -> Self {
11024        std::default::Default::default()
11025    }
11026
11027    /// Sets the value of [collection][crate::model::MongodbCollection::collection].
11028    ///
11029    /// # Example
11030    /// ```ignore,no_run
11031    /// # use google_cloud_datastream_v1::model::MongodbCollection;
11032    /// let x = MongodbCollection::new().set_collection("example");
11033    /// ```
11034    pub fn set_collection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11035        self.collection = v.into();
11036        self
11037    }
11038
11039    /// Sets the value of [fields][crate::model::MongodbCollection::fields].
11040    ///
11041    /// # Example
11042    /// ```ignore,no_run
11043    /// # use google_cloud_datastream_v1::model::MongodbCollection;
11044    /// use google_cloud_datastream_v1::model::MongodbField;
11045    /// let x = MongodbCollection::new()
11046    ///     .set_fields([
11047    ///         MongodbField::default()/* use setters */,
11048    ///         MongodbField::default()/* use (different) setters */,
11049    ///     ]);
11050    /// ```
11051    pub fn set_fields<T, V>(mut self, v: T) -> Self
11052    where
11053        T: std::iter::IntoIterator<Item = V>,
11054        V: std::convert::Into<crate::model::MongodbField>,
11055    {
11056        use std::iter::Iterator;
11057        self.fields = v.into_iter().map(|i| i.into()).collect();
11058        self
11059    }
11060}
11061
11062impl wkt::message::Message for MongodbCollection {
11063    fn typename() -> &'static str {
11064        "type.googleapis.com/google.cloud.datastream.v1.MongodbCollection"
11065    }
11066}
11067
11068/// MongoDB Field.
11069#[derive(Clone, Default, PartialEq)]
11070#[non_exhaustive]
11071pub struct MongodbField {
11072    /// Field name.
11073    pub field: std::string::String,
11074
11075    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11076}
11077
11078impl MongodbField {
11079    pub fn new() -> Self {
11080        std::default::Default::default()
11081    }
11082
11083    /// Sets the value of [field][crate::model::MongodbField::field].
11084    ///
11085    /// # Example
11086    /// ```ignore,no_run
11087    /// # use google_cloud_datastream_v1::model::MongodbField;
11088    /// let x = MongodbField::new().set_field("example");
11089    /// ```
11090    pub fn set_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11091        self.field = v.into();
11092        self
11093    }
11094}
11095
11096impl wkt::message::Message for MongodbField {
11097    fn typename() -> &'static str {
11098        "type.googleapis.com/google.cloud.datastream.v1.MongodbField"
11099    }
11100}
11101
11102/// The configuration of the stream source.
11103#[derive(Clone, Default, PartialEq)]
11104#[non_exhaustive]
11105pub struct SourceConfig {
11106    /// Required. Source connection profile resource.
11107    /// Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
11108    pub source_connection_profile: std::string::String,
11109
11110    /// Stream configuration that is specific to the data source type.
11111    pub source_stream_config: std::option::Option<crate::model::source_config::SourceStreamConfig>,
11112
11113    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11114}
11115
11116impl SourceConfig {
11117    pub fn new() -> Self {
11118        std::default::Default::default()
11119    }
11120
11121    /// Sets the value of [source_connection_profile][crate::model::SourceConfig::source_connection_profile].
11122    ///
11123    /// # Example
11124    /// ```ignore,no_run
11125    /// # use google_cloud_datastream_v1::model::SourceConfig;
11126    /// let x = SourceConfig::new().set_source_connection_profile("example");
11127    /// ```
11128    pub fn set_source_connection_profile<T: std::convert::Into<std::string::String>>(
11129        mut self,
11130        v: T,
11131    ) -> Self {
11132        self.source_connection_profile = v.into();
11133        self
11134    }
11135
11136    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config].
11137    ///
11138    /// Note that all the setters affecting `source_stream_config` are mutually
11139    /// exclusive.
11140    ///
11141    /// # Example
11142    /// ```ignore,no_run
11143    /// # use google_cloud_datastream_v1::model::SourceConfig;
11144    /// use google_cloud_datastream_v1::model::OracleSourceConfig;
11145    /// let x = SourceConfig::new().set_source_stream_config(Some(
11146    ///     google_cloud_datastream_v1::model::source_config::SourceStreamConfig::OracleSourceConfig(OracleSourceConfig::default().into())));
11147    /// ```
11148    pub fn set_source_stream_config<
11149        T: std::convert::Into<std::option::Option<crate::model::source_config::SourceStreamConfig>>,
11150    >(
11151        mut self,
11152        v: T,
11153    ) -> Self {
11154        self.source_stream_config = v.into();
11155        self
11156    }
11157
11158    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11159    /// if it holds a `OracleSourceConfig`, `None` if the field is not set or
11160    /// holds a different branch.
11161    pub fn oracle_source_config(
11162        &self,
11163    ) -> std::option::Option<&std::boxed::Box<crate::model::OracleSourceConfig>> {
11164        #[allow(unreachable_patterns)]
11165        self.source_stream_config.as_ref().and_then(|v| match v {
11166            crate::model::source_config::SourceStreamConfig::OracleSourceConfig(v) => {
11167                std::option::Option::Some(v)
11168            }
11169            _ => std::option::Option::None,
11170        })
11171    }
11172
11173    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11174    /// to hold a `OracleSourceConfig`.
11175    ///
11176    /// Note that all the setters affecting `source_stream_config` are
11177    /// mutually exclusive.
11178    ///
11179    /// # Example
11180    /// ```ignore,no_run
11181    /// # use google_cloud_datastream_v1::model::SourceConfig;
11182    /// use google_cloud_datastream_v1::model::OracleSourceConfig;
11183    /// let x = SourceConfig::new().set_oracle_source_config(OracleSourceConfig::default()/* use setters */);
11184    /// assert!(x.oracle_source_config().is_some());
11185    /// assert!(x.mysql_source_config().is_none());
11186    /// assert!(x.postgresql_source_config().is_none());
11187    /// assert!(x.sql_server_source_config().is_none());
11188    /// assert!(x.salesforce_source_config().is_none());
11189    /// assert!(x.mongodb_source_config().is_none());
11190    /// ```
11191    pub fn set_oracle_source_config<
11192        T: std::convert::Into<std::boxed::Box<crate::model::OracleSourceConfig>>,
11193    >(
11194        mut self,
11195        v: T,
11196    ) -> Self {
11197        self.source_stream_config = std::option::Option::Some(
11198            crate::model::source_config::SourceStreamConfig::OracleSourceConfig(v.into()),
11199        );
11200        self
11201    }
11202
11203    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11204    /// if it holds a `MysqlSourceConfig`, `None` if the field is not set or
11205    /// holds a different branch.
11206    pub fn mysql_source_config(
11207        &self,
11208    ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlSourceConfig>> {
11209        #[allow(unreachable_patterns)]
11210        self.source_stream_config.as_ref().and_then(|v| match v {
11211            crate::model::source_config::SourceStreamConfig::MysqlSourceConfig(v) => {
11212                std::option::Option::Some(v)
11213            }
11214            _ => std::option::Option::None,
11215        })
11216    }
11217
11218    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11219    /// to hold a `MysqlSourceConfig`.
11220    ///
11221    /// Note that all the setters affecting `source_stream_config` are
11222    /// mutually exclusive.
11223    ///
11224    /// # Example
11225    /// ```ignore,no_run
11226    /// # use google_cloud_datastream_v1::model::SourceConfig;
11227    /// use google_cloud_datastream_v1::model::MysqlSourceConfig;
11228    /// let x = SourceConfig::new().set_mysql_source_config(MysqlSourceConfig::default()/* use setters */);
11229    /// assert!(x.mysql_source_config().is_some());
11230    /// assert!(x.oracle_source_config().is_none());
11231    /// assert!(x.postgresql_source_config().is_none());
11232    /// assert!(x.sql_server_source_config().is_none());
11233    /// assert!(x.salesforce_source_config().is_none());
11234    /// assert!(x.mongodb_source_config().is_none());
11235    /// ```
11236    pub fn set_mysql_source_config<
11237        T: std::convert::Into<std::boxed::Box<crate::model::MysqlSourceConfig>>,
11238    >(
11239        mut self,
11240        v: T,
11241    ) -> Self {
11242        self.source_stream_config = std::option::Option::Some(
11243            crate::model::source_config::SourceStreamConfig::MysqlSourceConfig(v.into()),
11244        );
11245        self
11246    }
11247
11248    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11249    /// if it holds a `PostgresqlSourceConfig`, `None` if the field is not set or
11250    /// holds a different branch.
11251    pub fn postgresql_source_config(
11252        &self,
11253    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlSourceConfig>> {
11254        #[allow(unreachable_patterns)]
11255        self.source_stream_config.as_ref().and_then(|v| match v {
11256            crate::model::source_config::SourceStreamConfig::PostgresqlSourceConfig(v) => {
11257                std::option::Option::Some(v)
11258            }
11259            _ => std::option::Option::None,
11260        })
11261    }
11262
11263    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11264    /// to hold a `PostgresqlSourceConfig`.
11265    ///
11266    /// Note that all the setters affecting `source_stream_config` are
11267    /// mutually exclusive.
11268    ///
11269    /// # Example
11270    /// ```ignore,no_run
11271    /// # use google_cloud_datastream_v1::model::SourceConfig;
11272    /// use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
11273    /// let x = SourceConfig::new().set_postgresql_source_config(PostgresqlSourceConfig::default()/* use setters */);
11274    /// assert!(x.postgresql_source_config().is_some());
11275    /// assert!(x.oracle_source_config().is_none());
11276    /// assert!(x.mysql_source_config().is_none());
11277    /// assert!(x.sql_server_source_config().is_none());
11278    /// assert!(x.salesforce_source_config().is_none());
11279    /// assert!(x.mongodb_source_config().is_none());
11280    /// ```
11281    pub fn set_postgresql_source_config<
11282        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlSourceConfig>>,
11283    >(
11284        mut self,
11285        v: T,
11286    ) -> Self {
11287        self.source_stream_config = std::option::Option::Some(
11288            crate::model::source_config::SourceStreamConfig::PostgresqlSourceConfig(v.into()),
11289        );
11290        self
11291    }
11292
11293    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11294    /// if it holds a `SqlServerSourceConfig`, `None` if the field is not set or
11295    /// holds a different branch.
11296    pub fn sql_server_source_config(
11297        &self,
11298    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerSourceConfig>> {
11299        #[allow(unreachable_patterns)]
11300        self.source_stream_config.as_ref().and_then(|v| match v {
11301            crate::model::source_config::SourceStreamConfig::SqlServerSourceConfig(v) => {
11302                std::option::Option::Some(v)
11303            }
11304            _ => std::option::Option::None,
11305        })
11306    }
11307
11308    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11309    /// to hold a `SqlServerSourceConfig`.
11310    ///
11311    /// Note that all the setters affecting `source_stream_config` are
11312    /// mutually exclusive.
11313    ///
11314    /// # Example
11315    /// ```ignore,no_run
11316    /// # use google_cloud_datastream_v1::model::SourceConfig;
11317    /// use google_cloud_datastream_v1::model::SqlServerSourceConfig;
11318    /// let x = SourceConfig::new().set_sql_server_source_config(SqlServerSourceConfig::default()/* use setters */);
11319    /// assert!(x.sql_server_source_config().is_some());
11320    /// assert!(x.oracle_source_config().is_none());
11321    /// assert!(x.mysql_source_config().is_none());
11322    /// assert!(x.postgresql_source_config().is_none());
11323    /// assert!(x.salesforce_source_config().is_none());
11324    /// assert!(x.mongodb_source_config().is_none());
11325    /// ```
11326    pub fn set_sql_server_source_config<
11327        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerSourceConfig>>,
11328    >(
11329        mut self,
11330        v: T,
11331    ) -> Self {
11332        self.source_stream_config = std::option::Option::Some(
11333            crate::model::source_config::SourceStreamConfig::SqlServerSourceConfig(v.into()),
11334        );
11335        self
11336    }
11337
11338    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11339    /// if it holds a `SalesforceSourceConfig`, `None` if the field is not set or
11340    /// holds a different branch.
11341    pub fn salesforce_source_config(
11342        &self,
11343    ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceSourceConfig>> {
11344        #[allow(unreachable_patterns)]
11345        self.source_stream_config.as_ref().and_then(|v| match v {
11346            crate::model::source_config::SourceStreamConfig::SalesforceSourceConfig(v) => {
11347                std::option::Option::Some(v)
11348            }
11349            _ => std::option::Option::None,
11350        })
11351    }
11352
11353    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11354    /// to hold a `SalesforceSourceConfig`.
11355    ///
11356    /// Note that all the setters affecting `source_stream_config` are
11357    /// mutually exclusive.
11358    ///
11359    /// # Example
11360    /// ```ignore,no_run
11361    /// # use google_cloud_datastream_v1::model::SourceConfig;
11362    /// use google_cloud_datastream_v1::model::SalesforceSourceConfig;
11363    /// let x = SourceConfig::new().set_salesforce_source_config(SalesforceSourceConfig::default()/* use setters */);
11364    /// assert!(x.salesforce_source_config().is_some());
11365    /// assert!(x.oracle_source_config().is_none());
11366    /// assert!(x.mysql_source_config().is_none());
11367    /// assert!(x.postgresql_source_config().is_none());
11368    /// assert!(x.sql_server_source_config().is_none());
11369    /// assert!(x.mongodb_source_config().is_none());
11370    /// ```
11371    pub fn set_salesforce_source_config<
11372        T: std::convert::Into<std::boxed::Box<crate::model::SalesforceSourceConfig>>,
11373    >(
11374        mut self,
11375        v: T,
11376    ) -> Self {
11377        self.source_stream_config = std::option::Option::Some(
11378            crate::model::source_config::SourceStreamConfig::SalesforceSourceConfig(v.into()),
11379        );
11380        self
11381    }
11382
11383    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11384    /// if it holds a `MongodbSourceConfig`, `None` if the field is not set or
11385    /// holds a different branch.
11386    pub fn mongodb_source_config(
11387        &self,
11388    ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbSourceConfig>> {
11389        #[allow(unreachable_patterns)]
11390        self.source_stream_config.as_ref().and_then(|v| match v {
11391            crate::model::source_config::SourceStreamConfig::MongodbSourceConfig(v) => {
11392                std::option::Option::Some(v)
11393            }
11394            _ => std::option::Option::None,
11395        })
11396    }
11397
11398    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11399    /// to hold a `MongodbSourceConfig`.
11400    ///
11401    /// Note that all the setters affecting `source_stream_config` are
11402    /// mutually exclusive.
11403    ///
11404    /// # Example
11405    /// ```ignore,no_run
11406    /// # use google_cloud_datastream_v1::model::SourceConfig;
11407    /// use google_cloud_datastream_v1::model::MongodbSourceConfig;
11408    /// let x = SourceConfig::new().set_mongodb_source_config(MongodbSourceConfig::default()/* use setters */);
11409    /// assert!(x.mongodb_source_config().is_some());
11410    /// assert!(x.oracle_source_config().is_none());
11411    /// assert!(x.mysql_source_config().is_none());
11412    /// assert!(x.postgresql_source_config().is_none());
11413    /// assert!(x.sql_server_source_config().is_none());
11414    /// assert!(x.salesforce_source_config().is_none());
11415    /// ```
11416    pub fn set_mongodb_source_config<
11417        T: std::convert::Into<std::boxed::Box<crate::model::MongodbSourceConfig>>,
11418    >(
11419        mut self,
11420        v: T,
11421    ) -> Self {
11422        self.source_stream_config = std::option::Option::Some(
11423            crate::model::source_config::SourceStreamConfig::MongodbSourceConfig(v.into()),
11424        );
11425        self
11426    }
11427}
11428
11429impl wkt::message::Message for SourceConfig {
11430    fn typename() -> &'static str {
11431        "type.googleapis.com/google.cloud.datastream.v1.SourceConfig"
11432    }
11433}
11434
11435/// Defines additional types related to [SourceConfig].
11436pub mod source_config {
11437    #[allow(unused_imports)]
11438    use super::*;
11439
11440    /// Stream configuration that is specific to the data source type.
11441    #[derive(Clone, Debug, PartialEq)]
11442    #[non_exhaustive]
11443    pub enum SourceStreamConfig {
11444        /// Oracle data source configuration.
11445        OracleSourceConfig(std::boxed::Box<crate::model::OracleSourceConfig>),
11446        /// MySQL data source configuration.
11447        MysqlSourceConfig(std::boxed::Box<crate::model::MysqlSourceConfig>),
11448        /// PostgreSQL data source configuration.
11449        PostgresqlSourceConfig(std::boxed::Box<crate::model::PostgresqlSourceConfig>),
11450        /// SQLServer data source configuration.
11451        SqlServerSourceConfig(std::boxed::Box<crate::model::SqlServerSourceConfig>),
11452        /// Salesforce data source configuration.
11453        SalesforceSourceConfig(std::boxed::Box<crate::model::SalesforceSourceConfig>),
11454        /// MongoDB data source configuration.
11455        MongodbSourceConfig(std::boxed::Box<crate::model::MongodbSourceConfig>),
11456    }
11457}
11458
11459/// AVRO file format configuration.
11460#[derive(Clone, Default, PartialEq)]
11461#[non_exhaustive]
11462pub struct AvroFileFormat {
11463    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11464}
11465
11466impl AvroFileFormat {
11467    pub fn new() -> Self {
11468        std::default::Default::default()
11469    }
11470}
11471
11472impl wkt::message::Message for AvroFileFormat {
11473    fn typename() -> &'static str {
11474        "type.googleapis.com/google.cloud.datastream.v1.AvroFileFormat"
11475    }
11476}
11477
11478/// JSON file format configuration.
11479#[derive(Clone, Default, PartialEq)]
11480#[non_exhaustive]
11481pub struct JsonFileFormat {
11482    /// The schema file format along JSON data files.
11483    pub schema_file_format: crate::model::json_file_format::SchemaFileFormat,
11484
11485    /// Compression of the loaded JSON file.
11486    pub compression: crate::model::json_file_format::JsonCompression,
11487
11488    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11489}
11490
11491impl JsonFileFormat {
11492    pub fn new() -> Self {
11493        std::default::Default::default()
11494    }
11495
11496    /// Sets the value of [schema_file_format][crate::model::JsonFileFormat::schema_file_format].
11497    ///
11498    /// # Example
11499    /// ```ignore,no_run
11500    /// # use google_cloud_datastream_v1::model::JsonFileFormat;
11501    /// use google_cloud_datastream_v1::model::json_file_format::SchemaFileFormat;
11502    /// let x0 = JsonFileFormat::new().set_schema_file_format(SchemaFileFormat::NoSchemaFile);
11503    /// let x1 = JsonFileFormat::new().set_schema_file_format(SchemaFileFormat::AvroSchemaFile);
11504    /// ```
11505    pub fn set_schema_file_format<
11506        T: std::convert::Into<crate::model::json_file_format::SchemaFileFormat>,
11507    >(
11508        mut self,
11509        v: T,
11510    ) -> Self {
11511        self.schema_file_format = v.into();
11512        self
11513    }
11514
11515    /// Sets the value of [compression][crate::model::JsonFileFormat::compression].
11516    ///
11517    /// # Example
11518    /// ```ignore,no_run
11519    /// # use google_cloud_datastream_v1::model::JsonFileFormat;
11520    /// use google_cloud_datastream_v1::model::json_file_format::JsonCompression;
11521    /// let x0 = JsonFileFormat::new().set_compression(JsonCompression::NoCompression);
11522    /// let x1 = JsonFileFormat::new().set_compression(JsonCompression::Gzip);
11523    /// ```
11524    pub fn set_compression<
11525        T: std::convert::Into<crate::model::json_file_format::JsonCompression>,
11526    >(
11527        mut self,
11528        v: T,
11529    ) -> Self {
11530        self.compression = v.into();
11531        self
11532    }
11533}
11534
11535impl wkt::message::Message for JsonFileFormat {
11536    fn typename() -> &'static str {
11537        "type.googleapis.com/google.cloud.datastream.v1.JsonFileFormat"
11538    }
11539}
11540
11541/// Defines additional types related to [JsonFileFormat].
11542pub mod json_file_format {
11543    #[allow(unused_imports)]
11544    use super::*;
11545
11546    /// Schema file format.
11547    ///
11548    /// # Working with unknown values
11549    ///
11550    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11551    /// additional enum variants at any time. Adding new variants is not considered
11552    /// a breaking change. Applications should write their code in anticipation of:
11553    ///
11554    /// - New values appearing in future releases of the client library, **and**
11555    /// - New values received dynamically, without application changes.
11556    ///
11557    /// Please consult the [Working with enums] section in the user guide for some
11558    /// guidelines.
11559    ///
11560    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11561    #[derive(Clone, Debug, PartialEq)]
11562    #[non_exhaustive]
11563    pub enum SchemaFileFormat {
11564        /// Unspecified schema file format.
11565        Unspecified,
11566        /// Do not attach schema file.
11567        NoSchemaFile,
11568        /// Avro schema format.
11569        AvroSchemaFile,
11570        /// If set, the enum was initialized with an unknown value.
11571        ///
11572        /// Applications can examine the value using [SchemaFileFormat::value] or
11573        /// [SchemaFileFormat::name].
11574        UnknownValue(schema_file_format::UnknownValue),
11575    }
11576
11577    #[doc(hidden)]
11578    pub mod schema_file_format {
11579        #[allow(unused_imports)]
11580        use super::*;
11581        #[derive(Clone, Debug, PartialEq)]
11582        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11583    }
11584
11585    impl SchemaFileFormat {
11586        /// Gets the enum value.
11587        ///
11588        /// Returns `None` if the enum contains an unknown value deserialized from
11589        /// the string representation of enums.
11590        pub fn value(&self) -> std::option::Option<i32> {
11591            match self {
11592                Self::Unspecified => std::option::Option::Some(0),
11593                Self::NoSchemaFile => std::option::Option::Some(1),
11594                Self::AvroSchemaFile => std::option::Option::Some(2),
11595                Self::UnknownValue(u) => u.0.value(),
11596            }
11597        }
11598
11599        /// Gets the enum value as a string.
11600        ///
11601        /// Returns `None` if the enum contains an unknown value deserialized from
11602        /// the integer representation of enums.
11603        pub fn name(&self) -> std::option::Option<&str> {
11604            match self {
11605                Self::Unspecified => std::option::Option::Some("SCHEMA_FILE_FORMAT_UNSPECIFIED"),
11606                Self::NoSchemaFile => std::option::Option::Some("NO_SCHEMA_FILE"),
11607                Self::AvroSchemaFile => std::option::Option::Some("AVRO_SCHEMA_FILE"),
11608                Self::UnknownValue(u) => u.0.name(),
11609            }
11610        }
11611    }
11612
11613    impl std::default::Default for SchemaFileFormat {
11614        fn default() -> Self {
11615            use std::convert::From;
11616            Self::from(0)
11617        }
11618    }
11619
11620    impl std::fmt::Display for SchemaFileFormat {
11621        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11622            wkt::internal::display_enum(f, self.name(), self.value())
11623        }
11624    }
11625
11626    impl std::convert::From<i32> for SchemaFileFormat {
11627        fn from(value: i32) -> Self {
11628            match value {
11629                0 => Self::Unspecified,
11630                1 => Self::NoSchemaFile,
11631                2 => Self::AvroSchemaFile,
11632                _ => Self::UnknownValue(schema_file_format::UnknownValue(
11633                    wkt::internal::UnknownEnumValue::Integer(value),
11634                )),
11635            }
11636        }
11637    }
11638
11639    impl std::convert::From<&str> for SchemaFileFormat {
11640        fn from(value: &str) -> Self {
11641            use std::string::ToString;
11642            match value {
11643                "SCHEMA_FILE_FORMAT_UNSPECIFIED" => Self::Unspecified,
11644                "NO_SCHEMA_FILE" => Self::NoSchemaFile,
11645                "AVRO_SCHEMA_FILE" => Self::AvroSchemaFile,
11646                _ => Self::UnknownValue(schema_file_format::UnknownValue(
11647                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11648                )),
11649            }
11650        }
11651    }
11652
11653    impl serde::ser::Serialize for SchemaFileFormat {
11654        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11655        where
11656            S: serde::Serializer,
11657        {
11658            match self {
11659                Self::Unspecified => serializer.serialize_i32(0),
11660                Self::NoSchemaFile => serializer.serialize_i32(1),
11661                Self::AvroSchemaFile => serializer.serialize_i32(2),
11662                Self::UnknownValue(u) => u.0.serialize(serializer),
11663            }
11664        }
11665    }
11666
11667    impl<'de> serde::de::Deserialize<'de> for SchemaFileFormat {
11668        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11669        where
11670            D: serde::Deserializer<'de>,
11671        {
11672            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SchemaFileFormat>::new(
11673                ".google.cloud.datastream.v1.JsonFileFormat.SchemaFileFormat",
11674            ))
11675        }
11676    }
11677
11678    /// Json file compression.
11679    ///
11680    /// # Working with unknown values
11681    ///
11682    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11683    /// additional enum variants at any time. Adding new variants is not considered
11684    /// a breaking change. Applications should write their code in anticipation of:
11685    ///
11686    /// - New values appearing in future releases of the client library, **and**
11687    /// - New values received dynamically, without application changes.
11688    ///
11689    /// Please consult the [Working with enums] section in the user guide for some
11690    /// guidelines.
11691    ///
11692    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11693    #[derive(Clone, Debug, PartialEq)]
11694    #[non_exhaustive]
11695    pub enum JsonCompression {
11696        /// Unspecified json file compression.
11697        Unspecified,
11698        /// Do not compress JSON file.
11699        NoCompression,
11700        /// Gzip compression.
11701        Gzip,
11702        /// If set, the enum was initialized with an unknown value.
11703        ///
11704        /// Applications can examine the value using [JsonCompression::value] or
11705        /// [JsonCompression::name].
11706        UnknownValue(json_compression::UnknownValue),
11707    }
11708
11709    #[doc(hidden)]
11710    pub mod json_compression {
11711        #[allow(unused_imports)]
11712        use super::*;
11713        #[derive(Clone, Debug, PartialEq)]
11714        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11715    }
11716
11717    impl JsonCompression {
11718        /// Gets the enum value.
11719        ///
11720        /// Returns `None` if the enum contains an unknown value deserialized from
11721        /// the string representation of enums.
11722        pub fn value(&self) -> std::option::Option<i32> {
11723            match self {
11724                Self::Unspecified => std::option::Option::Some(0),
11725                Self::NoCompression => std::option::Option::Some(1),
11726                Self::Gzip => std::option::Option::Some(2),
11727                Self::UnknownValue(u) => u.0.value(),
11728            }
11729        }
11730
11731        /// Gets the enum value as a string.
11732        ///
11733        /// Returns `None` if the enum contains an unknown value deserialized from
11734        /// the integer representation of enums.
11735        pub fn name(&self) -> std::option::Option<&str> {
11736            match self {
11737                Self::Unspecified => std::option::Option::Some("JSON_COMPRESSION_UNSPECIFIED"),
11738                Self::NoCompression => std::option::Option::Some("NO_COMPRESSION"),
11739                Self::Gzip => std::option::Option::Some("GZIP"),
11740                Self::UnknownValue(u) => u.0.name(),
11741            }
11742        }
11743    }
11744
11745    impl std::default::Default for JsonCompression {
11746        fn default() -> Self {
11747            use std::convert::From;
11748            Self::from(0)
11749        }
11750    }
11751
11752    impl std::fmt::Display for JsonCompression {
11753        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11754            wkt::internal::display_enum(f, self.name(), self.value())
11755        }
11756    }
11757
11758    impl std::convert::From<i32> for JsonCompression {
11759        fn from(value: i32) -> Self {
11760            match value {
11761                0 => Self::Unspecified,
11762                1 => Self::NoCompression,
11763                2 => Self::Gzip,
11764                _ => Self::UnknownValue(json_compression::UnknownValue(
11765                    wkt::internal::UnknownEnumValue::Integer(value),
11766                )),
11767            }
11768        }
11769    }
11770
11771    impl std::convert::From<&str> for JsonCompression {
11772        fn from(value: &str) -> Self {
11773            use std::string::ToString;
11774            match value {
11775                "JSON_COMPRESSION_UNSPECIFIED" => Self::Unspecified,
11776                "NO_COMPRESSION" => Self::NoCompression,
11777                "GZIP" => Self::Gzip,
11778                _ => Self::UnknownValue(json_compression::UnknownValue(
11779                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11780                )),
11781            }
11782        }
11783    }
11784
11785    impl serde::ser::Serialize for JsonCompression {
11786        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11787        where
11788            S: serde::Serializer,
11789        {
11790            match self {
11791                Self::Unspecified => serializer.serialize_i32(0),
11792                Self::NoCompression => serializer.serialize_i32(1),
11793                Self::Gzip => serializer.serialize_i32(2),
11794                Self::UnknownValue(u) => u.0.serialize(serializer),
11795            }
11796        }
11797    }
11798
11799    impl<'de> serde::de::Deserialize<'de> for JsonCompression {
11800        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11801        where
11802            D: serde::Deserializer<'de>,
11803        {
11804            deserializer.deserialize_any(wkt::internal::EnumVisitor::<JsonCompression>::new(
11805                ".google.cloud.datastream.v1.JsonFileFormat.JsonCompression",
11806            ))
11807        }
11808    }
11809}
11810
11811/// Google Cloud Storage destination configuration
11812#[derive(Clone, Default, PartialEq)]
11813#[non_exhaustive]
11814pub struct GcsDestinationConfig {
11815    /// Path inside the Cloud Storage bucket to write data to.
11816    pub path: std::string::String,
11817
11818    /// The maximum file size to be saved in the bucket.
11819    pub file_rotation_mb: i32,
11820
11821    /// The maximum duration for which new events are added before a file is
11822    /// closed and a new file is created. Values within the range of 15-60 seconds
11823    /// are allowed.
11824    pub file_rotation_interval: std::option::Option<wkt::Duration>,
11825
11826    /// File Format that the data should be written in.
11827    pub file_format: std::option::Option<crate::model::gcs_destination_config::FileFormat>,
11828
11829    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11830}
11831
11832impl GcsDestinationConfig {
11833    pub fn new() -> Self {
11834        std::default::Default::default()
11835    }
11836
11837    /// Sets the value of [path][crate::model::GcsDestinationConfig::path].
11838    ///
11839    /// # Example
11840    /// ```ignore,no_run
11841    /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
11842    /// let x = GcsDestinationConfig::new().set_path("example");
11843    /// ```
11844    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11845        self.path = v.into();
11846        self
11847    }
11848
11849    /// Sets the value of [file_rotation_mb][crate::model::GcsDestinationConfig::file_rotation_mb].
11850    ///
11851    /// # Example
11852    /// ```ignore,no_run
11853    /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
11854    /// let x = GcsDestinationConfig::new().set_file_rotation_mb(42);
11855    /// ```
11856    pub fn set_file_rotation_mb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11857        self.file_rotation_mb = v.into();
11858        self
11859    }
11860
11861    /// Sets the value of [file_rotation_interval][crate::model::GcsDestinationConfig::file_rotation_interval].
11862    ///
11863    /// # Example
11864    /// ```ignore,no_run
11865    /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
11866    /// use wkt::Duration;
11867    /// let x = GcsDestinationConfig::new().set_file_rotation_interval(Duration::default()/* use setters */);
11868    /// ```
11869    pub fn set_file_rotation_interval<T>(mut self, v: T) -> Self
11870    where
11871        T: std::convert::Into<wkt::Duration>,
11872    {
11873        self.file_rotation_interval = std::option::Option::Some(v.into());
11874        self
11875    }
11876
11877    /// Sets or clears the value of [file_rotation_interval][crate::model::GcsDestinationConfig::file_rotation_interval].
11878    ///
11879    /// # Example
11880    /// ```ignore,no_run
11881    /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
11882    /// use wkt::Duration;
11883    /// let x = GcsDestinationConfig::new().set_or_clear_file_rotation_interval(Some(Duration::default()/* use setters */));
11884    /// let x = GcsDestinationConfig::new().set_or_clear_file_rotation_interval(None::<Duration>);
11885    /// ```
11886    pub fn set_or_clear_file_rotation_interval<T>(mut self, v: std::option::Option<T>) -> Self
11887    where
11888        T: std::convert::Into<wkt::Duration>,
11889    {
11890        self.file_rotation_interval = v.map(|x| x.into());
11891        self
11892    }
11893
11894    /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format].
11895    ///
11896    /// Note that all the setters affecting `file_format` are mutually
11897    /// exclusive.
11898    ///
11899    /// # Example
11900    /// ```ignore,no_run
11901    /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
11902    /// use google_cloud_datastream_v1::model::AvroFileFormat;
11903    /// let x = GcsDestinationConfig::new().set_file_format(Some(
11904    ///     google_cloud_datastream_v1::model::gcs_destination_config::FileFormat::AvroFileFormat(AvroFileFormat::default().into())));
11905    /// ```
11906    pub fn set_file_format<
11907        T: std::convert::Into<std::option::Option<crate::model::gcs_destination_config::FileFormat>>,
11908    >(
11909        mut self,
11910        v: T,
11911    ) -> Self {
11912        self.file_format = v.into();
11913        self
11914    }
11915
11916    /// The value of [file_format][crate::model::GcsDestinationConfig::file_format]
11917    /// if it holds a `AvroFileFormat`, `None` if the field is not set or
11918    /// holds a different branch.
11919    pub fn avro_file_format(
11920        &self,
11921    ) -> std::option::Option<&std::boxed::Box<crate::model::AvroFileFormat>> {
11922        #[allow(unreachable_patterns)]
11923        self.file_format.as_ref().and_then(|v| match v {
11924            crate::model::gcs_destination_config::FileFormat::AvroFileFormat(v) => {
11925                std::option::Option::Some(v)
11926            }
11927            _ => std::option::Option::None,
11928        })
11929    }
11930
11931    /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format]
11932    /// to hold a `AvroFileFormat`.
11933    ///
11934    /// Note that all the setters affecting `file_format` are
11935    /// mutually exclusive.
11936    ///
11937    /// # Example
11938    /// ```ignore,no_run
11939    /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
11940    /// use google_cloud_datastream_v1::model::AvroFileFormat;
11941    /// let x = GcsDestinationConfig::new().set_avro_file_format(AvroFileFormat::default()/* use setters */);
11942    /// assert!(x.avro_file_format().is_some());
11943    /// assert!(x.json_file_format().is_none());
11944    /// ```
11945    pub fn set_avro_file_format<
11946        T: std::convert::Into<std::boxed::Box<crate::model::AvroFileFormat>>,
11947    >(
11948        mut self,
11949        v: T,
11950    ) -> Self {
11951        self.file_format = std::option::Option::Some(
11952            crate::model::gcs_destination_config::FileFormat::AvroFileFormat(v.into()),
11953        );
11954        self
11955    }
11956
11957    /// The value of [file_format][crate::model::GcsDestinationConfig::file_format]
11958    /// if it holds a `JsonFileFormat`, `None` if the field is not set or
11959    /// holds a different branch.
11960    pub fn json_file_format(
11961        &self,
11962    ) -> std::option::Option<&std::boxed::Box<crate::model::JsonFileFormat>> {
11963        #[allow(unreachable_patterns)]
11964        self.file_format.as_ref().and_then(|v| match v {
11965            crate::model::gcs_destination_config::FileFormat::JsonFileFormat(v) => {
11966                std::option::Option::Some(v)
11967            }
11968            _ => std::option::Option::None,
11969        })
11970    }
11971
11972    /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format]
11973    /// to hold a `JsonFileFormat`.
11974    ///
11975    /// Note that all the setters affecting `file_format` are
11976    /// mutually exclusive.
11977    ///
11978    /// # Example
11979    /// ```ignore,no_run
11980    /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
11981    /// use google_cloud_datastream_v1::model::JsonFileFormat;
11982    /// let x = GcsDestinationConfig::new().set_json_file_format(JsonFileFormat::default()/* use setters */);
11983    /// assert!(x.json_file_format().is_some());
11984    /// assert!(x.avro_file_format().is_none());
11985    /// ```
11986    pub fn set_json_file_format<
11987        T: std::convert::Into<std::boxed::Box<crate::model::JsonFileFormat>>,
11988    >(
11989        mut self,
11990        v: T,
11991    ) -> Self {
11992        self.file_format = std::option::Option::Some(
11993            crate::model::gcs_destination_config::FileFormat::JsonFileFormat(v.into()),
11994        );
11995        self
11996    }
11997}
11998
11999impl wkt::message::Message for GcsDestinationConfig {
12000    fn typename() -> &'static str {
12001        "type.googleapis.com/google.cloud.datastream.v1.GcsDestinationConfig"
12002    }
12003}
12004
12005/// Defines additional types related to [GcsDestinationConfig].
12006pub mod gcs_destination_config {
12007    #[allow(unused_imports)]
12008    use super::*;
12009
12010    /// File Format that the data should be written in.
12011    #[derive(Clone, Debug, PartialEq)]
12012    #[non_exhaustive]
12013    pub enum FileFormat {
12014        /// AVRO file format configuration.
12015        AvroFileFormat(std::boxed::Box<crate::model::AvroFileFormat>),
12016        /// JSON file format configuration.
12017        JsonFileFormat(std::boxed::Box<crate::model::JsonFileFormat>),
12018    }
12019}
12020
12021/// BigQuery destination configuration
12022#[derive(Clone, Default, PartialEq)]
12023#[non_exhaustive]
12024pub struct BigQueryDestinationConfig {
12025    /// The guaranteed data freshness (in seconds) when querying tables created by
12026    /// the stream. Editing this field will only affect new tables created in the
12027    /// future, but existing tables will not be impacted. Lower values mean that
12028    /// queries will return fresher data, but may result in higher cost.
12029    pub data_freshness: std::option::Option<wkt::Duration>,
12030
12031    /// Optional. Big Lake Managed Tables (BLMT) configuration.
12032    pub blmt_config: std::option::Option<crate::model::big_query_destination_config::BlmtConfig>,
12033
12034    /// Target dataset(s) configuration.
12035    pub dataset_config:
12036        std::option::Option<crate::model::big_query_destination_config::DatasetConfig>,
12037
12038    pub write_mode: std::option::Option<crate::model::big_query_destination_config::WriteMode>,
12039
12040    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12041}
12042
12043impl BigQueryDestinationConfig {
12044    pub fn new() -> Self {
12045        std::default::Default::default()
12046    }
12047
12048    /// Sets the value of [data_freshness][crate::model::BigQueryDestinationConfig::data_freshness].
12049    ///
12050    /// # Example
12051    /// ```ignore,no_run
12052    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12053    /// use wkt::Duration;
12054    /// let x = BigQueryDestinationConfig::new().set_data_freshness(Duration::default()/* use setters */);
12055    /// ```
12056    pub fn set_data_freshness<T>(mut self, v: T) -> Self
12057    where
12058        T: std::convert::Into<wkt::Duration>,
12059    {
12060        self.data_freshness = std::option::Option::Some(v.into());
12061        self
12062    }
12063
12064    /// Sets or clears the value of [data_freshness][crate::model::BigQueryDestinationConfig::data_freshness].
12065    ///
12066    /// # Example
12067    /// ```ignore,no_run
12068    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12069    /// use wkt::Duration;
12070    /// let x = BigQueryDestinationConfig::new().set_or_clear_data_freshness(Some(Duration::default()/* use setters */));
12071    /// let x = BigQueryDestinationConfig::new().set_or_clear_data_freshness(None::<Duration>);
12072    /// ```
12073    pub fn set_or_clear_data_freshness<T>(mut self, v: std::option::Option<T>) -> Self
12074    where
12075        T: std::convert::Into<wkt::Duration>,
12076    {
12077        self.data_freshness = v.map(|x| x.into());
12078        self
12079    }
12080
12081    /// Sets the value of [blmt_config][crate::model::BigQueryDestinationConfig::blmt_config].
12082    ///
12083    /// # Example
12084    /// ```ignore,no_run
12085    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12086    /// use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12087    /// let x = BigQueryDestinationConfig::new().set_blmt_config(BlmtConfig::default()/* use setters */);
12088    /// ```
12089    pub fn set_blmt_config<T>(mut self, v: T) -> Self
12090    where
12091        T: std::convert::Into<crate::model::big_query_destination_config::BlmtConfig>,
12092    {
12093        self.blmt_config = std::option::Option::Some(v.into());
12094        self
12095    }
12096
12097    /// Sets or clears the value of [blmt_config][crate::model::BigQueryDestinationConfig::blmt_config].
12098    ///
12099    /// # Example
12100    /// ```ignore,no_run
12101    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12102    /// use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12103    /// let x = BigQueryDestinationConfig::new().set_or_clear_blmt_config(Some(BlmtConfig::default()/* use setters */));
12104    /// let x = BigQueryDestinationConfig::new().set_or_clear_blmt_config(None::<BlmtConfig>);
12105    /// ```
12106    pub fn set_or_clear_blmt_config<T>(mut self, v: std::option::Option<T>) -> Self
12107    where
12108        T: std::convert::Into<crate::model::big_query_destination_config::BlmtConfig>,
12109    {
12110        self.blmt_config = v.map(|x| x.into());
12111        self
12112    }
12113
12114    /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config].
12115    ///
12116    /// Note that all the setters affecting `dataset_config` are mutually
12117    /// exclusive.
12118    ///
12119    /// # Example
12120    /// ```ignore,no_run
12121    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12122    /// use google_cloud_datastream_v1::model::big_query_destination_config::SingleTargetDataset;
12123    /// let x = BigQueryDestinationConfig::new().set_dataset_config(Some(
12124    ///     google_cloud_datastream_v1::model::big_query_destination_config::DatasetConfig::SingleTargetDataset(SingleTargetDataset::default().into())));
12125    /// ```
12126    pub fn set_dataset_config<
12127        T: std::convert::Into<
12128                std::option::Option<crate::model::big_query_destination_config::DatasetConfig>,
12129            >,
12130    >(
12131        mut self,
12132        v: T,
12133    ) -> Self {
12134        self.dataset_config = v.into();
12135        self
12136    }
12137
12138    /// The value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
12139    /// if it holds a `SingleTargetDataset`, `None` if the field is not set or
12140    /// holds a different branch.
12141    pub fn single_target_dataset(
12142        &self,
12143    ) -> std::option::Option<
12144        &std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
12145    > {
12146        #[allow(unreachable_patterns)]
12147        self.dataset_config.as_ref().and_then(|v| match v {
12148            crate::model::big_query_destination_config::DatasetConfig::SingleTargetDataset(v) => {
12149                std::option::Option::Some(v)
12150            }
12151            _ => std::option::Option::None,
12152        })
12153    }
12154
12155    /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
12156    /// to hold a `SingleTargetDataset`.
12157    ///
12158    /// Note that all the setters affecting `dataset_config` are
12159    /// mutually exclusive.
12160    ///
12161    /// # Example
12162    /// ```ignore,no_run
12163    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12164    /// use google_cloud_datastream_v1::model::big_query_destination_config::SingleTargetDataset;
12165    /// let x = BigQueryDestinationConfig::new().set_single_target_dataset(SingleTargetDataset::default()/* use setters */);
12166    /// assert!(x.single_target_dataset().is_some());
12167    /// assert!(x.source_hierarchy_datasets().is_none());
12168    /// ```
12169    pub fn set_single_target_dataset<
12170        T: std::convert::Into<
12171                std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
12172            >,
12173    >(
12174        mut self,
12175        v: T,
12176    ) -> Self {
12177        self.dataset_config = std::option::Option::Some(
12178            crate::model::big_query_destination_config::DatasetConfig::SingleTargetDataset(
12179                v.into(),
12180            ),
12181        );
12182        self
12183    }
12184
12185    /// The value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
12186    /// if it holds a `SourceHierarchyDatasets`, `None` if the field is not set or
12187    /// holds a different branch.
12188    pub fn source_hierarchy_datasets(
12189        &self,
12190    ) -> std::option::Option<
12191        &std::boxed::Box<crate::model::big_query_destination_config::SourceHierarchyDatasets>,
12192    > {
12193        #[allow(unreachable_patterns)]
12194        self.dataset_config.as_ref().and_then(|v| match v {
12195            crate::model::big_query_destination_config::DatasetConfig::SourceHierarchyDatasets(
12196                v,
12197            ) => std::option::Option::Some(v),
12198            _ => std::option::Option::None,
12199        })
12200    }
12201
12202    /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
12203    /// to hold a `SourceHierarchyDatasets`.
12204    ///
12205    /// Note that all the setters affecting `dataset_config` are
12206    /// mutually exclusive.
12207    ///
12208    /// # Example
12209    /// ```ignore,no_run
12210    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12211    /// use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12212    /// let x = BigQueryDestinationConfig::new().set_source_hierarchy_datasets(SourceHierarchyDatasets::default()/* use setters */);
12213    /// assert!(x.source_hierarchy_datasets().is_some());
12214    /// assert!(x.single_target_dataset().is_none());
12215    /// ```
12216    pub fn set_source_hierarchy_datasets<
12217        T: std::convert::Into<
12218                std::boxed::Box<
12219                    crate::model::big_query_destination_config::SourceHierarchyDatasets,
12220                >,
12221            >,
12222    >(
12223        mut self,
12224        v: T,
12225    ) -> Self {
12226        self.dataset_config = std::option::Option::Some(
12227            crate::model::big_query_destination_config::DatasetConfig::SourceHierarchyDatasets(
12228                v.into(),
12229            ),
12230        );
12231        self
12232    }
12233
12234    /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode].
12235    ///
12236    /// Note that all the setters affecting `write_mode` are mutually
12237    /// exclusive.
12238    ///
12239    /// # Example
12240    /// ```ignore,no_run
12241    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12242    /// use google_cloud_datastream_v1::model::big_query_destination_config::Merge;
12243    /// let x = BigQueryDestinationConfig::new().set_write_mode(Some(
12244    ///     google_cloud_datastream_v1::model::big_query_destination_config::WriteMode::Merge(Merge::default().into())));
12245    /// ```
12246    pub fn set_write_mode<
12247        T: std::convert::Into<
12248                std::option::Option<crate::model::big_query_destination_config::WriteMode>,
12249            >,
12250    >(
12251        mut self,
12252        v: T,
12253    ) -> Self {
12254        self.write_mode = v.into();
12255        self
12256    }
12257
12258    /// The value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
12259    /// if it holds a `Merge`, `None` if the field is not set or
12260    /// holds a different branch.
12261    pub fn merge(
12262        &self,
12263    ) -> std::option::Option<&std::boxed::Box<crate::model::big_query_destination_config::Merge>>
12264    {
12265        #[allow(unreachable_patterns)]
12266        self.write_mode.as_ref().and_then(|v| match v {
12267            crate::model::big_query_destination_config::WriteMode::Merge(v) => {
12268                std::option::Option::Some(v)
12269            }
12270            _ => std::option::Option::None,
12271        })
12272    }
12273
12274    /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
12275    /// to hold a `Merge`.
12276    ///
12277    /// Note that all the setters affecting `write_mode` are
12278    /// mutually exclusive.
12279    ///
12280    /// # Example
12281    /// ```ignore,no_run
12282    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12283    /// use google_cloud_datastream_v1::model::big_query_destination_config::Merge;
12284    /// let x = BigQueryDestinationConfig::new().set_merge(Merge::default()/* use setters */);
12285    /// assert!(x.merge().is_some());
12286    /// assert!(x.append_only().is_none());
12287    /// ```
12288    pub fn set_merge<
12289        T: std::convert::Into<std::boxed::Box<crate::model::big_query_destination_config::Merge>>,
12290    >(
12291        mut self,
12292        v: T,
12293    ) -> Self {
12294        self.write_mode = std::option::Option::Some(
12295            crate::model::big_query_destination_config::WriteMode::Merge(v.into()),
12296        );
12297        self
12298    }
12299
12300    /// The value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
12301    /// if it holds a `AppendOnly`, `None` if the field is not set or
12302    /// holds a different branch.
12303    pub fn append_only(
12304        &self,
12305    ) -> std::option::Option<&std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>>
12306    {
12307        #[allow(unreachable_patterns)]
12308        self.write_mode.as_ref().and_then(|v| match v {
12309            crate::model::big_query_destination_config::WriteMode::AppendOnly(v) => {
12310                std::option::Option::Some(v)
12311            }
12312            _ => std::option::Option::None,
12313        })
12314    }
12315
12316    /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
12317    /// to hold a `AppendOnly`.
12318    ///
12319    /// Note that all the setters affecting `write_mode` are
12320    /// mutually exclusive.
12321    ///
12322    /// # Example
12323    /// ```ignore,no_run
12324    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12325    /// use google_cloud_datastream_v1::model::big_query_destination_config::AppendOnly;
12326    /// let x = BigQueryDestinationConfig::new().set_append_only(AppendOnly::default()/* use setters */);
12327    /// assert!(x.append_only().is_some());
12328    /// assert!(x.merge().is_none());
12329    /// ```
12330    pub fn set_append_only<
12331        T: std::convert::Into<std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>>,
12332    >(
12333        mut self,
12334        v: T,
12335    ) -> Self {
12336        self.write_mode = std::option::Option::Some(
12337            crate::model::big_query_destination_config::WriteMode::AppendOnly(v.into()),
12338        );
12339        self
12340    }
12341}
12342
12343impl wkt::message::Message for BigQueryDestinationConfig {
12344    fn typename() -> &'static str {
12345        "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig"
12346    }
12347}
12348
12349/// Defines additional types related to [BigQueryDestinationConfig].
12350pub mod big_query_destination_config {
12351    #[allow(unused_imports)]
12352    use super::*;
12353
12354    /// A single target dataset to which all data will be streamed.
12355    #[derive(Clone, Default, PartialEq)]
12356    #[non_exhaustive]
12357    pub struct SingleTargetDataset {
12358        /// The dataset ID of the target dataset.
12359        /// DatasetIds allowed characters:
12360        /// <https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets#datasetreference>.
12361        pub dataset_id: std::string::String,
12362
12363        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12364    }
12365
12366    impl SingleTargetDataset {
12367        pub fn new() -> Self {
12368            std::default::Default::default()
12369        }
12370
12371        /// Sets the value of [dataset_id][crate::model::big_query_destination_config::SingleTargetDataset::dataset_id].
12372        ///
12373        /// # Example
12374        /// ```ignore,no_run
12375        /// # use google_cloud_datastream_v1::model::big_query_destination_config::SingleTargetDataset;
12376        /// let x = SingleTargetDataset::new().set_dataset_id("example");
12377        /// ```
12378        pub fn set_dataset_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12379            self.dataset_id = v.into();
12380            self
12381        }
12382    }
12383
12384    impl wkt::message::Message for SingleTargetDataset {
12385        fn typename() -> &'static str {
12386            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SingleTargetDataset"
12387        }
12388    }
12389
12390    /// Destination datasets are created so that hierarchy of the destination data
12391    /// objects matches the source hierarchy.
12392    #[derive(Clone, Default, PartialEq)]
12393    #[non_exhaustive]
12394    pub struct SourceHierarchyDatasets {
12395        /// The dataset template to use for dynamic dataset creation.
12396        pub dataset_template: std::option::Option<
12397            crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate,
12398        >,
12399
12400        /// Optional. The project id of the BigQuery dataset. If not specified, the
12401        /// project will be inferred from the stream resource.
12402        pub project_id: std::option::Option<std::string::String>,
12403
12404        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12405    }
12406
12407    impl SourceHierarchyDatasets {
12408        pub fn new() -> Self {
12409            std::default::Default::default()
12410        }
12411
12412        /// Sets the value of [dataset_template][crate::model::big_query_destination_config::SourceHierarchyDatasets::dataset_template].
12413        ///
12414        /// # Example
12415        /// ```ignore,no_run
12416        /// # use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12417        /// use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12418        /// let x = SourceHierarchyDatasets::new().set_dataset_template(DatasetTemplate::default()/* use setters */);
12419        /// ```
12420        pub fn set_dataset_template<T>(mut self, v: T) -> Self
12421        where T: std::convert::Into<crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate>
12422        {
12423            self.dataset_template = std::option::Option::Some(v.into());
12424            self
12425        }
12426
12427        /// Sets or clears the value of [dataset_template][crate::model::big_query_destination_config::SourceHierarchyDatasets::dataset_template].
12428        ///
12429        /// # Example
12430        /// ```ignore,no_run
12431        /// # use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12432        /// use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12433        /// let x = SourceHierarchyDatasets::new().set_or_clear_dataset_template(Some(DatasetTemplate::default()/* use setters */));
12434        /// let x = SourceHierarchyDatasets::new().set_or_clear_dataset_template(None::<DatasetTemplate>);
12435        /// ```
12436        pub fn set_or_clear_dataset_template<T>(mut self, v: std::option::Option<T>) -> Self
12437        where T: std::convert::Into<crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate>
12438        {
12439            self.dataset_template = v.map(|x| x.into());
12440            self
12441        }
12442
12443        /// Sets the value of [project_id][crate::model::big_query_destination_config::SourceHierarchyDatasets::project_id].
12444        ///
12445        /// # Example
12446        /// ```ignore,no_run
12447        /// # use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12448        /// let x = SourceHierarchyDatasets::new().set_project_id("example");
12449        /// ```
12450        pub fn set_project_id<T>(mut self, v: T) -> Self
12451        where
12452            T: std::convert::Into<std::string::String>,
12453        {
12454            self.project_id = std::option::Option::Some(v.into());
12455            self
12456        }
12457
12458        /// Sets or clears the value of [project_id][crate::model::big_query_destination_config::SourceHierarchyDatasets::project_id].
12459        ///
12460        /// # Example
12461        /// ```ignore,no_run
12462        /// # use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12463        /// let x = SourceHierarchyDatasets::new().set_or_clear_project_id(Some("example"));
12464        /// let x = SourceHierarchyDatasets::new().set_or_clear_project_id(None::<String>);
12465        /// ```
12466        pub fn set_or_clear_project_id<T>(mut self, v: std::option::Option<T>) -> Self
12467        where
12468            T: std::convert::Into<std::string::String>,
12469        {
12470            self.project_id = v.map(|x| x.into());
12471            self
12472        }
12473    }
12474
12475    impl wkt::message::Message for SourceHierarchyDatasets {
12476        fn typename() -> &'static str {
12477            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SourceHierarchyDatasets"
12478        }
12479    }
12480
12481    /// Defines additional types related to [SourceHierarchyDatasets].
12482    pub mod source_hierarchy_datasets {
12483        #[allow(unused_imports)]
12484        use super::*;
12485
12486        /// Dataset template used for dynamic dataset creation.
12487        #[derive(Clone, Default, PartialEq)]
12488        #[non_exhaustive]
12489        pub struct DatasetTemplate {
12490            /// Required. The geographic location where the dataset should reside. See
12491            /// <https://cloud.google.com/bigquery/docs/locations> for supported
12492            /// locations.
12493            pub location: std::string::String,
12494
12495            /// If supplied, every created dataset will have its name prefixed by the
12496            /// provided value. The prefix and name will be separated by an underscore.
12497            /// i.e. \<prefix\>_<dataset_name>.
12498            pub dataset_id_prefix: std::string::String,
12499
12500            /// Describes the Cloud KMS encryption key that will be used to
12501            /// protect destination BigQuery table. The BigQuery Service Account
12502            /// associated with your project requires access to this encryption key.
12503            /// i.e.
12504            /// projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{cryptoKey}.
12505            /// See <https://cloud.google.com/bigquery/docs/customer-managed-encryption>
12506            /// for more information.
12507            pub kms_key_name: std::string::String,
12508
12509            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12510        }
12511
12512        impl DatasetTemplate {
12513            pub fn new() -> Self {
12514                std::default::Default::default()
12515            }
12516
12517            /// Sets the value of [location][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::location].
12518            ///
12519            /// # Example
12520            /// ```ignore,no_run
12521            /// # use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12522            /// let x = DatasetTemplate::new().set_location("example");
12523            /// ```
12524            pub fn set_location<T: std::convert::Into<std::string::String>>(
12525                mut self,
12526                v: T,
12527            ) -> Self {
12528                self.location = v.into();
12529                self
12530            }
12531
12532            /// Sets the value of [dataset_id_prefix][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::dataset_id_prefix].
12533            ///
12534            /// # Example
12535            /// ```ignore,no_run
12536            /// # use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12537            /// let x = DatasetTemplate::new().set_dataset_id_prefix("example");
12538            /// ```
12539            pub fn set_dataset_id_prefix<T: std::convert::Into<std::string::String>>(
12540                mut self,
12541                v: T,
12542            ) -> Self {
12543                self.dataset_id_prefix = v.into();
12544                self
12545            }
12546
12547            /// Sets the value of [kms_key_name][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::kms_key_name].
12548            ///
12549            /// # Example
12550            /// ```ignore,no_run
12551            /// # use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12552            /// let x = DatasetTemplate::new().set_kms_key_name("example");
12553            /// ```
12554            pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(
12555                mut self,
12556                v: T,
12557            ) -> Self {
12558                self.kms_key_name = v.into();
12559                self
12560            }
12561        }
12562
12563        impl wkt::message::Message for DatasetTemplate {
12564            fn typename() -> &'static str {
12565                "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SourceHierarchyDatasets.DatasetTemplate"
12566            }
12567        }
12568    }
12569
12570    /// The configuration for BLMT.
12571    #[derive(Clone, Default, PartialEq)]
12572    #[non_exhaustive]
12573    pub struct BlmtConfig {
12574        /// Required. The Cloud Storage bucket name.
12575        pub bucket: std::string::String,
12576
12577        /// The root path inside the Cloud Storage bucket.
12578        pub root_path: std::string::String,
12579
12580        /// Required. The bigquery connection.
12581        /// Format: `{project}.{location}.{name}`
12582        pub connection_name: std::string::String,
12583
12584        /// Required. The file format.
12585        pub file_format: crate::model::big_query_destination_config::blmt_config::FileFormat,
12586
12587        /// Required. The table format.
12588        pub table_format: crate::model::big_query_destination_config::blmt_config::TableFormat,
12589
12590        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12591    }
12592
12593    impl BlmtConfig {
12594        pub fn new() -> Self {
12595            std::default::Default::default()
12596        }
12597
12598        /// Sets the value of [bucket][crate::model::big_query_destination_config::BlmtConfig::bucket].
12599        ///
12600        /// # Example
12601        /// ```ignore,no_run
12602        /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12603        /// let x = BlmtConfig::new().set_bucket("example");
12604        /// ```
12605        pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12606            self.bucket = v.into();
12607            self
12608        }
12609
12610        /// Sets the value of [root_path][crate::model::big_query_destination_config::BlmtConfig::root_path].
12611        ///
12612        /// # Example
12613        /// ```ignore,no_run
12614        /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12615        /// let x = BlmtConfig::new().set_root_path("example");
12616        /// ```
12617        pub fn set_root_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12618            self.root_path = v.into();
12619            self
12620        }
12621
12622        /// Sets the value of [connection_name][crate::model::big_query_destination_config::BlmtConfig::connection_name].
12623        ///
12624        /// # Example
12625        /// ```ignore,no_run
12626        /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12627        /// let x = BlmtConfig::new().set_connection_name("example");
12628        /// ```
12629        pub fn set_connection_name<T: std::convert::Into<std::string::String>>(
12630            mut self,
12631            v: T,
12632        ) -> Self {
12633            self.connection_name = v.into();
12634            self
12635        }
12636
12637        /// Sets the value of [file_format][crate::model::big_query_destination_config::BlmtConfig::file_format].
12638        ///
12639        /// # Example
12640        /// ```ignore,no_run
12641        /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12642        /// use google_cloud_datastream_v1::model::big_query_destination_config::blmt_config::FileFormat;
12643        /// let x0 = BlmtConfig::new().set_file_format(FileFormat::Parquet);
12644        /// ```
12645        pub fn set_file_format<
12646            T: std::convert::Into<crate::model::big_query_destination_config::blmt_config::FileFormat>,
12647        >(
12648            mut self,
12649            v: T,
12650        ) -> Self {
12651            self.file_format = v.into();
12652            self
12653        }
12654
12655        /// Sets the value of [table_format][crate::model::big_query_destination_config::BlmtConfig::table_format].
12656        ///
12657        /// # Example
12658        /// ```ignore,no_run
12659        /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12660        /// use google_cloud_datastream_v1::model::big_query_destination_config::blmt_config::TableFormat;
12661        /// let x0 = BlmtConfig::new().set_table_format(TableFormat::Iceberg);
12662        /// ```
12663        pub fn set_table_format<
12664            T: std::convert::Into<
12665                    crate::model::big_query_destination_config::blmt_config::TableFormat,
12666                >,
12667        >(
12668            mut self,
12669            v: T,
12670        ) -> Self {
12671            self.table_format = v.into();
12672            self
12673        }
12674    }
12675
12676    impl wkt::message::Message for BlmtConfig {
12677        fn typename() -> &'static str {
12678            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig"
12679        }
12680    }
12681
12682    /// Defines additional types related to [BlmtConfig].
12683    pub mod blmt_config {
12684        #[allow(unused_imports)]
12685        use super::*;
12686
12687        /// Supported file formats for BigLake managed tables.
12688        ///
12689        /// # Working with unknown values
12690        ///
12691        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12692        /// additional enum variants at any time. Adding new variants is not considered
12693        /// a breaking change. Applications should write their code in anticipation of:
12694        ///
12695        /// - New values appearing in future releases of the client library, **and**
12696        /// - New values received dynamically, without application changes.
12697        ///
12698        /// Please consult the [Working with enums] section in the user guide for some
12699        /// guidelines.
12700        ///
12701        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12702        #[derive(Clone, Debug, PartialEq)]
12703        #[non_exhaustive]
12704        pub enum FileFormat {
12705            /// Default value.
12706            Unspecified,
12707            /// Parquet file format.
12708            Parquet,
12709            /// If set, the enum was initialized with an unknown value.
12710            ///
12711            /// Applications can examine the value using [FileFormat::value] or
12712            /// [FileFormat::name].
12713            UnknownValue(file_format::UnknownValue),
12714        }
12715
12716        #[doc(hidden)]
12717        pub mod file_format {
12718            #[allow(unused_imports)]
12719            use super::*;
12720            #[derive(Clone, Debug, PartialEq)]
12721            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12722        }
12723
12724        impl FileFormat {
12725            /// Gets the enum value.
12726            ///
12727            /// Returns `None` if the enum contains an unknown value deserialized from
12728            /// the string representation of enums.
12729            pub fn value(&self) -> std::option::Option<i32> {
12730                match self {
12731                    Self::Unspecified => std::option::Option::Some(0),
12732                    Self::Parquet => std::option::Option::Some(1),
12733                    Self::UnknownValue(u) => u.0.value(),
12734                }
12735            }
12736
12737            /// Gets the enum value as a string.
12738            ///
12739            /// Returns `None` if the enum contains an unknown value deserialized from
12740            /// the integer representation of enums.
12741            pub fn name(&self) -> std::option::Option<&str> {
12742                match self {
12743                    Self::Unspecified => std::option::Option::Some("FILE_FORMAT_UNSPECIFIED"),
12744                    Self::Parquet => std::option::Option::Some("PARQUET"),
12745                    Self::UnknownValue(u) => u.0.name(),
12746                }
12747            }
12748        }
12749
12750        impl std::default::Default for FileFormat {
12751            fn default() -> Self {
12752                use std::convert::From;
12753                Self::from(0)
12754            }
12755        }
12756
12757        impl std::fmt::Display for FileFormat {
12758            fn fmt(
12759                &self,
12760                f: &mut std::fmt::Formatter<'_>,
12761            ) -> std::result::Result<(), std::fmt::Error> {
12762                wkt::internal::display_enum(f, self.name(), self.value())
12763            }
12764        }
12765
12766        impl std::convert::From<i32> for FileFormat {
12767            fn from(value: i32) -> Self {
12768                match value {
12769                    0 => Self::Unspecified,
12770                    1 => Self::Parquet,
12771                    _ => Self::UnknownValue(file_format::UnknownValue(
12772                        wkt::internal::UnknownEnumValue::Integer(value),
12773                    )),
12774                }
12775            }
12776        }
12777
12778        impl std::convert::From<&str> for FileFormat {
12779            fn from(value: &str) -> Self {
12780                use std::string::ToString;
12781                match value {
12782                    "FILE_FORMAT_UNSPECIFIED" => Self::Unspecified,
12783                    "PARQUET" => Self::Parquet,
12784                    _ => Self::UnknownValue(file_format::UnknownValue(
12785                        wkt::internal::UnknownEnumValue::String(value.to_string()),
12786                    )),
12787                }
12788            }
12789        }
12790
12791        impl serde::ser::Serialize for FileFormat {
12792            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12793            where
12794                S: serde::Serializer,
12795            {
12796                match self {
12797                    Self::Unspecified => serializer.serialize_i32(0),
12798                    Self::Parquet => serializer.serialize_i32(1),
12799                    Self::UnknownValue(u) => u.0.serialize(serializer),
12800                }
12801            }
12802        }
12803
12804        impl<'de> serde::de::Deserialize<'de> for FileFormat {
12805            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12806            where
12807                D: serde::Deserializer<'de>,
12808            {
12809                deserializer.deserialize_any(wkt::internal::EnumVisitor::<FileFormat>::new(
12810                    ".google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig.FileFormat",
12811                ))
12812            }
12813        }
12814
12815        /// Supported table formats for BigLake managed tables.
12816        ///
12817        /// # Working with unknown values
12818        ///
12819        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12820        /// additional enum variants at any time. Adding new variants is not considered
12821        /// a breaking change. Applications should write their code in anticipation of:
12822        ///
12823        /// - New values appearing in future releases of the client library, **and**
12824        /// - New values received dynamically, without application changes.
12825        ///
12826        /// Please consult the [Working with enums] section in the user guide for some
12827        /// guidelines.
12828        ///
12829        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12830        #[derive(Clone, Debug, PartialEq)]
12831        #[non_exhaustive]
12832        pub enum TableFormat {
12833            /// Default value.
12834            Unspecified,
12835            /// Iceberg table format.
12836            Iceberg,
12837            /// If set, the enum was initialized with an unknown value.
12838            ///
12839            /// Applications can examine the value using [TableFormat::value] or
12840            /// [TableFormat::name].
12841            UnknownValue(table_format::UnknownValue),
12842        }
12843
12844        #[doc(hidden)]
12845        pub mod table_format {
12846            #[allow(unused_imports)]
12847            use super::*;
12848            #[derive(Clone, Debug, PartialEq)]
12849            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12850        }
12851
12852        impl TableFormat {
12853            /// Gets the enum value.
12854            ///
12855            /// Returns `None` if the enum contains an unknown value deserialized from
12856            /// the string representation of enums.
12857            pub fn value(&self) -> std::option::Option<i32> {
12858                match self {
12859                    Self::Unspecified => std::option::Option::Some(0),
12860                    Self::Iceberg => std::option::Option::Some(1),
12861                    Self::UnknownValue(u) => u.0.value(),
12862                }
12863            }
12864
12865            /// Gets the enum value as a string.
12866            ///
12867            /// Returns `None` if the enum contains an unknown value deserialized from
12868            /// the integer representation of enums.
12869            pub fn name(&self) -> std::option::Option<&str> {
12870                match self {
12871                    Self::Unspecified => std::option::Option::Some("TABLE_FORMAT_UNSPECIFIED"),
12872                    Self::Iceberg => std::option::Option::Some("ICEBERG"),
12873                    Self::UnknownValue(u) => u.0.name(),
12874                }
12875            }
12876        }
12877
12878        impl std::default::Default for TableFormat {
12879            fn default() -> Self {
12880                use std::convert::From;
12881                Self::from(0)
12882            }
12883        }
12884
12885        impl std::fmt::Display for TableFormat {
12886            fn fmt(
12887                &self,
12888                f: &mut std::fmt::Formatter<'_>,
12889            ) -> std::result::Result<(), std::fmt::Error> {
12890                wkt::internal::display_enum(f, self.name(), self.value())
12891            }
12892        }
12893
12894        impl std::convert::From<i32> for TableFormat {
12895            fn from(value: i32) -> Self {
12896                match value {
12897                    0 => Self::Unspecified,
12898                    1 => Self::Iceberg,
12899                    _ => Self::UnknownValue(table_format::UnknownValue(
12900                        wkt::internal::UnknownEnumValue::Integer(value),
12901                    )),
12902                }
12903            }
12904        }
12905
12906        impl std::convert::From<&str> for TableFormat {
12907            fn from(value: &str) -> Self {
12908                use std::string::ToString;
12909                match value {
12910                    "TABLE_FORMAT_UNSPECIFIED" => Self::Unspecified,
12911                    "ICEBERG" => Self::Iceberg,
12912                    _ => Self::UnknownValue(table_format::UnknownValue(
12913                        wkt::internal::UnknownEnumValue::String(value.to_string()),
12914                    )),
12915                }
12916            }
12917        }
12918
12919        impl serde::ser::Serialize for TableFormat {
12920            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12921            where
12922                S: serde::Serializer,
12923            {
12924                match self {
12925                    Self::Unspecified => serializer.serialize_i32(0),
12926                    Self::Iceberg => serializer.serialize_i32(1),
12927                    Self::UnknownValue(u) => u.0.serialize(serializer),
12928                }
12929            }
12930        }
12931
12932        impl<'de> serde::de::Deserialize<'de> for TableFormat {
12933            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12934            where
12935                D: serde::Deserializer<'de>,
12936            {
12937                deserializer.deserialize_any(wkt::internal::EnumVisitor::<TableFormat>::new(
12938                    ".google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig.TableFormat",
12939                ))
12940            }
12941        }
12942    }
12943
12944    /// AppendOnly mode defines that all changes to a table will be written to the
12945    /// destination table.
12946    #[derive(Clone, Default, PartialEq)]
12947    #[non_exhaustive]
12948    pub struct AppendOnly {
12949        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12950    }
12951
12952    impl AppendOnly {
12953        pub fn new() -> Self {
12954            std::default::Default::default()
12955        }
12956    }
12957
12958    impl wkt::message::Message for AppendOnly {
12959        fn typename() -> &'static str {
12960            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.AppendOnly"
12961        }
12962    }
12963
12964    /// Merge mode defines that all changes to a table will be merged at the
12965    /// destination table.
12966    #[derive(Clone, Default, PartialEq)]
12967    #[non_exhaustive]
12968    pub struct Merge {
12969        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12970    }
12971
12972    impl Merge {
12973        pub fn new() -> Self {
12974            std::default::Default::default()
12975        }
12976    }
12977
12978    impl wkt::message::Message for Merge {
12979        fn typename() -> &'static str {
12980            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.Merge"
12981        }
12982    }
12983
12984    /// Target dataset(s) configuration.
12985    #[derive(Clone, Debug, PartialEq)]
12986    #[non_exhaustive]
12987    pub enum DatasetConfig {
12988        /// Single destination dataset.
12989        SingleTargetDataset(
12990            std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
12991        ),
12992        /// Source hierarchy datasets.
12993        SourceHierarchyDatasets(
12994            std::boxed::Box<crate::model::big_query_destination_config::SourceHierarchyDatasets>,
12995        ),
12996    }
12997
12998    #[derive(Clone, Debug, PartialEq)]
12999    #[non_exhaustive]
13000    pub enum WriteMode {
13001        /// The standard mode
13002        Merge(std::boxed::Box<crate::model::big_query_destination_config::Merge>),
13003        /// Append only mode
13004        AppendOnly(std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>),
13005    }
13006}
13007
13008/// The configuration of the stream destination.
13009#[derive(Clone, Default, PartialEq)]
13010#[non_exhaustive]
13011pub struct DestinationConfig {
13012    /// Required. Destination connection profile resource.
13013    /// Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
13014    pub destination_connection_profile: std::string::String,
13015
13016    /// Stream configuration that is specific to the data destination type.
13017    pub destination_stream_config:
13018        std::option::Option<crate::model::destination_config::DestinationStreamConfig>,
13019
13020    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13021}
13022
13023impl DestinationConfig {
13024    pub fn new() -> Self {
13025        std::default::Default::default()
13026    }
13027
13028    /// Sets the value of [destination_connection_profile][crate::model::DestinationConfig::destination_connection_profile].
13029    ///
13030    /// # Example
13031    /// ```ignore,no_run
13032    /// # use google_cloud_datastream_v1::model::DestinationConfig;
13033    /// let x = DestinationConfig::new().set_destination_connection_profile("example");
13034    /// ```
13035    pub fn set_destination_connection_profile<T: std::convert::Into<std::string::String>>(
13036        mut self,
13037        v: T,
13038    ) -> Self {
13039        self.destination_connection_profile = v.into();
13040        self
13041    }
13042
13043    /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config].
13044    ///
13045    /// Note that all the setters affecting `destination_stream_config` are mutually
13046    /// exclusive.
13047    ///
13048    /// # Example
13049    /// ```ignore,no_run
13050    /// # use google_cloud_datastream_v1::model::DestinationConfig;
13051    /// use google_cloud_datastream_v1::model::GcsDestinationConfig;
13052    /// let x = DestinationConfig::new().set_destination_stream_config(Some(
13053    ///     google_cloud_datastream_v1::model::destination_config::DestinationStreamConfig::GcsDestinationConfig(GcsDestinationConfig::default().into())));
13054    /// ```
13055    pub fn set_destination_stream_config<
13056        T: std::convert::Into<
13057                std::option::Option<crate::model::destination_config::DestinationStreamConfig>,
13058            >,
13059    >(
13060        mut self,
13061        v: T,
13062    ) -> Self {
13063        self.destination_stream_config = v.into();
13064        self
13065    }
13066
13067    /// The value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
13068    /// if it holds a `GcsDestinationConfig`, `None` if the field is not set or
13069    /// holds a different branch.
13070    pub fn gcs_destination_config(
13071        &self,
13072    ) -> std::option::Option<&std::boxed::Box<crate::model::GcsDestinationConfig>> {
13073        #[allow(unreachable_patterns)]
13074        self.destination_stream_config
13075            .as_ref()
13076            .and_then(|v| match v {
13077                crate::model::destination_config::DestinationStreamConfig::GcsDestinationConfig(
13078                    v,
13079                ) => std::option::Option::Some(v),
13080                _ => std::option::Option::None,
13081            })
13082    }
13083
13084    /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
13085    /// to hold a `GcsDestinationConfig`.
13086    ///
13087    /// Note that all the setters affecting `destination_stream_config` are
13088    /// mutually exclusive.
13089    ///
13090    /// # Example
13091    /// ```ignore,no_run
13092    /// # use google_cloud_datastream_v1::model::DestinationConfig;
13093    /// use google_cloud_datastream_v1::model::GcsDestinationConfig;
13094    /// let x = DestinationConfig::new().set_gcs_destination_config(GcsDestinationConfig::default()/* use setters */);
13095    /// assert!(x.gcs_destination_config().is_some());
13096    /// assert!(x.bigquery_destination_config().is_none());
13097    /// ```
13098    pub fn set_gcs_destination_config<
13099        T: std::convert::Into<std::boxed::Box<crate::model::GcsDestinationConfig>>,
13100    >(
13101        mut self,
13102        v: T,
13103    ) -> Self {
13104        self.destination_stream_config = std::option::Option::Some(
13105            crate::model::destination_config::DestinationStreamConfig::GcsDestinationConfig(
13106                v.into(),
13107            ),
13108        );
13109        self
13110    }
13111
13112    /// The value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
13113    /// if it holds a `BigqueryDestinationConfig`, `None` if the field is not set or
13114    /// holds a different branch.
13115    pub fn bigquery_destination_config(
13116        &self,
13117    ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryDestinationConfig>> {
13118        #[allow(unreachable_patterns)]
13119        self.destination_stream_config.as_ref().and_then(|v| match v {
13120            crate::model::destination_config::DestinationStreamConfig::BigqueryDestinationConfig(v) => std::option::Option::Some(v),
13121            _ => std::option::Option::None,
13122        })
13123    }
13124
13125    /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
13126    /// to hold a `BigqueryDestinationConfig`.
13127    ///
13128    /// Note that all the setters affecting `destination_stream_config` are
13129    /// mutually exclusive.
13130    ///
13131    /// # Example
13132    /// ```ignore,no_run
13133    /// # use google_cloud_datastream_v1::model::DestinationConfig;
13134    /// use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
13135    /// let x = DestinationConfig::new().set_bigquery_destination_config(BigQueryDestinationConfig::default()/* use setters */);
13136    /// assert!(x.bigquery_destination_config().is_some());
13137    /// assert!(x.gcs_destination_config().is_none());
13138    /// ```
13139    pub fn set_bigquery_destination_config<
13140        T: std::convert::Into<std::boxed::Box<crate::model::BigQueryDestinationConfig>>,
13141    >(
13142        mut self,
13143        v: T,
13144    ) -> Self {
13145        self.destination_stream_config = std::option::Option::Some(
13146            crate::model::destination_config::DestinationStreamConfig::BigqueryDestinationConfig(
13147                v.into(),
13148            ),
13149        );
13150        self
13151    }
13152}
13153
13154impl wkt::message::Message for DestinationConfig {
13155    fn typename() -> &'static str {
13156        "type.googleapis.com/google.cloud.datastream.v1.DestinationConfig"
13157    }
13158}
13159
13160/// Defines additional types related to [DestinationConfig].
13161pub mod destination_config {
13162    #[allow(unused_imports)]
13163    use super::*;
13164
13165    /// Stream configuration that is specific to the data destination type.
13166    #[derive(Clone, Debug, PartialEq)]
13167    #[non_exhaustive]
13168    pub enum DestinationStreamConfig {
13169        /// A configuration for how data should be loaded to Cloud Storage.
13170        GcsDestinationConfig(std::boxed::Box<crate::model::GcsDestinationConfig>),
13171        /// BigQuery destination configuration.
13172        BigqueryDestinationConfig(std::boxed::Box<crate::model::BigQueryDestinationConfig>),
13173    }
13174}
13175
13176/// A resource representing streaming data from a source to a destination.
13177#[derive(Clone, Default, PartialEq)]
13178#[non_exhaustive]
13179pub struct Stream {
13180    /// Output only. Identifier. The stream's name.
13181    pub name: std::string::String,
13182
13183    /// Output only. The creation time of the stream.
13184    pub create_time: std::option::Option<wkt::Timestamp>,
13185
13186    /// Output only. The last update time of the stream.
13187    pub update_time: std::option::Option<wkt::Timestamp>,
13188
13189    /// Labels.
13190    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
13191
13192    /// Required. Display name.
13193    pub display_name: std::string::String,
13194
13195    /// Required. Source connection profile configuration.
13196    pub source_config: std::option::Option<crate::model::SourceConfig>,
13197
13198    /// Required. Destination connection profile configuration.
13199    pub destination_config: std::option::Option<crate::model::DestinationConfig>,
13200
13201    /// The state of the stream.
13202    pub state: crate::model::stream::State,
13203
13204    /// Output only. Errors on the Stream.
13205    pub errors: std::vec::Vec<crate::model::Error>,
13206
13207    /// Immutable. A reference to a KMS encryption key.
13208    /// If provided, it will be used to encrypt the data.
13209    /// If left blank, data will be encrypted using an internal Stream-specific
13210    /// encryption key provisioned through KMS.
13211    pub customer_managed_encryption_key: std::option::Option<std::string::String>,
13212
13213    /// Output only. If the stream was recovered, the time of the last recovery.
13214    /// Note: This field is currently experimental.
13215    pub last_recovery_time: std::option::Option<wkt::Timestamp>,
13216
13217    /// Output only. Reserved for future use.
13218    pub satisfies_pzs: std::option::Option<bool>,
13219
13220    /// Output only. Reserved for future use.
13221    pub satisfies_pzi: std::option::Option<bool>,
13222
13223    /// Stream backfill strategy.
13224    pub backfill_strategy: std::option::Option<crate::model::stream::BackfillStrategy>,
13225
13226    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13227}
13228
13229impl Stream {
13230    pub fn new() -> Self {
13231        std::default::Default::default()
13232    }
13233
13234    /// Sets the value of [name][crate::model::Stream::name].
13235    ///
13236    /// # Example
13237    /// ```ignore,no_run
13238    /// # use google_cloud_datastream_v1::model::Stream;
13239    /// let x = Stream::new().set_name("example");
13240    /// ```
13241    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13242        self.name = v.into();
13243        self
13244    }
13245
13246    /// Sets the value of [create_time][crate::model::Stream::create_time].
13247    ///
13248    /// # Example
13249    /// ```ignore,no_run
13250    /// # use google_cloud_datastream_v1::model::Stream;
13251    /// use wkt::Timestamp;
13252    /// let x = Stream::new().set_create_time(Timestamp::default()/* use setters */);
13253    /// ```
13254    pub fn set_create_time<T>(mut self, v: T) -> Self
13255    where
13256        T: std::convert::Into<wkt::Timestamp>,
13257    {
13258        self.create_time = std::option::Option::Some(v.into());
13259        self
13260    }
13261
13262    /// Sets or clears the value of [create_time][crate::model::Stream::create_time].
13263    ///
13264    /// # Example
13265    /// ```ignore,no_run
13266    /// # use google_cloud_datastream_v1::model::Stream;
13267    /// use wkt::Timestamp;
13268    /// let x = Stream::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
13269    /// let x = Stream::new().set_or_clear_create_time(None::<Timestamp>);
13270    /// ```
13271    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13272    where
13273        T: std::convert::Into<wkt::Timestamp>,
13274    {
13275        self.create_time = v.map(|x| x.into());
13276        self
13277    }
13278
13279    /// Sets the value of [update_time][crate::model::Stream::update_time].
13280    ///
13281    /// # Example
13282    /// ```ignore,no_run
13283    /// # use google_cloud_datastream_v1::model::Stream;
13284    /// use wkt::Timestamp;
13285    /// let x = Stream::new().set_update_time(Timestamp::default()/* use setters */);
13286    /// ```
13287    pub fn set_update_time<T>(mut self, v: T) -> Self
13288    where
13289        T: std::convert::Into<wkt::Timestamp>,
13290    {
13291        self.update_time = std::option::Option::Some(v.into());
13292        self
13293    }
13294
13295    /// Sets or clears the value of [update_time][crate::model::Stream::update_time].
13296    ///
13297    /// # Example
13298    /// ```ignore,no_run
13299    /// # use google_cloud_datastream_v1::model::Stream;
13300    /// use wkt::Timestamp;
13301    /// let x = Stream::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
13302    /// let x = Stream::new().set_or_clear_update_time(None::<Timestamp>);
13303    /// ```
13304    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13305    where
13306        T: std::convert::Into<wkt::Timestamp>,
13307    {
13308        self.update_time = v.map(|x| x.into());
13309        self
13310    }
13311
13312    /// Sets the value of [labels][crate::model::Stream::labels].
13313    ///
13314    /// # Example
13315    /// ```ignore,no_run
13316    /// # use google_cloud_datastream_v1::model::Stream;
13317    /// let x = Stream::new().set_labels([
13318    ///     ("key0", "abc"),
13319    ///     ("key1", "xyz"),
13320    /// ]);
13321    /// ```
13322    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
13323    where
13324        T: std::iter::IntoIterator<Item = (K, V)>,
13325        K: std::convert::Into<std::string::String>,
13326        V: std::convert::Into<std::string::String>,
13327    {
13328        use std::iter::Iterator;
13329        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13330        self
13331    }
13332
13333    /// Sets the value of [display_name][crate::model::Stream::display_name].
13334    ///
13335    /// # Example
13336    /// ```ignore,no_run
13337    /// # use google_cloud_datastream_v1::model::Stream;
13338    /// let x = Stream::new().set_display_name("example");
13339    /// ```
13340    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13341        self.display_name = v.into();
13342        self
13343    }
13344
13345    /// Sets the value of [source_config][crate::model::Stream::source_config].
13346    ///
13347    /// # Example
13348    /// ```ignore,no_run
13349    /// # use google_cloud_datastream_v1::model::Stream;
13350    /// use google_cloud_datastream_v1::model::SourceConfig;
13351    /// let x = Stream::new().set_source_config(SourceConfig::default()/* use setters */);
13352    /// ```
13353    pub fn set_source_config<T>(mut self, v: T) -> Self
13354    where
13355        T: std::convert::Into<crate::model::SourceConfig>,
13356    {
13357        self.source_config = std::option::Option::Some(v.into());
13358        self
13359    }
13360
13361    /// Sets or clears the value of [source_config][crate::model::Stream::source_config].
13362    ///
13363    /// # Example
13364    /// ```ignore,no_run
13365    /// # use google_cloud_datastream_v1::model::Stream;
13366    /// use google_cloud_datastream_v1::model::SourceConfig;
13367    /// let x = Stream::new().set_or_clear_source_config(Some(SourceConfig::default()/* use setters */));
13368    /// let x = Stream::new().set_or_clear_source_config(None::<SourceConfig>);
13369    /// ```
13370    pub fn set_or_clear_source_config<T>(mut self, v: std::option::Option<T>) -> Self
13371    where
13372        T: std::convert::Into<crate::model::SourceConfig>,
13373    {
13374        self.source_config = v.map(|x| x.into());
13375        self
13376    }
13377
13378    /// Sets the value of [destination_config][crate::model::Stream::destination_config].
13379    ///
13380    /// # Example
13381    /// ```ignore,no_run
13382    /// # use google_cloud_datastream_v1::model::Stream;
13383    /// use google_cloud_datastream_v1::model::DestinationConfig;
13384    /// let x = Stream::new().set_destination_config(DestinationConfig::default()/* use setters */);
13385    /// ```
13386    pub fn set_destination_config<T>(mut self, v: T) -> Self
13387    where
13388        T: std::convert::Into<crate::model::DestinationConfig>,
13389    {
13390        self.destination_config = std::option::Option::Some(v.into());
13391        self
13392    }
13393
13394    /// Sets or clears the value of [destination_config][crate::model::Stream::destination_config].
13395    ///
13396    /// # Example
13397    /// ```ignore,no_run
13398    /// # use google_cloud_datastream_v1::model::Stream;
13399    /// use google_cloud_datastream_v1::model::DestinationConfig;
13400    /// let x = Stream::new().set_or_clear_destination_config(Some(DestinationConfig::default()/* use setters */));
13401    /// let x = Stream::new().set_or_clear_destination_config(None::<DestinationConfig>);
13402    /// ```
13403    pub fn set_or_clear_destination_config<T>(mut self, v: std::option::Option<T>) -> Self
13404    where
13405        T: std::convert::Into<crate::model::DestinationConfig>,
13406    {
13407        self.destination_config = v.map(|x| x.into());
13408        self
13409    }
13410
13411    /// Sets the value of [state][crate::model::Stream::state].
13412    ///
13413    /// # Example
13414    /// ```ignore,no_run
13415    /// # use google_cloud_datastream_v1::model::Stream;
13416    /// use google_cloud_datastream_v1::model::stream::State;
13417    /// let x0 = Stream::new().set_state(State::NotStarted);
13418    /// let x1 = Stream::new().set_state(State::Running);
13419    /// let x2 = Stream::new().set_state(State::Paused);
13420    /// ```
13421    pub fn set_state<T: std::convert::Into<crate::model::stream::State>>(mut self, v: T) -> Self {
13422        self.state = v.into();
13423        self
13424    }
13425
13426    /// Sets the value of [errors][crate::model::Stream::errors].
13427    ///
13428    /// # Example
13429    /// ```ignore,no_run
13430    /// # use google_cloud_datastream_v1::model::Stream;
13431    /// use google_cloud_datastream_v1::model::Error;
13432    /// let x = Stream::new()
13433    ///     .set_errors([
13434    ///         Error::default()/* use setters */,
13435    ///         Error::default()/* use (different) setters */,
13436    ///     ]);
13437    /// ```
13438    pub fn set_errors<T, V>(mut self, v: T) -> Self
13439    where
13440        T: std::iter::IntoIterator<Item = V>,
13441        V: std::convert::Into<crate::model::Error>,
13442    {
13443        use std::iter::Iterator;
13444        self.errors = v.into_iter().map(|i| i.into()).collect();
13445        self
13446    }
13447
13448    /// Sets the value of [customer_managed_encryption_key][crate::model::Stream::customer_managed_encryption_key].
13449    ///
13450    /// # Example
13451    /// ```ignore,no_run
13452    /// # use google_cloud_datastream_v1::model::Stream;
13453    /// let x = Stream::new().set_customer_managed_encryption_key("example");
13454    /// ```
13455    pub fn set_customer_managed_encryption_key<T>(mut self, v: T) -> Self
13456    where
13457        T: std::convert::Into<std::string::String>,
13458    {
13459        self.customer_managed_encryption_key = std::option::Option::Some(v.into());
13460        self
13461    }
13462
13463    /// Sets or clears the value of [customer_managed_encryption_key][crate::model::Stream::customer_managed_encryption_key].
13464    ///
13465    /// # Example
13466    /// ```ignore,no_run
13467    /// # use google_cloud_datastream_v1::model::Stream;
13468    /// let x = Stream::new().set_or_clear_customer_managed_encryption_key(Some("example"));
13469    /// let x = Stream::new().set_or_clear_customer_managed_encryption_key(None::<String>);
13470    /// ```
13471    pub fn set_or_clear_customer_managed_encryption_key<T>(
13472        mut self,
13473        v: std::option::Option<T>,
13474    ) -> Self
13475    where
13476        T: std::convert::Into<std::string::String>,
13477    {
13478        self.customer_managed_encryption_key = v.map(|x| x.into());
13479        self
13480    }
13481
13482    /// Sets the value of [last_recovery_time][crate::model::Stream::last_recovery_time].
13483    ///
13484    /// # Example
13485    /// ```ignore,no_run
13486    /// # use google_cloud_datastream_v1::model::Stream;
13487    /// use wkt::Timestamp;
13488    /// let x = Stream::new().set_last_recovery_time(Timestamp::default()/* use setters */);
13489    /// ```
13490    pub fn set_last_recovery_time<T>(mut self, v: T) -> Self
13491    where
13492        T: std::convert::Into<wkt::Timestamp>,
13493    {
13494        self.last_recovery_time = std::option::Option::Some(v.into());
13495        self
13496    }
13497
13498    /// Sets or clears the value of [last_recovery_time][crate::model::Stream::last_recovery_time].
13499    ///
13500    /// # Example
13501    /// ```ignore,no_run
13502    /// # use google_cloud_datastream_v1::model::Stream;
13503    /// use wkt::Timestamp;
13504    /// let x = Stream::new().set_or_clear_last_recovery_time(Some(Timestamp::default()/* use setters */));
13505    /// let x = Stream::new().set_or_clear_last_recovery_time(None::<Timestamp>);
13506    /// ```
13507    pub fn set_or_clear_last_recovery_time<T>(mut self, v: std::option::Option<T>) -> Self
13508    where
13509        T: std::convert::Into<wkt::Timestamp>,
13510    {
13511        self.last_recovery_time = v.map(|x| x.into());
13512        self
13513    }
13514
13515    /// Sets the value of [satisfies_pzs][crate::model::Stream::satisfies_pzs].
13516    ///
13517    /// # Example
13518    /// ```ignore,no_run
13519    /// # use google_cloud_datastream_v1::model::Stream;
13520    /// let x = Stream::new().set_satisfies_pzs(true);
13521    /// ```
13522    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
13523    where
13524        T: std::convert::Into<bool>,
13525    {
13526        self.satisfies_pzs = std::option::Option::Some(v.into());
13527        self
13528    }
13529
13530    /// Sets or clears the value of [satisfies_pzs][crate::model::Stream::satisfies_pzs].
13531    ///
13532    /// # Example
13533    /// ```ignore,no_run
13534    /// # use google_cloud_datastream_v1::model::Stream;
13535    /// let x = Stream::new().set_or_clear_satisfies_pzs(Some(false));
13536    /// let x = Stream::new().set_or_clear_satisfies_pzs(None::<bool>);
13537    /// ```
13538    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
13539    where
13540        T: std::convert::Into<bool>,
13541    {
13542        self.satisfies_pzs = v.map(|x| x.into());
13543        self
13544    }
13545
13546    /// Sets the value of [satisfies_pzi][crate::model::Stream::satisfies_pzi].
13547    ///
13548    /// # Example
13549    /// ```ignore,no_run
13550    /// # use google_cloud_datastream_v1::model::Stream;
13551    /// let x = Stream::new().set_satisfies_pzi(true);
13552    /// ```
13553    pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
13554    where
13555        T: std::convert::Into<bool>,
13556    {
13557        self.satisfies_pzi = std::option::Option::Some(v.into());
13558        self
13559    }
13560
13561    /// Sets or clears the value of [satisfies_pzi][crate::model::Stream::satisfies_pzi].
13562    ///
13563    /// # Example
13564    /// ```ignore,no_run
13565    /// # use google_cloud_datastream_v1::model::Stream;
13566    /// let x = Stream::new().set_or_clear_satisfies_pzi(Some(false));
13567    /// let x = Stream::new().set_or_clear_satisfies_pzi(None::<bool>);
13568    /// ```
13569    pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
13570    where
13571        T: std::convert::Into<bool>,
13572    {
13573        self.satisfies_pzi = v.map(|x| x.into());
13574        self
13575    }
13576
13577    /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy].
13578    ///
13579    /// Note that all the setters affecting `backfill_strategy` are mutually
13580    /// exclusive.
13581    ///
13582    /// # Example
13583    /// ```ignore,no_run
13584    /// # use google_cloud_datastream_v1::model::Stream;
13585    /// use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13586    /// let x = Stream::new().set_backfill_strategy(Some(
13587    ///     google_cloud_datastream_v1::model::stream::BackfillStrategy::BackfillAll(BackfillAllStrategy::default().into())));
13588    /// ```
13589    pub fn set_backfill_strategy<
13590        T: std::convert::Into<std::option::Option<crate::model::stream::BackfillStrategy>>,
13591    >(
13592        mut self,
13593        v: T,
13594    ) -> Self {
13595        self.backfill_strategy = v.into();
13596        self
13597    }
13598
13599    /// The value of [backfill_strategy][crate::model::Stream::backfill_strategy]
13600    /// if it holds a `BackfillAll`, `None` if the field is not set or
13601    /// holds a different branch.
13602    pub fn backfill_all(
13603        &self,
13604    ) -> std::option::Option<&std::boxed::Box<crate::model::stream::BackfillAllStrategy>> {
13605        #[allow(unreachable_patterns)]
13606        self.backfill_strategy.as_ref().and_then(|v| match v {
13607            crate::model::stream::BackfillStrategy::BackfillAll(v) => std::option::Option::Some(v),
13608            _ => std::option::Option::None,
13609        })
13610    }
13611
13612    /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy]
13613    /// to hold a `BackfillAll`.
13614    ///
13615    /// Note that all the setters affecting `backfill_strategy` are
13616    /// mutually exclusive.
13617    ///
13618    /// # Example
13619    /// ```ignore,no_run
13620    /// # use google_cloud_datastream_v1::model::Stream;
13621    /// use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13622    /// let x = Stream::new().set_backfill_all(BackfillAllStrategy::default()/* use setters */);
13623    /// assert!(x.backfill_all().is_some());
13624    /// assert!(x.backfill_none().is_none());
13625    /// ```
13626    pub fn set_backfill_all<
13627        T: std::convert::Into<std::boxed::Box<crate::model::stream::BackfillAllStrategy>>,
13628    >(
13629        mut self,
13630        v: T,
13631    ) -> Self {
13632        self.backfill_strategy = std::option::Option::Some(
13633            crate::model::stream::BackfillStrategy::BackfillAll(v.into()),
13634        );
13635        self
13636    }
13637
13638    /// The value of [backfill_strategy][crate::model::Stream::backfill_strategy]
13639    /// if it holds a `BackfillNone`, `None` if the field is not set or
13640    /// holds a different branch.
13641    pub fn backfill_none(
13642        &self,
13643    ) -> std::option::Option<&std::boxed::Box<crate::model::stream::BackfillNoneStrategy>> {
13644        #[allow(unreachable_patterns)]
13645        self.backfill_strategy.as_ref().and_then(|v| match v {
13646            crate::model::stream::BackfillStrategy::BackfillNone(v) => std::option::Option::Some(v),
13647            _ => std::option::Option::None,
13648        })
13649    }
13650
13651    /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy]
13652    /// to hold a `BackfillNone`.
13653    ///
13654    /// Note that all the setters affecting `backfill_strategy` are
13655    /// mutually exclusive.
13656    ///
13657    /// # Example
13658    /// ```ignore,no_run
13659    /// # use google_cloud_datastream_v1::model::Stream;
13660    /// use google_cloud_datastream_v1::model::stream::BackfillNoneStrategy;
13661    /// let x = Stream::new().set_backfill_none(BackfillNoneStrategy::default()/* use setters */);
13662    /// assert!(x.backfill_none().is_some());
13663    /// assert!(x.backfill_all().is_none());
13664    /// ```
13665    pub fn set_backfill_none<
13666        T: std::convert::Into<std::boxed::Box<crate::model::stream::BackfillNoneStrategy>>,
13667    >(
13668        mut self,
13669        v: T,
13670    ) -> Self {
13671        self.backfill_strategy = std::option::Option::Some(
13672            crate::model::stream::BackfillStrategy::BackfillNone(v.into()),
13673        );
13674        self
13675    }
13676}
13677
13678impl wkt::message::Message for Stream {
13679    fn typename() -> &'static str {
13680        "type.googleapis.com/google.cloud.datastream.v1.Stream"
13681    }
13682}
13683
13684/// Defines additional types related to [Stream].
13685pub mod stream {
13686    #[allow(unused_imports)]
13687    use super::*;
13688
13689    /// Backfill strategy to automatically backfill the Stream's objects.
13690    /// Specific objects can be excluded.
13691    #[derive(Clone, Default, PartialEq)]
13692    #[non_exhaustive]
13693    pub struct BackfillAllStrategy {
13694        /// List of objects to exclude.
13695        pub excluded_objects:
13696            std::option::Option<crate::model::stream::backfill_all_strategy::ExcludedObjects>,
13697
13698        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13699    }
13700
13701    impl BackfillAllStrategy {
13702        pub fn new() -> Self {
13703            std::default::Default::default()
13704        }
13705
13706        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects].
13707        ///
13708        /// Note that all the setters affecting `excluded_objects` are mutually
13709        /// exclusive.
13710        ///
13711        /// # Example
13712        /// ```ignore,no_run
13713        /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13714        /// use google_cloud_datastream_v1::model::OracleRdbms;
13715        /// let x = BackfillAllStrategy::new().set_excluded_objects(Some(
13716        ///     google_cloud_datastream_v1::model::stream::backfill_all_strategy::ExcludedObjects::OracleExcludedObjects(OracleRdbms::default().into())));
13717        /// ```
13718        pub fn set_excluded_objects<
13719            T: std::convert::Into<
13720                    std::option::Option<
13721                        crate::model::stream::backfill_all_strategy::ExcludedObjects,
13722                    >,
13723                >,
13724        >(
13725            mut self,
13726            v: T,
13727        ) -> Self {
13728            self.excluded_objects = v.into();
13729            self
13730        }
13731
13732        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13733        /// if it holds a `OracleExcludedObjects`, `None` if the field is not set or
13734        /// holds a different branch.
13735        pub fn oracle_excluded_objects(
13736            &self,
13737        ) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
13738            #[allow(unreachable_patterns)]
13739            self.excluded_objects.as_ref().and_then(|v| match v {
13740                crate::model::stream::backfill_all_strategy::ExcludedObjects::OracleExcludedObjects(v) => std::option::Option::Some(v),
13741                _ => std::option::Option::None,
13742            })
13743        }
13744
13745        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13746        /// to hold a `OracleExcludedObjects`.
13747        ///
13748        /// Note that all the setters affecting `excluded_objects` are
13749        /// mutually exclusive.
13750        ///
13751        /// # Example
13752        /// ```ignore,no_run
13753        /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13754        /// use google_cloud_datastream_v1::model::OracleRdbms;
13755        /// let x = BackfillAllStrategy::new().set_oracle_excluded_objects(OracleRdbms::default()/* use setters */);
13756        /// assert!(x.oracle_excluded_objects().is_some());
13757        /// assert!(x.mysql_excluded_objects().is_none());
13758        /// assert!(x.postgresql_excluded_objects().is_none());
13759        /// assert!(x.sql_server_excluded_objects().is_none());
13760        /// assert!(x.salesforce_excluded_objects().is_none());
13761        /// assert!(x.mongodb_excluded_objects().is_none());
13762        /// ```
13763        pub fn set_oracle_excluded_objects<
13764            T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>,
13765        >(
13766            mut self,
13767            v: T,
13768        ) -> Self {
13769            self.excluded_objects = std::option::Option::Some(
13770                crate::model::stream::backfill_all_strategy::ExcludedObjects::OracleExcludedObjects(
13771                    v.into(),
13772                ),
13773            );
13774            self
13775        }
13776
13777        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13778        /// if it holds a `MysqlExcludedObjects`, `None` if the field is not set or
13779        /// holds a different branch.
13780        pub fn mysql_excluded_objects(
13781            &self,
13782        ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
13783            #[allow(unreachable_patterns)]
13784            self.excluded_objects.as_ref().and_then(|v| match v {
13785                crate::model::stream::backfill_all_strategy::ExcludedObjects::MysqlExcludedObjects(v) => std::option::Option::Some(v),
13786                _ => std::option::Option::None,
13787            })
13788        }
13789
13790        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13791        /// to hold a `MysqlExcludedObjects`.
13792        ///
13793        /// Note that all the setters affecting `excluded_objects` are
13794        /// mutually exclusive.
13795        ///
13796        /// # Example
13797        /// ```ignore,no_run
13798        /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13799        /// use google_cloud_datastream_v1::model::MysqlRdbms;
13800        /// let x = BackfillAllStrategy::new().set_mysql_excluded_objects(MysqlRdbms::default()/* use setters */);
13801        /// assert!(x.mysql_excluded_objects().is_some());
13802        /// assert!(x.oracle_excluded_objects().is_none());
13803        /// assert!(x.postgresql_excluded_objects().is_none());
13804        /// assert!(x.sql_server_excluded_objects().is_none());
13805        /// assert!(x.salesforce_excluded_objects().is_none());
13806        /// assert!(x.mongodb_excluded_objects().is_none());
13807        /// ```
13808        pub fn set_mysql_excluded_objects<
13809            T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>,
13810        >(
13811            mut self,
13812            v: T,
13813        ) -> Self {
13814            self.excluded_objects = std::option::Option::Some(
13815                crate::model::stream::backfill_all_strategy::ExcludedObjects::MysqlExcludedObjects(
13816                    v.into(),
13817                ),
13818            );
13819            self
13820        }
13821
13822        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13823        /// if it holds a `PostgresqlExcludedObjects`, `None` if the field is not set or
13824        /// holds a different branch.
13825        pub fn postgresql_excluded_objects(
13826            &self,
13827        ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
13828            #[allow(unreachable_patterns)]
13829            self.excluded_objects.as_ref().and_then(|v| match v {
13830                crate::model::stream::backfill_all_strategy::ExcludedObjects::PostgresqlExcludedObjects(v) => std::option::Option::Some(v),
13831                _ => std::option::Option::None,
13832            })
13833        }
13834
13835        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13836        /// to hold a `PostgresqlExcludedObjects`.
13837        ///
13838        /// Note that all the setters affecting `excluded_objects` are
13839        /// mutually exclusive.
13840        ///
13841        /// # Example
13842        /// ```ignore,no_run
13843        /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13844        /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
13845        /// let x = BackfillAllStrategy::new().set_postgresql_excluded_objects(PostgresqlRdbms::default()/* use setters */);
13846        /// assert!(x.postgresql_excluded_objects().is_some());
13847        /// assert!(x.oracle_excluded_objects().is_none());
13848        /// assert!(x.mysql_excluded_objects().is_none());
13849        /// assert!(x.sql_server_excluded_objects().is_none());
13850        /// assert!(x.salesforce_excluded_objects().is_none());
13851        /// assert!(x.mongodb_excluded_objects().is_none());
13852        /// ```
13853        pub fn set_postgresql_excluded_objects<
13854            T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
13855        >(
13856            mut self,
13857            v: T,
13858        ) -> Self {
13859            self.excluded_objects = std::option::Option::Some(
13860                crate::model::stream::backfill_all_strategy::ExcludedObjects::PostgresqlExcludedObjects(
13861                    v.into()
13862                )
13863            );
13864            self
13865        }
13866
13867        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13868        /// if it holds a `SqlServerExcludedObjects`, `None` if the field is not set or
13869        /// holds a different branch.
13870        pub fn sql_server_excluded_objects(
13871            &self,
13872        ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
13873            #[allow(unreachable_patterns)]
13874            self.excluded_objects.as_ref().and_then(|v| match v {
13875                crate::model::stream::backfill_all_strategy::ExcludedObjects::SqlServerExcludedObjects(v) => std::option::Option::Some(v),
13876                _ => std::option::Option::None,
13877            })
13878        }
13879
13880        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13881        /// to hold a `SqlServerExcludedObjects`.
13882        ///
13883        /// Note that all the setters affecting `excluded_objects` are
13884        /// mutually exclusive.
13885        ///
13886        /// # Example
13887        /// ```ignore,no_run
13888        /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13889        /// use google_cloud_datastream_v1::model::SqlServerRdbms;
13890        /// let x = BackfillAllStrategy::new().set_sql_server_excluded_objects(SqlServerRdbms::default()/* use setters */);
13891        /// assert!(x.sql_server_excluded_objects().is_some());
13892        /// assert!(x.oracle_excluded_objects().is_none());
13893        /// assert!(x.mysql_excluded_objects().is_none());
13894        /// assert!(x.postgresql_excluded_objects().is_none());
13895        /// assert!(x.salesforce_excluded_objects().is_none());
13896        /// assert!(x.mongodb_excluded_objects().is_none());
13897        /// ```
13898        pub fn set_sql_server_excluded_objects<
13899            T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
13900        >(
13901            mut self,
13902            v: T,
13903        ) -> Self {
13904            self.excluded_objects = std::option::Option::Some(
13905                crate::model::stream::backfill_all_strategy::ExcludedObjects::SqlServerExcludedObjects(
13906                    v.into()
13907                )
13908            );
13909            self
13910        }
13911
13912        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13913        /// if it holds a `SalesforceExcludedObjects`, `None` if the field is not set or
13914        /// holds a different branch.
13915        pub fn salesforce_excluded_objects(
13916            &self,
13917        ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceOrg>> {
13918            #[allow(unreachable_patterns)]
13919            self.excluded_objects.as_ref().and_then(|v| match v {
13920                crate::model::stream::backfill_all_strategy::ExcludedObjects::SalesforceExcludedObjects(v) => std::option::Option::Some(v),
13921                _ => std::option::Option::None,
13922            })
13923        }
13924
13925        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13926        /// to hold a `SalesforceExcludedObjects`.
13927        ///
13928        /// Note that all the setters affecting `excluded_objects` are
13929        /// mutually exclusive.
13930        ///
13931        /// # Example
13932        /// ```ignore,no_run
13933        /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13934        /// use google_cloud_datastream_v1::model::SalesforceOrg;
13935        /// let x = BackfillAllStrategy::new().set_salesforce_excluded_objects(SalesforceOrg::default()/* use setters */);
13936        /// assert!(x.salesforce_excluded_objects().is_some());
13937        /// assert!(x.oracle_excluded_objects().is_none());
13938        /// assert!(x.mysql_excluded_objects().is_none());
13939        /// assert!(x.postgresql_excluded_objects().is_none());
13940        /// assert!(x.sql_server_excluded_objects().is_none());
13941        /// assert!(x.mongodb_excluded_objects().is_none());
13942        /// ```
13943        pub fn set_salesforce_excluded_objects<
13944            T: std::convert::Into<std::boxed::Box<crate::model::SalesforceOrg>>,
13945        >(
13946            mut self,
13947            v: T,
13948        ) -> Self {
13949            self.excluded_objects = std::option::Option::Some(
13950                crate::model::stream::backfill_all_strategy::ExcludedObjects::SalesforceExcludedObjects(
13951                    v.into()
13952                )
13953            );
13954            self
13955        }
13956
13957        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13958        /// if it holds a `MongodbExcludedObjects`, `None` if the field is not set or
13959        /// holds a different branch.
13960        pub fn mongodb_excluded_objects(
13961            &self,
13962        ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbCluster>> {
13963            #[allow(unreachable_patterns)]
13964            self.excluded_objects.as_ref().and_then(|v| match v {
13965                crate::model::stream::backfill_all_strategy::ExcludedObjects::MongodbExcludedObjects(v) => std::option::Option::Some(v),
13966                _ => std::option::Option::None,
13967            })
13968        }
13969
13970        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13971        /// to hold a `MongodbExcludedObjects`.
13972        ///
13973        /// Note that all the setters affecting `excluded_objects` are
13974        /// mutually exclusive.
13975        ///
13976        /// # Example
13977        /// ```ignore,no_run
13978        /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13979        /// use google_cloud_datastream_v1::model::MongodbCluster;
13980        /// let x = BackfillAllStrategy::new().set_mongodb_excluded_objects(MongodbCluster::default()/* use setters */);
13981        /// assert!(x.mongodb_excluded_objects().is_some());
13982        /// assert!(x.oracle_excluded_objects().is_none());
13983        /// assert!(x.mysql_excluded_objects().is_none());
13984        /// assert!(x.postgresql_excluded_objects().is_none());
13985        /// assert!(x.sql_server_excluded_objects().is_none());
13986        /// assert!(x.salesforce_excluded_objects().is_none());
13987        /// ```
13988        pub fn set_mongodb_excluded_objects<
13989            T: std::convert::Into<std::boxed::Box<crate::model::MongodbCluster>>,
13990        >(
13991            mut self,
13992            v: T,
13993        ) -> Self {
13994            self.excluded_objects = std::option::Option::Some(
13995                crate::model::stream::backfill_all_strategy::ExcludedObjects::MongodbExcludedObjects(
13996                    v.into()
13997                )
13998            );
13999            self
14000        }
14001    }
14002
14003    impl wkt::message::Message for BackfillAllStrategy {
14004        fn typename() -> &'static str {
14005            "type.googleapis.com/google.cloud.datastream.v1.Stream.BackfillAllStrategy"
14006        }
14007    }
14008
14009    /// Defines additional types related to [BackfillAllStrategy].
14010    pub mod backfill_all_strategy {
14011        #[allow(unused_imports)]
14012        use super::*;
14013
14014        /// List of objects to exclude.
14015        #[derive(Clone, Debug, PartialEq)]
14016        #[non_exhaustive]
14017        pub enum ExcludedObjects {
14018            /// Oracle data source objects to avoid backfilling.
14019            OracleExcludedObjects(std::boxed::Box<crate::model::OracleRdbms>),
14020            /// MySQL data source objects to avoid backfilling.
14021            MysqlExcludedObjects(std::boxed::Box<crate::model::MysqlRdbms>),
14022            /// PostgreSQL data source objects to avoid backfilling.
14023            PostgresqlExcludedObjects(std::boxed::Box<crate::model::PostgresqlRdbms>),
14024            /// SQLServer data source objects to avoid backfilling
14025            SqlServerExcludedObjects(std::boxed::Box<crate::model::SqlServerRdbms>),
14026            /// Salesforce data source objects to avoid backfilling
14027            SalesforceExcludedObjects(std::boxed::Box<crate::model::SalesforceOrg>),
14028            /// MongoDB data source objects to avoid backfilling
14029            MongodbExcludedObjects(std::boxed::Box<crate::model::MongodbCluster>),
14030        }
14031    }
14032
14033    /// Backfill strategy to disable automatic backfill for the Stream's objects.
14034    #[derive(Clone, Default, PartialEq)]
14035    #[non_exhaustive]
14036    pub struct BackfillNoneStrategy {
14037        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14038    }
14039
14040    impl BackfillNoneStrategy {
14041        pub fn new() -> Self {
14042            std::default::Default::default()
14043        }
14044    }
14045
14046    impl wkt::message::Message for BackfillNoneStrategy {
14047        fn typename() -> &'static str {
14048            "type.googleapis.com/google.cloud.datastream.v1.Stream.BackfillNoneStrategy"
14049        }
14050    }
14051
14052    /// Stream state.
14053    ///
14054    /// # Working with unknown values
14055    ///
14056    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14057    /// additional enum variants at any time. Adding new variants is not considered
14058    /// a breaking change. Applications should write their code in anticipation of:
14059    ///
14060    /// - New values appearing in future releases of the client library, **and**
14061    /// - New values received dynamically, without application changes.
14062    ///
14063    /// Please consult the [Working with enums] section in the user guide for some
14064    /// guidelines.
14065    ///
14066    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14067    #[derive(Clone, Debug, PartialEq)]
14068    #[non_exhaustive]
14069    pub enum State {
14070        /// Unspecified stream state.
14071        Unspecified,
14072        /// The stream has been created but has not yet started streaming data.
14073        NotStarted,
14074        /// The stream is running.
14075        Running,
14076        /// The stream is paused.
14077        Paused,
14078        /// The stream is in maintenance mode.
14079        ///
14080        /// Updates are rejected on the resource in this state.
14081        Maintenance,
14082        /// The stream is experiencing an error that is preventing data from being
14083        /// streamed.
14084        Failed,
14085        /// The stream has experienced a terminal failure.
14086        FailedPermanently,
14087        /// The stream is starting, but not yet running.
14088        Starting,
14089        /// The Stream is no longer reading new events, but still writing events in
14090        /// the buffer.
14091        Draining,
14092        /// If set, the enum was initialized with an unknown value.
14093        ///
14094        /// Applications can examine the value using [State::value] or
14095        /// [State::name].
14096        UnknownValue(state::UnknownValue),
14097    }
14098
14099    #[doc(hidden)]
14100    pub mod state {
14101        #[allow(unused_imports)]
14102        use super::*;
14103        #[derive(Clone, Debug, PartialEq)]
14104        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14105    }
14106
14107    impl State {
14108        /// Gets the enum value.
14109        ///
14110        /// Returns `None` if the enum contains an unknown value deserialized from
14111        /// the string representation of enums.
14112        pub fn value(&self) -> std::option::Option<i32> {
14113            match self {
14114                Self::Unspecified => std::option::Option::Some(0),
14115                Self::NotStarted => std::option::Option::Some(1),
14116                Self::Running => std::option::Option::Some(2),
14117                Self::Paused => std::option::Option::Some(3),
14118                Self::Maintenance => std::option::Option::Some(4),
14119                Self::Failed => std::option::Option::Some(5),
14120                Self::FailedPermanently => std::option::Option::Some(6),
14121                Self::Starting => std::option::Option::Some(7),
14122                Self::Draining => std::option::Option::Some(8),
14123                Self::UnknownValue(u) => u.0.value(),
14124            }
14125        }
14126
14127        /// Gets the enum value as a string.
14128        ///
14129        /// Returns `None` if the enum contains an unknown value deserialized from
14130        /// the integer representation of enums.
14131        pub fn name(&self) -> std::option::Option<&str> {
14132            match self {
14133                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14134                Self::NotStarted => std::option::Option::Some("NOT_STARTED"),
14135                Self::Running => std::option::Option::Some("RUNNING"),
14136                Self::Paused => std::option::Option::Some("PAUSED"),
14137                Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
14138                Self::Failed => std::option::Option::Some("FAILED"),
14139                Self::FailedPermanently => std::option::Option::Some("FAILED_PERMANENTLY"),
14140                Self::Starting => std::option::Option::Some("STARTING"),
14141                Self::Draining => std::option::Option::Some("DRAINING"),
14142                Self::UnknownValue(u) => u.0.name(),
14143            }
14144        }
14145    }
14146
14147    impl std::default::Default for State {
14148        fn default() -> Self {
14149            use std::convert::From;
14150            Self::from(0)
14151        }
14152    }
14153
14154    impl std::fmt::Display for State {
14155        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14156            wkt::internal::display_enum(f, self.name(), self.value())
14157        }
14158    }
14159
14160    impl std::convert::From<i32> for State {
14161        fn from(value: i32) -> Self {
14162            match value {
14163                0 => Self::Unspecified,
14164                1 => Self::NotStarted,
14165                2 => Self::Running,
14166                3 => Self::Paused,
14167                4 => Self::Maintenance,
14168                5 => Self::Failed,
14169                6 => Self::FailedPermanently,
14170                7 => Self::Starting,
14171                8 => Self::Draining,
14172                _ => Self::UnknownValue(state::UnknownValue(
14173                    wkt::internal::UnknownEnumValue::Integer(value),
14174                )),
14175            }
14176        }
14177    }
14178
14179    impl std::convert::From<&str> for State {
14180        fn from(value: &str) -> Self {
14181            use std::string::ToString;
14182            match value {
14183                "STATE_UNSPECIFIED" => Self::Unspecified,
14184                "NOT_STARTED" => Self::NotStarted,
14185                "RUNNING" => Self::Running,
14186                "PAUSED" => Self::Paused,
14187                "MAINTENANCE" => Self::Maintenance,
14188                "FAILED" => Self::Failed,
14189                "FAILED_PERMANENTLY" => Self::FailedPermanently,
14190                "STARTING" => Self::Starting,
14191                "DRAINING" => Self::Draining,
14192                _ => Self::UnknownValue(state::UnknownValue(
14193                    wkt::internal::UnknownEnumValue::String(value.to_string()),
14194                )),
14195            }
14196        }
14197    }
14198
14199    impl serde::ser::Serialize for State {
14200        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14201        where
14202            S: serde::Serializer,
14203        {
14204            match self {
14205                Self::Unspecified => serializer.serialize_i32(0),
14206                Self::NotStarted => serializer.serialize_i32(1),
14207                Self::Running => serializer.serialize_i32(2),
14208                Self::Paused => serializer.serialize_i32(3),
14209                Self::Maintenance => serializer.serialize_i32(4),
14210                Self::Failed => serializer.serialize_i32(5),
14211                Self::FailedPermanently => serializer.serialize_i32(6),
14212                Self::Starting => serializer.serialize_i32(7),
14213                Self::Draining => serializer.serialize_i32(8),
14214                Self::UnknownValue(u) => u.0.serialize(serializer),
14215            }
14216        }
14217    }
14218
14219    impl<'de> serde::de::Deserialize<'de> for State {
14220        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14221        where
14222            D: serde::Deserializer<'de>,
14223        {
14224            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14225                ".google.cloud.datastream.v1.Stream.State",
14226            ))
14227        }
14228    }
14229
14230    /// Stream backfill strategy.
14231    #[derive(Clone, Debug, PartialEq)]
14232    #[non_exhaustive]
14233    pub enum BackfillStrategy {
14234        /// Automatically backfill objects included in the stream source
14235        /// configuration. Specific objects can be excluded.
14236        BackfillAll(std::boxed::Box<crate::model::stream::BackfillAllStrategy>),
14237        /// Do not automatically backfill any objects.
14238        BackfillNone(std::boxed::Box<crate::model::stream::BackfillNoneStrategy>),
14239    }
14240}
14241
14242/// A specific stream object (e.g a specific DB table).
14243#[derive(Clone, Default, PartialEq)]
14244#[non_exhaustive]
14245pub struct StreamObject {
14246    /// Output only. Identifier. The object resource's name.
14247    pub name: std::string::String,
14248
14249    /// Output only. The creation time of the object.
14250    pub create_time: std::option::Option<wkt::Timestamp>,
14251
14252    /// Output only. The last update time of the object.
14253    pub update_time: std::option::Option<wkt::Timestamp>,
14254
14255    /// Required. Display name.
14256    pub display_name: std::string::String,
14257
14258    /// Output only. Active errors on the object.
14259    pub errors: std::vec::Vec<crate::model::Error>,
14260
14261    /// The latest backfill job that was initiated for the stream object.
14262    pub backfill_job: std::option::Option<crate::model::BackfillJob>,
14263
14264    /// The object identifier in the data source.
14265    pub source_object: std::option::Option<crate::model::SourceObjectIdentifier>,
14266
14267    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14268}
14269
14270impl StreamObject {
14271    pub fn new() -> Self {
14272        std::default::Default::default()
14273    }
14274
14275    /// Sets the value of [name][crate::model::StreamObject::name].
14276    ///
14277    /// # Example
14278    /// ```ignore,no_run
14279    /// # use google_cloud_datastream_v1::model::StreamObject;
14280    /// let x = StreamObject::new().set_name("example");
14281    /// ```
14282    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14283        self.name = v.into();
14284        self
14285    }
14286
14287    /// Sets the value of [create_time][crate::model::StreamObject::create_time].
14288    ///
14289    /// # Example
14290    /// ```ignore,no_run
14291    /// # use google_cloud_datastream_v1::model::StreamObject;
14292    /// use wkt::Timestamp;
14293    /// let x = StreamObject::new().set_create_time(Timestamp::default()/* use setters */);
14294    /// ```
14295    pub fn set_create_time<T>(mut self, v: T) -> Self
14296    where
14297        T: std::convert::Into<wkt::Timestamp>,
14298    {
14299        self.create_time = std::option::Option::Some(v.into());
14300        self
14301    }
14302
14303    /// Sets or clears the value of [create_time][crate::model::StreamObject::create_time].
14304    ///
14305    /// # Example
14306    /// ```ignore,no_run
14307    /// # use google_cloud_datastream_v1::model::StreamObject;
14308    /// use wkt::Timestamp;
14309    /// let x = StreamObject::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
14310    /// let x = StreamObject::new().set_or_clear_create_time(None::<Timestamp>);
14311    /// ```
14312    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14313    where
14314        T: std::convert::Into<wkt::Timestamp>,
14315    {
14316        self.create_time = v.map(|x| x.into());
14317        self
14318    }
14319
14320    /// Sets the value of [update_time][crate::model::StreamObject::update_time].
14321    ///
14322    /// # Example
14323    /// ```ignore,no_run
14324    /// # use google_cloud_datastream_v1::model::StreamObject;
14325    /// use wkt::Timestamp;
14326    /// let x = StreamObject::new().set_update_time(Timestamp::default()/* use setters */);
14327    /// ```
14328    pub fn set_update_time<T>(mut self, v: T) -> Self
14329    where
14330        T: std::convert::Into<wkt::Timestamp>,
14331    {
14332        self.update_time = std::option::Option::Some(v.into());
14333        self
14334    }
14335
14336    /// Sets or clears the value of [update_time][crate::model::StreamObject::update_time].
14337    ///
14338    /// # Example
14339    /// ```ignore,no_run
14340    /// # use google_cloud_datastream_v1::model::StreamObject;
14341    /// use wkt::Timestamp;
14342    /// let x = StreamObject::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
14343    /// let x = StreamObject::new().set_or_clear_update_time(None::<Timestamp>);
14344    /// ```
14345    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
14346    where
14347        T: std::convert::Into<wkt::Timestamp>,
14348    {
14349        self.update_time = v.map(|x| x.into());
14350        self
14351    }
14352
14353    /// Sets the value of [display_name][crate::model::StreamObject::display_name].
14354    ///
14355    /// # Example
14356    /// ```ignore,no_run
14357    /// # use google_cloud_datastream_v1::model::StreamObject;
14358    /// let x = StreamObject::new().set_display_name("example");
14359    /// ```
14360    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14361        self.display_name = v.into();
14362        self
14363    }
14364
14365    /// Sets the value of [errors][crate::model::StreamObject::errors].
14366    ///
14367    /// # Example
14368    /// ```ignore,no_run
14369    /// # use google_cloud_datastream_v1::model::StreamObject;
14370    /// use google_cloud_datastream_v1::model::Error;
14371    /// let x = StreamObject::new()
14372    ///     .set_errors([
14373    ///         Error::default()/* use setters */,
14374    ///         Error::default()/* use (different) setters */,
14375    ///     ]);
14376    /// ```
14377    pub fn set_errors<T, V>(mut self, v: T) -> Self
14378    where
14379        T: std::iter::IntoIterator<Item = V>,
14380        V: std::convert::Into<crate::model::Error>,
14381    {
14382        use std::iter::Iterator;
14383        self.errors = v.into_iter().map(|i| i.into()).collect();
14384        self
14385    }
14386
14387    /// Sets the value of [backfill_job][crate::model::StreamObject::backfill_job].
14388    ///
14389    /// # Example
14390    /// ```ignore,no_run
14391    /// # use google_cloud_datastream_v1::model::StreamObject;
14392    /// use google_cloud_datastream_v1::model::BackfillJob;
14393    /// let x = StreamObject::new().set_backfill_job(BackfillJob::default()/* use setters */);
14394    /// ```
14395    pub fn set_backfill_job<T>(mut self, v: T) -> Self
14396    where
14397        T: std::convert::Into<crate::model::BackfillJob>,
14398    {
14399        self.backfill_job = std::option::Option::Some(v.into());
14400        self
14401    }
14402
14403    /// Sets or clears the value of [backfill_job][crate::model::StreamObject::backfill_job].
14404    ///
14405    /// # Example
14406    /// ```ignore,no_run
14407    /// # use google_cloud_datastream_v1::model::StreamObject;
14408    /// use google_cloud_datastream_v1::model::BackfillJob;
14409    /// let x = StreamObject::new().set_or_clear_backfill_job(Some(BackfillJob::default()/* use setters */));
14410    /// let x = StreamObject::new().set_or_clear_backfill_job(None::<BackfillJob>);
14411    /// ```
14412    pub fn set_or_clear_backfill_job<T>(mut self, v: std::option::Option<T>) -> Self
14413    where
14414        T: std::convert::Into<crate::model::BackfillJob>,
14415    {
14416        self.backfill_job = v.map(|x| x.into());
14417        self
14418    }
14419
14420    /// Sets the value of [source_object][crate::model::StreamObject::source_object].
14421    ///
14422    /// # Example
14423    /// ```ignore,no_run
14424    /// # use google_cloud_datastream_v1::model::StreamObject;
14425    /// use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14426    /// let x = StreamObject::new().set_source_object(SourceObjectIdentifier::default()/* use setters */);
14427    /// ```
14428    pub fn set_source_object<T>(mut self, v: T) -> Self
14429    where
14430        T: std::convert::Into<crate::model::SourceObjectIdentifier>,
14431    {
14432        self.source_object = std::option::Option::Some(v.into());
14433        self
14434    }
14435
14436    /// Sets or clears the value of [source_object][crate::model::StreamObject::source_object].
14437    ///
14438    /// # Example
14439    /// ```ignore,no_run
14440    /// # use google_cloud_datastream_v1::model::StreamObject;
14441    /// use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14442    /// let x = StreamObject::new().set_or_clear_source_object(Some(SourceObjectIdentifier::default()/* use setters */));
14443    /// let x = StreamObject::new().set_or_clear_source_object(None::<SourceObjectIdentifier>);
14444    /// ```
14445    pub fn set_or_clear_source_object<T>(mut self, v: std::option::Option<T>) -> Self
14446    where
14447        T: std::convert::Into<crate::model::SourceObjectIdentifier>,
14448    {
14449        self.source_object = v.map(|x| x.into());
14450        self
14451    }
14452}
14453
14454impl wkt::message::Message for StreamObject {
14455    fn typename() -> &'static str {
14456        "type.googleapis.com/google.cloud.datastream.v1.StreamObject"
14457    }
14458}
14459
14460/// Represents an identifier of an object in the data source.
14461#[derive(Clone, Default, PartialEq)]
14462#[non_exhaustive]
14463pub struct SourceObjectIdentifier {
14464    /// The identifier for an object in the data source.
14465    pub source_identifier:
14466        std::option::Option<crate::model::source_object_identifier::SourceIdentifier>,
14467
14468    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14469}
14470
14471impl SourceObjectIdentifier {
14472    pub fn new() -> Self {
14473        std::default::Default::default()
14474    }
14475
14476    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier].
14477    ///
14478    /// Note that all the setters affecting `source_identifier` are mutually
14479    /// exclusive.
14480    ///
14481    /// # Example
14482    /// ```ignore,no_run
14483    /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14484    /// use google_cloud_datastream_v1::model::source_object_identifier::OracleObjectIdentifier;
14485    /// let x = SourceObjectIdentifier::new().set_source_identifier(Some(
14486    ///     google_cloud_datastream_v1::model::source_object_identifier::SourceIdentifier::OracleIdentifier(OracleObjectIdentifier::default().into())));
14487    /// ```
14488    pub fn set_source_identifier<
14489        T: std::convert::Into<
14490                std::option::Option<crate::model::source_object_identifier::SourceIdentifier>,
14491            >,
14492    >(
14493        mut self,
14494        v: T,
14495    ) -> Self {
14496        self.source_identifier = v.into();
14497        self
14498    }
14499
14500    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14501    /// if it holds a `OracleIdentifier`, `None` if the field is not set or
14502    /// holds a different branch.
14503    pub fn oracle_identifier(
14504        &self,
14505    ) -> std::option::Option<
14506        &std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
14507    > {
14508        #[allow(unreachable_patterns)]
14509        self.source_identifier.as_ref().and_then(|v| match v {
14510            crate::model::source_object_identifier::SourceIdentifier::OracleIdentifier(v) => {
14511                std::option::Option::Some(v)
14512            }
14513            _ => std::option::Option::None,
14514        })
14515    }
14516
14517    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14518    /// to hold a `OracleIdentifier`.
14519    ///
14520    /// Note that all the setters affecting `source_identifier` are
14521    /// mutually exclusive.
14522    ///
14523    /// # Example
14524    /// ```ignore,no_run
14525    /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14526    /// use google_cloud_datastream_v1::model::source_object_identifier::OracleObjectIdentifier;
14527    /// let x = SourceObjectIdentifier::new().set_oracle_identifier(OracleObjectIdentifier::default()/* use setters */);
14528    /// assert!(x.oracle_identifier().is_some());
14529    /// assert!(x.mysql_identifier().is_none());
14530    /// assert!(x.postgresql_identifier().is_none());
14531    /// assert!(x.sql_server_identifier().is_none());
14532    /// assert!(x.salesforce_identifier().is_none());
14533    /// assert!(x.mongodb_identifier().is_none());
14534    /// ```
14535    pub fn set_oracle_identifier<
14536        T: std::convert::Into<
14537                std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
14538            >,
14539    >(
14540        mut self,
14541        v: T,
14542    ) -> Self {
14543        self.source_identifier = std::option::Option::Some(
14544            crate::model::source_object_identifier::SourceIdentifier::OracleIdentifier(v.into()),
14545        );
14546        self
14547    }
14548
14549    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14550    /// if it holds a `MysqlIdentifier`, `None` if the field is not set or
14551    /// holds a different branch.
14552    pub fn mysql_identifier(
14553        &self,
14554    ) -> std::option::Option<
14555        &std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
14556    > {
14557        #[allow(unreachable_patterns)]
14558        self.source_identifier.as_ref().and_then(|v| match v {
14559            crate::model::source_object_identifier::SourceIdentifier::MysqlIdentifier(v) => {
14560                std::option::Option::Some(v)
14561            }
14562            _ => std::option::Option::None,
14563        })
14564    }
14565
14566    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14567    /// to hold a `MysqlIdentifier`.
14568    ///
14569    /// Note that all the setters affecting `source_identifier` are
14570    /// mutually exclusive.
14571    ///
14572    /// # Example
14573    /// ```ignore,no_run
14574    /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14575    /// use google_cloud_datastream_v1::model::source_object_identifier::MysqlObjectIdentifier;
14576    /// let x = SourceObjectIdentifier::new().set_mysql_identifier(MysqlObjectIdentifier::default()/* use setters */);
14577    /// assert!(x.mysql_identifier().is_some());
14578    /// assert!(x.oracle_identifier().is_none());
14579    /// assert!(x.postgresql_identifier().is_none());
14580    /// assert!(x.sql_server_identifier().is_none());
14581    /// assert!(x.salesforce_identifier().is_none());
14582    /// assert!(x.mongodb_identifier().is_none());
14583    /// ```
14584    pub fn set_mysql_identifier<
14585        T: std::convert::Into<
14586                std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
14587            >,
14588    >(
14589        mut self,
14590        v: T,
14591    ) -> Self {
14592        self.source_identifier = std::option::Option::Some(
14593            crate::model::source_object_identifier::SourceIdentifier::MysqlIdentifier(v.into()),
14594        );
14595        self
14596    }
14597
14598    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14599    /// if it holds a `PostgresqlIdentifier`, `None` if the field is not set or
14600    /// holds a different branch.
14601    pub fn postgresql_identifier(
14602        &self,
14603    ) -> std::option::Option<
14604        &std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
14605    > {
14606        #[allow(unreachable_patterns)]
14607        self.source_identifier.as_ref().and_then(|v| match v {
14608            crate::model::source_object_identifier::SourceIdentifier::PostgresqlIdentifier(v) => {
14609                std::option::Option::Some(v)
14610            }
14611            _ => std::option::Option::None,
14612        })
14613    }
14614
14615    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14616    /// to hold a `PostgresqlIdentifier`.
14617    ///
14618    /// Note that all the setters affecting `source_identifier` are
14619    /// mutually exclusive.
14620    ///
14621    /// # Example
14622    /// ```ignore,no_run
14623    /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14624    /// use google_cloud_datastream_v1::model::source_object_identifier::PostgresqlObjectIdentifier;
14625    /// let x = SourceObjectIdentifier::new().set_postgresql_identifier(PostgresqlObjectIdentifier::default()/* use setters */);
14626    /// assert!(x.postgresql_identifier().is_some());
14627    /// assert!(x.oracle_identifier().is_none());
14628    /// assert!(x.mysql_identifier().is_none());
14629    /// assert!(x.sql_server_identifier().is_none());
14630    /// assert!(x.salesforce_identifier().is_none());
14631    /// assert!(x.mongodb_identifier().is_none());
14632    /// ```
14633    pub fn set_postgresql_identifier<
14634        T: std::convert::Into<
14635                std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
14636            >,
14637    >(
14638        mut self,
14639        v: T,
14640    ) -> Self {
14641        self.source_identifier = std::option::Option::Some(
14642            crate::model::source_object_identifier::SourceIdentifier::PostgresqlIdentifier(
14643                v.into(),
14644            ),
14645        );
14646        self
14647    }
14648
14649    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14650    /// if it holds a `SqlServerIdentifier`, `None` if the field is not set or
14651    /// holds a different branch.
14652    pub fn sql_server_identifier(
14653        &self,
14654    ) -> std::option::Option<
14655        &std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
14656    > {
14657        #[allow(unreachable_patterns)]
14658        self.source_identifier.as_ref().and_then(|v| match v {
14659            crate::model::source_object_identifier::SourceIdentifier::SqlServerIdentifier(v) => {
14660                std::option::Option::Some(v)
14661            }
14662            _ => std::option::Option::None,
14663        })
14664    }
14665
14666    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14667    /// to hold a `SqlServerIdentifier`.
14668    ///
14669    /// Note that all the setters affecting `source_identifier` are
14670    /// mutually exclusive.
14671    ///
14672    /// # Example
14673    /// ```ignore,no_run
14674    /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14675    /// use google_cloud_datastream_v1::model::source_object_identifier::SqlServerObjectIdentifier;
14676    /// let x = SourceObjectIdentifier::new().set_sql_server_identifier(SqlServerObjectIdentifier::default()/* use setters */);
14677    /// assert!(x.sql_server_identifier().is_some());
14678    /// assert!(x.oracle_identifier().is_none());
14679    /// assert!(x.mysql_identifier().is_none());
14680    /// assert!(x.postgresql_identifier().is_none());
14681    /// assert!(x.salesforce_identifier().is_none());
14682    /// assert!(x.mongodb_identifier().is_none());
14683    /// ```
14684    pub fn set_sql_server_identifier<
14685        T: std::convert::Into<
14686                std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
14687            >,
14688    >(
14689        mut self,
14690        v: T,
14691    ) -> Self {
14692        self.source_identifier = std::option::Option::Some(
14693            crate::model::source_object_identifier::SourceIdentifier::SqlServerIdentifier(v.into()),
14694        );
14695        self
14696    }
14697
14698    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14699    /// if it holds a `SalesforceIdentifier`, `None` if the field is not set or
14700    /// holds a different branch.
14701    pub fn salesforce_identifier(
14702        &self,
14703    ) -> std::option::Option<
14704        &std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>,
14705    > {
14706        #[allow(unreachable_patterns)]
14707        self.source_identifier.as_ref().and_then(|v| match v {
14708            crate::model::source_object_identifier::SourceIdentifier::SalesforceIdentifier(v) => {
14709                std::option::Option::Some(v)
14710            }
14711            _ => std::option::Option::None,
14712        })
14713    }
14714
14715    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14716    /// to hold a `SalesforceIdentifier`.
14717    ///
14718    /// Note that all the setters affecting `source_identifier` are
14719    /// mutually exclusive.
14720    ///
14721    /// # Example
14722    /// ```ignore,no_run
14723    /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14724    /// use google_cloud_datastream_v1::model::source_object_identifier::SalesforceObjectIdentifier;
14725    /// let x = SourceObjectIdentifier::new().set_salesforce_identifier(SalesforceObjectIdentifier::default()/* use setters */);
14726    /// assert!(x.salesforce_identifier().is_some());
14727    /// assert!(x.oracle_identifier().is_none());
14728    /// assert!(x.mysql_identifier().is_none());
14729    /// assert!(x.postgresql_identifier().is_none());
14730    /// assert!(x.sql_server_identifier().is_none());
14731    /// assert!(x.mongodb_identifier().is_none());
14732    /// ```
14733    pub fn set_salesforce_identifier<
14734        T: std::convert::Into<
14735                std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>,
14736            >,
14737    >(
14738        mut self,
14739        v: T,
14740    ) -> Self {
14741        self.source_identifier = std::option::Option::Some(
14742            crate::model::source_object_identifier::SourceIdentifier::SalesforceIdentifier(
14743                v.into(),
14744            ),
14745        );
14746        self
14747    }
14748
14749    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14750    /// if it holds a `MongodbIdentifier`, `None` if the field is not set or
14751    /// holds a different branch.
14752    pub fn mongodb_identifier(
14753        &self,
14754    ) -> std::option::Option<
14755        &std::boxed::Box<crate::model::source_object_identifier::MongodbObjectIdentifier>,
14756    > {
14757        #[allow(unreachable_patterns)]
14758        self.source_identifier.as_ref().and_then(|v| match v {
14759            crate::model::source_object_identifier::SourceIdentifier::MongodbIdentifier(v) => {
14760                std::option::Option::Some(v)
14761            }
14762            _ => std::option::Option::None,
14763        })
14764    }
14765
14766    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14767    /// to hold a `MongodbIdentifier`.
14768    ///
14769    /// Note that all the setters affecting `source_identifier` are
14770    /// mutually exclusive.
14771    ///
14772    /// # Example
14773    /// ```ignore,no_run
14774    /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14775    /// use google_cloud_datastream_v1::model::source_object_identifier::MongodbObjectIdentifier;
14776    /// let x = SourceObjectIdentifier::new().set_mongodb_identifier(MongodbObjectIdentifier::default()/* use setters */);
14777    /// assert!(x.mongodb_identifier().is_some());
14778    /// assert!(x.oracle_identifier().is_none());
14779    /// assert!(x.mysql_identifier().is_none());
14780    /// assert!(x.postgresql_identifier().is_none());
14781    /// assert!(x.sql_server_identifier().is_none());
14782    /// assert!(x.salesforce_identifier().is_none());
14783    /// ```
14784    pub fn set_mongodb_identifier<
14785        T: std::convert::Into<
14786                std::boxed::Box<crate::model::source_object_identifier::MongodbObjectIdentifier>,
14787            >,
14788    >(
14789        mut self,
14790        v: T,
14791    ) -> Self {
14792        self.source_identifier = std::option::Option::Some(
14793            crate::model::source_object_identifier::SourceIdentifier::MongodbIdentifier(v.into()),
14794        );
14795        self
14796    }
14797}
14798
14799impl wkt::message::Message for SourceObjectIdentifier {
14800    fn typename() -> &'static str {
14801        "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier"
14802    }
14803}
14804
14805/// Defines additional types related to [SourceObjectIdentifier].
14806pub mod source_object_identifier {
14807    #[allow(unused_imports)]
14808    use super::*;
14809
14810    /// Oracle data source object identifier.
14811    #[derive(Clone, Default, PartialEq)]
14812    #[non_exhaustive]
14813    pub struct OracleObjectIdentifier {
14814        /// Required. The schema name.
14815        pub schema: std::string::String,
14816
14817        /// Required. The table name.
14818        pub table: std::string::String,
14819
14820        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14821    }
14822
14823    impl OracleObjectIdentifier {
14824        pub fn new() -> Self {
14825            std::default::Default::default()
14826        }
14827
14828        /// Sets the value of [schema][crate::model::source_object_identifier::OracleObjectIdentifier::schema].
14829        ///
14830        /// # Example
14831        /// ```ignore,no_run
14832        /// # use google_cloud_datastream_v1::model::source_object_identifier::OracleObjectIdentifier;
14833        /// let x = OracleObjectIdentifier::new().set_schema("example");
14834        /// ```
14835        pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14836            self.schema = v.into();
14837            self
14838        }
14839
14840        /// Sets the value of [table][crate::model::source_object_identifier::OracleObjectIdentifier::table].
14841        ///
14842        /// # Example
14843        /// ```ignore,no_run
14844        /// # use google_cloud_datastream_v1::model::source_object_identifier::OracleObjectIdentifier;
14845        /// let x = OracleObjectIdentifier::new().set_table("example");
14846        /// ```
14847        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14848            self.table = v.into();
14849            self
14850        }
14851    }
14852
14853    impl wkt::message::Message for OracleObjectIdentifier {
14854        fn typename() -> &'static str {
14855            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.OracleObjectIdentifier"
14856        }
14857    }
14858
14859    /// PostgreSQL data source object identifier.
14860    #[derive(Clone, Default, PartialEq)]
14861    #[non_exhaustive]
14862    pub struct PostgresqlObjectIdentifier {
14863        /// Required. The schema name.
14864        pub schema: std::string::String,
14865
14866        /// Required. The table name.
14867        pub table: std::string::String,
14868
14869        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14870    }
14871
14872    impl PostgresqlObjectIdentifier {
14873        pub fn new() -> Self {
14874            std::default::Default::default()
14875        }
14876
14877        /// Sets the value of [schema][crate::model::source_object_identifier::PostgresqlObjectIdentifier::schema].
14878        ///
14879        /// # Example
14880        /// ```ignore,no_run
14881        /// # use google_cloud_datastream_v1::model::source_object_identifier::PostgresqlObjectIdentifier;
14882        /// let x = PostgresqlObjectIdentifier::new().set_schema("example");
14883        /// ```
14884        pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14885            self.schema = v.into();
14886            self
14887        }
14888
14889        /// Sets the value of [table][crate::model::source_object_identifier::PostgresqlObjectIdentifier::table].
14890        ///
14891        /// # Example
14892        /// ```ignore,no_run
14893        /// # use google_cloud_datastream_v1::model::source_object_identifier::PostgresqlObjectIdentifier;
14894        /// let x = PostgresqlObjectIdentifier::new().set_table("example");
14895        /// ```
14896        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14897            self.table = v.into();
14898            self
14899        }
14900    }
14901
14902    impl wkt::message::Message for PostgresqlObjectIdentifier {
14903        fn typename() -> &'static str {
14904            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.PostgresqlObjectIdentifier"
14905        }
14906    }
14907
14908    /// Mysql data source object identifier.
14909    #[derive(Clone, Default, PartialEq)]
14910    #[non_exhaustive]
14911    pub struct MysqlObjectIdentifier {
14912        /// Required. The database name.
14913        pub database: std::string::String,
14914
14915        /// Required. The table name.
14916        pub table: std::string::String,
14917
14918        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14919    }
14920
14921    impl MysqlObjectIdentifier {
14922        pub fn new() -> Self {
14923            std::default::Default::default()
14924        }
14925
14926        /// Sets the value of [database][crate::model::source_object_identifier::MysqlObjectIdentifier::database].
14927        ///
14928        /// # Example
14929        /// ```ignore,no_run
14930        /// # use google_cloud_datastream_v1::model::source_object_identifier::MysqlObjectIdentifier;
14931        /// let x = MysqlObjectIdentifier::new().set_database("example");
14932        /// ```
14933        pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14934            self.database = v.into();
14935            self
14936        }
14937
14938        /// Sets the value of [table][crate::model::source_object_identifier::MysqlObjectIdentifier::table].
14939        ///
14940        /// # Example
14941        /// ```ignore,no_run
14942        /// # use google_cloud_datastream_v1::model::source_object_identifier::MysqlObjectIdentifier;
14943        /// let x = MysqlObjectIdentifier::new().set_table("example");
14944        /// ```
14945        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14946            self.table = v.into();
14947            self
14948        }
14949    }
14950
14951    impl wkt::message::Message for MysqlObjectIdentifier {
14952        fn typename() -> &'static str {
14953            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.MysqlObjectIdentifier"
14954        }
14955    }
14956
14957    /// SQLServer data source object identifier.
14958    #[derive(Clone, Default, PartialEq)]
14959    #[non_exhaustive]
14960    pub struct SqlServerObjectIdentifier {
14961        /// Required. The schema name.
14962        pub schema: std::string::String,
14963
14964        /// Required. The table name.
14965        pub table: std::string::String,
14966
14967        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14968    }
14969
14970    impl SqlServerObjectIdentifier {
14971        pub fn new() -> Self {
14972            std::default::Default::default()
14973        }
14974
14975        /// Sets the value of [schema][crate::model::source_object_identifier::SqlServerObjectIdentifier::schema].
14976        ///
14977        /// # Example
14978        /// ```ignore,no_run
14979        /// # use google_cloud_datastream_v1::model::source_object_identifier::SqlServerObjectIdentifier;
14980        /// let x = SqlServerObjectIdentifier::new().set_schema("example");
14981        /// ```
14982        pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14983            self.schema = v.into();
14984            self
14985        }
14986
14987        /// Sets the value of [table][crate::model::source_object_identifier::SqlServerObjectIdentifier::table].
14988        ///
14989        /// # Example
14990        /// ```ignore,no_run
14991        /// # use google_cloud_datastream_v1::model::source_object_identifier::SqlServerObjectIdentifier;
14992        /// let x = SqlServerObjectIdentifier::new().set_table("example");
14993        /// ```
14994        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14995            self.table = v.into();
14996            self
14997        }
14998    }
14999
15000    impl wkt::message::Message for SqlServerObjectIdentifier {
15001        fn typename() -> &'static str {
15002            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.SqlServerObjectIdentifier"
15003        }
15004    }
15005
15006    /// Salesforce data source object identifier.
15007    #[derive(Clone, Default, PartialEq)]
15008    #[non_exhaustive]
15009    pub struct SalesforceObjectIdentifier {
15010        /// Required. The object name.
15011        pub object_name: std::string::String,
15012
15013        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15014    }
15015
15016    impl SalesforceObjectIdentifier {
15017        pub fn new() -> Self {
15018            std::default::Default::default()
15019        }
15020
15021        /// Sets the value of [object_name][crate::model::source_object_identifier::SalesforceObjectIdentifier::object_name].
15022        ///
15023        /// # Example
15024        /// ```ignore,no_run
15025        /// # use google_cloud_datastream_v1::model::source_object_identifier::SalesforceObjectIdentifier;
15026        /// let x = SalesforceObjectIdentifier::new().set_object_name("example");
15027        /// ```
15028        pub fn set_object_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15029            self.object_name = v.into();
15030            self
15031        }
15032    }
15033
15034    impl wkt::message::Message for SalesforceObjectIdentifier {
15035        fn typename() -> &'static str {
15036            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.SalesforceObjectIdentifier"
15037        }
15038    }
15039
15040    /// MongoDB data source object identifier.
15041    #[derive(Clone, Default, PartialEq)]
15042    #[non_exhaustive]
15043    pub struct MongodbObjectIdentifier {
15044        /// Required. The database name.
15045        pub database: std::string::String,
15046
15047        /// Required. The collection name.
15048        pub collection: std::string::String,
15049
15050        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15051    }
15052
15053    impl MongodbObjectIdentifier {
15054        pub fn new() -> Self {
15055            std::default::Default::default()
15056        }
15057
15058        /// Sets the value of [database][crate::model::source_object_identifier::MongodbObjectIdentifier::database].
15059        ///
15060        /// # Example
15061        /// ```ignore,no_run
15062        /// # use google_cloud_datastream_v1::model::source_object_identifier::MongodbObjectIdentifier;
15063        /// let x = MongodbObjectIdentifier::new().set_database("example");
15064        /// ```
15065        pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15066            self.database = v.into();
15067            self
15068        }
15069
15070        /// Sets the value of [collection][crate::model::source_object_identifier::MongodbObjectIdentifier::collection].
15071        ///
15072        /// # Example
15073        /// ```ignore,no_run
15074        /// # use google_cloud_datastream_v1::model::source_object_identifier::MongodbObjectIdentifier;
15075        /// let x = MongodbObjectIdentifier::new().set_collection("example");
15076        /// ```
15077        pub fn set_collection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15078            self.collection = v.into();
15079            self
15080        }
15081    }
15082
15083    impl wkt::message::Message for MongodbObjectIdentifier {
15084        fn typename() -> &'static str {
15085            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.MongodbObjectIdentifier"
15086        }
15087    }
15088
15089    /// The identifier for an object in the data source.
15090    #[derive(Clone, Debug, PartialEq)]
15091    #[non_exhaustive]
15092    pub enum SourceIdentifier {
15093        /// Oracle data source object identifier.
15094        OracleIdentifier(
15095            std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
15096        ),
15097        /// Mysql data source object identifier.
15098        MysqlIdentifier(
15099            std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
15100        ),
15101        /// PostgreSQL data source object identifier.
15102        PostgresqlIdentifier(
15103            std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
15104        ),
15105        /// SQLServer data source object identifier.
15106        SqlServerIdentifier(
15107            std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
15108        ),
15109        /// Salesforce data source object identifier.
15110        SalesforceIdentifier(
15111            std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>,
15112        ),
15113        /// MongoDB data source object identifier.
15114        MongodbIdentifier(
15115            std::boxed::Box<crate::model::source_object_identifier::MongodbObjectIdentifier>,
15116        ),
15117    }
15118}
15119
15120/// Represents a backfill job on a specific stream object.
15121#[derive(Clone, Default, PartialEq)]
15122#[non_exhaustive]
15123pub struct BackfillJob {
15124    /// Output only. Backfill job state.
15125    pub state: crate::model::backfill_job::State,
15126
15127    /// Backfill job's triggering reason.
15128    pub trigger: crate::model::backfill_job::Trigger,
15129
15130    /// Output only. Backfill job's start time.
15131    pub last_start_time: std::option::Option<wkt::Timestamp>,
15132
15133    /// Output only. Backfill job's end time.
15134    pub last_end_time: std::option::Option<wkt::Timestamp>,
15135
15136    /// Output only. Errors which caused the backfill job to fail.
15137    pub errors: std::vec::Vec<crate::model::Error>,
15138
15139    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15140}
15141
15142impl BackfillJob {
15143    pub fn new() -> Self {
15144        std::default::Default::default()
15145    }
15146
15147    /// Sets the value of [state][crate::model::BackfillJob::state].
15148    ///
15149    /// # Example
15150    /// ```ignore,no_run
15151    /// # use google_cloud_datastream_v1::model::BackfillJob;
15152    /// use google_cloud_datastream_v1::model::backfill_job::State;
15153    /// let x0 = BackfillJob::new().set_state(State::NotStarted);
15154    /// let x1 = BackfillJob::new().set_state(State::Pending);
15155    /// let x2 = BackfillJob::new().set_state(State::Active);
15156    /// ```
15157    pub fn set_state<T: std::convert::Into<crate::model::backfill_job::State>>(
15158        mut self,
15159        v: T,
15160    ) -> Self {
15161        self.state = v.into();
15162        self
15163    }
15164
15165    /// Sets the value of [trigger][crate::model::BackfillJob::trigger].
15166    ///
15167    /// # Example
15168    /// ```ignore,no_run
15169    /// # use google_cloud_datastream_v1::model::BackfillJob;
15170    /// use google_cloud_datastream_v1::model::backfill_job::Trigger;
15171    /// let x0 = BackfillJob::new().set_trigger(Trigger::Automatic);
15172    /// let x1 = BackfillJob::new().set_trigger(Trigger::Manual);
15173    /// ```
15174    pub fn set_trigger<T: std::convert::Into<crate::model::backfill_job::Trigger>>(
15175        mut self,
15176        v: T,
15177    ) -> Self {
15178        self.trigger = v.into();
15179        self
15180    }
15181
15182    /// Sets the value of [last_start_time][crate::model::BackfillJob::last_start_time].
15183    ///
15184    /// # Example
15185    /// ```ignore,no_run
15186    /// # use google_cloud_datastream_v1::model::BackfillJob;
15187    /// use wkt::Timestamp;
15188    /// let x = BackfillJob::new().set_last_start_time(Timestamp::default()/* use setters */);
15189    /// ```
15190    pub fn set_last_start_time<T>(mut self, v: T) -> Self
15191    where
15192        T: std::convert::Into<wkt::Timestamp>,
15193    {
15194        self.last_start_time = std::option::Option::Some(v.into());
15195        self
15196    }
15197
15198    /// Sets or clears the value of [last_start_time][crate::model::BackfillJob::last_start_time].
15199    ///
15200    /// # Example
15201    /// ```ignore,no_run
15202    /// # use google_cloud_datastream_v1::model::BackfillJob;
15203    /// use wkt::Timestamp;
15204    /// let x = BackfillJob::new().set_or_clear_last_start_time(Some(Timestamp::default()/* use setters */));
15205    /// let x = BackfillJob::new().set_or_clear_last_start_time(None::<Timestamp>);
15206    /// ```
15207    pub fn set_or_clear_last_start_time<T>(mut self, v: std::option::Option<T>) -> Self
15208    where
15209        T: std::convert::Into<wkt::Timestamp>,
15210    {
15211        self.last_start_time = v.map(|x| x.into());
15212        self
15213    }
15214
15215    /// Sets the value of [last_end_time][crate::model::BackfillJob::last_end_time].
15216    ///
15217    /// # Example
15218    /// ```ignore,no_run
15219    /// # use google_cloud_datastream_v1::model::BackfillJob;
15220    /// use wkt::Timestamp;
15221    /// let x = BackfillJob::new().set_last_end_time(Timestamp::default()/* use setters */);
15222    /// ```
15223    pub fn set_last_end_time<T>(mut self, v: T) -> Self
15224    where
15225        T: std::convert::Into<wkt::Timestamp>,
15226    {
15227        self.last_end_time = std::option::Option::Some(v.into());
15228        self
15229    }
15230
15231    /// Sets or clears the value of [last_end_time][crate::model::BackfillJob::last_end_time].
15232    ///
15233    /// # Example
15234    /// ```ignore,no_run
15235    /// # use google_cloud_datastream_v1::model::BackfillJob;
15236    /// use wkt::Timestamp;
15237    /// let x = BackfillJob::new().set_or_clear_last_end_time(Some(Timestamp::default()/* use setters */));
15238    /// let x = BackfillJob::new().set_or_clear_last_end_time(None::<Timestamp>);
15239    /// ```
15240    pub fn set_or_clear_last_end_time<T>(mut self, v: std::option::Option<T>) -> Self
15241    where
15242        T: std::convert::Into<wkt::Timestamp>,
15243    {
15244        self.last_end_time = v.map(|x| x.into());
15245        self
15246    }
15247
15248    /// Sets the value of [errors][crate::model::BackfillJob::errors].
15249    ///
15250    /// # Example
15251    /// ```ignore,no_run
15252    /// # use google_cloud_datastream_v1::model::BackfillJob;
15253    /// use google_cloud_datastream_v1::model::Error;
15254    /// let x = BackfillJob::new()
15255    ///     .set_errors([
15256    ///         Error::default()/* use setters */,
15257    ///         Error::default()/* use (different) setters */,
15258    ///     ]);
15259    /// ```
15260    pub fn set_errors<T, V>(mut self, v: T) -> Self
15261    where
15262        T: std::iter::IntoIterator<Item = V>,
15263        V: std::convert::Into<crate::model::Error>,
15264    {
15265        use std::iter::Iterator;
15266        self.errors = v.into_iter().map(|i| i.into()).collect();
15267        self
15268    }
15269}
15270
15271impl wkt::message::Message for BackfillJob {
15272    fn typename() -> &'static str {
15273        "type.googleapis.com/google.cloud.datastream.v1.BackfillJob"
15274    }
15275}
15276
15277/// Defines additional types related to [BackfillJob].
15278pub mod backfill_job {
15279    #[allow(unused_imports)]
15280    use super::*;
15281
15282    /// State of the stream object's backfill job.
15283    ///
15284    /// # Working with unknown values
15285    ///
15286    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15287    /// additional enum variants at any time. Adding new variants is not considered
15288    /// a breaking change. Applications should write their code in anticipation of:
15289    ///
15290    /// - New values appearing in future releases of the client library, **and**
15291    /// - New values received dynamically, without application changes.
15292    ///
15293    /// Please consult the [Working with enums] section in the user guide for some
15294    /// guidelines.
15295    ///
15296    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15297    #[derive(Clone, Debug, PartialEq)]
15298    #[non_exhaustive]
15299    pub enum State {
15300        /// Default value.
15301        Unspecified,
15302        /// Backfill job was never started for the stream object (stream has backfill
15303        /// strategy defined as manual or object was explicitly excluded from
15304        /// automatic backfill).
15305        NotStarted,
15306        /// Backfill job will start pending available resources.
15307        Pending,
15308        /// Backfill job is running.
15309        Active,
15310        /// Backfill job stopped (next job run will start from beginning).
15311        Stopped,
15312        /// Backfill job failed (due to an error).
15313        Failed,
15314        /// Backfill completed successfully.
15315        Completed,
15316        /// Backfill job failed since the table structure is currently unsupported
15317        /// for backfill.
15318        Unsupported,
15319        /// If set, the enum was initialized with an unknown value.
15320        ///
15321        /// Applications can examine the value using [State::value] or
15322        /// [State::name].
15323        UnknownValue(state::UnknownValue),
15324    }
15325
15326    #[doc(hidden)]
15327    pub mod state {
15328        #[allow(unused_imports)]
15329        use super::*;
15330        #[derive(Clone, Debug, PartialEq)]
15331        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15332    }
15333
15334    impl State {
15335        /// Gets the enum value.
15336        ///
15337        /// Returns `None` if the enum contains an unknown value deserialized from
15338        /// the string representation of enums.
15339        pub fn value(&self) -> std::option::Option<i32> {
15340            match self {
15341                Self::Unspecified => std::option::Option::Some(0),
15342                Self::NotStarted => std::option::Option::Some(1),
15343                Self::Pending => std::option::Option::Some(2),
15344                Self::Active => std::option::Option::Some(3),
15345                Self::Stopped => std::option::Option::Some(4),
15346                Self::Failed => std::option::Option::Some(5),
15347                Self::Completed => std::option::Option::Some(6),
15348                Self::Unsupported => std::option::Option::Some(7),
15349                Self::UnknownValue(u) => u.0.value(),
15350            }
15351        }
15352
15353        /// Gets the enum value as a string.
15354        ///
15355        /// Returns `None` if the enum contains an unknown value deserialized from
15356        /// the integer representation of enums.
15357        pub fn name(&self) -> std::option::Option<&str> {
15358            match self {
15359                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
15360                Self::NotStarted => std::option::Option::Some("NOT_STARTED"),
15361                Self::Pending => std::option::Option::Some("PENDING"),
15362                Self::Active => std::option::Option::Some("ACTIVE"),
15363                Self::Stopped => std::option::Option::Some("STOPPED"),
15364                Self::Failed => std::option::Option::Some("FAILED"),
15365                Self::Completed => std::option::Option::Some("COMPLETED"),
15366                Self::Unsupported => std::option::Option::Some("UNSUPPORTED"),
15367                Self::UnknownValue(u) => u.0.name(),
15368            }
15369        }
15370    }
15371
15372    impl std::default::Default for State {
15373        fn default() -> Self {
15374            use std::convert::From;
15375            Self::from(0)
15376        }
15377    }
15378
15379    impl std::fmt::Display for State {
15380        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15381            wkt::internal::display_enum(f, self.name(), self.value())
15382        }
15383    }
15384
15385    impl std::convert::From<i32> for State {
15386        fn from(value: i32) -> Self {
15387            match value {
15388                0 => Self::Unspecified,
15389                1 => Self::NotStarted,
15390                2 => Self::Pending,
15391                3 => Self::Active,
15392                4 => Self::Stopped,
15393                5 => Self::Failed,
15394                6 => Self::Completed,
15395                7 => Self::Unsupported,
15396                _ => Self::UnknownValue(state::UnknownValue(
15397                    wkt::internal::UnknownEnumValue::Integer(value),
15398                )),
15399            }
15400        }
15401    }
15402
15403    impl std::convert::From<&str> for State {
15404        fn from(value: &str) -> Self {
15405            use std::string::ToString;
15406            match value {
15407                "STATE_UNSPECIFIED" => Self::Unspecified,
15408                "NOT_STARTED" => Self::NotStarted,
15409                "PENDING" => Self::Pending,
15410                "ACTIVE" => Self::Active,
15411                "STOPPED" => Self::Stopped,
15412                "FAILED" => Self::Failed,
15413                "COMPLETED" => Self::Completed,
15414                "UNSUPPORTED" => Self::Unsupported,
15415                _ => Self::UnknownValue(state::UnknownValue(
15416                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15417                )),
15418            }
15419        }
15420    }
15421
15422    impl serde::ser::Serialize for State {
15423        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15424        where
15425            S: serde::Serializer,
15426        {
15427            match self {
15428                Self::Unspecified => serializer.serialize_i32(0),
15429                Self::NotStarted => serializer.serialize_i32(1),
15430                Self::Pending => serializer.serialize_i32(2),
15431                Self::Active => serializer.serialize_i32(3),
15432                Self::Stopped => serializer.serialize_i32(4),
15433                Self::Failed => serializer.serialize_i32(5),
15434                Self::Completed => serializer.serialize_i32(6),
15435                Self::Unsupported => serializer.serialize_i32(7),
15436                Self::UnknownValue(u) => u.0.serialize(serializer),
15437            }
15438        }
15439    }
15440
15441    impl<'de> serde::de::Deserialize<'de> for State {
15442        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15443        where
15444            D: serde::Deserializer<'de>,
15445        {
15446            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
15447                ".google.cloud.datastream.v1.BackfillJob.State",
15448            ))
15449        }
15450    }
15451
15452    /// Triggering reason for a backfill job.
15453    ///
15454    /// # Working with unknown values
15455    ///
15456    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15457    /// additional enum variants at any time. Adding new variants is not considered
15458    /// a breaking change. Applications should write their code in anticipation of:
15459    ///
15460    /// - New values appearing in future releases of the client library, **and**
15461    /// - New values received dynamically, without application changes.
15462    ///
15463    /// Please consult the [Working with enums] section in the user guide for some
15464    /// guidelines.
15465    ///
15466    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15467    #[derive(Clone, Debug, PartialEq)]
15468    #[non_exhaustive]
15469    pub enum Trigger {
15470        /// Default value.
15471        Unspecified,
15472        /// Object backfill job was triggered automatically according to the stream's
15473        /// backfill strategy.
15474        Automatic,
15475        /// Object backfill job was triggered manually using the dedicated API.
15476        Manual,
15477        /// If set, the enum was initialized with an unknown value.
15478        ///
15479        /// Applications can examine the value using [Trigger::value] or
15480        /// [Trigger::name].
15481        UnknownValue(trigger::UnknownValue),
15482    }
15483
15484    #[doc(hidden)]
15485    pub mod trigger {
15486        #[allow(unused_imports)]
15487        use super::*;
15488        #[derive(Clone, Debug, PartialEq)]
15489        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15490    }
15491
15492    impl Trigger {
15493        /// Gets the enum value.
15494        ///
15495        /// Returns `None` if the enum contains an unknown value deserialized from
15496        /// the string representation of enums.
15497        pub fn value(&self) -> std::option::Option<i32> {
15498            match self {
15499                Self::Unspecified => std::option::Option::Some(0),
15500                Self::Automatic => std::option::Option::Some(1),
15501                Self::Manual => std::option::Option::Some(2),
15502                Self::UnknownValue(u) => u.0.value(),
15503            }
15504        }
15505
15506        /// Gets the enum value as a string.
15507        ///
15508        /// Returns `None` if the enum contains an unknown value deserialized from
15509        /// the integer representation of enums.
15510        pub fn name(&self) -> std::option::Option<&str> {
15511            match self {
15512                Self::Unspecified => std::option::Option::Some("TRIGGER_UNSPECIFIED"),
15513                Self::Automatic => std::option::Option::Some("AUTOMATIC"),
15514                Self::Manual => std::option::Option::Some("MANUAL"),
15515                Self::UnknownValue(u) => u.0.name(),
15516            }
15517        }
15518    }
15519
15520    impl std::default::Default for Trigger {
15521        fn default() -> Self {
15522            use std::convert::From;
15523            Self::from(0)
15524        }
15525    }
15526
15527    impl std::fmt::Display for Trigger {
15528        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15529            wkt::internal::display_enum(f, self.name(), self.value())
15530        }
15531    }
15532
15533    impl std::convert::From<i32> for Trigger {
15534        fn from(value: i32) -> Self {
15535            match value {
15536                0 => Self::Unspecified,
15537                1 => Self::Automatic,
15538                2 => Self::Manual,
15539                _ => Self::UnknownValue(trigger::UnknownValue(
15540                    wkt::internal::UnknownEnumValue::Integer(value),
15541                )),
15542            }
15543        }
15544    }
15545
15546    impl std::convert::From<&str> for Trigger {
15547        fn from(value: &str) -> Self {
15548            use std::string::ToString;
15549            match value {
15550                "TRIGGER_UNSPECIFIED" => Self::Unspecified,
15551                "AUTOMATIC" => Self::Automatic,
15552                "MANUAL" => Self::Manual,
15553                _ => Self::UnknownValue(trigger::UnknownValue(
15554                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15555                )),
15556            }
15557        }
15558    }
15559
15560    impl serde::ser::Serialize for Trigger {
15561        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15562        where
15563            S: serde::Serializer,
15564        {
15565            match self {
15566                Self::Unspecified => serializer.serialize_i32(0),
15567                Self::Automatic => serializer.serialize_i32(1),
15568                Self::Manual => serializer.serialize_i32(2),
15569                Self::UnknownValue(u) => u.0.serialize(serializer),
15570            }
15571        }
15572    }
15573
15574    impl<'de> serde::de::Deserialize<'de> for Trigger {
15575        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15576        where
15577            D: serde::Deserializer<'de>,
15578        {
15579            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Trigger>::new(
15580                ".google.cloud.datastream.v1.BackfillJob.Trigger",
15581            ))
15582        }
15583    }
15584}
15585
15586/// Represent a user-facing Error.
15587#[derive(Clone, Default, PartialEq)]
15588#[non_exhaustive]
15589pub struct Error {
15590    /// A title that explains the reason for the error.
15591    pub reason: std::string::String,
15592
15593    /// A unique identifier for this specific error,
15594    /// allowing it to be traced throughout the system in logs and API responses.
15595    pub error_uuid: std::string::String,
15596
15597    /// A message containing more information about the error that occurred.
15598    pub message: std::string::String,
15599
15600    /// The time when the error occurred.
15601    pub error_time: std::option::Option<wkt::Timestamp>,
15602
15603    /// Additional information about the error.
15604    pub details: std::collections::HashMap<std::string::String, std::string::String>,
15605
15606    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15607}
15608
15609impl Error {
15610    pub fn new() -> Self {
15611        std::default::Default::default()
15612    }
15613
15614    /// Sets the value of [reason][crate::model::Error::reason].
15615    ///
15616    /// # Example
15617    /// ```ignore,no_run
15618    /// # use google_cloud_datastream_v1::model::Error;
15619    /// let x = Error::new().set_reason("example");
15620    /// ```
15621    pub fn set_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15622        self.reason = v.into();
15623        self
15624    }
15625
15626    /// Sets the value of [error_uuid][crate::model::Error::error_uuid].
15627    ///
15628    /// # Example
15629    /// ```ignore,no_run
15630    /// # use google_cloud_datastream_v1::model::Error;
15631    /// let x = Error::new().set_error_uuid("example");
15632    /// ```
15633    pub fn set_error_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15634        self.error_uuid = v.into();
15635        self
15636    }
15637
15638    /// Sets the value of [message][crate::model::Error::message].
15639    ///
15640    /// # Example
15641    /// ```ignore,no_run
15642    /// # use google_cloud_datastream_v1::model::Error;
15643    /// let x = Error::new().set_message("example");
15644    /// ```
15645    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15646        self.message = v.into();
15647        self
15648    }
15649
15650    /// Sets the value of [error_time][crate::model::Error::error_time].
15651    ///
15652    /// # Example
15653    /// ```ignore,no_run
15654    /// # use google_cloud_datastream_v1::model::Error;
15655    /// use wkt::Timestamp;
15656    /// let x = Error::new().set_error_time(Timestamp::default()/* use setters */);
15657    /// ```
15658    pub fn set_error_time<T>(mut self, v: T) -> Self
15659    where
15660        T: std::convert::Into<wkt::Timestamp>,
15661    {
15662        self.error_time = std::option::Option::Some(v.into());
15663        self
15664    }
15665
15666    /// Sets or clears the value of [error_time][crate::model::Error::error_time].
15667    ///
15668    /// # Example
15669    /// ```ignore,no_run
15670    /// # use google_cloud_datastream_v1::model::Error;
15671    /// use wkt::Timestamp;
15672    /// let x = Error::new().set_or_clear_error_time(Some(Timestamp::default()/* use setters */));
15673    /// let x = Error::new().set_or_clear_error_time(None::<Timestamp>);
15674    /// ```
15675    pub fn set_or_clear_error_time<T>(mut self, v: std::option::Option<T>) -> Self
15676    where
15677        T: std::convert::Into<wkt::Timestamp>,
15678    {
15679        self.error_time = v.map(|x| x.into());
15680        self
15681    }
15682
15683    /// Sets the value of [details][crate::model::Error::details].
15684    ///
15685    /// # Example
15686    /// ```ignore,no_run
15687    /// # use google_cloud_datastream_v1::model::Error;
15688    /// let x = Error::new().set_details([
15689    ///     ("key0", "abc"),
15690    ///     ("key1", "xyz"),
15691    /// ]);
15692    /// ```
15693    pub fn set_details<T, K, V>(mut self, v: T) -> Self
15694    where
15695        T: std::iter::IntoIterator<Item = (K, V)>,
15696        K: std::convert::Into<std::string::String>,
15697        V: std::convert::Into<std::string::String>,
15698    {
15699        use std::iter::Iterator;
15700        self.details = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
15701        self
15702    }
15703}
15704
15705impl wkt::message::Message for Error {
15706    fn typename() -> &'static str {
15707        "type.googleapis.com/google.cloud.datastream.v1.Error"
15708    }
15709}
15710
15711/// Contains the current validation results.
15712#[derive(Clone, Default, PartialEq)]
15713#[non_exhaustive]
15714pub struct ValidationResult {
15715    /// A list of validations (includes both executed as well as not executed
15716    /// validations).
15717    pub validations: std::vec::Vec<crate::model::Validation>,
15718
15719    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15720}
15721
15722impl ValidationResult {
15723    pub fn new() -> Self {
15724        std::default::Default::default()
15725    }
15726
15727    /// Sets the value of [validations][crate::model::ValidationResult::validations].
15728    ///
15729    /// # Example
15730    /// ```ignore,no_run
15731    /// # use google_cloud_datastream_v1::model::ValidationResult;
15732    /// use google_cloud_datastream_v1::model::Validation;
15733    /// let x = ValidationResult::new()
15734    ///     .set_validations([
15735    ///         Validation::default()/* use setters */,
15736    ///         Validation::default()/* use (different) setters */,
15737    ///     ]);
15738    /// ```
15739    pub fn set_validations<T, V>(mut self, v: T) -> Self
15740    where
15741        T: std::iter::IntoIterator<Item = V>,
15742        V: std::convert::Into<crate::model::Validation>,
15743    {
15744        use std::iter::Iterator;
15745        self.validations = v.into_iter().map(|i| i.into()).collect();
15746        self
15747    }
15748}
15749
15750impl wkt::message::Message for ValidationResult {
15751    fn typename() -> &'static str {
15752        "type.googleapis.com/google.cloud.datastream.v1.ValidationResult"
15753    }
15754}
15755
15756/// A validation to perform on a stream.
15757#[derive(Clone, Default, PartialEq)]
15758#[non_exhaustive]
15759pub struct Validation {
15760    /// A short description of the validation.
15761    pub description: std::string::String,
15762
15763    /// Output only. Validation execution status.
15764    pub state: crate::model::validation::State,
15765
15766    /// Messages reflecting the validation results.
15767    pub message: std::vec::Vec<crate::model::ValidationMessage>,
15768
15769    /// A custom code identifying this validation.
15770    pub code: std::string::String,
15771
15772    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15773}
15774
15775impl Validation {
15776    pub fn new() -> Self {
15777        std::default::Default::default()
15778    }
15779
15780    /// Sets the value of [description][crate::model::Validation::description].
15781    ///
15782    /// # Example
15783    /// ```ignore,no_run
15784    /// # use google_cloud_datastream_v1::model::Validation;
15785    /// let x = Validation::new().set_description("example");
15786    /// ```
15787    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15788        self.description = v.into();
15789        self
15790    }
15791
15792    /// Sets the value of [state][crate::model::Validation::state].
15793    ///
15794    /// # Example
15795    /// ```ignore,no_run
15796    /// # use google_cloud_datastream_v1::model::Validation;
15797    /// use google_cloud_datastream_v1::model::validation::State;
15798    /// let x0 = Validation::new().set_state(State::NotExecuted);
15799    /// let x1 = Validation::new().set_state(State::Failed);
15800    /// let x2 = Validation::new().set_state(State::Passed);
15801    /// ```
15802    pub fn set_state<T: std::convert::Into<crate::model::validation::State>>(
15803        mut self,
15804        v: T,
15805    ) -> Self {
15806        self.state = v.into();
15807        self
15808    }
15809
15810    /// Sets the value of [message][crate::model::Validation::message].
15811    ///
15812    /// # Example
15813    /// ```ignore,no_run
15814    /// # use google_cloud_datastream_v1::model::Validation;
15815    /// use google_cloud_datastream_v1::model::ValidationMessage;
15816    /// let x = Validation::new()
15817    ///     .set_message([
15818    ///         ValidationMessage::default()/* use setters */,
15819    ///         ValidationMessage::default()/* use (different) setters */,
15820    ///     ]);
15821    /// ```
15822    pub fn set_message<T, V>(mut self, v: T) -> Self
15823    where
15824        T: std::iter::IntoIterator<Item = V>,
15825        V: std::convert::Into<crate::model::ValidationMessage>,
15826    {
15827        use std::iter::Iterator;
15828        self.message = v.into_iter().map(|i| i.into()).collect();
15829        self
15830    }
15831
15832    /// Sets the value of [code][crate::model::Validation::code].
15833    ///
15834    /// # Example
15835    /// ```ignore,no_run
15836    /// # use google_cloud_datastream_v1::model::Validation;
15837    /// let x = Validation::new().set_code("example");
15838    /// ```
15839    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15840        self.code = v.into();
15841        self
15842    }
15843}
15844
15845impl wkt::message::Message for Validation {
15846    fn typename() -> &'static str {
15847        "type.googleapis.com/google.cloud.datastream.v1.Validation"
15848    }
15849}
15850
15851/// Defines additional types related to [Validation].
15852pub mod validation {
15853    #[allow(unused_imports)]
15854    use super::*;
15855
15856    /// Validation execution state.
15857    ///
15858    /// # Working with unknown values
15859    ///
15860    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15861    /// additional enum variants at any time. Adding new variants is not considered
15862    /// a breaking change. Applications should write their code in anticipation of:
15863    ///
15864    /// - New values appearing in future releases of the client library, **and**
15865    /// - New values received dynamically, without application changes.
15866    ///
15867    /// Please consult the [Working with enums] section in the user guide for some
15868    /// guidelines.
15869    ///
15870    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15871    #[derive(Clone, Debug, PartialEq)]
15872    #[non_exhaustive]
15873    pub enum State {
15874        /// Unspecified state.
15875        Unspecified,
15876        /// Validation did not execute.
15877        NotExecuted,
15878        /// Validation failed.
15879        Failed,
15880        /// Validation passed.
15881        Passed,
15882        /// Validation executed with warnings.
15883        Warning,
15884        /// If set, the enum was initialized with an unknown value.
15885        ///
15886        /// Applications can examine the value using [State::value] or
15887        /// [State::name].
15888        UnknownValue(state::UnknownValue),
15889    }
15890
15891    #[doc(hidden)]
15892    pub mod state {
15893        #[allow(unused_imports)]
15894        use super::*;
15895        #[derive(Clone, Debug, PartialEq)]
15896        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15897    }
15898
15899    impl State {
15900        /// Gets the enum value.
15901        ///
15902        /// Returns `None` if the enum contains an unknown value deserialized from
15903        /// the string representation of enums.
15904        pub fn value(&self) -> std::option::Option<i32> {
15905            match self {
15906                Self::Unspecified => std::option::Option::Some(0),
15907                Self::NotExecuted => std::option::Option::Some(1),
15908                Self::Failed => std::option::Option::Some(2),
15909                Self::Passed => std::option::Option::Some(3),
15910                Self::Warning => std::option::Option::Some(4),
15911                Self::UnknownValue(u) => u.0.value(),
15912            }
15913        }
15914
15915        /// Gets the enum value as a string.
15916        ///
15917        /// Returns `None` if the enum contains an unknown value deserialized from
15918        /// the integer representation of enums.
15919        pub fn name(&self) -> std::option::Option<&str> {
15920            match self {
15921                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
15922                Self::NotExecuted => std::option::Option::Some("NOT_EXECUTED"),
15923                Self::Failed => std::option::Option::Some("FAILED"),
15924                Self::Passed => std::option::Option::Some("PASSED"),
15925                Self::Warning => std::option::Option::Some("WARNING"),
15926                Self::UnknownValue(u) => u.0.name(),
15927            }
15928        }
15929    }
15930
15931    impl std::default::Default for State {
15932        fn default() -> Self {
15933            use std::convert::From;
15934            Self::from(0)
15935        }
15936    }
15937
15938    impl std::fmt::Display for State {
15939        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15940            wkt::internal::display_enum(f, self.name(), self.value())
15941        }
15942    }
15943
15944    impl std::convert::From<i32> for State {
15945        fn from(value: i32) -> Self {
15946            match value {
15947                0 => Self::Unspecified,
15948                1 => Self::NotExecuted,
15949                2 => Self::Failed,
15950                3 => Self::Passed,
15951                4 => Self::Warning,
15952                _ => Self::UnknownValue(state::UnknownValue(
15953                    wkt::internal::UnknownEnumValue::Integer(value),
15954                )),
15955            }
15956        }
15957    }
15958
15959    impl std::convert::From<&str> for State {
15960        fn from(value: &str) -> Self {
15961            use std::string::ToString;
15962            match value {
15963                "STATE_UNSPECIFIED" => Self::Unspecified,
15964                "NOT_EXECUTED" => Self::NotExecuted,
15965                "FAILED" => Self::Failed,
15966                "PASSED" => Self::Passed,
15967                "WARNING" => Self::Warning,
15968                _ => Self::UnknownValue(state::UnknownValue(
15969                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15970                )),
15971            }
15972        }
15973    }
15974
15975    impl serde::ser::Serialize for State {
15976        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15977        where
15978            S: serde::Serializer,
15979        {
15980            match self {
15981                Self::Unspecified => serializer.serialize_i32(0),
15982                Self::NotExecuted => serializer.serialize_i32(1),
15983                Self::Failed => serializer.serialize_i32(2),
15984                Self::Passed => serializer.serialize_i32(3),
15985                Self::Warning => serializer.serialize_i32(4),
15986                Self::UnknownValue(u) => u.0.serialize(serializer),
15987            }
15988        }
15989    }
15990
15991    impl<'de> serde::de::Deserialize<'de> for State {
15992        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15993        where
15994            D: serde::Deserializer<'de>,
15995        {
15996            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
15997                ".google.cloud.datastream.v1.Validation.State",
15998            ))
15999        }
16000    }
16001}
16002
16003/// Represent user-facing validation result message.
16004#[derive(Clone, Default, PartialEq)]
16005#[non_exhaustive]
16006pub struct ValidationMessage {
16007    /// The result of the validation.
16008    pub message: std::string::String,
16009
16010    /// Message severity level (warning or error).
16011    pub level: crate::model::validation_message::Level,
16012
16013    /// Additional metadata related to the result.
16014    pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
16015
16016    /// A custom code identifying this specific message.
16017    pub code: std::string::String,
16018
16019    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16020}
16021
16022impl ValidationMessage {
16023    pub fn new() -> Self {
16024        std::default::Default::default()
16025    }
16026
16027    /// Sets the value of [message][crate::model::ValidationMessage::message].
16028    ///
16029    /// # Example
16030    /// ```ignore,no_run
16031    /// # use google_cloud_datastream_v1::model::ValidationMessage;
16032    /// let x = ValidationMessage::new().set_message("example");
16033    /// ```
16034    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16035        self.message = v.into();
16036        self
16037    }
16038
16039    /// Sets the value of [level][crate::model::ValidationMessage::level].
16040    ///
16041    /// # Example
16042    /// ```ignore,no_run
16043    /// # use google_cloud_datastream_v1::model::ValidationMessage;
16044    /// use google_cloud_datastream_v1::model::validation_message::Level;
16045    /// let x0 = ValidationMessage::new().set_level(Level::Warning);
16046    /// let x1 = ValidationMessage::new().set_level(Level::Error);
16047    /// ```
16048    pub fn set_level<T: std::convert::Into<crate::model::validation_message::Level>>(
16049        mut self,
16050        v: T,
16051    ) -> Self {
16052        self.level = v.into();
16053        self
16054    }
16055
16056    /// Sets the value of [metadata][crate::model::ValidationMessage::metadata].
16057    ///
16058    /// # Example
16059    /// ```ignore,no_run
16060    /// # use google_cloud_datastream_v1::model::ValidationMessage;
16061    /// let x = ValidationMessage::new().set_metadata([
16062    ///     ("key0", "abc"),
16063    ///     ("key1", "xyz"),
16064    /// ]);
16065    /// ```
16066    pub fn set_metadata<T, K, V>(mut self, v: T) -> Self
16067    where
16068        T: std::iter::IntoIterator<Item = (K, V)>,
16069        K: std::convert::Into<std::string::String>,
16070        V: std::convert::Into<std::string::String>,
16071    {
16072        use std::iter::Iterator;
16073        self.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16074        self
16075    }
16076
16077    /// Sets the value of [code][crate::model::ValidationMessage::code].
16078    ///
16079    /// # Example
16080    /// ```ignore,no_run
16081    /// # use google_cloud_datastream_v1::model::ValidationMessage;
16082    /// let x = ValidationMessage::new().set_code("example");
16083    /// ```
16084    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16085        self.code = v.into();
16086        self
16087    }
16088}
16089
16090impl wkt::message::Message for ValidationMessage {
16091    fn typename() -> &'static str {
16092        "type.googleapis.com/google.cloud.datastream.v1.ValidationMessage"
16093    }
16094}
16095
16096/// Defines additional types related to [ValidationMessage].
16097pub mod validation_message {
16098    #[allow(unused_imports)]
16099    use super::*;
16100
16101    /// Validation message level.
16102    ///
16103    /// # Working with unknown values
16104    ///
16105    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16106    /// additional enum variants at any time. Adding new variants is not considered
16107    /// a breaking change. Applications should write their code in anticipation of:
16108    ///
16109    /// - New values appearing in future releases of the client library, **and**
16110    /// - New values received dynamically, without application changes.
16111    ///
16112    /// Please consult the [Working with enums] section in the user guide for some
16113    /// guidelines.
16114    ///
16115    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16116    #[derive(Clone, Debug, PartialEq)]
16117    #[non_exhaustive]
16118    pub enum Level {
16119        /// Unspecified level.
16120        Unspecified,
16121        /// Potentially cause issues with the Stream.
16122        Warning,
16123        /// Definitely cause issues with the Stream.
16124        Error,
16125        /// If set, the enum was initialized with an unknown value.
16126        ///
16127        /// Applications can examine the value using [Level::value] or
16128        /// [Level::name].
16129        UnknownValue(level::UnknownValue),
16130    }
16131
16132    #[doc(hidden)]
16133    pub mod level {
16134        #[allow(unused_imports)]
16135        use super::*;
16136        #[derive(Clone, Debug, PartialEq)]
16137        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16138    }
16139
16140    impl Level {
16141        /// Gets the enum value.
16142        ///
16143        /// Returns `None` if the enum contains an unknown value deserialized from
16144        /// the string representation of enums.
16145        pub fn value(&self) -> std::option::Option<i32> {
16146            match self {
16147                Self::Unspecified => std::option::Option::Some(0),
16148                Self::Warning => std::option::Option::Some(1),
16149                Self::Error => std::option::Option::Some(2),
16150                Self::UnknownValue(u) => u.0.value(),
16151            }
16152        }
16153
16154        /// Gets the enum value as a string.
16155        ///
16156        /// Returns `None` if the enum contains an unknown value deserialized from
16157        /// the integer representation of enums.
16158        pub fn name(&self) -> std::option::Option<&str> {
16159            match self {
16160                Self::Unspecified => std::option::Option::Some("LEVEL_UNSPECIFIED"),
16161                Self::Warning => std::option::Option::Some("WARNING"),
16162                Self::Error => std::option::Option::Some("ERROR"),
16163                Self::UnknownValue(u) => u.0.name(),
16164            }
16165        }
16166    }
16167
16168    impl std::default::Default for Level {
16169        fn default() -> Self {
16170            use std::convert::From;
16171            Self::from(0)
16172        }
16173    }
16174
16175    impl std::fmt::Display for Level {
16176        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16177            wkt::internal::display_enum(f, self.name(), self.value())
16178        }
16179    }
16180
16181    impl std::convert::From<i32> for Level {
16182        fn from(value: i32) -> Self {
16183            match value {
16184                0 => Self::Unspecified,
16185                1 => Self::Warning,
16186                2 => Self::Error,
16187                _ => Self::UnknownValue(level::UnknownValue(
16188                    wkt::internal::UnknownEnumValue::Integer(value),
16189                )),
16190            }
16191        }
16192    }
16193
16194    impl std::convert::From<&str> for Level {
16195        fn from(value: &str) -> Self {
16196            use std::string::ToString;
16197            match value {
16198                "LEVEL_UNSPECIFIED" => Self::Unspecified,
16199                "WARNING" => Self::Warning,
16200                "ERROR" => Self::Error,
16201                _ => Self::UnknownValue(level::UnknownValue(
16202                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16203                )),
16204            }
16205        }
16206    }
16207
16208    impl serde::ser::Serialize for Level {
16209        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16210        where
16211            S: serde::Serializer,
16212        {
16213            match self {
16214                Self::Unspecified => serializer.serialize_i32(0),
16215                Self::Warning => serializer.serialize_i32(1),
16216                Self::Error => serializer.serialize_i32(2),
16217                Self::UnknownValue(u) => u.0.serialize(serializer),
16218            }
16219        }
16220    }
16221
16222    impl<'de> serde::de::Deserialize<'de> for Level {
16223        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16224        where
16225            D: serde::Deserializer<'de>,
16226        {
16227            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Level>::new(
16228                ".google.cloud.datastream.v1.ValidationMessage.Level",
16229            ))
16230        }
16231    }
16232}
16233
16234/// The strategy that the stream uses for CDC replication.
16235#[derive(Clone, Default, PartialEq)]
16236#[non_exhaustive]
16237pub struct CdcStrategy {
16238    /// The position to start reading from when starting, resuming, or recovering
16239    /// the stream.
16240    /// If not set, the system's default value will be used.
16241    pub start_position: std::option::Option<crate::model::cdc_strategy::StartPosition>,
16242
16243    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16244}
16245
16246impl CdcStrategy {
16247    pub fn new() -> Self {
16248        std::default::Default::default()
16249    }
16250
16251    /// Sets the value of [start_position][crate::model::CdcStrategy::start_position].
16252    ///
16253    /// Note that all the setters affecting `start_position` are mutually
16254    /// exclusive.
16255    ///
16256    /// # Example
16257    /// ```ignore,no_run
16258    /// # use google_cloud_datastream_v1::model::CdcStrategy;
16259    /// use google_cloud_datastream_v1::model::cdc_strategy::MostRecentStartPosition;
16260    /// let x = CdcStrategy::new().set_start_position(Some(
16261    ///     google_cloud_datastream_v1::model::cdc_strategy::StartPosition::MostRecentStartPosition(MostRecentStartPosition::default().into())));
16262    /// ```
16263    pub fn set_start_position<
16264        T: std::convert::Into<std::option::Option<crate::model::cdc_strategy::StartPosition>>,
16265    >(
16266        mut self,
16267        v: T,
16268    ) -> Self {
16269        self.start_position = v.into();
16270        self
16271    }
16272
16273    /// The value of [start_position][crate::model::CdcStrategy::start_position]
16274    /// if it holds a `MostRecentStartPosition`, `None` if the field is not set or
16275    /// holds a different branch.
16276    pub fn most_recent_start_position(
16277        &self,
16278    ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>>
16279    {
16280        #[allow(unreachable_patterns)]
16281        self.start_position.as_ref().and_then(|v| match v {
16282            crate::model::cdc_strategy::StartPosition::MostRecentStartPosition(v) => {
16283                std::option::Option::Some(v)
16284            }
16285            _ => std::option::Option::None,
16286        })
16287    }
16288
16289    /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
16290    /// to hold a `MostRecentStartPosition`.
16291    ///
16292    /// Note that all the setters affecting `start_position` are
16293    /// mutually exclusive.
16294    ///
16295    /// # Example
16296    /// ```ignore,no_run
16297    /// # use google_cloud_datastream_v1::model::CdcStrategy;
16298    /// use google_cloud_datastream_v1::model::cdc_strategy::MostRecentStartPosition;
16299    /// let x = CdcStrategy::new().set_most_recent_start_position(MostRecentStartPosition::default()/* use setters */);
16300    /// assert!(x.most_recent_start_position().is_some());
16301    /// assert!(x.next_available_start_position().is_none());
16302    /// assert!(x.specific_start_position().is_none());
16303    /// ```
16304    pub fn set_most_recent_start_position<
16305        T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>>,
16306    >(
16307        mut self,
16308        v: T,
16309    ) -> Self {
16310        self.start_position = std::option::Option::Some(
16311            crate::model::cdc_strategy::StartPosition::MostRecentStartPosition(v.into()),
16312        );
16313        self
16314    }
16315
16316    /// The value of [start_position][crate::model::CdcStrategy::start_position]
16317    /// if it holds a `NextAvailableStartPosition`, `None` if the field is not set or
16318    /// holds a different branch.
16319    pub fn next_available_start_position(
16320        &self,
16321    ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>>
16322    {
16323        #[allow(unreachable_patterns)]
16324        self.start_position.as_ref().and_then(|v| match v {
16325            crate::model::cdc_strategy::StartPosition::NextAvailableStartPosition(v) => {
16326                std::option::Option::Some(v)
16327            }
16328            _ => std::option::Option::None,
16329        })
16330    }
16331
16332    /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
16333    /// to hold a `NextAvailableStartPosition`.
16334    ///
16335    /// Note that all the setters affecting `start_position` are
16336    /// mutually exclusive.
16337    ///
16338    /// # Example
16339    /// ```ignore,no_run
16340    /// # use google_cloud_datastream_v1::model::CdcStrategy;
16341    /// use google_cloud_datastream_v1::model::cdc_strategy::NextAvailableStartPosition;
16342    /// let x = CdcStrategy::new().set_next_available_start_position(NextAvailableStartPosition::default()/* use setters */);
16343    /// assert!(x.next_available_start_position().is_some());
16344    /// assert!(x.most_recent_start_position().is_none());
16345    /// assert!(x.specific_start_position().is_none());
16346    /// ```
16347    pub fn set_next_available_start_position<
16348        T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>>,
16349    >(
16350        mut self,
16351        v: T,
16352    ) -> Self {
16353        self.start_position = std::option::Option::Some(
16354            crate::model::cdc_strategy::StartPosition::NextAvailableStartPosition(v.into()),
16355        );
16356        self
16357    }
16358
16359    /// The value of [start_position][crate::model::CdcStrategy::start_position]
16360    /// if it holds a `SpecificStartPosition`, `None` if the field is not set or
16361    /// holds a different branch.
16362    pub fn specific_start_position(
16363        &self,
16364    ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>>
16365    {
16366        #[allow(unreachable_patterns)]
16367        self.start_position.as_ref().and_then(|v| match v {
16368            crate::model::cdc_strategy::StartPosition::SpecificStartPosition(v) => {
16369                std::option::Option::Some(v)
16370            }
16371            _ => std::option::Option::None,
16372        })
16373    }
16374
16375    /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
16376    /// to hold a `SpecificStartPosition`.
16377    ///
16378    /// Note that all the setters affecting `start_position` are
16379    /// mutually exclusive.
16380    ///
16381    /// # Example
16382    /// ```ignore,no_run
16383    /// # use google_cloud_datastream_v1::model::CdcStrategy;
16384    /// use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16385    /// let x = CdcStrategy::new().set_specific_start_position(SpecificStartPosition::default()/* use setters */);
16386    /// assert!(x.specific_start_position().is_some());
16387    /// assert!(x.most_recent_start_position().is_none());
16388    /// assert!(x.next_available_start_position().is_none());
16389    /// ```
16390    pub fn set_specific_start_position<
16391        T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>>,
16392    >(
16393        mut self,
16394        v: T,
16395    ) -> Self {
16396        self.start_position = std::option::Option::Some(
16397            crate::model::cdc_strategy::StartPosition::SpecificStartPosition(v.into()),
16398        );
16399        self
16400    }
16401}
16402
16403impl wkt::message::Message for CdcStrategy {
16404    fn typename() -> &'static str {
16405        "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy"
16406    }
16407}
16408
16409/// Defines additional types related to [CdcStrategy].
16410pub mod cdc_strategy {
16411    #[allow(unused_imports)]
16412    use super::*;
16413
16414    /// CDC strategy to start replicating from the most recent position in the
16415    /// source.
16416    #[derive(Clone, Default, PartialEq)]
16417    #[non_exhaustive]
16418    pub struct MostRecentStartPosition {
16419        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16420    }
16421
16422    impl MostRecentStartPosition {
16423        pub fn new() -> Self {
16424            std::default::Default::default()
16425        }
16426    }
16427
16428    impl wkt::message::Message for MostRecentStartPosition {
16429        fn typename() -> &'static str {
16430            "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.MostRecentStartPosition"
16431        }
16432    }
16433
16434    /// CDC strategy to resume replication from the next available position in the
16435    /// source.
16436    #[derive(Clone, Default, PartialEq)]
16437    #[non_exhaustive]
16438    pub struct NextAvailableStartPosition {
16439        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16440    }
16441
16442    impl NextAvailableStartPosition {
16443        pub fn new() -> Self {
16444            std::default::Default::default()
16445        }
16446    }
16447
16448    impl wkt::message::Message for NextAvailableStartPosition {
16449        fn typename() -> &'static str {
16450            "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.NextAvailableStartPosition"
16451        }
16452    }
16453
16454    /// CDC strategy to start replicating from a specific position in the source.
16455    #[derive(Clone, Default, PartialEq)]
16456    #[non_exhaustive]
16457    pub struct SpecificStartPosition {
16458        pub position:
16459            std::option::Option<crate::model::cdc_strategy::specific_start_position::Position>,
16460
16461        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16462    }
16463
16464    impl SpecificStartPosition {
16465        pub fn new() -> Self {
16466            std::default::Default::default()
16467        }
16468
16469        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position].
16470        ///
16471        /// Note that all the setters affecting `position` are mutually
16472        /// exclusive.
16473        ///
16474        /// # Example
16475        /// ```ignore,no_run
16476        /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16477        /// use google_cloud_datastream_v1::model::MysqlLogPosition;
16478        /// let x = SpecificStartPosition::new().set_position(Some(
16479        ///     google_cloud_datastream_v1::model::cdc_strategy::specific_start_position::Position::MysqlLogPosition(MysqlLogPosition::default().into())));
16480        /// ```
16481        pub fn set_position<
16482            T: std::convert::Into<
16483                    std::option::Option<
16484                        crate::model::cdc_strategy::specific_start_position::Position,
16485                    >,
16486                >,
16487        >(
16488            mut self,
16489            v: T,
16490        ) -> Self {
16491            self.position = v.into();
16492            self
16493        }
16494
16495        /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16496        /// if it holds a `MysqlLogPosition`, `None` if the field is not set or
16497        /// holds a different branch.
16498        pub fn mysql_log_position(
16499            &self,
16500        ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlLogPosition>> {
16501            #[allow(unreachable_patterns)]
16502            self.position.as_ref().and_then(|v| match v {
16503                crate::model::cdc_strategy::specific_start_position::Position::MysqlLogPosition(
16504                    v,
16505                ) => std::option::Option::Some(v),
16506                _ => std::option::Option::None,
16507            })
16508        }
16509
16510        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16511        /// to hold a `MysqlLogPosition`.
16512        ///
16513        /// Note that all the setters affecting `position` are
16514        /// mutually exclusive.
16515        ///
16516        /// # Example
16517        /// ```ignore,no_run
16518        /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16519        /// use google_cloud_datastream_v1::model::MysqlLogPosition;
16520        /// let x = SpecificStartPosition::new().set_mysql_log_position(MysqlLogPosition::default()/* use setters */);
16521        /// assert!(x.mysql_log_position().is_some());
16522        /// assert!(x.oracle_scn_position().is_none());
16523        /// assert!(x.sql_server_lsn_position().is_none());
16524        /// assert!(x.mysql_gtid_position().is_none());
16525        /// ```
16526        pub fn set_mysql_log_position<
16527            T: std::convert::Into<std::boxed::Box<crate::model::MysqlLogPosition>>,
16528        >(
16529            mut self,
16530            v: T,
16531        ) -> Self {
16532            self.position = std::option::Option::Some(
16533                crate::model::cdc_strategy::specific_start_position::Position::MysqlLogPosition(
16534                    v.into(),
16535                ),
16536            );
16537            self
16538        }
16539
16540        /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16541        /// if it holds a `OracleScnPosition`, `None` if the field is not set or
16542        /// holds a different branch.
16543        pub fn oracle_scn_position(
16544            &self,
16545        ) -> std::option::Option<&std::boxed::Box<crate::model::OracleScnPosition>> {
16546            #[allow(unreachable_patterns)]
16547            self.position.as_ref().and_then(|v| match v {
16548                crate::model::cdc_strategy::specific_start_position::Position::OracleScnPosition(v) => std::option::Option::Some(v),
16549                _ => std::option::Option::None,
16550            })
16551        }
16552
16553        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16554        /// to hold a `OracleScnPosition`.
16555        ///
16556        /// Note that all the setters affecting `position` are
16557        /// mutually exclusive.
16558        ///
16559        /// # Example
16560        /// ```ignore,no_run
16561        /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16562        /// use google_cloud_datastream_v1::model::OracleScnPosition;
16563        /// let x = SpecificStartPosition::new().set_oracle_scn_position(OracleScnPosition::default()/* use setters */);
16564        /// assert!(x.oracle_scn_position().is_some());
16565        /// assert!(x.mysql_log_position().is_none());
16566        /// assert!(x.sql_server_lsn_position().is_none());
16567        /// assert!(x.mysql_gtid_position().is_none());
16568        /// ```
16569        pub fn set_oracle_scn_position<
16570            T: std::convert::Into<std::boxed::Box<crate::model::OracleScnPosition>>,
16571        >(
16572            mut self,
16573            v: T,
16574        ) -> Self {
16575            self.position = std::option::Option::Some(
16576                crate::model::cdc_strategy::specific_start_position::Position::OracleScnPosition(
16577                    v.into(),
16578                ),
16579            );
16580            self
16581        }
16582
16583        /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16584        /// if it holds a `SqlServerLsnPosition`, `None` if the field is not set or
16585        /// holds a different branch.
16586        pub fn sql_server_lsn_position(
16587            &self,
16588        ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerLsnPosition>> {
16589            #[allow(unreachable_patterns)]
16590            self.position.as_ref().and_then(|v| match v {
16591                crate::model::cdc_strategy::specific_start_position::Position::SqlServerLsnPosition(v) => std::option::Option::Some(v),
16592                _ => std::option::Option::None,
16593            })
16594        }
16595
16596        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16597        /// to hold a `SqlServerLsnPosition`.
16598        ///
16599        /// Note that all the setters affecting `position` are
16600        /// mutually exclusive.
16601        ///
16602        /// # Example
16603        /// ```ignore,no_run
16604        /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16605        /// use google_cloud_datastream_v1::model::SqlServerLsnPosition;
16606        /// let x = SpecificStartPosition::new().set_sql_server_lsn_position(SqlServerLsnPosition::default()/* use setters */);
16607        /// assert!(x.sql_server_lsn_position().is_some());
16608        /// assert!(x.mysql_log_position().is_none());
16609        /// assert!(x.oracle_scn_position().is_none());
16610        /// assert!(x.mysql_gtid_position().is_none());
16611        /// ```
16612        pub fn set_sql_server_lsn_position<
16613            T: std::convert::Into<std::boxed::Box<crate::model::SqlServerLsnPosition>>,
16614        >(
16615            mut self,
16616            v: T,
16617        ) -> Self {
16618            self.position = std::option::Option::Some(
16619                crate::model::cdc_strategy::specific_start_position::Position::SqlServerLsnPosition(
16620                    v.into(),
16621                ),
16622            );
16623            self
16624        }
16625
16626        /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16627        /// if it holds a `MysqlGtidPosition`, `None` if the field is not set or
16628        /// holds a different branch.
16629        pub fn mysql_gtid_position(
16630            &self,
16631        ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlGtidPosition>> {
16632            #[allow(unreachable_patterns)]
16633            self.position.as_ref().and_then(|v| match v {
16634                crate::model::cdc_strategy::specific_start_position::Position::MysqlGtidPosition(v) => std::option::Option::Some(v),
16635                _ => std::option::Option::None,
16636            })
16637        }
16638
16639        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16640        /// to hold a `MysqlGtidPosition`.
16641        ///
16642        /// Note that all the setters affecting `position` are
16643        /// mutually exclusive.
16644        ///
16645        /// # Example
16646        /// ```ignore,no_run
16647        /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16648        /// use google_cloud_datastream_v1::model::MysqlGtidPosition;
16649        /// let x = SpecificStartPosition::new().set_mysql_gtid_position(MysqlGtidPosition::default()/* use setters */);
16650        /// assert!(x.mysql_gtid_position().is_some());
16651        /// assert!(x.mysql_log_position().is_none());
16652        /// assert!(x.oracle_scn_position().is_none());
16653        /// assert!(x.sql_server_lsn_position().is_none());
16654        /// ```
16655        pub fn set_mysql_gtid_position<
16656            T: std::convert::Into<std::boxed::Box<crate::model::MysqlGtidPosition>>,
16657        >(
16658            mut self,
16659            v: T,
16660        ) -> Self {
16661            self.position = std::option::Option::Some(
16662                crate::model::cdc_strategy::specific_start_position::Position::MysqlGtidPosition(
16663                    v.into(),
16664                ),
16665            );
16666            self
16667        }
16668    }
16669
16670    impl wkt::message::Message for SpecificStartPosition {
16671        fn typename() -> &'static str {
16672            "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.SpecificStartPosition"
16673        }
16674    }
16675
16676    /// Defines additional types related to [SpecificStartPosition].
16677    pub mod specific_start_position {
16678        #[allow(unused_imports)]
16679        use super::*;
16680
16681        #[derive(Clone, Debug, PartialEq)]
16682        #[non_exhaustive]
16683        pub enum Position {
16684            /// MySQL specific log position to start replicating from.
16685            MysqlLogPosition(std::boxed::Box<crate::model::MysqlLogPosition>),
16686            /// Oracle SCN to start replicating from.
16687            OracleScnPosition(std::boxed::Box<crate::model::OracleScnPosition>),
16688            /// SqlServer LSN to start replicating from.
16689            SqlServerLsnPosition(std::boxed::Box<crate::model::SqlServerLsnPosition>),
16690            /// MySQL GTID set to start replicating from.
16691            MysqlGtidPosition(std::boxed::Box<crate::model::MysqlGtidPosition>),
16692        }
16693    }
16694
16695    /// The position to start reading from when starting, resuming, or recovering
16696    /// the stream.
16697    /// If not set, the system's default value will be used.
16698    #[derive(Clone, Debug, PartialEq)]
16699    #[non_exhaustive]
16700    pub enum StartPosition {
16701        /// Optional. Start replicating from the most recent position in the source.
16702        MostRecentStartPosition(
16703            std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>,
16704        ),
16705        /// Optional. Resume replication from the next available position in the
16706        /// source.
16707        NextAvailableStartPosition(
16708            std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>,
16709        ),
16710        /// Optional. Start replicating from a specific position in the source.
16711        SpecificStartPosition(std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>),
16712    }
16713}
16714
16715/// SQL Server LSN position
16716#[derive(Clone, Default, PartialEq)]
16717#[non_exhaustive]
16718pub struct SqlServerLsnPosition {
16719    /// Required. Log sequence number (LSN) from where Logs will be read
16720    pub lsn: std::string::String,
16721
16722    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16723}
16724
16725impl SqlServerLsnPosition {
16726    pub fn new() -> Self {
16727        std::default::Default::default()
16728    }
16729
16730    /// Sets the value of [lsn][crate::model::SqlServerLsnPosition::lsn].
16731    ///
16732    /// # Example
16733    /// ```ignore,no_run
16734    /// # use google_cloud_datastream_v1::model::SqlServerLsnPosition;
16735    /// let x = SqlServerLsnPosition::new().set_lsn("example");
16736    /// ```
16737    pub fn set_lsn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16738        self.lsn = v.into();
16739        self
16740    }
16741}
16742
16743impl wkt::message::Message for SqlServerLsnPosition {
16744    fn typename() -> &'static str {
16745        "type.googleapis.com/google.cloud.datastream.v1.SqlServerLsnPosition"
16746    }
16747}
16748
16749/// Oracle SCN position
16750#[derive(Clone, Default, PartialEq)]
16751#[non_exhaustive]
16752pub struct OracleScnPosition {
16753    /// Required. SCN number from where Logs will be read
16754    pub scn: i64,
16755
16756    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16757}
16758
16759impl OracleScnPosition {
16760    pub fn new() -> Self {
16761        std::default::Default::default()
16762    }
16763
16764    /// Sets the value of [scn][crate::model::OracleScnPosition::scn].
16765    ///
16766    /// # Example
16767    /// ```ignore,no_run
16768    /// # use google_cloud_datastream_v1::model::OracleScnPosition;
16769    /// let x = OracleScnPosition::new().set_scn(42);
16770    /// ```
16771    pub fn set_scn<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
16772        self.scn = v.into();
16773        self
16774    }
16775}
16776
16777impl wkt::message::Message for OracleScnPosition {
16778    fn typename() -> &'static str {
16779        "type.googleapis.com/google.cloud.datastream.v1.OracleScnPosition"
16780    }
16781}
16782
16783/// MySQL log position
16784#[derive(Clone, Default, PartialEq)]
16785#[non_exhaustive]
16786pub struct MysqlLogPosition {
16787    /// Required. The binary log file name.
16788    pub log_file: std::string::String,
16789
16790    /// Optional. The position within the binary log file. Default is head of file.
16791    pub log_position: std::option::Option<i32>,
16792
16793    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16794}
16795
16796impl MysqlLogPosition {
16797    pub fn new() -> Self {
16798        std::default::Default::default()
16799    }
16800
16801    /// Sets the value of [log_file][crate::model::MysqlLogPosition::log_file].
16802    ///
16803    /// # Example
16804    /// ```ignore,no_run
16805    /// # use google_cloud_datastream_v1::model::MysqlLogPosition;
16806    /// let x = MysqlLogPosition::new().set_log_file("example");
16807    /// ```
16808    pub fn set_log_file<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16809        self.log_file = v.into();
16810        self
16811    }
16812
16813    /// Sets the value of [log_position][crate::model::MysqlLogPosition::log_position].
16814    ///
16815    /// # Example
16816    /// ```ignore,no_run
16817    /// # use google_cloud_datastream_v1::model::MysqlLogPosition;
16818    /// let x = MysqlLogPosition::new().set_log_position(42);
16819    /// ```
16820    pub fn set_log_position<T>(mut self, v: T) -> Self
16821    where
16822        T: std::convert::Into<i32>,
16823    {
16824        self.log_position = std::option::Option::Some(v.into());
16825        self
16826    }
16827
16828    /// Sets or clears the value of [log_position][crate::model::MysqlLogPosition::log_position].
16829    ///
16830    /// # Example
16831    /// ```ignore,no_run
16832    /// # use google_cloud_datastream_v1::model::MysqlLogPosition;
16833    /// let x = MysqlLogPosition::new().set_or_clear_log_position(Some(42));
16834    /// let x = MysqlLogPosition::new().set_or_clear_log_position(None::<i32>);
16835    /// ```
16836    pub fn set_or_clear_log_position<T>(mut self, v: std::option::Option<T>) -> Self
16837    where
16838        T: std::convert::Into<i32>,
16839    {
16840        self.log_position = v.map(|x| x.into());
16841        self
16842    }
16843}
16844
16845impl wkt::message::Message for MysqlLogPosition {
16846    fn typename() -> &'static str {
16847        "type.googleapis.com/google.cloud.datastream.v1.MysqlLogPosition"
16848    }
16849}
16850
16851/// MySQL GTID position
16852#[derive(Clone, Default, PartialEq)]
16853#[non_exhaustive]
16854pub struct MysqlGtidPosition {
16855    /// Required. The gtid set to start replication from.
16856    pub gtid_set: std::string::String,
16857
16858    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16859}
16860
16861impl MysqlGtidPosition {
16862    pub fn new() -> Self {
16863        std::default::Default::default()
16864    }
16865
16866    /// Sets the value of [gtid_set][crate::model::MysqlGtidPosition::gtid_set].
16867    ///
16868    /// # Example
16869    /// ```ignore,no_run
16870    /// # use google_cloud_datastream_v1::model::MysqlGtidPosition;
16871    /// let x = MysqlGtidPosition::new().set_gtid_set("example");
16872    /// ```
16873    pub fn set_gtid_set<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16874        self.gtid_set = v.into();
16875        self
16876    }
16877}
16878
16879impl wkt::message::Message for MysqlGtidPosition {
16880    fn typename() -> &'static str {
16881        "type.googleapis.com/google.cloud.datastream.v1.MysqlGtidPosition"
16882    }
16883}