Skip to main content

google_cloud_datastream_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_location;
25extern crate google_cloud_longrunning;
26extern crate google_cloud_lro;
27extern crate serde;
28extern crate serde_json;
29extern crate serde_with;
30extern crate std;
31extern crate tracing;
32extern crate wkt;
33
34mod debug;
35mod deserialize;
36mod serialize;
37
38/// Request message for 'discover' ConnectionProfile request.
39#[derive(Clone, Default, PartialEq)]
40#[non_exhaustive]
41pub struct DiscoverConnectionProfileRequest {
42    /// Required. The parent resource of the connection profile type. Must be in
43    /// the format `projects/*/locations/*`.
44    pub parent: std::string::String,
45
46    /// The connection profile on which to run discover.
47    pub target: std::option::Option<crate::model::discover_connection_profile_request::Target>,
48
49    /// The depth of the retrieved hierarchy of data objects.
50    pub hierarchy:
51        std::option::Option<crate::model::discover_connection_profile_request::Hierarchy>,
52
53    /// The data object to populate with child data objects and metadata.
54    pub data_object:
55        std::option::Option<crate::model::discover_connection_profile_request::DataObject>,
56
57    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
58}
59
60impl DiscoverConnectionProfileRequest {
61    /// Creates a new default instance.
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 project_id = "project_id";
72    /// # let location_id = "location_id";
73    /// let x = DiscoverConnectionProfileRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
74    /// ```
75    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
76        self.parent = v.into();
77        self
78    }
79
80    /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target].
81    ///
82    /// Note that all the setters affecting `target` are mutually
83    /// exclusive.
84    ///
85    /// # Example
86    /// ```ignore,no_run
87    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
88    /// use google_cloud_datastream_v1::model::discover_connection_profile_request::Target;
89    /// let x = DiscoverConnectionProfileRequest::new().set_target(Some(Target::ConnectionProfileName("example".to_string())));
90    /// ```
91    pub fn set_target<
92        T: std::convert::Into<
93                std::option::Option<crate::model::discover_connection_profile_request::Target>,
94            >,
95    >(
96        mut self,
97        v: T,
98    ) -> Self {
99        self.target = v.into();
100        self
101    }
102
103    /// The value of [target][crate::model::DiscoverConnectionProfileRequest::target]
104    /// if it holds a `ConnectionProfile`, `None` if the field is not set or
105    /// holds a different branch.
106    pub fn connection_profile(
107        &self,
108    ) -> std::option::Option<&std::boxed::Box<crate::model::ConnectionProfile>> {
109        #[allow(unreachable_patterns)]
110        self.target.as_ref().and_then(|v| match v {
111            crate::model::discover_connection_profile_request::Target::ConnectionProfile(v) => {
112                std::option::Option::Some(v)
113            }
114            _ => std::option::Option::None,
115        })
116    }
117
118    /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target]
119    /// to hold a `ConnectionProfile`.
120    ///
121    /// Note that all the setters affecting `target` are
122    /// mutually exclusive.
123    ///
124    /// # Example
125    /// ```ignore,no_run
126    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
127    /// use google_cloud_datastream_v1::model::ConnectionProfile;
128    /// let x = DiscoverConnectionProfileRequest::new().set_connection_profile(ConnectionProfile::default()/* use setters */);
129    /// assert!(x.connection_profile().is_some());
130    /// assert!(x.connection_profile_name().is_none());
131    /// ```
132    pub fn set_connection_profile<
133        T: std::convert::Into<std::boxed::Box<crate::model::ConnectionProfile>>,
134    >(
135        mut self,
136        v: T,
137    ) -> Self {
138        self.target = std::option::Option::Some(
139            crate::model::discover_connection_profile_request::Target::ConnectionProfile(v.into()),
140        );
141        self
142    }
143
144    /// The value of [target][crate::model::DiscoverConnectionProfileRequest::target]
145    /// if it holds a `ConnectionProfileName`, `None` if the field is not set or
146    /// holds a different branch.
147    pub fn connection_profile_name(&self) -> std::option::Option<&std::string::String> {
148        #[allow(unreachable_patterns)]
149        self.target.as_ref().and_then(|v| match v {
150            crate::model::discover_connection_profile_request::Target::ConnectionProfileName(v) => {
151                std::option::Option::Some(v)
152            }
153            _ => std::option::Option::None,
154        })
155    }
156
157    /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target]
158    /// to hold a `ConnectionProfileName`.
159    ///
160    /// Note that all the setters affecting `target` are
161    /// mutually exclusive.
162    ///
163    /// # Example
164    /// ```ignore,no_run
165    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
166    /// let x = DiscoverConnectionProfileRequest::new().set_connection_profile_name("example");
167    /// assert!(x.connection_profile_name().is_some());
168    /// assert!(x.connection_profile().is_none());
169    /// ```
170    pub fn set_connection_profile_name<T: std::convert::Into<std::string::String>>(
171        mut self,
172        v: T,
173    ) -> Self {
174        self.target = std::option::Option::Some(
175            crate::model::discover_connection_profile_request::Target::ConnectionProfileName(
176                v.into(),
177            ),
178        );
179        self
180    }
181
182    /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy].
183    ///
184    /// Note that all the setters affecting `hierarchy` are mutually
185    /// exclusive.
186    ///
187    /// # Example
188    /// ```ignore,no_run
189    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
190    /// use google_cloud_datastream_v1::model::discover_connection_profile_request::Hierarchy;
191    /// let x = DiscoverConnectionProfileRequest::new().set_hierarchy(Some(Hierarchy::FullHierarchy(true)));
192    /// ```
193    pub fn set_hierarchy<
194        T: std::convert::Into<
195                std::option::Option<crate::model::discover_connection_profile_request::Hierarchy>,
196            >,
197    >(
198        mut self,
199        v: T,
200    ) -> Self {
201        self.hierarchy = v.into();
202        self
203    }
204
205    /// The value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
206    /// if it holds a `FullHierarchy`, `None` if the field is not set or
207    /// holds a different branch.
208    pub fn full_hierarchy(&self) -> std::option::Option<&bool> {
209        #[allow(unreachable_patterns)]
210        self.hierarchy.as_ref().and_then(|v| match v {
211            crate::model::discover_connection_profile_request::Hierarchy::FullHierarchy(v) => {
212                std::option::Option::Some(v)
213            }
214            _ => std::option::Option::None,
215        })
216    }
217
218    /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
219    /// to hold a `FullHierarchy`.
220    ///
221    /// Note that all the setters affecting `hierarchy` are
222    /// mutually exclusive.
223    ///
224    /// # Example
225    /// ```ignore,no_run
226    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
227    /// let x = DiscoverConnectionProfileRequest::new().set_full_hierarchy(true);
228    /// assert!(x.full_hierarchy().is_some());
229    /// assert!(x.hierarchy_depth().is_none());
230    /// ```
231    pub fn set_full_hierarchy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
232        self.hierarchy = std::option::Option::Some(
233            crate::model::discover_connection_profile_request::Hierarchy::FullHierarchy(v.into()),
234        );
235        self
236    }
237
238    /// The value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
239    /// if it holds a `HierarchyDepth`, `None` if the field is not set or
240    /// holds a different branch.
241    pub fn hierarchy_depth(&self) -> std::option::Option<&i32> {
242        #[allow(unreachable_patterns)]
243        self.hierarchy.as_ref().and_then(|v| match v {
244            crate::model::discover_connection_profile_request::Hierarchy::HierarchyDepth(v) => {
245                std::option::Option::Some(v)
246            }
247            _ => std::option::Option::None,
248        })
249    }
250
251    /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
252    /// to hold a `HierarchyDepth`.
253    ///
254    /// Note that all the setters affecting `hierarchy` are
255    /// mutually exclusive.
256    ///
257    /// # Example
258    /// ```ignore,no_run
259    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
260    /// let x = DiscoverConnectionProfileRequest::new().set_hierarchy_depth(42);
261    /// assert!(x.hierarchy_depth().is_some());
262    /// assert!(x.full_hierarchy().is_none());
263    /// ```
264    pub fn set_hierarchy_depth<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
265        self.hierarchy = std::option::Option::Some(
266            crate::model::discover_connection_profile_request::Hierarchy::HierarchyDepth(v.into()),
267        );
268        self
269    }
270
271    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object].
272    ///
273    /// Note that all the setters affecting `data_object` are mutually
274    /// exclusive.
275    ///
276    /// # Example
277    /// ```ignore,no_run
278    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
279    /// use google_cloud_datastream_v1::model::OracleRdbms;
280    /// let x = DiscoverConnectionProfileRequest::new().set_data_object(Some(
281    ///     google_cloud_datastream_v1::model::discover_connection_profile_request::DataObject::OracleRdbms(OracleRdbms::default().into())));
282    /// ```
283    pub fn set_data_object<
284        T: std::convert::Into<
285                std::option::Option<crate::model::discover_connection_profile_request::DataObject>,
286            >,
287    >(
288        mut self,
289        v: T,
290    ) -> Self {
291        self.data_object = v.into();
292        self
293    }
294
295    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
296    /// if it holds a `OracleRdbms`, `None` if the field is not set or
297    /// holds a different branch.
298    pub fn oracle_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
299        #[allow(unreachable_patterns)]
300        self.data_object.as_ref().and_then(|v| match v {
301            crate::model::discover_connection_profile_request::DataObject::OracleRdbms(v) => {
302                std::option::Option::Some(v)
303            }
304            _ => std::option::Option::None,
305        })
306    }
307
308    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
309    /// to hold a `OracleRdbms`.
310    ///
311    /// Note that all the setters affecting `data_object` are
312    /// mutually exclusive.
313    ///
314    /// # Example
315    /// ```ignore,no_run
316    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
317    /// use google_cloud_datastream_v1::model::OracleRdbms;
318    /// let x = DiscoverConnectionProfileRequest::new().set_oracle_rdbms(OracleRdbms::default()/* use setters */);
319    /// assert!(x.oracle_rdbms().is_some());
320    /// assert!(x.mysql_rdbms().is_none());
321    /// assert!(x.postgresql_rdbms().is_none());
322    /// assert!(x.sql_server_rdbms().is_none());
323    /// assert!(x.salesforce_org().is_none());
324    /// assert!(x.mongodb_cluster().is_none());
325    /// ```
326    pub fn set_oracle_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>>(
327        mut self,
328        v: T,
329    ) -> Self {
330        self.data_object = std::option::Option::Some(
331            crate::model::discover_connection_profile_request::DataObject::OracleRdbms(v.into()),
332        );
333        self
334    }
335
336    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
337    /// if it holds a `MysqlRdbms`, `None` if the field is not set or
338    /// holds a different branch.
339    pub fn mysql_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
340        #[allow(unreachable_patterns)]
341        self.data_object.as_ref().and_then(|v| match v {
342            crate::model::discover_connection_profile_request::DataObject::MysqlRdbms(v) => {
343                std::option::Option::Some(v)
344            }
345            _ => std::option::Option::None,
346        })
347    }
348
349    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
350    /// to hold a `MysqlRdbms`.
351    ///
352    /// Note that all the setters affecting `data_object` are
353    /// mutually exclusive.
354    ///
355    /// # Example
356    /// ```ignore,no_run
357    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
358    /// use google_cloud_datastream_v1::model::MysqlRdbms;
359    /// let x = DiscoverConnectionProfileRequest::new().set_mysql_rdbms(MysqlRdbms::default()/* use setters */);
360    /// assert!(x.mysql_rdbms().is_some());
361    /// assert!(x.oracle_rdbms().is_none());
362    /// assert!(x.postgresql_rdbms().is_none());
363    /// assert!(x.sql_server_rdbms().is_none());
364    /// assert!(x.salesforce_org().is_none());
365    /// assert!(x.mongodb_cluster().is_none());
366    /// ```
367    pub fn set_mysql_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>>(
368        mut self,
369        v: T,
370    ) -> Self {
371        self.data_object = std::option::Option::Some(
372            crate::model::discover_connection_profile_request::DataObject::MysqlRdbms(v.into()),
373        );
374        self
375    }
376
377    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
378    /// if it holds a `PostgresqlRdbms`, `None` if the field is not set or
379    /// holds a different branch.
380    pub fn postgresql_rdbms(
381        &self,
382    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
383        #[allow(unreachable_patterns)]
384        self.data_object.as_ref().and_then(|v| match v {
385            crate::model::discover_connection_profile_request::DataObject::PostgresqlRdbms(v) => {
386                std::option::Option::Some(v)
387            }
388            _ => std::option::Option::None,
389        })
390    }
391
392    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
393    /// to hold a `PostgresqlRdbms`.
394    ///
395    /// Note that all the setters affecting `data_object` are
396    /// mutually exclusive.
397    ///
398    /// # Example
399    /// ```ignore,no_run
400    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
401    /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
402    /// let x = DiscoverConnectionProfileRequest::new().set_postgresql_rdbms(PostgresqlRdbms::default()/* use setters */);
403    /// assert!(x.postgresql_rdbms().is_some());
404    /// assert!(x.oracle_rdbms().is_none());
405    /// assert!(x.mysql_rdbms().is_none());
406    /// assert!(x.sql_server_rdbms().is_none());
407    /// assert!(x.salesforce_org().is_none());
408    /// assert!(x.mongodb_cluster().is_none());
409    /// ```
410    pub fn set_postgresql_rdbms<
411        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
412    >(
413        mut self,
414        v: T,
415    ) -> Self {
416        self.data_object = std::option::Option::Some(
417            crate::model::discover_connection_profile_request::DataObject::PostgresqlRdbms(
418                v.into(),
419            ),
420        );
421        self
422    }
423
424    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
425    /// if it holds a `SqlServerRdbms`, `None` if the field is not set or
426    /// holds a different branch.
427    pub fn sql_server_rdbms(
428        &self,
429    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
430        #[allow(unreachable_patterns)]
431        self.data_object.as_ref().and_then(|v| match v {
432            crate::model::discover_connection_profile_request::DataObject::SqlServerRdbms(v) => {
433                std::option::Option::Some(v)
434            }
435            _ => std::option::Option::None,
436        })
437    }
438
439    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
440    /// to hold a `SqlServerRdbms`.
441    ///
442    /// Note that all the setters affecting `data_object` are
443    /// mutually exclusive.
444    ///
445    /// # Example
446    /// ```ignore,no_run
447    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
448    /// use google_cloud_datastream_v1::model::SqlServerRdbms;
449    /// let x = DiscoverConnectionProfileRequest::new().set_sql_server_rdbms(SqlServerRdbms::default()/* use setters */);
450    /// assert!(x.sql_server_rdbms().is_some());
451    /// assert!(x.oracle_rdbms().is_none());
452    /// assert!(x.mysql_rdbms().is_none());
453    /// assert!(x.postgresql_rdbms().is_none());
454    /// assert!(x.salesforce_org().is_none());
455    /// assert!(x.mongodb_cluster().is_none());
456    /// ```
457    pub fn set_sql_server_rdbms<
458        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
459    >(
460        mut self,
461        v: T,
462    ) -> Self {
463        self.data_object = std::option::Option::Some(
464            crate::model::discover_connection_profile_request::DataObject::SqlServerRdbms(v.into()),
465        );
466        self
467    }
468
469    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
470    /// if it holds a `SalesforceOrg`, `None` if the field is not set or
471    /// holds a different branch.
472    pub fn salesforce_org(
473        &self,
474    ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceOrg>> {
475        #[allow(unreachable_patterns)]
476        self.data_object.as_ref().and_then(|v| match v {
477            crate::model::discover_connection_profile_request::DataObject::SalesforceOrg(v) => {
478                std::option::Option::Some(v)
479            }
480            _ => std::option::Option::None,
481        })
482    }
483
484    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
485    /// to hold a `SalesforceOrg`.
486    ///
487    /// Note that all the setters affecting `data_object` are
488    /// mutually exclusive.
489    ///
490    /// # Example
491    /// ```ignore,no_run
492    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
493    /// use google_cloud_datastream_v1::model::SalesforceOrg;
494    /// let x = DiscoverConnectionProfileRequest::new().set_salesforce_org(SalesforceOrg::default()/* use setters */);
495    /// assert!(x.salesforce_org().is_some());
496    /// assert!(x.oracle_rdbms().is_none());
497    /// assert!(x.mysql_rdbms().is_none());
498    /// assert!(x.postgresql_rdbms().is_none());
499    /// assert!(x.sql_server_rdbms().is_none());
500    /// assert!(x.mongodb_cluster().is_none());
501    /// ```
502    pub fn set_salesforce_org<
503        T: std::convert::Into<std::boxed::Box<crate::model::SalesforceOrg>>,
504    >(
505        mut self,
506        v: T,
507    ) -> Self {
508        self.data_object = std::option::Option::Some(
509            crate::model::discover_connection_profile_request::DataObject::SalesforceOrg(v.into()),
510        );
511        self
512    }
513
514    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
515    /// if it holds a `MongodbCluster`, `None` if the field is not set or
516    /// holds a different branch.
517    pub fn mongodb_cluster(
518        &self,
519    ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbCluster>> {
520        #[allow(unreachable_patterns)]
521        self.data_object.as_ref().and_then(|v| match v {
522            crate::model::discover_connection_profile_request::DataObject::MongodbCluster(v) => {
523                std::option::Option::Some(v)
524            }
525            _ => std::option::Option::None,
526        })
527    }
528
529    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
530    /// to hold a `MongodbCluster`.
531    ///
532    /// Note that all the setters affecting `data_object` are
533    /// mutually exclusive.
534    ///
535    /// # Example
536    /// ```ignore,no_run
537    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
538    /// use google_cloud_datastream_v1::model::MongodbCluster;
539    /// let x = DiscoverConnectionProfileRequest::new().set_mongodb_cluster(MongodbCluster::default()/* use setters */);
540    /// assert!(x.mongodb_cluster().is_some());
541    /// assert!(x.oracle_rdbms().is_none());
542    /// assert!(x.mysql_rdbms().is_none());
543    /// assert!(x.postgresql_rdbms().is_none());
544    /// assert!(x.sql_server_rdbms().is_none());
545    /// assert!(x.salesforce_org().is_none());
546    /// ```
547    pub fn set_mongodb_cluster<
548        T: std::convert::Into<std::boxed::Box<crate::model::MongodbCluster>>,
549    >(
550        mut self,
551        v: T,
552    ) -> Self {
553        self.data_object = std::option::Option::Some(
554            crate::model::discover_connection_profile_request::DataObject::MongodbCluster(v.into()),
555        );
556        self
557    }
558}
559
560impl wkt::message::Message for DiscoverConnectionProfileRequest {
561    fn typename() -> &'static str {
562        "type.googleapis.com/google.cloud.datastream.v1.DiscoverConnectionProfileRequest"
563    }
564}
565
566/// Defines additional types related to [DiscoverConnectionProfileRequest].
567pub mod discover_connection_profile_request {
568    #[allow(unused_imports)]
569    use super::*;
570
571    /// The connection profile on which to run discover.
572    #[derive(Clone, Debug, PartialEq)]
573    #[non_exhaustive]
574    pub enum Target {
575        /// An ad-hoc connection profile configuration.
576        ConnectionProfile(std::boxed::Box<crate::model::ConnectionProfile>),
577        /// A reference to an existing connection profile.
578        ConnectionProfileName(std::string::String),
579    }
580
581    /// The depth of the retrieved hierarchy of data objects.
582    #[derive(Clone, Debug, PartialEq)]
583    #[non_exhaustive]
584    pub enum Hierarchy {
585        /// Whether to retrieve the full hierarchy of data objects (TRUE) or only the
586        /// current level (FALSE).
587        FullHierarchy(bool),
588        /// The number of hierarchy levels below the current level to be retrieved.
589        HierarchyDepth(i32),
590    }
591
592    /// The data object to populate with child data objects and metadata.
593    #[derive(Clone, Debug, PartialEq)]
594    #[non_exhaustive]
595    pub enum DataObject {
596        /// Oracle RDBMS to enrich with child data objects and metadata.
597        OracleRdbms(std::boxed::Box<crate::model::OracleRdbms>),
598        /// MySQL RDBMS to enrich with child data objects and metadata.
599        MysqlRdbms(std::boxed::Box<crate::model::MysqlRdbms>),
600        /// PostgreSQL RDBMS to enrich with child data objects and metadata.
601        PostgresqlRdbms(std::boxed::Box<crate::model::PostgresqlRdbms>),
602        /// SQLServer RDBMS to enrich with child data objects and metadata.
603        SqlServerRdbms(std::boxed::Box<crate::model::SqlServerRdbms>),
604        /// Salesforce organization to enrich with child data objects and metadata.
605        SalesforceOrg(std::boxed::Box<crate::model::SalesforceOrg>),
606        /// MongoDB cluster to enrich with child data objects and metadata.
607        MongodbCluster(std::boxed::Box<crate::model::MongodbCluster>),
608    }
609}
610
611/// Response from a discover request.
612#[derive(Clone, Default, PartialEq)]
613#[non_exhaustive]
614pub struct DiscoverConnectionProfileResponse {
615    /// The data object that has been enriched by the discover API call.
616    pub data_object:
617        std::option::Option<crate::model::discover_connection_profile_response::DataObject>,
618
619    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
620}
621
622impl DiscoverConnectionProfileResponse {
623    /// Creates a new default instance.
624    pub fn new() -> Self {
625        std::default::Default::default()
626    }
627
628    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object].
629    ///
630    /// Note that all the setters affecting `data_object` are mutually
631    /// exclusive.
632    ///
633    /// # Example
634    /// ```ignore,no_run
635    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
636    /// use google_cloud_datastream_v1::model::OracleRdbms;
637    /// let x = DiscoverConnectionProfileResponse::new().set_data_object(Some(
638    ///     google_cloud_datastream_v1::model::discover_connection_profile_response::DataObject::OracleRdbms(OracleRdbms::default().into())));
639    /// ```
640    pub fn set_data_object<
641        T: std::convert::Into<
642                std::option::Option<crate::model::discover_connection_profile_response::DataObject>,
643            >,
644    >(
645        mut self,
646        v: T,
647    ) -> Self {
648        self.data_object = v.into();
649        self
650    }
651
652    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
653    /// if it holds a `OracleRdbms`, `None` if the field is not set or
654    /// holds a different branch.
655    pub fn oracle_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
656        #[allow(unreachable_patterns)]
657        self.data_object.as_ref().and_then(|v| match v {
658            crate::model::discover_connection_profile_response::DataObject::OracleRdbms(v) => {
659                std::option::Option::Some(v)
660            }
661            _ => std::option::Option::None,
662        })
663    }
664
665    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
666    /// to hold a `OracleRdbms`.
667    ///
668    /// Note that all the setters affecting `data_object` are
669    /// mutually exclusive.
670    ///
671    /// # Example
672    /// ```ignore,no_run
673    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
674    /// use google_cloud_datastream_v1::model::OracleRdbms;
675    /// let x = DiscoverConnectionProfileResponse::new().set_oracle_rdbms(OracleRdbms::default()/* use setters */);
676    /// assert!(x.oracle_rdbms().is_some());
677    /// assert!(x.mysql_rdbms().is_none());
678    /// assert!(x.postgresql_rdbms().is_none());
679    /// assert!(x.sql_server_rdbms().is_none());
680    /// assert!(x.salesforce_org().is_none());
681    /// assert!(x.mongodb_cluster().is_none());
682    /// ```
683    pub fn set_oracle_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>>(
684        mut self,
685        v: T,
686    ) -> Self {
687        self.data_object = std::option::Option::Some(
688            crate::model::discover_connection_profile_response::DataObject::OracleRdbms(v.into()),
689        );
690        self
691    }
692
693    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
694    /// if it holds a `MysqlRdbms`, `None` if the field is not set or
695    /// holds a different branch.
696    pub fn mysql_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
697        #[allow(unreachable_patterns)]
698        self.data_object.as_ref().and_then(|v| match v {
699            crate::model::discover_connection_profile_response::DataObject::MysqlRdbms(v) => {
700                std::option::Option::Some(v)
701            }
702            _ => std::option::Option::None,
703        })
704    }
705
706    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
707    /// to hold a `MysqlRdbms`.
708    ///
709    /// Note that all the setters affecting `data_object` are
710    /// mutually exclusive.
711    ///
712    /// # Example
713    /// ```ignore,no_run
714    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
715    /// use google_cloud_datastream_v1::model::MysqlRdbms;
716    /// let x = DiscoverConnectionProfileResponse::new().set_mysql_rdbms(MysqlRdbms::default()/* use setters */);
717    /// assert!(x.mysql_rdbms().is_some());
718    /// assert!(x.oracle_rdbms().is_none());
719    /// assert!(x.postgresql_rdbms().is_none());
720    /// assert!(x.sql_server_rdbms().is_none());
721    /// assert!(x.salesforce_org().is_none());
722    /// assert!(x.mongodb_cluster().is_none());
723    /// ```
724    pub fn set_mysql_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>>(
725        mut self,
726        v: T,
727    ) -> Self {
728        self.data_object = std::option::Option::Some(
729            crate::model::discover_connection_profile_response::DataObject::MysqlRdbms(v.into()),
730        );
731        self
732    }
733
734    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
735    /// if it holds a `PostgresqlRdbms`, `None` if the field is not set or
736    /// holds a different branch.
737    pub fn postgresql_rdbms(
738        &self,
739    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
740        #[allow(unreachable_patterns)]
741        self.data_object.as_ref().and_then(|v| match v {
742            crate::model::discover_connection_profile_response::DataObject::PostgresqlRdbms(v) => {
743                std::option::Option::Some(v)
744            }
745            _ => std::option::Option::None,
746        })
747    }
748
749    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
750    /// to hold a `PostgresqlRdbms`.
751    ///
752    /// Note that all the setters affecting `data_object` are
753    /// mutually exclusive.
754    ///
755    /// # Example
756    /// ```ignore,no_run
757    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
758    /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
759    /// let x = DiscoverConnectionProfileResponse::new().set_postgresql_rdbms(PostgresqlRdbms::default()/* use setters */);
760    /// assert!(x.postgresql_rdbms().is_some());
761    /// assert!(x.oracle_rdbms().is_none());
762    /// assert!(x.mysql_rdbms().is_none());
763    /// assert!(x.sql_server_rdbms().is_none());
764    /// assert!(x.salesforce_org().is_none());
765    /// assert!(x.mongodb_cluster().is_none());
766    /// ```
767    pub fn set_postgresql_rdbms<
768        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
769    >(
770        mut self,
771        v: T,
772    ) -> Self {
773        self.data_object = std::option::Option::Some(
774            crate::model::discover_connection_profile_response::DataObject::PostgresqlRdbms(
775                v.into(),
776            ),
777        );
778        self
779    }
780
781    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
782    /// if it holds a `SqlServerRdbms`, `None` if the field is not set or
783    /// holds a different branch.
784    pub fn sql_server_rdbms(
785        &self,
786    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
787        #[allow(unreachable_patterns)]
788        self.data_object.as_ref().and_then(|v| match v {
789            crate::model::discover_connection_profile_response::DataObject::SqlServerRdbms(v) => {
790                std::option::Option::Some(v)
791            }
792            _ => std::option::Option::None,
793        })
794    }
795
796    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
797    /// to hold a `SqlServerRdbms`.
798    ///
799    /// Note that all the setters affecting `data_object` are
800    /// mutually exclusive.
801    ///
802    /// # Example
803    /// ```ignore,no_run
804    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
805    /// use google_cloud_datastream_v1::model::SqlServerRdbms;
806    /// let x = DiscoverConnectionProfileResponse::new().set_sql_server_rdbms(SqlServerRdbms::default()/* use setters */);
807    /// assert!(x.sql_server_rdbms().is_some());
808    /// assert!(x.oracle_rdbms().is_none());
809    /// assert!(x.mysql_rdbms().is_none());
810    /// assert!(x.postgresql_rdbms().is_none());
811    /// assert!(x.salesforce_org().is_none());
812    /// assert!(x.mongodb_cluster().is_none());
813    /// ```
814    pub fn set_sql_server_rdbms<
815        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
816    >(
817        mut self,
818        v: T,
819    ) -> Self {
820        self.data_object = std::option::Option::Some(
821            crate::model::discover_connection_profile_response::DataObject::SqlServerRdbms(
822                v.into(),
823            ),
824        );
825        self
826    }
827
828    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
829    /// if it holds a `SalesforceOrg`, `None` if the field is not set or
830    /// holds a different branch.
831    pub fn salesforce_org(
832        &self,
833    ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceOrg>> {
834        #[allow(unreachable_patterns)]
835        self.data_object.as_ref().and_then(|v| match v {
836            crate::model::discover_connection_profile_response::DataObject::SalesforceOrg(v) => {
837                std::option::Option::Some(v)
838            }
839            _ => std::option::Option::None,
840        })
841    }
842
843    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
844    /// to hold a `SalesforceOrg`.
845    ///
846    /// Note that all the setters affecting `data_object` are
847    /// mutually exclusive.
848    ///
849    /// # Example
850    /// ```ignore,no_run
851    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
852    /// use google_cloud_datastream_v1::model::SalesforceOrg;
853    /// let x = DiscoverConnectionProfileResponse::new().set_salesforce_org(SalesforceOrg::default()/* use setters */);
854    /// assert!(x.salesforce_org().is_some());
855    /// assert!(x.oracle_rdbms().is_none());
856    /// assert!(x.mysql_rdbms().is_none());
857    /// assert!(x.postgresql_rdbms().is_none());
858    /// assert!(x.sql_server_rdbms().is_none());
859    /// assert!(x.mongodb_cluster().is_none());
860    /// ```
861    pub fn set_salesforce_org<
862        T: std::convert::Into<std::boxed::Box<crate::model::SalesforceOrg>>,
863    >(
864        mut self,
865        v: T,
866    ) -> Self {
867        self.data_object = std::option::Option::Some(
868            crate::model::discover_connection_profile_response::DataObject::SalesforceOrg(v.into()),
869        );
870        self
871    }
872
873    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
874    /// if it holds a `MongodbCluster`, `None` if the field is not set or
875    /// holds a different branch.
876    pub fn mongodb_cluster(
877        &self,
878    ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbCluster>> {
879        #[allow(unreachable_patterns)]
880        self.data_object.as_ref().and_then(|v| match v {
881            crate::model::discover_connection_profile_response::DataObject::MongodbCluster(v) => {
882                std::option::Option::Some(v)
883            }
884            _ => std::option::Option::None,
885        })
886    }
887
888    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
889    /// to hold a `MongodbCluster`.
890    ///
891    /// Note that all the setters affecting `data_object` are
892    /// mutually exclusive.
893    ///
894    /// # Example
895    /// ```ignore,no_run
896    /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
897    /// use google_cloud_datastream_v1::model::MongodbCluster;
898    /// let x = DiscoverConnectionProfileResponse::new().set_mongodb_cluster(MongodbCluster::default()/* use setters */);
899    /// assert!(x.mongodb_cluster().is_some());
900    /// assert!(x.oracle_rdbms().is_none());
901    /// assert!(x.mysql_rdbms().is_none());
902    /// assert!(x.postgresql_rdbms().is_none());
903    /// assert!(x.sql_server_rdbms().is_none());
904    /// assert!(x.salesforce_org().is_none());
905    /// ```
906    pub fn set_mongodb_cluster<
907        T: std::convert::Into<std::boxed::Box<crate::model::MongodbCluster>>,
908    >(
909        mut self,
910        v: T,
911    ) -> Self {
912        self.data_object = std::option::Option::Some(
913            crate::model::discover_connection_profile_response::DataObject::MongodbCluster(
914                v.into(),
915            ),
916        );
917        self
918    }
919}
920
921impl wkt::message::Message for DiscoverConnectionProfileResponse {
922    fn typename() -> &'static str {
923        "type.googleapis.com/google.cloud.datastream.v1.DiscoverConnectionProfileResponse"
924    }
925}
926
927/// Defines additional types related to [DiscoverConnectionProfileResponse].
928pub mod discover_connection_profile_response {
929    #[allow(unused_imports)]
930    use super::*;
931
932    /// The data object that has been enriched by the discover API call.
933    #[derive(Clone, Debug, PartialEq)]
934    #[non_exhaustive]
935    pub enum DataObject {
936        /// Enriched Oracle RDBMS object.
937        OracleRdbms(std::boxed::Box<crate::model::OracleRdbms>),
938        /// Enriched MySQL RDBMS object.
939        MysqlRdbms(std::boxed::Box<crate::model::MysqlRdbms>),
940        /// Enriched PostgreSQL RDBMS object.
941        PostgresqlRdbms(std::boxed::Box<crate::model::PostgresqlRdbms>),
942        /// Enriched SQLServer RDBMS object.
943        SqlServerRdbms(std::boxed::Box<crate::model::SqlServerRdbms>),
944        /// Enriched Salesforce organization.
945        SalesforceOrg(std::boxed::Box<crate::model::SalesforceOrg>),
946        /// Enriched MongoDB cluster.
947        MongodbCluster(std::boxed::Box<crate::model::MongodbCluster>),
948    }
949}
950
951/// Request message for 'FetchStaticIps' request.
952#[derive(Clone, Default, PartialEq)]
953#[non_exhaustive]
954pub struct FetchStaticIpsRequest {
955    /// Required. The resource name for the location for which static IPs should be
956    /// returned. Must be in the format `projects/*/locations/*`.
957    pub name: std::string::String,
958
959    /// Maximum number of Ips to return, will likely not be specified.
960    pub page_size: i32,
961
962    /// A page token, received from a previous `ListStaticIps` call.
963    /// will likely not be specified.
964    pub page_token: std::string::String,
965
966    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
967}
968
969impl FetchStaticIpsRequest {
970    /// Creates a new default instance.
971    pub fn new() -> Self {
972        std::default::Default::default()
973    }
974
975    /// Sets the value of [name][crate::model::FetchStaticIpsRequest::name].
976    ///
977    /// # Example
978    /// ```ignore,no_run
979    /// # use google_cloud_datastream_v1::model::FetchStaticIpsRequest;
980    /// let x = FetchStaticIpsRequest::new().set_name("example");
981    /// ```
982    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
983        self.name = v.into();
984        self
985    }
986
987    /// Sets the value of [page_size][crate::model::FetchStaticIpsRequest::page_size].
988    ///
989    /// # Example
990    /// ```ignore,no_run
991    /// # use google_cloud_datastream_v1::model::FetchStaticIpsRequest;
992    /// let x = FetchStaticIpsRequest::new().set_page_size(42);
993    /// ```
994    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
995        self.page_size = v.into();
996        self
997    }
998
999    /// Sets the value of [page_token][crate::model::FetchStaticIpsRequest::page_token].
1000    ///
1001    /// # Example
1002    /// ```ignore,no_run
1003    /// # use google_cloud_datastream_v1::model::FetchStaticIpsRequest;
1004    /// let x = FetchStaticIpsRequest::new().set_page_token("example");
1005    /// ```
1006    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1007        self.page_token = v.into();
1008        self
1009    }
1010}
1011
1012impl wkt::message::Message for FetchStaticIpsRequest {
1013    fn typename() -> &'static str {
1014        "type.googleapis.com/google.cloud.datastream.v1.FetchStaticIpsRequest"
1015    }
1016}
1017
1018/// Response message for a 'FetchStaticIps' response.
1019#[derive(Clone, Default, PartialEq)]
1020#[non_exhaustive]
1021pub struct FetchStaticIpsResponse {
1022    /// list of static ips by account
1023    pub static_ips: std::vec::Vec<std::string::String>,
1024
1025    /// A token that can be sent as `page_token` to retrieve the next page.
1026    /// If this field is omitted, there are no subsequent pages.
1027    pub next_page_token: std::string::String,
1028
1029    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1030}
1031
1032impl FetchStaticIpsResponse {
1033    /// Creates a new default instance.
1034    pub fn new() -> Self {
1035        std::default::Default::default()
1036    }
1037
1038    /// Sets the value of [static_ips][crate::model::FetchStaticIpsResponse::static_ips].
1039    ///
1040    /// # Example
1041    /// ```ignore,no_run
1042    /// # use google_cloud_datastream_v1::model::FetchStaticIpsResponse;
1043    /// let x = FetchStaticIpsResponse::new().set_static_ips(["a", "b", "c"]);
1044    /// ```
1045    pub fn set_static_ips<T, V>(mut self, v: T) -> Self
1046    where
1047        T: std::iter::IntoIterator<Item = V>,
1048        V: std::convert::Into<std::string::String>,
1049    {
1050        use std::iter::Iterator;
1051        self.static_ips = v.into_iter().map(|i| i.into()).collect();
1052        self
1053    }
1054
1055    /// Sets the value of [next_page_token][crate::model::FetchStaticIpsResponse::next_page_token].
1056    ///
1057    /// # Example
1058    /// ```ignore,no_run
1059    /// # use google_cloud_datastream_v1::model::FetchStaticIpsResponse;
1060    /// let x = FetchStaticIpsResponse::new().set_next_page_token("example");
1061    /// ```
1062    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1063        self.next_page_token = v.into();
1064        self
1065    }
1066}
1067
1068impl wkt::message::Message for FetchStaticIpsResponse {
1069    fn typename() -> &'static str {
1070        "type.googleapis.com/google.cloud.datastream.v1.FetchStaticIpsResponse"
1071    }
1072}
1073
1074/// Request message for listing connection profiles.
1075#[derive(Clone, Default, PartialEq)]
1076#[non_exhaustive]
1077pub struct ListConnectionProfilesRequest {
1078    /// Required. The parent that owns the collection of connection profiles.
1079    pub parent: std::string::String,
1080
1081    /// Maximum number of connection profiles to return.
1082    /// If unspecified, at most 50 connection profiles will be returned.
1083    /// The maximum value is 1000; values above 1000 will be coerced to 1000.
1084    pub page_size: i32,
1085
1086    /// Page token received from a previous `ListConnectionProfiles` call.
1087    /// Provide this to retrieve the subsequent page.
1088    ///
1089    /// When paginating, all other parameters provided to `ListConnectionProfiles`
1090    /// must match the call that provided the page token.
1091    pub page_token: std::string::String,
1092
1093    /// Filter request.
1094    pub filter: std::string::String,
1095
1096    /// Order by fields for the result.
1097    pub order_by: std::string::String,
1098
1099    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1100}
1101
1102impl ListConnectionProfilesRequest {
1103    /// Creates a new default instance.
1104    pub fn new() -> Self {
1105        std::default::Default::default()
1106    }
1107
1108    /// Sets the value of [parent][crate::model::ListConnectionProfilesRequest::parent].
1109    ///
1110    /// # Example
1111    /// ```ignore,no_run
1112    /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1113    /// # let project_id = "project_id";
1114    /// # let location_id = "location_id";
1115    /// let x = ListConnectionProfilesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
1116    /// ```
1117    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1118        self.parent = v.into();
1119        self
1120    }
1121
1122    /// Sets the value of [page_size][crate::model::ListConnectionProfilesRequest::page_size].
1123    ///
1124    /// # Example
1125    /// ```ignore,no_run
1126    /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1127    /// let x = ListConnectionProfilesRequest::new().set_page_size(42);
1128    /// ```
1129    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1130        self.page_size = v.into();
1131        self
1132    }
1133
1134    /// Sets the value of [page_token][crate::model::ListConnectionProfilesRequest::page_token].
1135    ///
1136    /// # Example
1137    /// ```ignore,no_run
1138    /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1139    /// let x = ListConnectionProfilesRequest::new().set_page_token("example");
1140    /// ```
1141    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1142        self.page_token = v.into();
1143        self
1144    }
1145
1146    /// Sets the value of [filter][crate::model::ListConnectionProfilesRequest::filter].
1147    ///
1148    /// # Example
1149    /// ```ignore,no_run
1150    /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1151    /// let x = ListConnectionProfilesRequest::new().set_filter("example");
1152    /// ```
1153    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1154        self.filter = v.into();
1155        self
1156    }
1157
1158    /// Sets the value of [order_by][crate::model::ListConnectionProfilesRequest::order_by].
1159    ///
1160    /// # Example
1161    /// ```ignore,no_run
1162    /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1163    /// let x = ListConnectionProfilesRequest::new().set_order_by("example");
1164    /// ```
1165    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1166        self.order_by = v.into();
1167        self
1168    }
1169}
1170
1171impl wkt::message::Message for ListConnectionProfilesRequest {
1172    fn typename() -> &'static str {
1173        "type.googleapis.com/google.cloud.datastream.v1.ListConnectionProfilesRequest"
1174    }
1175}
1176
1177/// Response message for listing connection profiles.
1178#[derive(Clone, Default, PartialEq)]
1179#[non_exhaustive]
1180pub struct ListConnectionProfilesResponse {
1181    /// List of connection profiles.
1182    pub connection_profiles: std::vec::Vec<crate::model::ConnectionProfile>,
1183
1184    /// A token, which can be sent as `page_token` to retrieve the next page.
1185    /// If this field is omitted, there are no subsequent pages.
1186    pub next_page_token: std::string::String,
1187
1188    /// Locations that could not be reached.
1189    pub unreachable: std::vec::Vec<std::string::String>,
1190
1191    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1192}
1193
1194impl ListConnectionProfilesResponse {
1195    /// Creates a new default instance.
1196    pub fn new() -> Self {
1197        std::default::Default::default()
1198    }
1199
1200    /// Sets the value of [connection_profiles][crate::model::ListConnectionProfilesResponse::connection_profiles].
1201    ///
1202    /// # Example
1203    /// ```ignore,no_run
1204    /// # use google_cloud_datastream_v1::model::ListConnectionProfilesResponse;
1205    /// use google_cloud_datastream_v1::model::ConnectionProfile;
1206    /// let x = ListConnectionProfilesResponse::new()
1207    ///     .set_connection_profiles([
1208    ///         ConnectionProfile::default()/* use setters */,
1209    ///         ConnectionProfile::default()/* use (different) setters */,
1210    ///     ]);
1211    /// ```
1212    pub fn set_connection_profiles<T, V>(mut self, v: T) -> Self
1213    where
1214        T: std::iter::IntoIterator<Item = V>,
1215        V: std::convert::Into<crate::model::ConnectionProfile>,
1216    {
1217        use std::iter::Iterator;
1218        self.connection_profiles = v.into_iter().map(|i| i.into()).collect();
1219        self
1220    }
1221
1222    /// Sets the value of [next_page_token][crate::model::ListConnectionProfilesResponse::next_page_token].
1223    ///
1224    /// # Example
1225    /// ```ignore,no_run
1226    /// # use google_cloud_datastream_v1::model::ListConnectionProfilesResponse;
1227    /// let x = ListConnectionProfilesResponse::new().set_next_page_token("example");
1228    /// ```
1229    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1230        self.next_page_token = v.into();
1231        self
1232    }
1233
1234    /// Sets the value of [unreachable][crate::model::ListConnectionProfilesResponse::unreachable].
1235    ///
1236    /// # Example
1237    /// ```ignore,no_run
1238    /// # use google_cloud_datastream_v1::model::ListConnectionProfilesResponse;
1239    /// let x = ListConnectionProfilesResponse::new().set_unreachable(["a", "b", "c"]);
1240    /// ```
1241    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1242    where
1243        T: std::iter::IntoIterator<Item = V>,
1244        V: std::convert::Into<std::string::String>,
1245    {
1246        use std::iter::Iterator;
1247        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1248        self
1249    }
1250}
1251
1252impl wkt::message::Message for ListConnectionProfilesResponse {
1253    fn typename() -> &'static str {
1254        "type.googleapis.com/google.cloud.datastream.v1.ListConnectionProfilesResponse"
1255    }
1256}
1257
1258#[doc(hidden)]
1259impl google_cloud_gax::paginator::internal::PageableResponse for ListConnectionProfilesResponse {
1260    type PageItem = crate::model::ConnectionProfile;
1261
1262    fn items(self) -> std::vec::Vec<Self::PageItem> {
1263        self.connection_profiles
1264    }
1265
1266    fn next_page_token(&self) -> std::string::String {
1267        use std::clone::Clone;
1268        self.next_page_token.clone()
1269    }
1270}
1271
1272/// Request message for getting a connection profile.
1273#[derive(Clone, Default, PartialEq)]
1274#[non_exhaustive]
1275pub struct GetConnectionProfileRequest {
1276    /// Required. The name of the connection profile resource to get.
1277    pub name: std::string::String,
1278
1279    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1280}
1281
1282impl GetConnectionProfileRequest {
1283    /// Creates a new default instance.
1284    pub fn new() -> Self {
1285        std::default::Default::default()
1286    }
1287
1288    /// Sets the value of [name][crate::model::GetConnectionProfileRequest::name].
1289    ///
1290    /// # Example
1291    /// ```ignore,no_run
1292    /// # use google_cloud_datastream_v1::model::GetConnectionProfileRequest;
1293    /// # let project_id = "project_id";
1294    /// # let location_id = "location_id";
1295    /// # let connection_profile_id = "connection_profile_id";
1296    /// let x = GetConnectionProfileRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connectionProfiles/{connection_profile_id}"));
1297    /// ```
1298    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1299        self.name = v.into();
1300        self
1301    }
1302}
1303
1304impl wkt::message::Message for GetConnectionProfileRequest {
1305    fn typename() -> &'static str {
1306        "type.googleapis.com/google.cloud.datastream.v1.GetConnectionProfileRequest"
1307    }
1308}
1309
1310/// Request message for creating a connection profile.
1311#[derive(Clone, Default, PartialEq)]
1312#[non_exhaustive]
1313pub struct CreateConnectionProfileRequest {
1314    /// Required. The parent that owns the collection of ConnectionProfiles.
1315    pub parent: std::string::String,
1316
1317    /// Required. The connection profile identifier.
1318    pub connection_profile_id: std::string::String,
1319
1320    /// Required. The connection profile resource to create.
1321    pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
1322
1323    /// Optional. A request ID to identify requests. Specify a unique request ID
1324    /// so that if you must retry your request, the server will know to ignore
1325    /// the request if it has already been completed. The server will guarantee
1326    /// that for at least 60 minutes since the first request.
1327    ///
1328    /// For example, consider a situation where you make an initial request and the
1329    /// request times out. If you make the request again with the same request ID,
1330    /// the server can check if original operation with the same request ID was
1331    /// received, and if so, will ignore the second request. This prevents clients
1332    /// from accidentally creating duplicate commitments.
1333    ///
1334    /// The request ID must be a valid UUID with the exception that zero UUID is
1335    /// not supported (00000000-0000-0000-0000-000000000000).
1336    pub request_id: std::string::String,
1337
1338    /// Optional. Only validate the connection profile, but don't create any
1339    /// resources. The default is false.
1340    pub validate_only: bool,
1341
1342    /// Optional. Create the connection profile without validating it.
1343    pub force: bool,
1344
1345    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1346}
1347
1348impl CreateConnectionProfileRequest {
1349    /// Creates a new default instance.
1350    pub fn new() -> Self {
1351        std::default::Default::default()
1352    }
1353
1354    /// Sets the value of [parent][crate::model::CreateConnectionProfileRequest::parent].
1355    ///
1356    /// # Example
1357    /// ```ignore,no_run
1358    /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1359    /// # let project_id = "project_id";
1360    /// # let location_id = "location_id";
1361    /// let x = CreateConnectionProfileRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
1362    /// ```
1363    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1364        self.parent = v.into();
1365        self
1366    }
1367
1368    /// Sets the value of [connection_profile_id][crate::model::CreateConnectionProfileRequest::connection_profile_id].
1369    ///
1370    /// # Example
1371    /// ```ignore,no_run
1372    /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1373    /// let x = CreateConnectionProfileRequest::new().set_connection_profile_id("example");
1374    /// ```
1375    pub fn set_connection_profile_id<T: std::convert::Into<std::string::String>>(
1376        mut self,
1377        v: T,
1378    ) -> Self {
1379        self.connection_profile_id = v.into();
1380        self
1381    }
1382
1383    /// Sets 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_connection_profile(ConnectionProfile::default()/* use setters */);
1390    /// ```
1391    pub fn set_connection_profile<T>(mut self, v: T) -> Self
1392    where
1393        T: std::convert::Into<crate::model::ConnectionProfile>,
1394    {
1395        self.connection_profile = std::option::Option::Some(v.into());
1396        self
1397    }
1398
1399    /// Sets or clears the value of [connection_profile][crate::model::CreateConnectionProfileRequest::connection_profile].
1400    ///
1401    /// # Example
1402    /// ```ignore,no_run
1403    /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1404    /// use google_cloud_datastream_v1::model::ConnectionProfile;
1405    /// let x = CreateConnectionProfileRequest::new().set_or_clear_connection_profile(Some(ConnectionProfile::default()/* use setters */));
1406    /// let x = CreateConnectionProfileRequest::new().set_or_clear_connection_profile(None::<ConnectionProfile>);
1407    /// ```
1408    pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
1409    where
1410        T: std::convert::Into<crate::model::ConnectionProfile>,
1411    {
1412        self.connection_profile = v.map(|x| x.into());
1413        self
1414    }
1415
1416    /// Sets the value of [request_id][crate::model::CreateConnectionProfileRequest::request_id].
1417    ///
1418    /// # Example
1419    /// ```ignore,no_run
1420    /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1421    /// let x = CreateConnectionProfileRequest::new().set_request_id("example");
1422    /// ```
1423    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1424        self.request_id = v.into();
1425        self
1426    }
1427
1428    /// Sets the value of [validate_only][crate::model::CreateConnectionProfileRequest::validate_only].
1429    ///
1430    /// # Example
1431    /// ```ignore,no_run
1432    /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1433    /// let x = CreateConnectionProfileRequest::new().set_validate_only(true);
1434    /// ```
1435    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1436        self.validate_only = v.into();
1437        self
1438    }
1439
1440    /// Sets the value of [force][crate::model::CreateConnectionProfileRequest::force].
1441    ///
1442    /// # Example
1443    /// ```ignore,no_run
1444    /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1445    /// let x = CreateConnectionProfileRequest::new().set_force(true);
1446    /// ```
1447    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1448        self.force = v.into();
1449        self
1450    }
1451}
1452
1453impl wkt::message::Message for CreateConnectionProfileRequest {
1454    fn typename() -> &'static str {
1455        "type.googleapis.com/google.cloud.datastream.v1.CreateConnectionProfileRequest"
1456    }
1457}
1458
1459/// Connection profile update message.
1460#[derive(Clone, Default, PartialEq)]
1461#[non_exhaustive]
1462pub struct UpdateConnectionProfileRequest {
1463    /// Optional. Field mask is used to specify the fields to be overwritten in the
1464    /// ConnectionProfile resource by the update.
1465    /// The fields specified in the update_mask are relative to the resource, not
1466    /// the full request. A field will be overwritten if it is in the mask. If the
1467    /// user does not provide a mask then all fields will be overwritten.
1468    pub update_mask: std::option::Option<wkt::FieldMask>,
1469
1470    /// Required. The connection profile to update.
1471    pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
1472
1473    /// Optional. A request ID to identify requests. Specify a unique request ID
1474    /// so that if you must retry your request, the server will know to ignore
1475    /// the request if it has already been completed. The server will guarantee
1476    /// that for at least 60 minutes since the first request.
1477    ///
1478    /// For example, consider a situation where you make an initial request and the
1479    /// request times out. If you make the request again with the same request ID,
1480    /// the server can check if original operation with the same request ID was
1481    /// received, and if so, will ignore the second request. This prevents clients
1482    /// from accidentally creating duplicate commitments.
1483    ///
1484    /// The request ID must be a valid UUID with the exception that zero UUID is
1485    /// not supported (00000000-0000-0000-0000-000000000000).
1486    pub request_id: std::string::String,
1487
1488    /// Optional. Only validate the connection profile, but don't update any
1489    /// resources. The default is false.
1490    pub validate_only: bool,
1491
1492    /// Optional. Update the connection profile without validating it.
1493    pub force: bool,
1494
1495    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1496}
1497
1498impl UpdateConnectionProfileRequest {
1499    /// Creates a new default instance.
1500    pub fn new() -> Self {
1501        std::default::Default::default()
1502    }
1503
1504    /// Sets the value of [update_mask][crate::model::UpdateConnectionProfileRequest::update_mask].
1505    ///
1506    /// # Example
1507    /// ```ignore,no_run
1508    /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1509    /// use wkt::FieldMask;
1510    /// let x = UpdateConnectionProfileRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1511    /// ```
1512    pub fn set_update_mask<T>(mut self, v: T) -> Self
1513    where
1514        T: std::convert::Into<wkt::FieldMask>,
1515    {
1516        self.update_mask = std::option::Option::Some(v.into());
1517        self
1518    }
1519
1520    /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionProfileRequest::update_mask].
1521    ///
1522    /// # Example
1523    /// ```ignore,no_run
1524    /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1525    /// use wkt::FieldMask;
1526    /// let x = UpdateConnectionProfileRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1527    /// let x = UpdateConnectionProfileRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1528    /// ```
1529    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1530    where
1531        T: std::convert::Into<wkt::FieldMask>,
1532    {
1533        self.update_mask = v.map(|x| x.into());
1534        self
1535    }
1536
1537    /// Sets the value of [connection_profile][crate::model::UpdateConnectionProfileRequest::connection_profile].
1538    ///
1539    /// # Example
1540    /// ```ignore,no_run
1541    /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1542    /// use google_cloud_datastream_v1::model::ConnectionProfile;
1543    /// let x = UpdateConnectionProfileRequest::new().set_connection_profile(ConnectionProfile::default()/* use setters */);
1544    /// ```
1545    pub fn set_connection_profile<T>(mut self, v: T) -> Self
1546    where
1547        T: std::convert::Into<crate::model::ConnectionProfile>,
1548    {
1549        self.connection_profile = std::option::Option::Some(v.into());
1550        self
1551    }
1552
1553    /// Sets or clears the value of [connection_profile][crate::model::UpdateConnectionProfileRequest::connection_profile].
1554    ///
1555    /// # Example
1556    /// ```ignore,no_run
1557    /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1558    /// use google_cloud_datastream_v1::model::ConnectionProfile;
1559    /// let x = UpdateConnectionProfileRequest::new().set_or_clear_connection_profile(Some(ConnectionProfile::default()/* use setters */));
1560    /// let x = UpdateConnectionProfileRequest::new().set_or_clear_connection_profile(None::<ConnectionProfile>);
1561    /// ```
1562    pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
1563    where
1564        T: std::convert::Into<crate::model::ConnectionProfile>,
1565    {
1566        self.connection_profile = v.map(|x| x.into());
1567        self
1568    }
1569
1570    /// Sets the value of [request_id][crate::model::UpdateConnectionProfileRequest::request_id].
1571    ///
1572    /// # Example
1573    /// ```ignore,no_run
1574    /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1575    /// let x = UpdateConnectionProfileRequest::new().set_request_id("example");
1576    /// ```
1577    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1578        self.request_id = v.into();
1579        self
1580    }
1581
1582    /// Sets the value of [validate_only][crate::model::UpdateConnectionProfileRequest::validate_only].
1583    ///
1584    /// # Example
1585    /// ```ignore,no_run
1586    /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1587    /// let x = UpdateConnectionProfileRequest::new().set_validate_only(true);
1588    /// ```
1589    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1590        self.validate_only = v.into();
1591        self
1592    }
1593
1594    /// Sets the value of [force][crate::model::UpdateConnectionProfileRequest::force].
1595    ///
1596    /// # Example
1597    /// ```ignore,no_run
1598    /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1599    /// let x = UpdateConnectionProfileRequest::new().set_force(true);
1600    /// ```
1601    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1602        self.force = v.into();
1603        self
1604    }
1605}
1606
1607impl wkt::message::Message for UpdateConnectionProfileRequest {
1608    fn typename() -> &'static str {
1609        "type.googleapis.com/google.cloud.datastream.v1.UpdateConnectionProfileRequest"
1610    }
1611}
1612
1613/// Request message for deleting a connection profile.
1614#[derive(Clone, Default, PartialEq)]
1615#[non_exhaustive]
1616pub struct DeleteConnectionProfileRequest {
1617    /// Required. The name of the connection profile resource to delete.
1618    pub name: std::string::String,
1619
1620    /// Optional. A request ID to identify requests. Specify a unique request ID
1621    /// so that if you must retry your request, the server will know to ignore
1622    /// the request if it has already been completed. The server will guarantee
1623    /// that for at least 60 minutes after the first request.
1624    ///
1625    /// For example, consider a situation where you make an initial request and the
1626    /// request times out. If you make the request again with the same request ID,
1627    /// the server can check if original operation with the same request ID was
1628    /// received, and if so, will ignore the second request. This prevents clients
1629    /// from accidentally creating duplicate commitments.
1630    ///
1631    /// The request ID must be a valid UUID with the exception that zero UUID is
1632    /// not supported (00000000-0000-0000-0000-000000000000).
1633    pub request_id: std::string::String,
1634
1635    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1636}
1637
1638impl DeleteConnectionProfileRequest {
1639    /// Creates a new default instance.
1640    pub fn new() -> Self {
1641        std::default::Default::default()
1642    }
1643
1644    /// Sets the value of [name][crate::model::DeleteConnectionProfileRequest::name].
1645    ///
1646    /// # Example
1647    /// ```ignore,no_run
1648    /// # use google_cloud_datastream_v1::model::DeleteConnectionProfileRequest;
1649    /// # let project_id = "project_id";
1650    /// # let location_id = "location_id";
1651    /// # let connection_profile_id = "connection_profile_id";
1652    /// let x = DeleteConnectionProfileRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connectionProfiles/{connection_profile_id}"));
1653    /// ```
1654    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1655        self.name = v.into();
1656        self
1657    }
1658
1659    /// Sets the value of [request_id][crate::model::DeleteConnectionProfileRequest::request_id].
1660    ///
1661    /// # Example
1662    /// ```ignore,no_run
1663    /// # use google_cloud_datastream_v1::model::DeleteConnectionProfileRequest;
1664    /// let x = DeleteConnectionProfileRequest::new().set_request_id("example");
1665    /// ```
1666    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1667        self.request_id = v.into();
1668        self
1669    }
1670}
1671
1672impl wkt::message::Message for DeleteConnectionProfileRequest {
1673    fn typename() -> &'static str {
1674        "type.googleapis.com/google.cloud.datastream.v1.DeleteConnectionProfileRequest"
1675    }
1676}
1677
1678/// Request message for listing streams.
1679#[derive(Clone, Default, PartialEq)]
1680#[non_exhaustive]
1681pub struct ListStreamsRequest {
1682    /// Required. The parent that owns the collection of streams.
1683    pub parent: std::string::String,
1684
1685    /// Maximum number of streams to return.
1686    /// If unspecified, at most 50 streams will  be returned. The maximum
1687    /// value is 1000; values above 1000 will be coerced to 1000.
1688    pub page_size: i32,
1689
1690    /// Page token received from a previous `ListStreams` call.
1691    /// Provide this to retrieve the subsequent page.
1692    ///
1693    /// When paginating, all other parameters provided to `ListStreams`
1694    /// must match the call that provided the page token.
1695    pub page_token: std::string::String,
1696
1697    /// Filter request.
1698    pub filter: std::string::String,
1699
1700    /// Order by fields for the result.
1701    pub order_by: std::string::String,
1702
1703    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1704}
1705
1706impl ListStreamsRequest {
1707    /// Creates a new default instance.
1708    pub fn new() -> Self {
1709        std::default::Default::default()
1710    }
1711
1712    /// Sets the value of [parent][crate::model::ListStreamsRequest::parent].
1713    ///
1714    /// # Example
1715    /// ```ignore,no_run
1716    /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1717    /// # let project_id = "project_id";
1718    /// # let location_id = "location_id";
1719    /// let x = ListStreamsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
1720    /// ```
1721    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1722        self.parent = v.into();
1723        self
1724    }
1725
1726    /// Sets the value of [page_size][crate::model::ListStreamsRequest::page_size].
1727    ///
1728    /// # Example
1729    /// ```ignore,no_run
1730    /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1731    /// let x = ListStreamsRequest::new().set_page_size(42);
1732    /// ```
1733    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1734        self.page_size = v.into();
1735        self
1736    }
1737
1738    /// Sets the value of [page_token][crate::model::ListStreamsRequest::page_token].
1739    ///
1740    /// # Example
1741    /// ```ignore,no_run
1742    /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1743    /// let x = ListStreamsRequest::new().set_page_token("example");
1744    /// ```
1745    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1746        self.page_token = v.into();
1747        self
1748    }
1749
1750    /// Sets the value of [filter][crate::model::ListStreamsRequest::filter].
1751    ///
1752    /// # Example
1753    /// ```ignore,no_run
1754    /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1755    /// let x = ListStreamsRequest::new().set_filter("example");
1756    /// ```
1757    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1758        self.filter = v.into();
1759        self
1760    }
1761
1762    /// Sets the value of [order_by][crate::model::ListStreamsRequest::order_by].
1763    ///
1764    /// # Example
1765    /// ```ignore,no_run
1766    /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1767    /// let x = ListStreamsRequest::new().set_order_by("example");
1768    /// ```
1769    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1770        self.order_by = v.into();
1771        self
1772    }
1773}
1774
1775impl wkt::message::Message for ListStreamsRequest {
1776    fn typename() -> &'static str {
1777        "type.googleapis.com/google.cloud.datastream.v1.ListStreamsRequest"
1778    }
1779}
1780
1781/// Response message for listing streams.
1782#[derive(Clone, Default, PartialEq)]
1783#[non_exhaustive]
1784pub struct ListStreamsResponse {
1785    /// List of streams
1786    pub streams: std::vec::Vec<crate::model::Stream>,
1787
1788    /// A token, which can be sent as `page_token` to retrieve the next page.
1789    /// If this field is omitted, there are no subsequent pages.
1790    pub next_page_token: std::string::String,
1791
1792    /// Locations that could not be reached.
1793    pub unreachable: std::vec::Vec<std::string::String>,
1794
1795    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1796}
1797
1798impl ListStreamsResponse {
1799    /// Creates a new default instance.
1800    pub fn new() -> Self {
1801        std::default::Default::default()
1802    }
1803
1804    /// Sets the value of [streams][crate::model::ListStreamsResponse::streams].
1805    ///
1806    /// # Example
1807    /// ```ignore,no_run
1808    /// # use google_cloud_datastream_v1::model::ListStreamsResponse;
1809    /// use google_cloud_datastream_v1::model::Stream;
1810    /// let x = ListStreamsResponse::new()
1811    ///     .set_streams([
1812    ///         Stream::default()/* use setters */,
1813    ///         Stream::default()/* use (different) setters */,
1814    ///     ]);
1815    /// ```
1816    pub fn set_streams<T, V>(mut self, v: T) -> Self
1817    where
1818        T: std::iter::IntoIterator<Item = V>,
1819        V: std::convert::Into<crate::model::Stream>,
1820    {
1821        use std::iter::Iterator;
1822        self.streams = v.into_iter().map(|i| i.into()).collect();
1823        self
1824    }
1825
1826    /// Sets the value of [next_page_token][crate::model::ListStreamsResponse::next_page_token].
1827    ///
1828    /// # Example
1829    /// ```ignore,no_run
1830    /// # use google_cloud_datastream_v1::model::ListStreamsResponse;
1831    /// let x = ListStreamsResponse::new().set_next_page_token("example");
1832    /// ```
1833    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1834        self.next_page_token = v.into();
1835        self
1836    }
1837
1838    /// Sets the value of [unreachable][crate::model::ListStreamsResponse::unreachable].
1839    ///
1840    /// # Example
1841    /// ```ignore,no_run
1842    /// # use google_cloud_datastream_v1::model::ListStreamsResponse;
1843    /// let x = ListStreamsResponse::new().set_unreachable(["a", "b", "c"]);
1844    /// ```
1845    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1846    where
1847        T: std::iter::IntoIterator<Item = V>,
1848        V: std::convert::Into<std::string::String>,
1849    {
1850        use std::iter::Iterator;
1851        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1852        self
1853    }
1854}
1855
1856impl wkt::message::Message for ListStreamsResponse {
1857    fn typename() -> &'static str {
1858        "type.googleapis.com/google.cloud.datastream.v1.ListStreamsResponse"
1859    }
1860}
1861
1862#[doc(hidden)]
1863impl google_cloud_gax::paginator::internal::PageableResponse for ListStreamsResponse {
1864    type PageItem = crate::model::Stream;
1865
1866    fn items(self) -> std::vec::Vec<Self::PageItem> {
1867        self.streams
1868    }
1869
1870    fn next_page_token(&self) -> std::string::String {
1871        use std::clone::Clone;
1872        self.next_page_token.clone()
1873    }
1874}
1875
1876/// Request message for getting a stream.
1877#[derive(Clone, Default, PartialEq)]
1878#[non_exhaustive]
1879pub struct GetStreamRequest {
1880    /// Required. The name of the stream resource to get.
1881    pub name: std::string::String,
1882
1883    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1884}
1885
1886impl GetStreamRequest {
1887    /// Creates a new default instance.
1888    pub fn new() -> Self {
1889        std::default::Default::default()
1890    }
1891
1892    /// Sets the value of [name][crate::model::GetStreamRequest::name].
1893    ///
1894    /// # Example
1895    /// ```ignore,no_run
1896    /// # use google_cloud_datastream_v1::model::GetStreamRequest;
1897    /// # let project_id = "project_id";
1898    /// # let location_id = "location_id";
1899    /// # let stream_id = "stream_id";
1900    /// let x = GetStreamRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/streams/{stream_id}"));
1901    /// ```
1902    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1903        self.name = v.into();
1904        self
1905    }
1906}
1907
1908impl wkt::message::Message for GetStreamRequest {
1909    fn typename() -> &'static str {
1910        "type.googleapis.com/google.cloud.datastream.v1.GetStreamRequest"
1911    }
1912}
1913
1914/// Request message for creating a stream.
1915#[derive(Clone, Default, PartialEq)]
1916#[non_exhaustive]
1917pub struct CreateStreamRequest {
1918    /// Required. The parent that owns the collection of streams.
1919    pub parent: std::string::String,
1920
1921    /// Required. The stream identifier.
1922    pub stream_id: std::string::String,
1923
1924    /// Required. The stream resource to create.
1925    pub stream: std::option::Option<crate::model::Stream>,
1926
1927    /// Optional. A request ID to identify requests. Specify a unique request ID
1928    /// so that if you must retry your request, the server will know to ignore
1929    /// the request if it has already been completed. The server will guarantee
1930    /// that for at least 60 minutes since the first request.
1931    ///
1932    /// For example, consider a situation where you make an initial request and the
1933    /// request times out. If you make the request again with the same request ID,
1934    /// the server can check if original operation with the same request ID was
1935    /// received, and if so, will ignore the second request. This prevents clients
1936    /// from accidentally creating duplicate commitments.
1937    ///
1938    /// The request ID must be a valid UUID with the exception that zero UUID is
1939    /// not supported (00000000-0000-0000-0000-000000000000).
1940    pub request_id: std::string::String,
1941
1942    /// Optional. Only validate the stream, but don't create any resources.
1943    /// The default is false.
1944    pub validate_only: bool,
1945
1946    /// Optional. Create the stream without validating it.
1947    pub force: bool,
1948
1949    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1950}
1951
1952impl CreateStreamRequest {
1953    /// Creates a new default instance.
1954    pub fn new() -> Self {
1955        std::default::Default::default()
1956    }
1957
1958    /// Sets the value of [parent][crate::model::CreateStreamRequest::parent].
1959    ///
1960    /// # Example
1961    /// ```ignore,no_run
1962    /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
1963    /// # let project_id = "project_id";
1964    /// # let location_id = "location_id";
1965    /// let x = CreateStreamRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
1966    /// ```
1967    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1968        self.parent = v.into();
1969        self
1970    }
1971
1972    /// Sets the value of [stream_id][crate::model::CreateStreamRequest::stream_id].
1973    ///
1974    /// # Example
1975    /// ```ignore,no_run
1976    /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
1977    /// let x = CreateStreamRequest::new().set_stream_id("example");
1978    /// ```
1979    pub fn set_stream_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1980        self.stream_id = v.into();
1981        self
1982    }
1983
1984    /// Sets the value of [stream][crate::model::CreateStreamRequest::stream].
1985    ///
1986    /// # Example
1987    /// ```ignore,no_run
1988    /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
1989    /// use google_cloud_datastream_v1::model::Stream;
1990    /// let x = CreateStreamRequest::new().set_stream(Stream::default()/* use setters */);
1991    /// ```
1992    pub fn set_stream<T>(mut self, v: T) -> Self
1993    where
1994        T: std::convert::Into<crate::model::Stream>,
1995    {
1996        self.stream = std::option::Option::Some(v.into());
1997        self
1998    }
1999
2000    /// Sets or clears the value of [stream][crate::model::CreateStreamRequest::stream].
2001    ///
2002    /// # Example
2003    /// ```ignore,no_run
2004    /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
2005    /// use google_cloud_datastream_v1::model::Stream;
2006    /// let x = CreateStreamRequest::new().set_or_clear_stream(Some(Stream::default()/* use setters */));
2007    /// let x = CreateStreamRequest::new().set_or_clear_stream(None::<Stream>);
2008    /// ```
2009    pub fn set_or_clear_stream<T>(mut self, v: std::option::Option<T>) -> Self
2010    where
2011        T: std::convert::Into<crate::model::Stream>,
2012    {
2013        self.stream = v.map(|x| x.into());
2014        self
2015    }
2016
2017    /// Sets the value of [request_id][crate::model::CreateStreamRequest::request_id].
2018    ///
2019    /// # Example
2020    /// ```ignore,no_run
2021    /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
2022    /// let x = CreateStreamRequest::new().set_request_id("example");
2023    /// ```
2024    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2025        self.request_id = v.into();
2026        self
2027    }
2028
2029    /// Sets the value of [validate_only][crate::model::CreateStreamRequest::validate_only].
2030    ///
2031    /// # Example
2032    /// ```ignore,no_run
2033    /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
2034    /// let x = CreateStreamRequest::new().set_validate_only(true);
2035    /// ```
2036    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2037        self.validate_only = v.into();
2038        self
2039    }
2040
2041    /// Sets the value of [force][crate::model::CreateStreamRequest::force].
2042    ///
2043    /// # Example
2044    /// ```ignore,no_run
2045    /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
2046    /// let x = CreateStreamRequest::new().set_force(true);
2047    /// ```
2048    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2049        self.force = v.into();
2050        self
2051    }
2052}
2053
2054impl wkt::message::Message for CreateStreamRequest {
2055    fn typename() -> &'static str {
2056        "type.googleapis.com/google.cloud.datastream.v1.CreateStreamRequest"
2057    }
2058}
2059
2060/// Request message for updating a stream.
2061#[derive(Clone, Default, PartialEq)]
2062#[non_exhaustive]
2063pub struct UpdateStreamRequest {
2064    /// Optional. Field mask is used to specify the fields to be overwritten in the
2065    /// stream resource by the update.
2066    /// The fields specified in the update_mask are relative to the resource, not
2067    /// the full request. A field will be overwritten if it is in the mask. If the
2068    /// user does not provide a mask then all fields will be overwritten.
2069    pub update_mask: std::option::Option<wkt::FieldMask>,
2070
2071    /// Required. The stream resource to update.
2072    pub stream: std::option::Option<crate::model::Stream>,
2073
2074    /// Optional. A request ID to identify requests. Specify a unique request ID
2075    /// so that if you must retry your request, the server will know to ignore
2076    /// the request if it has already been completed. The server will guarantee
2077    /// that for at least 60 minutes since the first request.
2078    ///
2079    /// For example, consider a situation where you make an initial request and the
2080    /// request times out. If you make the request again with the same request ID,
2081    /// the server can check if original operation with the same request ID was
2082    /// received, and if so, will ignore the second request. This prevents clients
2083    /// from accidentally creating duplicate commitments.
2084    ///
2085    /// The request ID must be a valid UUID with the exception that zero UUID is
2086    /// not supported (00000000-0000-0000-0000-000000000000).
2087    pub request_id: std::string::String,
2088
2089    /// Optional. Only validate the stream with the changes, without actually
2090    /// updating it. The default is false.
2091    pub validate_only: bool,
2092
2093    /// Optional. Update the stream without validating it.
2094    pub force: bool,
2095
2096    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2097}
2098
2099impl UpdateStreamRequest {
2100    /// Creates a new default instance.
2101    pub fn new() -> Self {
2102        std::default::Default::default()
2103    }
2104
2105    /// Sets the value of [update_mask][crate::model::UpdateStreamRequest::update_mask].
2106    ///
2107    /// # Example
2108    /// ```ignore,no_run
2109    /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2110    /// use wkt::FieldMask;
2111    /// let x = UpdateStreamRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2112    /// ```
2113    pub fn set_update_mask<T>(mut self, v: T) -> Self
2114    where
2115        T: std::convert::Into<wkt::FieldMask>,
2116    {
2117        self.update_mask = std::option::Option::Some(v.into());
2118        self
2119    }
2120
2121    /// Sets or clears the value of [update_mask][crate::model::UpdateStreamRequest::update_mask].
2122    ///
2123    /// # Example
2124    /// ```ignore,no_run
2125    /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2126    /// use wkt::FieldMask;
2127    /// let x = UpdateStreamRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2128    /// let x = UpdateStreamRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2129    /// ```
2130    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2131    where
2132        T: std::convert::Into<wkt::FieldMask>,
2133    {
2134        self.update_mask = v.map(|x| x.into());
2135        self
2136    }
2137
2138    /// Sets the value of [stream][crate::model::UpdateStreamRequest::stream].
2139    ///
2140    /// # Example
2141    /// ```ignore,no_run
2142    /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2143    /// use google_cloud_datastream_v1::model::Stream;
2144    /// let x = UpdateStreamRequest::new().set_stream(Stream::default()/* use setters */);
2145    /// ```
2146    pub fn set_stream<T>(mut self, v: T) -> Self
2147    where
2148        T: std::convert::Into<crate::model::Stream>,
2149    {
2150        self.stream = std::option::Option::Some(v.into());
2151        self
2152    }
2153
2154    /// Sets or clears the value of [stream][crate::model::UpdateStreamRequest::stream].
2155    ///
2156    /// # Example
2157    /// ```ignore,no_run
2158    /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2159    /// use google_cloud_datastream_v1::model::Stream;
2160    /// let x = UpdateStreamRequest::new().set_or_clear_stream(Some(Stream::default()/* use setters */));
2161    /// let x = UpdateStreamRequest::new().set_or_clear_stream(None::<Stream>);
2162    /// ```
2163    pub fn set_or_clear_stream<T>(mut self, v: std::option::Option<T>) -> Self
2164    where
2165        T: std::convert::Into<crate::model::Stream>,
2166    {
2167        self.stream = v.map(|x| x.into());
2168        self
2169    }
2170
2171    /// Sets the value of [request_id][crate::model::UpdateStreamRequest::request_id].
2172    ///
2173    /// # Example
2174    /// ```ignore,no_run
2175    /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2176    /// let x = UpdateStreamRequest::new().set_request_id("example");
2177    /// ```
2178    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2179        self.request_id = v.into();
2180        self
2181    }
2182
2183    /// Sets the value of [validate_only][crate::model::UpdateStreamRequest::validate_only].
2184    ///
2185    /// # Example
2186    /// ```ignore,no_run
2187    /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2188    /// let x = UpdateStreamRequest::new().set_validate_only(true);
2189    /// ```
2190    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2191        self.validate_only = v.into();
2192        self
2193    }
2194
2195    /// Sets the value of [force][crate::model::UpdateStreamRequest::force].
2196    ///
2197    /// # Example
2198    /// ```ignore,no_run
2199    /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2200    /// let x = UpdateStreamRequest::new().set_force(true);
2201    /// ```
2202    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2203        self.force = v.into();
2204        self
2205    }
2206}
2207
2208impl wkt::message::Message for UpdateStreamRequest {
2209    fn typename() -> &'static str {
2210        "type.googleapis.com/google.cloud.datastream.v1.UpdateStreamRequest"
2211    }
2212}
2213
2214/// Request message for deleting a stream.
2215#[derive(Clone, Default, PartialEq)]
2216#[non_exhaustive]
2217pub struct DeleteStreamRequest {
2218    /// Required. The name of the stream resource to delete.
2219    pub name: std::string::String,
2220
2221    /// Optional. A request ID to identify requests. Specify a unique request ID
2222    /// so that if you must retry your request, the server will know to ignore
2223    /// the request if it has already been completed. The server will guarantee
2224    /// that for at least 60 minutes after the first request.
2225    ///
2226    /// For example, consider a situation where you make an initial request and the
2227    /// request times out. If you make the request again with the same request ID,
2228    /// the server can check if original operation with the same request ID was
2229    /// received, and if so, will ignore the second request. This prevents clients
2230    /// from accidentally creating duplicate commitments.
2231    ///
2232    /// The request ID must be a valid UUID with the exception that zero UUID is
2233    /// not supported (00000000-0000-0000-0000-000000000000).
2234    pub request_id: std::string::String,
2235
2236    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2237}
2238
2239impl DeleteStreamRequest {
2240    /// Creates a new default instance.
2241    pub fn new() -> Self {
2242        std::default::Default::default()
2243    }
2244
2245    /// Sets the value of [name][crate::model::DeleteStreamRequest::name].
2246    ///
2247    /// # Example
2248    /// ```ignore,no_run
2249    /// # use google_cloud_datastream_v1::model::DeleteStreamRequest;
2250    /// # let project_id = "project_id";
2251    /// # let location_id = "location_id";
2252    /// # let stream_id = "stream_id";
2253    /// let x = DeleteStreamRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/streams/{stream_id}"));
2254    /// ```
2255    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2256        self.name = v.into();
2257        self
2258    }
2259
2260    /// Sets the value of [request_id][crate::model::DeleteStreamRequest::request_id].
2261    ///
2262    /// # Example
2263    /// ```ignore,no_run
2264    /// # use google_cloud_datastream_v1::model::DeleteStreamRequest;
2265    /// let x = DeleteStreamRequest::new().set_request_id("example");
2266    /// ```
2267    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2268        self.request_id = v.into();
2269        self
2270    }
2271}
2272
2273impl wkt::message::Message for DeleteStreamRequest {
2274    fn typename() -> &'static str {
2275        "type.googleapis.com/google.cloud.datastream.v1.DeleteStreamRequest"
2276    }
2277}
2278
2279/// Request message for running a stream.
2280#[derive(Clone, Default, PartialEq)]
2281#[non_exhaustive]
2282pub struct RunStreamRequest {
2283    /// Required. Name of the stream resource to start, in the format:
2284    /// projects/{project_id}/locations/{location}/streams/{stream_name}
2285    pub name: std::string::String,
2286
2287    /// Optional. The CDC strategy of the stream. If not set, the system's default
2288    /// value will be used.
2289    pub cdc_strategy: std::option::Option<crate::model::CdcStrategy>,
2290
2291    /// Optional. Update the stream without validating it.
2292    pub force: bool,
2293
2294    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2295}
2296
2297impl RunStreamRequest {
2298    /// Creates a new default instance.
2299    pub fn new() -> Self {
2300        std::default::Default::default()
2301    }
2302
2303    /// Sets the value of [name][crate::model::RunStreamRequest::name].
2304    ///
2305    /// # Example
2306    /// ```ignore,no_run
2307    /// # use google_cloud_datastream_v1::model::RunStreamRequest;
2308    /// # let project_id = "project_id";
2309    /// # let location_id = "location_id";
2310    /// # let stream_id = "stream_id";
2311    /// let x = RunStreamRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/streams/{stream_id}"));
2312    /// ```
2313    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2314        self.name = v.into();
2315        self
2316    }
2317
2318    /// Sets the value of [cdc_strategy][crate::model::RunStreamRequest::cdc_strategy].
2319    ///
2320    /// # Example
2321    /// ```ignore,no_run
2322    /// # use google_cloud_datastream_v1::model::RunStreamRequest;
2323    /// use google_cloud_datastream_v1::model::CdcStrategy;
2324    /// let x = RunStreamRequest::new().set_cdc_strategy(CdcStrategy::default()/* use setters */);
2325    /// ```
2326    pub fn set_cdc_strategy<T>(mut self, v: T) -> Self
2327    where
2328        T: std::convert::Into<crate::model::CdcStrategy>,
2329    {
2330        self.cdc_strategy = std::option::Option::Some(v.into());
2331        self
2332    }
2333
2334    /// Sets or clears the value of [cdc_strategy][crate::model::RunStreamRequest::cdc_strategy].
2335    ///
2336    /// # Example
2337    /// ```ignore,no_run
2338    /// # use google_cloud_datastream_v1::model::RunStreamRequest;
2339    /// use google_cloud_datastream_v1::model::CdcStrategy;
2340    /// let x = RunStreamRequest::new().set_or_clear_cdc_strategy(Some(CdcStrategy::default()/* use setters */));
2341    /// let x = RunStreamRequest::new().set_or_clear_cdc_strategy(None::<CdcStrategy>);
2342    /// ```
2343    pub fn set_or_clear_cdc_strategy<T>(mut self, v: std::option::Option<T>) -> Self
2344    where
2345        T: std::convert::Into<crate::model::CdcStrategy>,
2346    {
2347        self.cdc_strategy = v.map(|x| x.into());
2348        self
2349    }
2350
2351    /// Sets the value of [force][crate::model::RunStreamRequest::force].
2352    ///
2353    /// # Example
2354    /// ```ignore,no_run
2355    /// # use google_cloud_datastream_v1::model::RunStreamRequest;
2356    /// let x = RunStreamRequest::new().set_force(true);
2357    /// ```
2358    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2359        self.force = v.into();
2360        self
2361    }
2362}
2363
2364impl wkt::message::Message for RunStreamRequest {
2365    fn typename() -> &'static str {
2366        "type.googleapis.com/google.cloud.datastream.v1.RunStreamRequest"
2367    }
2368}
2369
2370/// Request for fetching a specific stream object.
2371#[derive(Clone, Default, PartialEq)]
2372#[non_exhaustive]
2373pub struct GetStreamObjectRequest {
2374    /// Required. The name of the stream object resource to get.
2375    pub name: std::string::String,
2376
2377    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2378}
2379
2380impl GetStreamObjectRequest {
2381    /// Creates a new default instance.
2382    pub fn new() -> Self {
2383        std::default::Default::default()
2384    }
2385
2386    /// Sets the value of [name][crate::model::GetStreamObjectRequest::name].
2387    ///
2388    /// # Example
2389    /// ```ignore,no_run
2390    /// # use google_cloud_datastream_v1::model::GetStreamObjectRequest;
2391    /// # let project_id = "project_id";
2392    /// # let location_id = "location_id";
2393    /// # let stream_id = "stream_id";
2394    /// # let object_id = "object_id";
2395    /// let x = GetStreamObjectRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/streams/{stream_id}/objects/{object_id}"));
2396    /// ```
2397    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2398        self.name = v.into();
2399        self
2400    }
2401}
2402
2403impl wkt::message::Message for GetStreamObjectRequest {
2404    fn typename() -> &'static str {
2405        "type.googleapis.com/google.cloud.datastream.v1.GetStreamObjectRequest"
2406    }
2407}
2408
2409/// Request for looking up a specific stream object by its source object
2410/// identifier.
2411#[derive(Clone, Default, PartialEq)]
2412#[non_exhaustive]
2413pub struct LookupStreamObjectRequest {
2414    /// Required. The parent stream that owns the collection of objects.
2415    pub parent: std::string::String,
2416
2417    /// Required. The source object identifier which maps to the stream object.
2418    pub source_object_identifier: std::option::Option<crate::model::SourceObjectIdentifier>,
2419
2420    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2421}
2422
2423impl LookupStreamObjectRequest {
2424    /// Creates a new default instance.
2425    pub fn new() -> Self {
2426        std::default::Default::default()
2427    }
2428
2429    /// Sets the value of [parent][crate::model::LookupStreamObjectRequest::parent].
2430    ///
2431    /// # Example
2432    /// ```ignore,no_run
2433    /// # use google_cloud_datastream_v1::model::LookupStreamObjectRequest;
2434    /// # let project_id = "project_id";
2435    /// # let location_id = "location_id";
2436    /// # let stream_id = "stream_id";
2437    /// let x = LookupStreamObjectRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/streams/{stream_id}"));
2438    /// ```
2439    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2440        self.parent = v.into();
2441        self
2442    }
2443
2444    /// Sets the value of [source_object_identifier][crate::model::LookupStreamObjectRequest::source_object_identifier].
2445    ///
2446    /// # Example
2447    /// ```ignore,no_run
2448    /// # use google_cloud_datastream_v1::model::LookupStreamObjectRequest;
2449    /// use google_cloud_datastream_v1::model::SourceObjectIdentifier;
2450    /// let x = LookupStreamObjectRequest::new().set_source_object_identifier(SourceObjectIdentifier::default()/* use setters */);
2451    /// ```
2452    pub fn set_source_object_identifier<T>(mut self, v: T) -> Self
2453    where
2454        T: std::convert::Into<crate::model::SourceObjectIdentifier>,
2455    {
2456        self.source_object_identifier = std::option::Option::Some(v.into());
2457        self
2458    }
2459
2460    /// Sets or clears the value of [source_object_identifier][crate::model::LookupStreamObjectRequest::source_object_identifier].
2461    ///
2462    /// # Example
2463    /// ```ignore,no_run
2464    /// # use google_cloud_datastream_v1::model::LookupStreamObjectRequest;
2465    /// use google_cloud_datastream_v1::model::SourceObjectIdentifier;
2466    /// let x = LookupStreamObjectRequest::new().set_or_clear_source_object_identifier(Some(SourceObjectIdentifier::default()/* use setters */));
2467    /// let x = LookupStreamObjectRequest::new().set_or_clear_source_object_identifier(None::<SourceObjectIdentifier>);
2468    /// ```
2469    pub fn set_or_clear_source_object_identifier<T>(mut self, v: std::option::Option<T>) -> Self
2470    where
2471        T: std::convert::Into<crate::model::SourceObjectIdentifier>,
2472    {
2473        self.source_object_identifier = v.map(|x| x.into());
2474        self
2475    }
2476}
2477
2478impl wkt::message::Message for LookupStreamObjectRequest {
2479    fn typename() -> &'static str {
2480        "type.googleapis.com/google.cloud.datastream.v1.LookupStreamObjectRequest"
2481    }
2482}
2483
2484/// Request for manually initiating a backfill job for a specific stream object.
2485#[derive(Clone, Default, PartialEq)]
2486#[non_exhaustive]
2487pub struct StartBackfillJobRequest {
2488    /// Required. The name of the stream object resource to start a backfill job
2489    /// for.
2490    pub object: std::string::String,
2491
2492    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2493}
2494
2495impl StartBackfillJobRequest {
2496    /// Creates a new default instance.
2497    pub fn new() -> Self {
2498        std::default::Default::default()
2499    }
2500
2501    /// Sets the value of [object][crate::model::StartBackfillJobRequest::object].
2502    ///
2503    /// # Example
2504    /// ```ignore,no_run
2505    /// # use google_cloud_datastream_v1::model::StartBackfillJobRequest;
2506    /// # let project_id = "project_id";
2507    /// # let location_id = "location_id";
2508    /// # let stream_id = "stream_id";
2509    /// # let object_id = "object_id";
2510    /// let x = StartBackfillJobRequest::new().set_object(format!("projects/{project_id}/locations/{location_id}/streams/{stream_id}/objects/{object_id}"));
2511    /// ```
2512    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2513        self.object = v.into();
2514        self
2515    }
2516}
2517
2518impl wkt::message::Message for StartBackfillJobRequest {
2519    fn typename() -> &'static str {
2520        "type.googleapis.com/google.cloud.datastream.v1.StartBackfillJobRequest"
2521    }
2522}
2523
2524/// Response for manually initiating a backfill job for a specific stream object.
2525#[derive(Clone, Default, PartialEq)]
2526#[non_exhaustive]
2527pub struct StartBackfillJobResponse {
2528    /// The stream object resource a backfill job was started for.
2529    pub object: std::option::Option<crate::model::StreamObject>,
2530
2531    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2532}
2533
2534impl StartBackfillJobResponse {
2535    /// Creates a new default instance.
2536    pub fn new() -> Self {
2537        std::default::Default::default()
2538    }
2539
2540    /// Sets the value of [object][crate::model::StartBackfillJobResponse::object].
2541    ///
2542    /// # Example
2543    /// ```ignore,no_run
2544    /// # use google_cloud_datastream_v1::model::StartBackfillJobResponse;
2545    /// use google_cloud_datastream_v1::model::StreamObject;
2546    /// let x = StartBackfillJobResponse::new().set_object(StreamObject::default()/* use setters */);
2547    /// ```
2548    pub fn set_object<T>(mut self, v: T) -> Self
2549    where
2550        T: std::convert::Into<crate::model::StreamObject>,
2551    {
2552        self.object = std::option::Option::Some(v.into());
2553        self
2554    }
2555
2556    /// Sets or clears the value of [object][crate::model::StartBackfillJobResponse::object].
2557    ///
2558    /// # Example
2559    /// ```ignore,no_run
2560    /// # use google_cloud_datastream_v1::model::StartBackfillJobResponse;
2561    /// use google_cloud_datastream_v1::model::StreamObject;
2562    /// let x = StartBackfillJobResponse::new().set_or_clear_object(Some(StreamObject::default()/* use setters */));
2563    /// let x = StartBackfillJobResponse::new().set_or_clear_object(None::<StreamObject>);
2564    /// ```
2565    pub fn set_or_clear_object<T>(mut self, v: std::option::Option<T>) -> Self
2566    where
2567        T: std::convert::Into<crate::model::StreamObject>,
2568    {
2569        self.object = v.map(|x| x.into());
2570        self
2571    }
2572}
2573
2574impl wkt::message::Message for StartBackfillJobResponse {
2575    fn typename() -> &'static str {
2576        "type.googleapis.com/google.cloud.datastream.v1.StartBackfillJobResponse"
2577    }
2578}
2579
2580/// Request for manually stopping a running backfill job for a specific stream
2581/// object.
2582#[derive(Clone, Default, PartialEq)]
2583#[non_exhaustive]
2584pub struct StopBackfillJobRequest {
2585    /// Required. The name of the stream object resource to stop the backfill job
2586    /// for.
2587    pub object: std::string::String,
2588
2589    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2590}
2591
2592impl StopBackfillJobRequest {
2593    /// Creates a new default instance.
2594    pub fn new() -> Self {
2595        std::default::Default::default()
2596    }
2597
2598    /// Sets the value of [object][crate::model::StopBackfillJobRequest::object].
2599    ///
2600    /// # Example
2601    /// ```ignore,no_run
2602    /// # use google_cloud_datastream_v1::model::StopBackfillJobRequest;
2603    /// # let project_id = "project_id";
2604    /// # let location_id = "location_id";
2605    /// # let stream_id = "stream_id";
2606    /// # let object_id = "object_id";
2607    /// let x = StopBackfillJobRequest::new().set_object(format!("projects/{project_id}/locations/{location_id}/streams/{stream_id}/objects/{object_id}"));
2608    /// ```
2609    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2610        self.object = v.into();
2611        self
2612    }
2613}
2614
2615impl wkt::message::Message for StopBackfillJobRequest {
2616    fn typename() -> &'static str {
2617        "type.googleapis.com/google.cloud.datastream.v1.StopBackfillJobRequest"
2618    }
2619}
2620
2621/// Response for manually stop a backfill job for a specific stream object.
2622#[derive(Clone, Default, PartialEq)]
2623#[non_exhaustive]
2624pub struct StopBackfillJobResponse {
2625    /// The stream object resource the backfill job was stopped for.
2626    pub object: std::option::Option<crate::model::StreamObject>,
2627
2628    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2629}
2630
2631impl StopBackfillJobResponse {
2632    /// Creates a new default instance.
2633    pub fn new() -> Self {
2634        std::default::Default::default()
2635    }
2636
2637    /// Sets the value of [object][crate::model::StopBackfillJobResponse::object].
2638    ///
2639    /// # Example
2640    /// ```ignore,no_run
2641    /// # use google_cloud_datastream_v1::model::StopBackfillJobResponse;
2642    /// use google_cloud_datastream_v1::model::StreamObject;
2643    /// let x = StopBackfillJobResponse::new().set_object(StreamObject::default()/* use setters */);
2644    /// ```
2645    pub fn set_object<T>(mut self, v: T) -> Self
2646    where
2647        T: std::convert::Into<crate::model::StreamObject>,
2648    {
2649        self.object = std::option::Option::Some(v.into());
2650        self
2651    }
2652
2653    /// Sets or clears the value of [object][crate::model::StopBackfillJobResponse::object].
2654    ///
2655    /// # Example
2656    /// ```ignore,no_run
2657    /// # use google_cloud_datastream_v1::model::StopBackfillJobResponse;
2658    /// use google_cloud_datastream_v1::model::StreamObject;
2659    /// let x = StopBackfillJobResponse::new().set_or_clear_object(Some(StreamObject::default()/* use setters */));
2660    /// let x = StopBackfillJobResponse::new().set_or_clear_object(None::<StreamObject>);
2661    /// ```
2662    pub fn set_or_clear_object<T>(mut self, v: std::option::Option<T>) -> Self
2663    where
2664        T: std::convert::Into<crate::model::StreamObject>,
2665    {
2666        self.object = v.map(|x| x.into());
2667        self
2668    }
2669}
2670
2671impl wkt::message::Message for StopBackfillJobResponse {
2672    fn typename() -> &'static str {
2673        "type.googleapis.com/google.cloud.datastream.v1.StopBackfillJobResponse"
2674    }
2675}
2676
2677/// Request for listing all objects for a specific stream.
2678#[derive(Clone, Default, PartialEq)]
2679#[non_exhaustive]
2680pub struct ListStreamObjectsRequest {
2681    /// Required. The parent stream that owns the collection of objects.
2682    pub parent: std::string::String,
2683
2684    /// Maximum number of objects to return. Default is 50.
2685    /// The maximum value is 1000; values above 1000 will be coerced to 1000.
2686    pub page_size: i32,
2687
2688    /// Page token received from a previous `ListStreamObjectsRequest` call.
2689    /// Provide this to retrieve the subsequent page.
2690    ///
2691    /// When paginating, all other parameters provided to
2692    /// `ListStreamObjectsRequest` must match the call that provided the page
2693    /// token.
2694    pub page_token: std::string::String,
2695
2696    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2697}
2698
2699impl ListStreamObjectsRequest {
2700    /// Creates a new default instance.
2701    pub fn new() -> Self {
2702        std::default::Default::default()
2703    }
2704
2705    /// Sets the value of [parent][crate::model::ListStreamObjectsRequest::parent].
2706    ///
2707    /// # Example
2708    /// ```ignore,no_run
2709    /// # use google_cloud_datastream_v1::model::ListStreamObjectsRequest;
2710    /// # let project_id = "project_id";
2711    /// # let location_id = "location_id";
2712    /// # let stream_id = "stream_id";
2713    /// let x = ListStreamObjectsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/streams/{stream_id}"));
2714    /// ```
2715    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2716        self.parent = v.into();
2717        self
2718    }
2719
2720    /// Sets the value of [page_size][crate::model::ListStreamObjectsRequest::page_size].
2721    ///
2722    /// # Example
2723    /// ```ignore,no_run
2724    /// # use google_cloud_datastream_v1::model::ListStreamObjectsRequest;
2725    /// let x = ListStreamObjectsRequest::new().set_page_size(42);
2726    /// ```
2727    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2728        self.page_size = v.into();
2729        self
2730    }
2731
2732    /// Sets the value of [page_token][crate::model::ListStreamObjectsRequest::page_token].
2733    ///
2734    /// # Example
2735    /// ```ignore,no_run
2736    /// # use google_cloud_datastream_v1::model::ListStreamObjectsRequest;
2737    /// let x = ListStreamObjectsRequest::new().set_page_token("example");
2738    /// ```
2739    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2740        self.page_token = v.into();
2741        self
2742    }
2743}
2744
2745impl wkt::message::Message for ListStreamObjectsRequest {
2746    fn typename() -> &'static str {
2747        "type.googleapis.com/google.cloud.datastream.v1.ListStreamObjectsRequest"
2748    }
2749}
2750
2751/// Response containing the objects for a stream.
2752#[derive(Clone, Default, PartialEq)]
2753#[non_exhaustive]
2754pub struct ListStreamObjectsResponse {
2755    /// List of stream objects.
2756    pub stream_objects: std::vec::Vec<crate::model::StreamObject>,
2757
2758    /// A token, which can be sent as `page_token` to retrieve the next page.
2759    pub next_page_token: std::string::String,
2760
2761    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2762}
2763
2764impl ListStreamObjectsResponse {
2765    /// Creates a new default instance.
2766    pub fn new() -> Self {
2767        std::default::Default::default()
2768    }
2769
2770    /// Sets the value of [stream_objects][crate::model::ListStreamObjectsResponse::stream_objects].
2771    ///
2772    /// # Example
2773    /// ```ignore,no_run
2774    /// # use google_cloud_datastream_v1::model::ListStreamObjectsResponse;
2775    /// use google_cloud_datastream_v1::model::StreamObject;
2776    /// let x = ListStreamObjectsResponse::new()
2777    ///     .set_stream_objects([
2778    ///         StreamObject::default()/* use setters */,
2779    ///         StreamObject::default()/* use (different) setters */,
2780    ///     ]);
2781    /// ```
2782    pub fn set_stream_objects<T, V>(mut self, v: T) -> Self
2783    where
2784        T: std::iter::IntoIterator<Item = V>,
2785        V: std::convert::Into<crate::model::StreamObject>,
2786    {
2787        use std::iter::Iterator;
2788        self.stream_objects = v.into_iter().map(|i| i.into()).collect();
2789        self
2790    }
2791
2792    /// Sets the value of [next_page_token][crate::model::ListStreamObjectsResponse::next_page_token].
2793    ///
2794    /// # Example
2795    /// ```ignore,no_run
2796    /// # use google_cloud_datastream_v1::model::ListStreamObjectsResponse;
2797    /// let x = ListStreamObjectsResponse::new().set_next_page_token("example");
2798    /// ```
2799    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2800        self.next_page_token = v.into();
2801        self
2802    }
2803}
2804
2805impl wkt::message::Message for ListStreamObjectsResponse {
2806    fn typename() -> &'static str {
2807        "type.googleapis.com/google.cloud.datastream.v1.ListStreamObjectsResponse"
2808    }
2809}
2810
2811#[doc(hidden)]
2812impl google_cloud_gax::paginator::internal::PageableResponse for ListStreamObjectsResponse {
2813    type PageItem = crate::model::StreamObject;
2814
2815    fn items(self) -> std::vec::Vec<Self::PageItem> {
2816        self.stream_objects
2817    }
2818
2819    fn next_page_token(&self) -> std::string::String {
2820        use std::clone::Clone;
2821        self.next_page_token.clone()
2822    }
2823}
2824
2825/// Represents the metadata of the long-running operation.
2826#[derive(Clone, Default, PartialEq)]
2827#[non_exhaustive]
2828pub struct OperationMetadata {
2829    /// Output only. The time the operation was created.
2830    pub create_time: std::option::Option<wkt::Timestamp>,
2831
2832    /// Output only. The time the operation finished running.
2833    pub end_time: std::option::Option<wkt::Timestamp>,
2834
2835    /// Output only. Server-defined resource path for the target of the operation.
2836    pub target: std::string::String,
2837
2838    /// Output only. Name of the verb executed by the operation.
2839    pub verb: std::string::String,
2840
2841    /// Output only. Human-readable status of the operation, if any.
2842    pub status_message: std::string::String,
2843
2844    /// Output only. Identifies whether the user has requested cancellation
2845    /// of the operation. Operations that have successfully been cancelled
2846    /// have
2847    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
2848    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
2849    /// corresponding to `Code.CANCELLED`.
2850    ///
2851    /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
2852    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
2853    pub requested_cancellation: bool,
2854
2855    /// Output only. API version used to start the operation.
2856    pub api_version: std::string::String,
2857
2858    /// Output only. Results of executed validations if there are any.
2859    pub validation_result: std::option::Option<crate::model::ValidationResult>,
2860
2861    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2862}
2863
2864impl OperationMetadata {
2865    /// Creates a new default instance.
2866    pub fn new() -> Self {
2867        std::default::Default::default()
2868    }
2869
2870    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
2871    ///
2872    /// # Example
2873    /// ```ignore,no_run
2874    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2875    /// use wkt::Timestamp;
2876    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
2877    /// ```
2878    pub fn set_create_time<T>(mut self, v: T) -> Self
2879    where
2880        T: std::convert::Into<wkt::Timestamp>,
2881    {
2882        self.create_time = std::option::Option::Some(v.into());
2883        self
2884    }
2885
2886    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
2887    ///
2888    /// # Example
2889    /// ```ignore,no_run
2890    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2891    /// use wkt::Timestamp;
2892    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2893    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
2894    /// ```
2895    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2896    where
2897        T: std::convert::Into<wkt::Timestamp>,
2898    {
2899        self.create_time = v.map(|x| x.into());
2900        self
2901    }
2902
2903    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
2904    ///
2905    /// # Example
2906    /// ```ignore,no_run
2907    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2908    /// use wkt::Timestamp;
2909    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
2910    /// ```
2911    pub fn set_end_time<T>(mut self, v: T) -> Self
2912    where
2913        T: std::convert::Into<wkt::Timestamp>,
2914    {
2915        self.end_time = std::option::Option::Some(v.into());
2916        self
2917    }
2918
2919    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
2920    ///
2921    /// # Example
2922    /// ```ignore,no_run
2923    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2924    /// use wkt::Timestamp;
2925    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
2926    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
2927    /// ```
2928    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2929    where
2930        T: std::convert::Into<wkt::Timestamp>,
2931    {
2932        self.end_time = v.map(|x| x.into());
2933        self
2934    }
2935
2936    /// Sets the value of [target][crate::model::OperationMetadata::target].
2937    ///
2938    /// # Example
2939    /// ```ignore,no_run
2940    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2941    /// let x = OperationMetadata::new().set_target("example");
2942    /// ```
2943    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2944        self.target = v.into();
2945        self
2946    }
2947
2948    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
2949    ///
2950    /// # Example
2951    /// ```ignore,no_run
2952    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2953    /// let x = OperationMetadata::new().set_verb("example");
2954    /// ```
2955    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2956        self.verb = v.into();
2957        self
2958    }
2959
2960    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
2961    ///
2962    /// # Example
2963    /// ```ignore,no_run
2964    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2965    /// let x = OperationMetadata::new().set_status_message("example");
2966    /// ```
2967    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2968        self.status_message = v.into();
2969        self
2970    }
2971
2972    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
2973    ///
2974    /// # Example
2975    /// ```ignore,no_run
2976    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2977    /// let x = OperationMetadata::new().set_requested_cancellation(true);
2978    /// ```
2979    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2980        self.requested_cancellation = v.into();
2981        self
2982    }
2983
2984    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
2985    ///
2986    /// # Example
2987    /// ```ignore,no_run
2988    /// # use google_cloud_datastream_v1::model::OperationMetadata;
2989    /// let x = OperationMetadata::new().set_api_version("example");
2990    /// ```
2991    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2992        self.api_version = v.into();
2993        self
2994    }
2995
2996    /// Sets the value of [validation_result][crate::model::OperationMetadata::validation_result].
2997    ///
2998    /// # Example
2999    /// ```ignore,no_run
3000    /// # use google_cloud_datastream_v1::model::OperationMetadata;
3001    /// use google_cloud_datastream_v1::model::ValidationResult;
3002    /// let x = OperationMetadata::new().set_validation_result(ValidationResult::default()/* use setters */);
3003    /// ```
3004    pub fn set_validation_result<T>(mut self, v: T) -> Self
3005    where
3006        T: std::convert::Into<crate::model::ValidationResult>,
3007    {
3008        self.validation_result = std::option::Option::Some(v.into());
3009        self
3010    }
3011
3012    /// Sets or clears the value of [validation_result][crate::model::OperationMetadata::validation_result].
3013    ///
3014    /// # Example
3015    /// ```ignore,no_run
3016    /// # use google_cloud_datastream_v1::model::OperationMetadata;
3017    /// use google_cloud_datastream_v1::model::ValidationResult;
3018    /// let x = OperationMetadata::new().set_or_clear_validation_result(Some(ValidationResult::default()/* use setters */));
3019    /// let x = OperationMetadata::new().set_or_clear_validation_result(None::<ValidationResult>);
3020    /// ```
3021    pub fn set_or_clear_validation_result<T>(mut self, v: std::option::Option<T>) -> Self
3022    where
3023        T: std::convert::Into<crate::model::ValidationResult>,
3024    {
3025        self.validation_result = v.map(|x| x.into());
3026        self
3027    }
3028}
3029
3030impl wkt::message::Message for OperationMetadata {
3031    fn typename() -> &'static str {
3032        "type.googleapis.com/google.cloud.datastream.v1.OperationMetadata"
3033    }
3034}
3035
3036/// Request for creating a private connection.
3037#[derive(Clone, Default, PartialEq)]
3038#[non_exhaustive]
3039pub struct CreatePrivateConnectionRequest {
3040    /// Required. The parent that owns the collection of PrivateConnections.
3041    pub parent: std::string::String,
3042
3043    /// Required. The private connectivity identifier.
3044    pub private_connection_id: std::string::String,
3045
3046    /// Required. The Private Connectivity resource to create.
3047    pub private_connection: std::option::Option<crate::model::PrivateConnection>,
3048
3049    /// Optional. A request ID to identify requests. Specify a unique request ID
3050    /// so that if you must retry your request, the server will know to ignore
3051    /// the request if it has already been completed. The server will guarantee
3052    /// that for at least 60 minutes since the first request.
3053    ///
3054    /// For example, consider a situation where you make an initial request and the
3055    /// request times out. If you make the request again with the same request ID,
3056    /// the server can check if original operation with the same request ID was
3057    /// received, and if so, will ignore the second request. This prevents clients
3058    /// from accidentally creating duplicate commitments.
3059    ///
3060    /// The request ID must be a valid UUID with the exception that zero UUID is
3061    /// not supported (00000000-0000-0000-0000-000000000000).
3062    pub request_id: std::string::String,
3063
3064    /// Optional. If set to true, will skip validations.
3065    pub force: bool,
3066
3067    /// Optional. When supplied with PSC Interface config, will get/create the
3068    /// tenant project required for the customer to allow list and won't actually
3069    /// create the private connection.
3070    pub validate_only: bool,
3071
3072    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3073}
3074
3075impl CreatePrivateConnectionRequest {
3076    /// Creates a new default instance.
3077    pub fn new() -> Self {
3078        std::default::Default::default()
3079    }
3080
3081    /// Sets the value of [parent][crate::model::CreatePrivateConnectionRequest::parent].
3082    ///
3083    /// # Example
3084    /// ```ignore,no_run
3085    /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3086    /// # let project_id = "project_id";
3087    /// # let location_id = "location_id";
3088    /// let x = CreatePrivateConnectionRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
3089    /// ```
3090    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3091        self.parent = v.into();
3092        self
3093    }
3094
3095    /// Sets the value of [private_connection_id][crate::model::CreatePrivateConnectionRequest::private_connection_id].
3096    ///
3097    /// # Example
3098    /// ```ignore,no_run
3099    /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3100    /// let x = CreatePrivateConnectionRequest::new().set_private_connection_id("example");
3101    /// ```
3102    pub fn set_private_connection_id<T: std::convert::Into<std::string::String>>(
3103        mut self,
3104        v: T,
3105    ) -> Self {
3106        self.private_connection_id = v.into();
3107        self
3108    }
3109
3110    /// Sets the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
3111    ///
3112    /// # Example
3113    /// ```ignore,no_run
3114    /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3115    /// use google_cloud_datastream_v1::model::PrivateConnection;
3116    /// let x = CreatePrivateConnectionRequest::new().set_private_connection(PrivateConnection::default()/* use setters */);
3117    /// ```
3118    pub fn set_private_connection<T>(mut self, v: T) -> Self
3119    where
3120        T: std::convert::Into<crate::model::PrivateConnection>,
3121    {
3122        self.private_connection = std::option::Option::Some(v.into());
3123        self
3124    }
3125
3126    /// Sets or clears the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
3127    ///
3128    /// # Example
3129    /// ```ignore,no_run
3130    /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3131    /// use google_cloud_datastream_v1::model::PrivateConnection;
3132    /// let x = CreatePrivateConnectionRequest::new().set_or_clear_private_connection(Some(PrivateConnection::default()/* use setters */));
3133    /// let x = CreatePrivateConnectionRequest::new().set_or_clear_private_connection(None::<PrivateConnection>);
3134    /// ```
3135    pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
3136    where
3137        T: std::convert::Into<crate::model::PrivateConnection>,
3138    {
3139        self.private_connection = v.map(|x| x.into());
3140        self
3141    }
3142
3143    /// Sets the value of [request_id][crate::model::CreatePrivateConnectionRequest::request_id].
3144    ///
3145    /// # Example
3146    /// ```ignore,no_run
3147    /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3148    /// let x = CreatePrivateConnectionRequest::new().set_request_id("example");
3149    /// ```
3150    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3151        self.request_id = v.into();
3152        self
3153    }
3154
3155    /// Sets the value of [force][crate::model::CreatePrivateConnectionRequest::force].
3156    ///
3157    /// # Example
3158    /// ```ignore,no_run
3159    /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3160    /// let x = CreatePrivateConnectionRequest::new().set_force(true);
3161    /// ```
3162    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3163        self.force = v.into();
3164        self
3165    }
3166
3167    /// Sets the value of [validate_only][crate::model::CreatePrivateConnectionRequest::validate_only].
3168    ///
3169    /// # Example
3170    /// ```ignore,no_run
3171    /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3172    /// let x = CreatePrivateConnectionRequest::new().set_validate_only(true);
3173    /// ```
3174    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3175        self.validate_only = v.into();
3176        self
3177    }
3178}
3179
3180impl wkt::message::Message for CreatePrivateConnectionRequest {
3181    fn typename() -> &'static str {
3182        "type.googleapis.com/google.cloud.datastream.v1.CreatePrivateConnectionRequest"
3183    }
3184}
3185
3186/// Request for listing private connections.
3187#[derive(Clone, Default, PartialEq)]
3188#[non_exhaustive]
3189pub struct ListPrivateConnectionsRequest {
3190    /// Required. The parent that owns the collection of private connectivity
3191    /// configurations.
3192    pub parent: std::string::String,
3193
3194    /// Maximum number of private connectivity configurations to return.
3195    /// If unspecified, at most 50 private connectivity configurations that will be
3196    /// returned. The maximum value is 1000; values above 1000 will be coerced to
3197    /// 1000.
3198    pub page_size: i32,
3199
3200    /// Page token received from a previous `ListPrivateConnections` call.
3201    /// Provide this to retrieve the subsequent page.
3202    ///
3203    /// When paginating, all other parameters provided to
3204    /// `ListPrivateConnections` must match the call that provided the page
3205    /// token.
3206    pub page_token: std::string::String,
3207
3208    /// Filter request.
3209    pub filter: std::string::String,
3210
3211    /// Order by fields for the result.
3212    pub order_by: std::string::String,
3213
3214    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3215}
3216
3217impl ListPrivateConnectionsRequest {
3218    /// Creates a new default instance.
3219    pub fn new() -> Self {
3220        std::default::Default::default()
3221    }
3222
3223    /// Sets the value of [parent][crate::model::ListPrivateConnectionsRequest::parent].
3224    ///
3225    /// # Example
3226    /// ```ignore,no_run
3227    /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3228    /// # let project_id = "project_id";
3229    /// # let location_id = "location_id";
3230    /// let x = ListPrivateConnectionsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
3231    /// ```
3232    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3233        self.parent = v.into();
3234        self
3235    }
3236
3237    /// Sets the value of [page_size][crate::model::ListPrivateConnectionsRequest::page_size].
3238    ///
3239    /// # Example
3240    /// ```ignore,no_run
3241    /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3242    /// let x = ListPrivateConnectionsRequest::new().set_page_size(42);
3243    /// ```
3244    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3245        self.page_size = v.into();
3246        self
3247    }
3248
3249    /// Sets the value of [page_token][crate::model::ListPrivateConnectionsRequest::page_token].
3250    ///
3251    /// # Example
3252    /// ```ignore,no_run
3253    /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3254    /// let x = ListPrivateConnectionsRequest::new().set_page_token("example");
3255    /// ```
3256    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3257        self.page_token = v.into();
3258        self
3259    }
3260
3261    /// Sets the value of [filter][crate::model::ListPrivateConnectionsRequest::filter].
3262    ///
3263    /// # Example
3264    /// ```ignore,no_run
3265    /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3266    /// let x = ListPrivateConnectionsRequest::new().set_filter("example");
3267    /// ```
3268    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3269        self.filter = v.into();
3270        self
3271    }
3272
3273    /// Sets the value of [order_by][crate::model::ListPrivateConnectionsRequest::order_by].
3274    ///
3275    /// # Example
3276    /// ```ignore,no_run
3277    /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3278    /// let x = ListPrivateConnectionsRequest::new().set_order_by("example");
3279    /// ```
3280    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3281        self.order_by = v.into();
3282        self
3283    }
3284}
3285
3286impl wkt::message::Message for ListPrivateConnectionsRequest {
3287    fn typename() -> &'static str {
3288        "type.googleapis.com/google.cloud.datastream.v1.ListPrivateConnectionsRequest"
3289    }
3290}
3291
3292/// Response containing a list of private connection configurations.
3293#[derive(Clone, Default, PartialEq)]
3294#[non_exhaustive]
3295pub struct ListPrivateConnectionsResponse {
3296    /// List of private connectivity configurations.
3297    pub private_connections: std::vec::Vec<crate::model::PrivateConnection>,
3298
3299    /// A token, which can be sent as `page_token` to retrieve the next page.
3300    /// If this field is omitted, there are no subsequent pages.
3301    pub next_page_token: std::string::String,
3302
3303    /// Locations that could not be reached.
3304    pub unreachable: std::vec::Vec<std::string::String>,
3305
3306    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3307}
3308
3309impl ListPrivateConnectionsResponse {
3310    /// Creates a new default instance.
3311    pub fn new() -> Self {
3312        std::default::Default::default()
3313    }
3314
3315    /// Sets the value of [private_connections][crate::model::ListPrivateConnectionsResponse::private_connections].
3316    ///
3317    /// # Example
3318    /// ```ignore,no_run
3319    /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsResponse;
3320    /// use google_cloud_datastream_v1::model::PrivateConnection;
3321    /// let x = ListPrivateConnectionsResponse::new()
3322    ///     .set_private_connections([
3323    ///         PrivateConnection::default()/* use setters */,
3324    ///         PrivateConnection::default()/* use (different) setters */,
3325    ///     ]);
3326    /// ```
3327    pub fn set_private_connections<T, V>(mut self, v: T) -> Self
3328    where
3329        T: std::iter::IntoIterator<Item = V>,
3330        V: std::convert::Into<crate::model::PrivateConnection>,
3331    {
3332        use std::iter::Iterator;
3333        self.private_connections = v.into_iter().map(|i| i.into()).collect();
3334        self
3335    }
3336
3337    /// Sets the value of [next_page_token][crate::model::ListPrivateConnectionsResponse::next_page_token].
3338    ///
3339    /// # Example
3340    /// ```ignore,no_run
3341    /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsResponse;
3342    /// let x = ListPrivateConnectionsResponse::new().set_next_page_token("example");
3343    /// ```
3344    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3345        self.next_page_token = v.into();
3346        self
3347    }
3348
3349    /// Sets the value of [unreachable][crate::model::ListPrivateConnectionsResponse::unreachable].
3350    ///
3351    /// # Example
3352    /// ```ignore,no_run
3353    /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsResponse;
3354    /// let x = ListPrivateConnectionsResponse::new().set_unreachable(["a", "b", "c"]);
3355    /// ```
3356    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3357    where
3358        T: std::iter::IntoIterator<Item = V>,
3359        V: std::convert::Into<std::string::String>,
3360    {
3361        use std::iter::Iterator;
3362        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3363        self
3364    }
3365}
3366
3367impl wkt::message::Message for ListPrivateConnectionsResponse {
3368    fn typename() -> &'static str {
3369        "type.googleapis.com/google.cloud.datastream.v1.ListPrivateConnectionsResponse"
3370    }
3371}
3372
3373#[doc(hidden)]
3374impl google_cloud_gax::paginator::internal::PageableResponse for ListPrivateConnectionsResponse {
3375    type PageItem = crate::model::PrivateConnection;
3376
3377    fn items(self) -> std::vec::Vec<Self::PageItem> {
3378        self.private_connections
3379    }
3380
3381    fn next_page_token(&self) -> std::string::String {
3382        use std::clone::Clone;
3383        self.next_page_token.clone()
3384    }
3385}
3386
3387/// Request to delete a private connection.
3388#[derive(Clone, Default, PartialEq)]
3389#[non_exhaustive]
3390pub struct DeletePrivateConnectionRequest {
3391    /// Required. The name of the private connectivity configuration to delete.
3392    pub name: std::string::String,
3393
3394    /// Optional. A request ID to identify requests. Specify a unique request ID
3395    /// so that if you must retry your request, the server will know to ignore
3396    /// the request if it has already been completed. The server will guarantee
3397    /// that for at least 60 minutes after the first request.
3398    ///
3399    /// For example, consider a situation where you make an initial request and the
3400    /// request times out. If you make the request again with the same request ID,
3401    /// the server can check if original operation with the same request ID was
3402    /// received, and if so, will ignore the second request. This prevents clients
3403    /// from accidentally creating duplicate commitments.
3404    ///
3405    /// The request ID must be a valid UUID with the exception that zero UUID is
3406    /// not supported (00000000-0000-0000-0000-000000000000).
3407    pub request_id: std::string::String,
3408
3409    /// Optional. If set to true, any child routes that belong to this
3410    /// PrivateConnection will also be deleted.
3411    pub force: bool,
3412
3413    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3414}
3415
3416impl DeletePrivateConnectionRequest {
3417    /// Creates a new default instance.
3418    pub fn new() -> Self {
3419        std::default::Default::default()
3420    }
3421
3422    /// Sets the value of [name][crate::model::DeletePrivateConnectionRequest::name].
3423    ///
3424    /// # Example
3425    /// ```ignore,no_run
3426    /// # use google_cloud_datastream_v1::model::DeletePrivateConnectionRequest;
3427    /// # let project_id = "project_id";
3428    /// # let location_id = "location_id";
3429    /// # let private_connection_id = "private_connection_id";
3430    /// let x = DeletePrivateConnectionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateConnections/{private_connection_id}"));
3431    /// ```
3432    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3433        self.name = v.into();
3434        self
3435    }
3436
3437    /// Sets the value of [request_id][crate::model::DeletePrivateConnectionRequest::request_id].
3438    ///
3439    /// # Example
3440    /// ```ignore,no_run
3441    /// # use google_cloud_datastream_v1::model::DeletePrivateConnectionRequest;
3442    /// let x = DeletePrivateConnectionRequest::new().set_request_id("example");
3443    /// ```
3444    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3445        self.request_id = v.into();
3446        self
3447    }
3448
3449    /// Sets the value of [force][crate::model::DeletePrivateConnectionRequest::force].
3450    ///
3451    /// # Example
3452    /// ```ignore,no_run
3453    /// # use google_cloud_datastream_v1::model::DeletePrivateConnectionRequest;
3454    /// let x = DeletePrivateConnectionRequest::new().set_force(true);
3455    /// ```
3456    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3457        self.force = v.into();
3458        self
3459    }
3460}
3461
3462impl wkt::message::Message for DeletePrivateConnectionRequest {
3463    fn typename() -> &'static str {
3464        "type.googleapis.com/google.cloud.datastream.v1.DeletePrivateConnectionRequest"
3465    }
3466}
3467
3468/// Request to get a private connection configuration.
3469#[derive(Clone, Default, PartialEq)]
3470#[non_exhaustive]
3471pub struct GetPrivateConnectionRequest {
3472    /// Required. The name of the  private connectivity configuration to get.
3473    pub name: std::string::String,
3474
3475    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3476}
3477
3478impl GetPrivateConnectionRequest {
3479    /// Creates a new default instance.
3480    pub fn new() -> Self {
3481        std::default::Default::default()
3482    }
3483
3484    /// Sets the value of [name][crate::model::GetPrivateConnectionRequest::name].
3485    ///
3486    /// # Example
3487    /// ```ignore,no_run
3488    /// # use google_cloud_datastream_v1::model::GetPrivateConnectionRequest;
3489    /// # let project_id = "project_id";
3490    /// # let location_id = "location_id";
3491    /// # let private_connection_id = "private_connection_id";
3492    /// let x = GetPrivateConnectionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateConnections/{private_connection_id}"));
3493    /// ```
3494    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3495        self.name = v.into();
3496        self
3497    }
3498}
3499
3500impl wkt::message::Message for GetPrivateConnectionRequest {
3501    fn typename() -> &'static str {
3502        "type.googleapis.com/google.cloud.datastream.v1.GetPrivateConnectionRequest"
3503    }
3504}
3505
3506/// Route creation request.
3507#[derive(Clone, Default, PartialEq)]
3508#[non_exhaustive]
3509pub struct CreateRouteRequest {
3510    /// Required. The parent that owns the collection of Routes.
3511    pub parent: std::string::String,
3512
3513    /// Required. The Route identifier.
3514    pub route_id: std::string::String,
3515
3516    /// Required. The Route resource to create.
3517    pub route: std::option::Option<crate::model::Route>,
3518
3519    /// Optional. A request ID to identify requests. Specify a unique request ID
3520    /// so that if you must retry your request, the server will know to ignore
3521    /// the request if it has already been completed. The server will guarantee
3522    /// that for at least 60 minutes since the first request.
3523    ///
3524    /// For example, consider a situation where you make an initial request and the
3525    /// request times out. If you make the request again with the same request ID,
3526    /// the server can check if original operation with the same request ID was
3527    /// received, and if so, will ignore the second request. This prevents clients
3528    /// from accidentally creating duplicate commitments.
3529    ///
3530    /// The request ID must be a valid UUID with the exception that zero UUID is
3531    /// not supported (00000000-0000-0000-0000-000000000000).
3532    pub request_id: std::string::String,
3533
3534    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3535}
3536
3537impl CreateRouteRequest {
3538    /// Creates a new default instance.
3539    pub fn new() -> Self {
3540        std::default::Default::default()
3541    }
3542
3543    /// Sets the value of [parent][crate::model::CreateRouteRequest::parent].
3544    ///
3545    /// # Example
3546    /// ```ignore,no_run
3547    /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3548    /// # let project_id = "project_id";
3549    /// # let location_id = "location_id";
3550    /// # let private_connection_id = "private_connection_id";
3551    /// let x = CreateRouteRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/privateConnections/{private_connection_id}"));
3552    /// ```
3553    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3554        self.parent = v.into();
3555        self
3556    }
3557
3558    /// Sets the value of [route_id][crate::model::CreateRouteRequest::route_id].
3559    ///
3560    /// # Example
3561    /// ```ignore,no_run
3562    /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3563    /// let x = CreateRouteRequest::new().set_route_id("example");
3564    /// ```
3565    pub fn set_route_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3566        self.route_id = v.into();
3567        self
3568    }
3569
3570    /// Sets the value of [route][crate::model::CreateRouteRequest::route].
3571    ///
3572    /// # Example
3573    /// ```ignore,no_run
3574    /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3575    /// use google_cloud_datastream_v1::model::Route;
3576    /// let x = CreateRouteRequest::new().set_route(Route::default()/* use setters */);
3577    /// ```
3578    pub fn set_route<T>(mut self, v: T) -> Self
3579    where
3580        T: std::convert::Into<crate::model::Route>,
3581    {
3582        self.route = std::option::Option::Some(v.into());
3583        self
3584    }
3585
3586    /// Sets or clears the value of [route][crate::model::CreateRouteRequest::route].
3587    ///
3588    /// # Example
3589    /// ```ignore,no_run
3590    /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3591    /// use google_cloud_datastream_v1::model::Route;
3592    /// let x = CreateRouteRequest::new().set_or_clear_route(Some(Route::default()/* use setters */));
3593    /// let x = CreateRouteRequest::new().set_or_clear_route(None::<Route>);
3594    /// ```
3595    pub fn set_or_clear_route<T>(mut self, v: std::option::Option<T>) -> Self
3596    where
3597        T: std::convert::Into<crate::model::Route>,
3598    {
3599        self.route = v.map(|x| x.into());
3600        self
3601    }
3602
3603    /// Sets the value of [request_id][crate::model::CreateRouteRequest::request_id].
3604    ///
3605    /// # Example
3606    /// ```ignore,no_run
3607    /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3608    /// let x = CreateRouteRequest::new().set_request_id("example");
3609    /// ```
3610    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3611        self.request_id = v.into();
3612        self
3613    }
3614}
3615
3616impl wkt::message::Message for CreateRouteRequest {
3617    fn typename() -> &'static str {
3618        "type.googleapis.com/google.cloud.datastream.v1.CreateRouteRequest"
3619    }
3620}
3621
3622/// Route list request.
3623#[derive(Clone, Default, PartialEq)]
3624#[non_exhaustive]
3625pub struct ListRoutesRequest {
3626    /// Required. The parent that owns the collection of Routess.
3627    pub parent: std::string::String,
3628
3629    /// Maximum number of Routes to return. The service may return
3630    /// fewer than this value. If unspecified, at most 50 Routes
3631    /// will be returned. The maximum value is 1000; values above 1000 will be
3632    /// coerced to 1000.
3633    pub page_size: i32,
3634
3635    /// Page token received from a previous `ListRoutes` call.
3636    /// Provide this to retrieve the subsequent page.
3637    ///
3638    /// When paginating, all other parameters provided to
3639    /// `ListRoutes` must match the call that provided the page
3640    /// token.
3641    pub page_token: std::string::String,
3642
3643    /// Filter request.
3644    pub filter: std::string::String,
3645
3646    /// Order by fields for the result.
3647    pub order_by: std::string::String,
3648
3649    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3650}
3651
3652impl ListRoutesRequest {
3653    /// Creates a new default instance.
3654    pub fn new() -> Self {
3655        std::default::Default::default()
3656    }
3657
3658    /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
3659    ///
3660    /// # Example
3661    /// ```ignore,no_run
3662    /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3663    /// # let project_id = "project_id";
3664    /// # let location_id = "location_id";
3665    /// # let private_connection_id = "private_connection_id";
3666    /// let x = ListRoutesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/privateConnections/{private_connection_id}"));
3667    /// ```
3668    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3669        self.parent = v.into();
3670        self
3671    }
3672
3673    /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
3674    ///
3675    /// # Example
3676    /// ```ignore,no_run
3677    /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3678    /// let x = ListRoutesRequest::new().set_page_size(42);
3679    /// ```
3680    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3681        self.page_size = v.into();
3682        self
3683    }
3684
3685    /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
3686    ///
3687    /// # Example
3688    /// ```ignore,no_run
3689    /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3690    /// let x = ListRoutesRequest::new().set_page_token("example");
3691    /// ```
3692    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3693        self.page_token = v.into();
3694        self
3695    }
3696
3697    /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
3698    ///
3699    /// # Example
3700    /// ```ignore,no_run
3701    /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3702    /// let x = ListRoutesRequest::new().set_filter("example");
3703    /// ```
3704    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3705        self.filter = v.into();
3706        self
3707    }
3708
3709    /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
3710    ///
3711    /// # Example
3712    /// ```ignore,no_run
3713    /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3714    /// let x = ListRoutesRequest::new().set_order_by("example");
3715    /// ```
3716    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3717        self.order_by = v.into();
3718        self
3719    }
3720}
3721
3722impl wkt::message::Message for ListRoutesRequest {
3723    fn typename() -> &'static str {
3724        "type.googleapis.com/google.cloud.datastream.v1.ListRoutesRequest"
3725    }
3726}
3727
3728/// Route list response.
3729#[derive(Clone, Default, PartialEq)]
3730#[non_exhaustive]
3731pub struct ListRoutesResponse {
3732    /// List of Routes.
3733    pub routes: std::vec::Vec<crate::model::Route>,
3734
3735    /// A token, which can be sent as `page_token` to retrieve the next page.
3736    /// If this field is omitted, there are no subsequent pages.
3737    pub next_page_token: std::string::String,
3738
3739    /// Locations that could not be reached.
3740    pub unreachable: std::vec::Vec<std::string::String>,
3741
3742    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3743}
3744
3745impl ListRoutesResponse {
3746    /// Creates a new default instance.
3747    pub fn new() -> Self {
3748        std::default::Default::default()
3749    }
3750
3751    /// Sets the value of [routes][crate::model::ListRoutesResponse::routes].
3752    ///
3753    /// # Example
3754    /// ```ignore,no_run
3755    /// # use google_cloud_datastream_v1::model::ListRoutesResponse;
3756    /// use google_cloud_datastream_v1::model::Route;
3757    /// let x = ListRoutesResponse::new()
3758    ///     .set_routes([
3759    ///         Route::default()/* use setters */,
3760    ///         Route::default()/* use (different) setters */,
3761    ///     ]);
3762    /// ```
3763    pub fn set_routes<T, V>(mut self, v: T) -> Self
3764    where
3765        T: std::iter::IntoIterator<Item = V>,
3766        V: std::convert::Into<crate::model::Route>,
3767    {
3768        use std::iter::Iterator;
3769        self.routes = v.into_iter().map(|i| i.into()).collect();
3770        self
3771    }
3772
3773    /// Sets the value of [next_page_token][crate::model::ListRoutesResponse::next_page_token].
3774    ///
3775    /// # Example
3776    /// ```ignore,no_run
3777    /// # use google_cloud_datastream_v1::model::ListRoutesResponse;
3778    /// let x = ListRoutesResponse::new().set_next_page_token("example");
3779    /// ```
3780    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3781        self.next_page_token = v.into();
3782        self
3783    }
3784
3785    /// Sets the value of [unreachable][crate::model::ListRoutesResponse::unreachable].
3786    ///
3787    /// # Example
3788    /// ```ignore,no_run
3789    /// # use google_cloud_datastream_v1::model::ListRoutesResponse;
3790    /// let x = ListRoutesResponse::new().set_unreachable(["a", "b", "c"]);
3791    /// ```
3792    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3793    where
3794        T: std::iter::IntoIterator<Item = V>,
3795        V: std::convert::Into<std::string::String>,
3796    {
3797        use std::iter::Iterator;
3798        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3799        self
3800    }
3801}
3802
3803impl wkt::message::Message for ListRoutesResponse {
3804    fn typename() -> &'static str {
3805        "type.googleapis.com/google.cloud.datastream.v1.ListRoutesResponse"
3806    }
3807}
3808
3809#[doc(hidden)]
3810impl google_cloud_gax::paginator::internal::PageableResponse for ListRoutesResponse {
3811    type PageItem = crate::model::Route;
3812
3813    fn items(self) -> std::vec::Vec<Self::PageItem> {
3814        self.routes
3815    }
3816
3817    fn next_page_token(&self) -> std::string::String {
3818        use std::clone::Clone;
3819        self.next_page_token.clone()
3820    }
3821}
3822
3823/// Route deletion request.
3824#[derive(Clone, Default, PartialEq)]
3825#[non_exhaustive]
3826pub struct DeleteRouteRequest {
3827    /// Required. The name of the Route resource to delete.
3828    pub name: std::string::String,
3829
3830    /// Optional. A request ID to identify requests. Specify a unique request ID
3831    /// so that if you must retry your request, the server will know to ignore
3832    /// the request if it has already been completed. The server will guarantee
3833    /// that for at least 60 minutes after the first request.
3834    ///
3835    /// For example, consider a situation where you make an initial request and the
3836    /// request times out. If you make the request again with the same request ID,
3837    /// the server can check if original operation with the same request ID was
3838    /// received, and if so, will ignore the second request. This prevents clients
3839    /// from accidentally creating duplicate commitments.
3840    ///
3841    /// The request ID must be a valid UUID with the exception that zero UUID is
3842    /// not supported (00000000-0000-0000-0000-000000000000).
3843    pub request_id: std::string::String,
3844
3845    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3846}
3847
3848impl DeleteRouteRequest {
3849    /// Creates a new default instance.
3850    pub fn new() -> Self {
3851        std::default::Default::default()
3852    }
3853
3854    /// Sets the value of [name][crate::model::DeleteRouteRequest::name].
3855    ///
3856    /// # Example
3857    /// ```ignore,no_run
3858    /// # use google_cloud_datastream_v1::model::DeleteRouteRequest;
3859    /// # let project_id = "project_id";
3860    /// # let location_id = "location_id";
3861    /// # let private_connection_id = "private_connection_id";
3862    /// # let route_id = "route_id";
3863    /// let x = DeleteRouteRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateConnections/{private_connection_id}/routes/{route_id}"));
3864    /// ```
3865    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3866        self.name = v.into();
3867        self
3868    }
3869
3870    /// Sets the value of [request_id][crate::model::DeleteRouteRequest::request_id].
3871    ///
3872    /// # Example
3873    /// ```ignore,no_run
3874    /// # use google_cloud_datastream_v1::model::DeleteRouteRequest;
3875    /// let x = DeleteRouteRequest::new().set_request_id("example");
3876    /// ```
3877    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3878        self.request_id = v.into();
3879        self
3880    }
3881}
3882
3883impl wkt::message::Message for DeleteRouteRequest {
3884    fn typename() -> &'static str {
3885        "type.googleapis.com/google.cloud.datastream.v1.DeleteRouteRequest"
3886    }
3887}
3888
3889/// Route get request.
3890#[derive(Clone, Default, PartialEq)]
3891#[non_exhaustive]
3892pub struct GetRouteRequest {
3893    /// Required. The name of the Route resource to get.
3894    pub name: std::string::String,
3895
3896    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3897}
3898
3899impl GetRouteRequest {
3900    /// Creates a new default instance.
3901    pub fn new() -> Self {
3902        std::default::Default::default()
3903    }
3904
3905    /// Sets the value of [name][crate::model::GetRouteRequest::name].
3906    ///
3907    /// # Example
3908    /// ```ignore,no_run
3909    /// # use google_cloud_datastream_v1::model::GetRouteRequest;
3910    /// # let project_id = "project_id";
3911    /// # let location_id = "location_id";
3912    /// # let private_connection_id = "private_connection_id";
3913    /// # let route_id = "route_id";
3914    /// let x = GetRouteRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateConnections/{private_connection_id}/routes/{route_id}"));
3915    /// ```
3916    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3917        self.name = v.into();
3918        self
3919    }
3920}
3921
3922impl wkt::message::Message for GetRouteRequest {
3923    fn typename() -> &'static str {
3924        "type.googleapis.com/google.cloud.datastream.v1.GetRouteRequest"
3925    }
3926}
3927
3928/// Oracle database profile.
3929#[derive(Clone, Default, PartialEq)]
3930#[non_exhaustive]
3931pub struct OracleProfile {
3932    /// Required. Hostname for the Oracle connection.
3933    pub hostname: std::string::String,
3934
3935    /// Port for the Oracle connection, default value is 1521.
3936    pub port: i32,
3937
3938    /// Required. Username for the Oracle connection.
3939    pub username: std::string::String,
3940
3941    /// Optional. Password for the Oracle connection. Mutually exclusive with the
3942    /// `secret_manager_stored_password` field.
3943    pub password: std::string::String,
3944
3945    /// Required. Database for the Oracle connection.
3946    pub database_service: std::string::String,
3947
3948    /// Connection string attributes
3949    pub connection_attributes: std::collections::HashMap<std::string::String, std::string::String>,
3950
3951    /// Optional. SSL configuration for the Oracle connection.
3952    pub oracle_ssl_config: std::option::Option<crate::model::OracleSslConfig>,
3953
3954    /// Optional. Configuration for Oracle ASM connection.
3955    pub oracle_asm_config: std::option::Option<crate::model::OracleAsmConfig>,
3956
3957    /// Optional. A reference to a Secret Manager resource name storing the Oracle
3958    /// connection password. Mutually exclusive with the `password` field.
3959    pub secret_manager_stored_password: std::string::String,
3960
3961    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3962}
3963
3964impl OracleProfile {
3965    /// Creates a new default instance.
3966    pub fn new() -> Self {
3967        std::default::Default::default()
3968    }
3969
3970    /// Sets the value of [hostname][crate::model::OracleProfile::hostname].
3971    ///
3972    /// # Example
3973    /// ```ignore,no_run
3974    /// # use google_cloud_datastream_v1::model::OracleProfile;
3975    /// let x = OracleProfile::new().set_hostname("example");
3976    /// ```
3977    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3978        self.hostname = v.into();
3979        self
3980    }
3981
3982    /// Sets the value of [port][crate::model::OracleProfile::port].
3983    ///
3984    /// # Example
3985    /// ```ignore,no_run
3986    /// # use google_cloud_datastream_v1::model::OracleProfile;
3987    /// let x = OracleProfile::new().set_port(42);
3988    /// ```
3989    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3990        self.port = v.into();
3991        self
3992    }
3993
3994    /// Sets the value of [username][crate::model::OracleProfile::username].
3995    ///
3996    /// # Example
3997    /// ```ignore,no_run
3998    /// # use google_cloud_datastream_v1::model::OracleProfile;
3999    /// let x = OracleProfile::new().set_username("example");
4000    /// ```
4001    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4002        self.username = v.into();
4003        self
4004    }
4005
4006    /// Sets the value of [password][crate::model::OracleProfile::password].
4007    ///
4008    /// # Example
4009    /// ```ignore,no_run
4010    /// # use google_cloud_datastream_v1::model::OracleProfile;
4011    /// let x = OracleProfile::new().set_password("example");
4012    /// ```
4013    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4014        self.password = v.into();
4015        self
4016    }
4017
4018    /// Sets the value of [database_service][crate::model::OracleProfile::database_service].
4019    ///
4020    /// # Example
4021    /// ```ignore,no_run
4022    /// # use google_cloud_datastream_v1::model::OracleProfile;
4023    /// let x = OracleProfile::new().set_database_service("example");
4024    /// ```
4025    pub fn set_database_service<T: std::convert::Into<std::string::String>>(
4026        mut self,
4027        v: T,
4028    ) -> Self {
4029        self.database_service = v.into();
4030        self
4031    }
4032
4033    /// Sets the value of [connection_attributes][crate::model::OracleProfile::connection_attributes].
4034    ///
4035    /// # Example
4036    /// ```ignore,no_run
4037    /// # use google_cloud_datastream_v1::model::OracleProfile;
4038    /// let x = OracleProfile::new().set_connection_attributes([
4039    ///     ("key0", "abc"),
4040    ///     ("key1", "xyz"),
4041    /// ]);
4042    /// ```
4043    pub fn set_connection_attributes<T, K, V>(mut self, v: T) -> Self
4044    where
4045        T: std::iter::IntoIterator<Item = (K, V)>,
4046        K: std::convert::Into<std::string::String>,
4047        V: std::convert::Into<std::string::String>,
4048    {
4049        use std::iter::Iterator;
4050        self.connection_attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4051        self
4052    }
4053
4054    /// Sets the value of [oracle_ssl_config][crate::model::OracleProfile::oracle_ssl_config].
4055    ///
4056    /// # Example
4057    /// ```ignore,no_run
4058    /// # use google_cloud_datastream_v1::model::OracleProfile;
4059    /// use google_cloud_datastream_v1::model::OracleSslConfig;
4060    /// let x = OracleProfile::new().set_oracle_ssl_config(OracleSslConfig::default()/* use setters */);
4061    /// ```
4062    pub fn set_oracle_ssl_config<T>(mut self, v: T) -> Self
4063    where
4064        T: std::convert::Into<crate::model::OracleSslConfig>,
4065    {
4066        self.oracle_ssl_config = std::option::Option::Some(v.into());
4067        self
4068    }
4069
4070    /// Sets or clears the value of [oracle_ssl_config][crate::model::OracleProfile::oracle_ssl_config].
4071    ///
4072    /// # Example
4073    /// ```ignore,no_run
4074    /// # use google_cloud_datastream_v1::model::OracleProfile;
4075    /// use google_cloud_datastream_v1::model::OracleSslConfig;
4076    /// let x = OracleProfile::new().set_or_clear_oracle_ssl_config(Some(OracleSslConfig::default()/* use setters */));
4077    /// let x = OracleProfile::new().set_or_clear_oracle_ssl_config(None::<OracleSslConfig>);
4078    /// ```
4079    pub fn set_or_clear_oracle_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
4080    where
4081        T: std::convert::Into<crate::model::OracleSslConfig>,
4082    {
4083        self.oracle_ssl_config = v.map(|x| x.into());
4084        self
4085    }
4086
4087    /// Sets the value of [oracle_asm_config][crate::model::OracleProfile::oracle_asm_config].
4088    ///
4089    /// # Example
4090    /// ```ignore,no_run
4091    /// # use google_cloud_datastream_v1::model::OracleProfile;
4092    /// use google_cloud_datastream_v1::model::OracleAsmConfig;
4093    /// let x = OracleProfile::new().set_oracle_asm_config(OracleAsmConfig::default()/* use setters */);
4094    /// ```
4095    pub fn set_oracle_asm_config<T>(mut self, v: T) -> Self
4096    where
4097        T: std::convert::Into<crate::model::OracleAsmConfig>,
4098    {
4099        self.oracle_asm_config = std::option::Option::Some(v.into());
4100        self
4101    }
4102
4103    /// Sets or clears the value of [oracle_asm_config][crate::model::OracleProfile::oracle_asm_config].
4104    ///
4105    /// # Example
4106    /// ```ignore,no_run
4107    /// # use google_cloud_datastream_v1::model::OracleProfile;
4108    /// use google_cloud_datastream_v1::model::OracleAsmConfig;
4109    /// let x = OracleProfile::new().set_or_clear_oracle_asm_config(Some(OracleAsmConfig::default()/* use setters */));
4110    /// let x = OracleProfile::new().set_or_clear_oracle_asm_config(None::<OracleAsmConfig>);
4111    /// ```
4112    pub fn set_or_clear_oracle_asm_config<T>(mut self, v: std::option::Option<T>) -> Self
4113    where
4114        T: std::convert::Into<crate::model::OracleAsmConfig>,
4115    {
4116        self.oracle_asm_config = v.map(|x| x.into());
4117        self
4118    }
4119
4120    /// Sets the value of [secret_manager_stored_password][crate::model::OracleProfile::secret_manager_stored_password].
4121    ///
4122    /// # Example
4123    /// ```ignore,no_run
4124    /// # use google_cloud_datastream_v1::model::OracleProfile;
4125    /// let x = OracleProfile::new().set_secret_manager_stored_password("example");
4126    /// ```
4127    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4128        mut self,
4129        v: T,
4130    ) -> Self {
4131        self.secret_manager_stored_password = v.into();
4132        self
4133    }
4134}
4135
4136impl wkt::message::Message for OracleProfile {
4137    fn typename() -> &'static str {
4138        "type.googleapis.com/google.cloud.datastream.v1.OracleProfile"
4139    }
4140}
4141
4142/// Configuration for Oracle Automatic Storage Management (ASM) connection.
4143#[derive(Clone, Default, PartialEq)]
4144#[non_exhaustive]
4145pub struct OracleAsmConfig {
4146    /// Required. Hostname for the Oracle ASM connection.
4147    pub hostname: std::string::String,
4148
4149    /// Required. Port for the Oracle ASM connection.
4150    pub port: i32,
4151
4152    /// Required. Username for the Oracle ASM connection.
4153    pub username: std::string::String,
4154
4155    /// Optional. Password for the Oracle ASM connection. Mutually exclusive with
4156    /// the `secret_manager_stored_password` field.
4157    pub password: std::string::String,
4158
4159    /// Required. ASM service name for the Oracle ASM connection.
4160    pub asm_service: std::string::String,
4161
4162    /// Optional. Connection string attributes
4163    pub connection_attributes: std::collections::HashMap<std::string::String, std::string::String>,
4164
4165    /// Optional. SSL configuration for the Oracle connection.
4166    pub oracle_ssl_config: std::option::Option<crate::model::OracleSslConfig>,
4167
4168    /// Optional. A reference to a Secret Manager resource name storing the Oracle
4169    /// ASM connection password. Mutually exclusive with the `password` field.
4170    pub secret_manager_stored_password: std::string::String,
4171
4172    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4173}
4174
4175impl OracleAsmConfig {
4176    /// Creates a new default instance.
4177    pub fn new() -> Self {
4178        std::default::Default::default()
4179    }
4180
4181    /// Sets the value of [hostname][crate::model::OracleAsmConfig::hostname].
4182    ///
4183    /// # Example
4184    /// ```ignore,no_run
4185    /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4186    /// let x = OracleAsmConfig::new().set_hostname("example");
4187    /// ```
4188    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4189        self.hostname = v.into();
4190        self
4191    }
4192
4193    /// Sets the value of [port][crate::model::OracleAsmConfig::port].
4194    ///
4195    /// # Example
4196    /// ```ignore,no_run
4197    /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4198    /// let x = OracleAsmConfig::new().set_port(42);
4199    /// ```
4200    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4201        self.port = v.into();
4202        self
4203    }
4204
4205    /// Sets the value of [username][crate::model::OracleAsmConfig::username].
4206    ///
4207    /// # Example
4208    /// ```ignore,no_run
4209    /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4210    /// let x = OracleAsmConfig::new().set_username("example");
4211    /// ```
4212    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4213        self.username = v.into();
4214        self
4215    }
4216
4217    /// Sets the value of [password][crate::model::OracleAsmConfig::password].
4218    ///
4219    /// # Example
4220    /// ```ignore,no_run
4221    /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4222    /// let x = OracleAsmConfig::new().set_password("example");
4223    /// ```
4224    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4225        self.password = v.into();
4226        self
4227    }
4228
4229    /// Sets the value of [asm_service][crate::model::OracleAsmConfig::asm_service].
4230    ///
4231    /// # Example
4232    /// ```ignore,no_run
4233    /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4234    /// let x = OracleAsmConfig::new().set_asm_service("example");
4235    /// ```
4236    pub fn set_asm_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4237        self.asm_service = v.into();
4238        self
4239    }
4240
4241    /// Sets the value of [connection_attributes][crate::model::OracleAsmConfig::connection_attributes].
4242    ///
4243    /// # Example
4244    /// ```ignore,no_run
4245    /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4246    /// let x = OracleAsmConfig::new().set_connection_attributes([
4247    ///     ("key0", "abc"),
4248    ///     ("key1", "xyz"),
4249    /// ]);
4250    /// ```
4251    pub fn set_connection_attributes<T, K, V>(mut self, v: T) -> Self
4252    where
4253        T: std::iter::IntoIterator<Item = (K, V)>,
4254        K: std::convert::Into<std::string::String>,
4255        V: std::convert::Into<std::string::String>,
4256    {
4257        use std::iter::Iterator;
4258        self.connection_attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4259        self
4260    }
4261
4262    /// Sets the value of [oracle_ssl_config][crate::model::OracleAsmConfig::oracle_ssl_config].
4263    ///
4264    /// # Example
4265    /// ```ignore,no_run
4266    /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4267    /// use google_cloud_datastream_v1::model::OracleSslConfig;
4268    /// let x = OracleAsmConfig::new().set_oracle_ssl_config(OracleSslConfig::default()/* use setters */);
4269    /// ```
4270    pub fn set_oracle_ssl_config<T>(mut self, v: T) -> Self
4271    where
4272        T: std::convert::Into<crate::model::OracleSslConfig>,
4273    {
4274        self.oracle_ssl_config = std::option::Option::Some(v.into());
4275        self
4276    }
4277
4278    /// Sets or clears the value of [oracle_ssl_config][crate::model::OracleAsmConfig::oracle_ssl_config].
4279    ///
4280    /// # Example
4281    /// ```ignore,no_run
4282    /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4283    /// use google_cloud_datastream_v1::model::OracleSslConfig;
4284    /// let x = OracleAsmConfig::new().set_or_clear_oracle_ssl_config(Some(OracleSslConfig::default()/* use setters */));
4285    /// let x = OracleAsmConfig::new().set_or_clear_oracle_ssl_config(None::<OracleSslConfig>);
4286    /// ```
4287    pub fn set_or_clear_oracle_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
4288    where
4289        T: std::convert::Into<crate::model::OracleSslConfig>,
4290    {
4291        self.oracle_ssl_config = v.map(|x| x.into());
4292        self
4293    }
4294
4295    /// Sets the value of [secret_manager_stored_password][crate::model::OracleAsmConfig::secret_manager_stored_password].
4296    ///
4297    /// # Example
4298    /// ```ignore,no_run
4299    /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4300    /// let x = OracleAsmConfig::new().set_secret_manager_stored_password("example");
4301    /// ```
4302    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4303        mut self,
4304        v: T,
4305    ) -> Self {
4306        self.secret_manager_stored_password = v.into();
4307        self
4308    }
4309}
4310
4311impl wkt::message::Message for OracleAsmConfig {
4312    fn typename() -> &'static str {
4313        "type.googleapis.com/google.cloud.datastream.v1.OracleAsmConfig"
4314    }
4315}
4316
4317/// MySQL database profile.
4318#[derive(Clone, Default, PartialEq)]
4319#[non_exhaustive]
4320pub struct MysqlProfile {
4321    /// Required. Hostname for the MySQL connection.
4322    pub hostname: std::string::String,
4323
4324    /// Port for the MySQL connection, default value is 3306.
4325    pub port: i32,
4326
4327    /// Required. Username for the MySQL connection.
4328    pub username: std::string::String,
4329
4330    /// Optional. Input only. Password for the MySQL connection. Mutually exclusive
4331    /// with the `secret_manager_stored_password` field.
4332    pub password: std::string::String,
4333
4334    /// SSL configuration for the MySQL connection.
4335    pub ssl_config: std::option::Option<crate::model::MysqlSslConfig>,
4336
4337    /// Optional. A reference to a Secret Manager resource name storing the MySQL
4338    /// connection password. Mutually exclusive with the `password` field.
4339    pub secret_manager_stored_password: std::string::String,
4340
4341    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4342}
4343
4344impl MysqlProfile {
4345    /// Creates a new default instance.
4346    pub fn new() -> Self {
4347        std::default::Default::default()
4348    }
4349
4350    /// Sets the value of [hostname][crate::model::MysqlProfile::hostname].
4351    ///
4352    /// # Example
4353    /// ```ignore,no_run
4354    /// # use google_cloud_datastream_v1::model::MysqlProfile;
4355    /// let x = MysqlProfile::new().set_hostname("example");
4356    /// ```
4357    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4358        self.hostname = v.into();
4359        self
4360    }
4361
4362    /// Sets the value of [port][crate::model::MysqlProfile::port].
4363    ///
4364    /// # Example
4365    /// ```ignore,no_run
4366    /// # use google_cloud_datastream_v1::model::MysqlProfile;
4367    /// let x = MysqlProfile::new().set_port(42);
4368    /// ```
4369    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4370        self.port = v.into();
4371        self
4372    }
4373
4374    /// Sets the value of [username][crate::model::MysqlProfile::username].
4375    ///
4376    /// # Example
4377    /// ```ignore,no_run
4378    /// # use google_cloud_datastream_v1::model::MysqlProfile;
4379    /// let x = MysqlProfile::new().set_username("example");
4380    /// ```
4381    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4382        self.username = v.into();
4383        self
4384    }
4385
4386    /// Sets the value of [password][crate::model::MysqlProfile::password].
4387    ///
4388    /// # Example
4389    /// ```ignore,no_run
4390    /// # use google_cloud_datastream_v1::model::MysqlProfile;
4391    /// let x = MysqlProfile::new().set_password("example");
4392    /// ```
4393    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4394        self.password = v.into();
4395        self
4396    }
4397
4398    /// Sets the value of [ssl_config][crate::model::MysqlProfile::ssl_config].
4399    ///
4400    /// # Example
4401    /// ```ignore,no_run
4402    /// # use google_cloud_datastream_v1::model::MysqlProfile;
4403    /// use google_cloud_datastream_v1::model::MysqlSslConfig;
4404    /// let x = MysqlProfile::new().set_ssl_config(MysqlSslConfig::default()/* use setters */);
4405    /// ```
4406    pub fn set_ssl_config<T>(mut self, v: T) -> Self
4407    where
4408        T: std::convert::Into<crate::model::MysqlSslConfig>,
4409    {
4410        self.ssl_config = std::option::Option::Some(v.into());
4411        self
4412    }
4413
4414    /// Sets or clears the value of [ssl_config][crate::model::MysqlProfile::ssl_config].
4415    ///
4416    /// # Example
4417    /// ```ignore,no_run
4418    /// # use google_cloud_datastream_v1::model::MysqlProfile;
4419    /// use google_cloud_datastream_v1::model::MysqlSslConfig;
4420    /// let x = MysqlProfile::new().set_or_clear_ssl_config(Some(MysqlSslConfig::default()/* use setters */));
4421    /// let x = MysqlProfile::new().set_or_clear_ssl_config(None::<MysqlSslConfig>);
4422    /// ```
4423    pub fn set_or_clear_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
4424    where
4425        T: std::convert::Into<crate::model::MysqlSslConfig>,
4426    {
4427        self.ssl_config = v.map(|x| x.into());
4428        self
4429    }
4430
4431    /// Sets the value of [secret_manager_stored_password][crate::model::MysqlProfile::secret_manager_stored_password].
4432    ///
4433    /// # Example
4434    /// ```ignore,no_run
4435    /// # use google_cloud_datastream_v1::model::MysqlProfile;
4436    /// let x = MysqlProfile::new().set_secret_manager_stored_password("example");
4437    /// ```
4438    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4439        mut self,
4440        v: T,
4441    ) -> Self {
4442        self.secret_manager_stored_password = v.into();
4443        self
4444    }
4445}
4446
4447impl wkt::message::Message for MysqlProfile {
4448    fn typename() -> &'static str {
4449        "type.googleapis.com/google.cloud.datastream.v1.MysqlProfile"
4450    }
4451}
4452
4453/// PostgreSQL database profile.
4454#[derive(Clone, Default, PartialEq)]
4455#[non_exhaustive]
4456pub struct PostgresqlProfile {
4457    /// Required. Hostname for the PostgreSQL connection.
4458    pub hostname: std::string::String,
4459
4460    /// Port for the PostgreSQL connection, default value is 5432.
4461    pub port: i32,
4462
4463    /// Required. Username for the PostgreSQL connection.
4464    pub username: std::string::String,
4465
4466    /// Optional. Password for the PostgreSQL connection. Mutually exclusive with
4467    /// the `secret_manager_stored_password` field.
4468    pub password: std::string::String,
4469
4470    /// Required. Database for the PostgreSQL connection.
4471    pub database: std::string::String,
4472
4473    /// Optional. A reference to a Secret Manager resource name storing the
4474    /// PostgreSQL connection password. Mutually exclusive with the `password`
4475    /// field.
4476    pub secret_manager_stored_password: std::string::String,
4477
4478    /// Optional. SSL configuration for the PostgreSQL connection.
4479    /// In case PostgresqlSslConfig is not set, the connection will use the default
4480    /// SSL mode, which is `prefer` (i.e. this mode will only use encryption if
4481    /// enabled from database side, otherwise will use unencrypted communication)
4482    pub ssl_config: std::option::Option<crate::model::PostgresqlSslConfig>,
4483
4484    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4485}
4486
4487impl PostgresqlProfile {
4488    /// Creates a new default instance.
4489    pub fn new() -> Self {
4490        std::default::Default::default()
4491    }
4492
4493    /// Sets the value of [hostname][crate::model::PostgresqlProfile::hostname].
4494    ///
4495    /// # Example
4496    /// ```ignore,no_run
4497    /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4498    /// let x = PostgresqlProfile::new().set_hostname("example");
4499    /// ```
4500    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4501        self.hostname = v.into();
4502        self
4503    }
4504
4505    /// Sets the value of [port][crate::model::PostgresqlProfile::port].
4506    ///
4507    /// # Example
4508    /// ```ignore,no_run
4509    /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4510    /// let x = PostgresqlProfile::new().set_port(42);
4511    /// ```
4512    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4513        self.port = v.into();
4514        self
4515    }
4516
4517    /// Sets the value of [username][crate::model::PostgresqlProfile::username].
4518    ///
4519    /// # Example
4520    /// ```ignore,no_run
4521    /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4522    /// let x = PostgresqlProfile::new().set_username("example");
4523    /// ```
4524    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4525        self.username = v.into();
4526        self
4527    }
4528
4529    /// Sets the value of [password][crate::model::PostgresqlProfile::password].
4530    ///
4531    /// # Example
4532    /// ```ignore,no_run
4533    /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4534    /// let x = PostgresqlProfile::new().set_password("example");
4535    /// ```
4536    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4537        self.password = v.into();
4538        self
4539    }
4540
4541    /// Sets the value of [database][crate::model::PostgresqlProfile::database].
4542    ///
4543    /// # Example
4544    /// ```ignore,no_run
4545    /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4546    /// let x = PostgresqlProfile::new().set_database("example");
4547    /// ```
4548    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4549        self.database = v.into();
4550        self
4551    }
4552
4553    /// Sets the value of [secret_manager_stored_password][crate::model::PostgresqlProfile::secret_manager_stored_password].
4554    ///
4555    /// # Example
4556    /// ```ignore,no_run
4557    /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4558    /// let x = PostgresqlProfile::new().set_secret_manager_stored_password("example");
4559    /// ```
4560    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4561        mut self,
4562        v: T,
4563    ) -> Self {
4564        self.secret_manager_stored_password = v.into();
4565        self
4566    }
4567
4568    /// Sets the value of [ssl_config][crate::model::PostgresqlProfile::ssl_config].
4569    ///
4570    /// # Example
4571    /// ```ignore,no_run
4572    /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4573    /// use google_cloud_datastream_v1::model::PostgresqlSslConfig;
4574    /// let x = PostgresqlProfile::new().set_ssl_config(PostgresqlSslConfig::default()/* use setters */);
4575    /// ```
4576    pub fn set_ssl_config<T>(mut self, v: T) -> Self
4577    where
4578        T: std::convert::Into<crate::model::PostgresqlSslConfig>,
4579    {
4580        self.ssl_config = std::option::Option::Some(v.into());
4581        self
4582    }
4583
4584    /// Sets or clears the value of [ssl_config][crate::model::PostgresqlProfile::ssl_config].
4585    ///
4586    /// # Example
4587    /// ```ignore,no_run
4588    /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4589    /// use google_cloud_datastream_v1::model::PostgresqlSslConfig;
4590    /// let x = PostgresqlProfile::new().set_or_clear_ssl_config(Some(PostgresqlSslConfig::default()/* use setters */));
4591    /// let x = PostgresqlProfile::new().set_or_clear_ssl_config(None::<PostgresqlSslConfig>);
4592    /// ```
4593    pub fn set_or_clear_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
4594    where
4595        T: std::convert::Into<crate::model::PostgresqlSslConfig>,
4596    {
4597        self.ssl_config = v.map(|x| x.into());
4598        self
4599    }
4600}
4601
4602impl wkt::message::Message for PostgresqlProfile {
4603    fn typename() -> &'static str {
4604        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlProfile"
4605    }
4606}
4607
4608/// SQLServer database profile.
4609#[derive(Clone, Default, PartialEq)]
4610#[non_exhaustive]
4611pub struct SqlServerProfile {
4612    /// Required. Hostname for the SQLServer connection.
4613    pub hostname: std::string::String,
4614
4615    /// Port for the SQLServer connection, default value is 1433.
4616    pub port: i32,
4617
4618    /// Required. Username for the SQLServer connection.
4619    pub username: std::string::String,
4620
4621    /// Optional. Password for the SQLServer connection. Mutually exclusive with
4622    /// the `secret_manager_stored_password` field.
4623    pub password: std::string::String,
4624
4625    /// Required. Database for the SQLServer connection.
4626    pub database: std::string::String,
4627
4628    /// Optional. A reference to a Secret Manager resource name storing the
4629    /// SQLServer connection password. Mutually exclusive with the `password`
4630    /// field.
4631    pub secret_manager_stored_password: std::string::String,
4632
4633    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4634}
4635
4636impl SqlServerProfile {
4637    /// Creates a new default instance.
4638    pub fn new() -> Self {
4639        std::default::Default::default()
4640    }
4641
4642    /// Sets the value of [hostname][crate::model::SqlServerProfile::hostname].
4643    ///
4644    /// # Example
4645    /// ```ignore,no_run
4646    /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4647    /// let x = SqlServerProfile::new().set_hostname("example");
4648    /// ```
4649    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4650        self.hostname = v.into();
4651        self
4652    }
4653
4654    /// Sets the value of [port][crate::model::SqlServerProfile::port].
4655    ///
4656    /// # Example
4657    /// ```ignore,no_run
4658    /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4659    /// let x = SqlServerProfile::new().set_port(42);
4660    /// ```
4661    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4662        self.port = v.into();
4663        self
4664    }
4665
4666    /// Sets the value of [username][crate::model::SqlServerProfile::username].
4667    ///
4668    /// # Example
4669    /// ```ignore,no_run
4670    /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4671    /// let x = SqlServerProfile::new().set_username("example");
4672    /// ```
4673    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4674        self.username = v.into();
4675        self
4676    }
4677
4678    /// Sets the value of [password][crate::model::SqlServerProfile::password].
4679    ///
4680    /// # Example
4681    /// ```ignore,no_run
4682    /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4683    /// let x = SqlServerProfile::new().set_password("example");
4684    /// ```
4685    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4686        self.password = v.into();
4687        self
4688    }
4689
4690    /// Sets the value of [database][crate::model::SqlServerProfile::database].
4691    ///
4692    /// # Example
4693    /// ```ignore,no_run
4694    /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4695    /// let x = SqlServerProfile::new().set_database("example");
4696    /// ```
4697    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4698        self.database = v.into();
4699        self
4700    }
4701
4702    /// Sets the value of [secret_manager_stored_password][crate::model::SqlServerProfile::secret_manager_stored_password].
4703    ///
4704    /// # Example
4705    /// ```ignore,no_run
4706    /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4707    /// let x = SqlServerProfile::new().set_secret_manager_stored_password("example");
4708    /// ```
4709    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4710        mut self,
4711        v: T,
4712    ) -> Self {
4713        self.secret_manager_stored_password = v.into();
4714        self
4715    }
4716}
4717
4718impl wkt::message::Message for SqlServerProfile {
4719    fn typename() -> &'static str {
4720        "type.googleapis.com/google.cloud.datastream.v1.SqlServerProfile"
4721    }
4722}
4723
4724/// Salesforce profile
4725#[derive(Clone, Default, PartialEq)]
4726#[non_exhaustive]
4727pub struct SalesforceProfile {
4728    /// Required. Domain endpoint for the Salesforce connection.
4729    pub domain: std::string::String,
4730
4731    /// Credentials for Salesforce connection.
4732    pub credentials: std::option::Option<crate::model::salesforce_profile::Credentials>,
4733
4734    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4735}
4736
4737impl SalesforceProfile {
4738    /// Creates a new default instance.
4739    pub fn new() -> Self {
4740        std::default::Default::default()
4741    }
4742
4743    /// Sets the value of [domain][crate::model::SalesforceProfile::domain].
4744    ///
4745    /// # Example
4746    /// ```ignore,no_run
4747    /// # use google_cloud_datastream_v1::model::SalesforceProfile;
4748    /// let x = SalesforceProfile::new().set_domain("example");
4749    /// ```
4750    pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4751        self.domain = v.into();
4752        self
4753    }
4754
4755    /// Sets the value of [credentials][crate::model::SalesforceProfile::credentials].
4756    ///
4757    /// Note that all the setters affecting `credentials` are mutually
4758    /// exclusive.
4759    ///
4760    /// # Example
4761    /// ```ignore,no_run
4762    /// # use google_cloud_datastream_v1::model::SalesforceProfile;
4763    /// use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4764    /// let x = SalesforceProfile::new().set_credentials(Some(
4765    ///     google_cloud_datastream_v1::model::salesforce_profile::Credentials::UserCredentials(UserCredentials::default().into())));
4766    /// ```
4767    pub fn set_credentials<
4768        T: std::convert::Into<std::option::Option<crate::model::salesforce_profile::Credentials>>,
4769    >(
4770        mut self,
4771        v: T,
4772    ) -> Self {
4773        self.credentials = v.into();
4774        self
4775    }
4776
4777    /// The value of [credentials][crate::model::SalesforceProfile::credentials]
4778    /// if it holds a `UserCredentials`, `None` if the field is not set or
4779    /// holds a different branch.
4780    pub fn user_credentials(
4781        &self,
4782    ) -> std::option::Option<&std::boxed::Box<crate::model::salesforce_profile::UserCredentials>>
4783    {
4784        #[allow(unreachable_patterns)]
4785        self.credentials.as_ref().and_then(|v| match v {
4786            crate::model::salesforce_profile::Credentials::UserCredentials(v) => {
4787                std::option::Option::Some(v)
4788            }
4789            _ => std::option::Option::None,
4790        })
4791    }
4792
4793    /// Sets the value of [credentials][crate::model::SalesforceProfile::credentials]
4794    /// to hold a `UserCredentials`.
4795    ///
4796    /// Note that all the setters affecting `credentials` are
4797    /// mutually exclusive.
4798    ///
4799    /// # Example
4800    /// ```ignore,no_run
4801    /// # use google_cloud_datastream_v1::model::SalesforceProfile;
4802    /// use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4803    /// let x = SalesforceProfile::new().set_user_credentials(UserCredentials::default()/* use setters */);
4804    /// assert!(x.user_credentials().is_some());
4805    /// assert!(x.oauth2_client_credentials().is_none());
4806    /// ```
4807    pub fn set_user_credentials<
4808        T: std::convert::Into<std::boxed::Box<crate::model::salesforce_profile::UserCredentials>>,
4809    >(
4810        mut self,
4811        v: T,
4812    ) -> Self {
4813        self.credentials = std::option::Option::Some(
4814            crate::model::salesforce_profile::Credentials::UserCredentials(v.into()),
4815        );
4816        self
4817    }
4818
4819    /// The value of [credentials][crate::model::SalesforceProfile::credentials]
4820    /// if it holds a `Oauth2ClientCredentials`, `None` if the field is not set or
4821    /// holds a different branch.
4822    pub fn oauth2_client_credentials(
4823        &self,
4824    ) -> std::option::Option<
4825        &std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>,
4826    > {
4827        #[allow(unreachable_patterns)]
4828        self.credentials.as_ref().and_then(|v| match v {
4829            crate::model::salesforce_profile::Credentials::Oauth2ClientCredentials(v) => {
4830                std::option::Option::Some(v)
4831            }
4832            _ => std::option::Option::None,
4833        })
4834    }
4835
4836    /// Sets the value of [credentials][crate::model::SalesforceProfile::credentials]
4837    /// to hold a `Oauth2ClientCredentials`.
4838    ///
4839    /// Note that all the setters affecting `credentials` are
4840    /// mutually exclusive.
4841    ///
4842    /// # Example
4843    /// ```ignore,no_run
4844    /// # use google_cloud_datastream_v1::model::SalesforceProfile;
4845    /// use google_cloud_datastream_v1::model::salesforce_profile::Oauth2ClientCredentials;
4846    /// let x = SalesforceProfile::new().set_oauth2_client_credentials(Oauth2ClientCredentials::default()/* use setters */);
4847    /// assert!(x.oauth2_client_credentials().is_some());
4848    /// assert!(x.user_credentials().is_none());
4849    /// ```
4850    pub fn set_oauth2_client_credentials<
4851        T: std::convert::Into<
4852                std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>,
4853            >,
4854    >(
4855        mut self,
4856        v: T,
4857    ) -> Self {
4858        self.credentials = std::option::Option::Some(
4859            crate::model::salesforce_profile::Credentials::Oauth2ClientCredentials(v.into()),
4860        );
4861        self
4862    }
4863}
4864
4865impl wkt::message::Message for SalesforceProfile {
4866    fn typename() -> &'static str {
4867        "type.googleapis.com/google.cloud.datastream.v1.SalesforceProfile"
4868    }
4869}
4870
4871/// Defines additional types related to [SalesforceProfile].
4872pub mod salesforce_profile {
4873    #[allow(unused_imports)]
4874    use super::*;
4875
4876    /// Username-password credentials.
4877    #[derive(Clone, Default, PartialEq)]
4878    #[non_exhaustive]
4879    pub struct UserCredentials {
4880        /// Required. Username for the Salesforce connection.
4881        pub username: std::string::String,
4882
4883        /// Optional. Password for the Salesforce connection.
4884        /// Mutually exclusive with the `secret_manager_stored_password` field.
4885        pub password: std::string::String,
4886
4887        /// Optional. Security token for the Salesforce connection.
4888        /// Mutually exclusive with the `secret_manager_stored_security_token` field.
4889        pub security_token: std::string::String,
4890
4891        /// Optional. A reference to a Secret Manager resource name storing the
4892        /// Salesforce connection's password. Mutually exclusive with the `password`
4893        /// field.
4894        pub secret_manager_stored_password: std::string::String,
4895
4896        /// Optional. A reference to a Secret Manager resource name storing the
4897        /// Salesforce connection's security token. Mutually exclusive with the
4898        /// `security_token` field.
4899        pub secret_manager_stored_security_token: std::string::String,
4900
4901        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4902    }
4903
4904    impl UserCredentials {
4905        /// Creates a new default instance.
4906        pub fn new() -> Self {
4907            std::default::Default::default()
4908        }
4909
4910        /// Sets the value of [username][crate::model::salesforce_profile::UserCredentials::username].
4911        ///
4912        /// # Example
4913        /// ```ignore,no_run
4914        /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4915        /// let x = UserCredentials::new().set_username("example");
4916        /// ```
4917        pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4918            self.username = v.into();
4919            self
4920        }
4921
4922        /// Sets the value of [password][crate::model::salesforce_profile::UserCredentials::password].
4923        ///
4924        /// # Example
4925        /// ```ignore,no_run
4926        /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4927        /// let x = UserCredentials::new().set_password("example");
4928        /// ```
4929        pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4930            self.password = v.into();
4931            self
4932        }
4933
4934        /// Sets the value of [security_token][crate::model::salesforce_profile::UserCredentials::security_token].
4935        ///
4936        /// # Example
4937        /// ```ignore,no_run
4938        /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4939        /// let x = UserCredentials::new().set_security_token("example");
4940        /// ```
4941        pub fn set_security_token<T: std::convert::Into<std::string::String>>(
4942            mut self,
4943            v: T,
4944        ) -> Self {
4945            self.security_token = v.into();
4946            self
4947        }
4948
4949        /// Sets the value of [secret_manager_stored_password][crate::model::salesforce_profile::UserCredentials::secret_manager_stored_password].
4950        ///
4951        /// # Example
4952        /// ```ignore,no_run
4953        /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4954        /// let x = UserCredentials::new().set_secret_manager_stored_password("example");
4955        /// ```
4956        pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4957            mut self,
4958            v: T,
4959        ) -> Self {
4960            self.secret_manager_stored_password = v.into();
4961            self
4962        }
4963
4964        /// Sets the value of [secret_manager_stored_security_token][crate::model::salesforce_profile::UserCredentials::secret_manager_stored_security_token].
4965        ///
4966        /// # Example
4967        /// ```ignore,no_run
4968        /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4969        /// let x = UserCredentials::new().set_secret_manager_stored_security_token("example");
4970        /// ```
4971        pub fn set_secret_manager_stored_security_token<
4972            T: std::convert::Into<std::string::String>,
4973        >(
4974            mut self,
4975            v: T,
4976        ) -> Self {
4977            self.secret_manager_stored_security_token = v.into();
4978            self
4979        }
4980    }
4981
4982    impl wkt::message::Message for UserCredentials {
4983        fn typename() -> &'static str {
4984            "type.googleapis.com/google.cloud.datastream.v1.SalesforceProfile.UserCredentials"
4985        }
4986    }
4987
4988    /// OAuth2 Client Credentials.
4989    #[derive(Clone, Default, PartialEq)]
4990    #[non_exhaustive]
4991    pub struct Oauth2ClientCredentials {
4992        /// Required. Client ID for Salesforce OAuth2 Client Credentials.
4993        pub client_id: std::string::String,
4994
4995        /// Optional. Client secret for Salesforce OAuth2 Client Credentials.
4996        /// Mutually exclusive with the `secret_manager_stored_client_secret` field.
4997        pub client_secret: std::string::String,
4998
4999        /// Optional. A reference to a Secret Manager resource name storing the
5000        /// Salesforce OAuth2 client_secret. Mutually exclusive with the
5001        /// `client_secret` field.
5002        pub secret_manager_stored_client_secret: std::string::String,
5003
5004        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5005    }
5006
5007    impl Oauth2ClientCredentials {
5008        /// Creates a new default instance.
5009        pub fn new() -> Self {
5010            std::default::Default::default()
5011        }
5012
5013        /// Sets the value of [client_id][crate::model::salesforce_profile::Oauth2ClientCredentials::client_id].
5014        ///
5015        /// # Example
5016        /// ```ignore,no_run
5017        /// # use google_cloud_datastream_v1::model::salesforce_profile::Oauth2ClientCredentials;
5018        /// let x = Oauth2ClientCredentials::new().set_client_id("example");
5019        /// ```
5020        pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5021            self.client_id = v.into();
5022            self
5023        }
5024
5025        /// Sets the value of [client_secret][crate::model::salesforce_profile::Oauth2ClientCredentials::client_secret].
5026        ///
5027        /// # Example
5028        /// ```ignore,no_run
5029        /// # use google_cloud_datastream_v1::model::salesforce_profile::Oauth2ClientCredentials;
5030        /// let x = Oauth2ClientCredentials::new().set_client_secret("example");
5031        /// ```
5032        pub fn set_client_secret<T: std::convert::Into<std::string::String>>(
5033            mut self,
5034            v: T,
5035        ) -> Self {
5036            self.client_secret = v.into();
5037            self
5038        }
5039
5040        /// Sets the value of [secret_manager_stored_client_secret][crate::model::salesforce_profile::Oauth2ClientCredentials::secret_manager_stored_client_secret].
5041        ///
5042        /// # Example
5043        /// ```ignore,no_run
5044        /// # use google_cloud_datastream_v1::model::salesforce_profile::Oauth2ClientCredentials;
5045        /// let x = Oauth2ClientCredentials::new().set_secret_manager_stored_client_secret("example");
5046        /// ```
5047        pub fn set_secret_manager_stored_client_secret<
5048            T: std::convert::Into<std::string::String>,
5049        >(
5050            mut self,
5051            v: T,
5052        ) -> Self {
5053            self.secret_manager_stored_client_secret = v.into();
5054            self
5055        }
5056    }
5057
5058    impl wkt::message::Message for Oauth2ClientCredentials {
5059        fn typename() -> &'static str {
5060            "type.googleapis.com/google.cloud.datastream.v1.SalesforceProfile.Oauth2ClientCredentials"
5061        }
5062    }
5063
5064    /// Credentials for Salesforce connection.
5065    #[derive(Clone, Debug, PartialEq)]
5066    #[non_exhaustive]
5067    pub enum Credentials {
5068        /// User-password authentication.
5069        UserCredentials(std::boxed::Box<crate::model::salesforce_profile::UserCredentials>),
5070        /// Connected app authentication.
5071        Oauth2ClientCredentials(
5072            std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>,
5073        ),
5074    }
5075}
5076
5077/// MongoDB profile.
5078#[derive(Clone, Default, PartialEq)]
5079#[non_exhaustive]
5080pub struct MongodbProfile {
5081    /// Required. List of host addresses for a MongoDB cluster.
5082    /// For SRV connection format, this list must contain exactly one DNS host
5083    /// without a port. For Standard connection format, this list must contain all
5084    /// the required hosts in the cluster with their respective ports.
5085    pub host_addresses: std::vec::Vec<crate::model::HostAddress>,
5086
5087    /// Optional. Name of the replica set. Only needed for self hosted replica set
5088    /// type MongoDB cluster. For SRV connection format, this field must be empty.
5089    /// For Standard connection format, this field must be specified.
5090    pub replica_set: std::string::String,
5091
5092    /// Required. Username for the MongoDB connection.
5093    pub username: std::string::String,
5094
5095    /// Optional. Password for the MongoDB connection. Mutually exclusive with the
5096    /// `secret_manager_stored_password` field.
5097    pub password: std::string::String,
5098
5099    /// Optional. A reference to a Secret Manager resource name storing the
5100    /// SQLServer connection password. Mutually exclusive with the `password`
5101    /// field.
5102    pub secret_manager_stored_password: std::string::String,
5103
5104    /// Optional. SSL configuration for the MongoDB connection.
5105    pub ssl_config: std::option::Option<crate::model::MongodbSslConfig>,
5106
5107    /// MongoDB connection format.
5108    /// Must specify either srv_connection_format or standard_connection_format.
5109    pub mongodb_connection_format:
5110        std::option::Option<crate::model::mongodb_profile::MongodbConnectionFormat>,
5111
5112    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5113}
5114
5115impl MongodbProfile {
5116    /// Creates a new default instance.
5117    pub fn new() -> Self {
5118        std::default::Default::default()
5119    }
5120
5121    /// Sets the value of [host_addresses][crate::model::MongodbProfile::host_addresses].
5122    ///
5123    /// # Example
5124    /// ```ignore,no_run
5125    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5126    /// use google_cloud_datastream_v1::model::HostAddress;
5127    /// let x = MongodbProfile::new()
5128    ///     .set_host_addresses([
5129    ///         HostAddress::default()/* use setters */,
5130    ///         HostAddress::default()/* use (different) setters */,
5131    ///     ]);
5132    /// ```
5133    pub fn set_host_addresses<T, V>(mut self, v: T) -> Self
5134    where
5135        T: std::iter::IntoIterator<Item = V>,
5136        V: std::convert::Into<crate::model::HostAddress>,
5137    {
5138        use std::iter::Iterator;
5139        self.host_addresses = v.into_iter().map(|i| i.into()).collect();
5140        self
5141    }
5142
5143    /// Sets the value of [replica_set][crate::model::MongodbProfile::replica_set].
5144    ///
5145    /// # Example
5146    /// ```ignore,no_run
5147    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5148    /// let x = MongodbProfile::new().set_replica_set("example");
5149    /// ```
5150    pub fn set_replica_set<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5151        self.replica_set = v.into();
5152        self
5153    }
5154
5155    /// Sets the value of [username][crate::model::MongodbProfile::username].
5156    ///
5157    /// # Example
5158    /// ```ignore,no_run
5159    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5160    /// let x = MongodbProfile::new().set_username("example");
5161    /// ```
5162    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5163        self.username = v.into();
5164        self
5165    }
5166
5167    /// Sets the value of [password][crate::model::MongodbProfile::password].
5168    ///
5169    /// # Example
5170    /// ```ignore,no_run
5171    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5172    /// let x = MongodbProfile::new().set_password("example");
5173    /// ```
5174    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5175        self.password = v.into();
5176        self
5177    }
5178
5179    /// Sets the value of [secret_manager_stored_password][crate::model::MongodbProfile::secret_manager_stored_password].
5180    ///
5181    /// # Example
5182    /// ```ignore,no_run
5183    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5184    /// let x = MongodbProfile::new().set_secret_manager_stored_password("example");
5185    /// ```
5186    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
5187        mut self,
5188        v: T,
5189    ) -> Self {
5190        self.secret_manager_stored_password = v.into();
5191        self
5192    }
5193
5194    /// Sets the value of [ssl_config][crate::model::MongodbProfile::ssl_config].
5195    ///
5196    /// # Example
5197    /// ```ignore,no_run
5198    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5199    /// use google_cloud_datastream_v1::model::MongodbSslConfig;
5200    /// let x = MongodbProfile::new().set_ssl_config(MongodbSslConfig::default()/* use setters */);
5201    /// ```
5202    pub fn set_ssl_config<T>(mut self, v: T) -> Self
5203    where
5204        T: std::convert::Into<crate::model::MongodbSslConfig>,
5205    {
5206        self.ssl_config = std::option::Option::Some(v.into());
5207        self
5208    }
5209
5210    /// Sets or clears the value of [ssl_config][crate::model::MongodbProfile::ssl_config].
5211    ///
5212    /// # Example
5213    /// ```ignore,no_run
5214    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5215    /// use google_cloud_datastream_v1::model::MongodbSslConfig;
5216    /// let x = MongodbProfile::new().set_or_clear_ssl_config(Some(MongodbSslConfig::default()/* use setters */));
5217    /// let x = MongodbProfile::new().set_or_clear_ssl_config(None::<MongodbSslConfig>);
5218    /// ```
5219    pub fn set_or_clear_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
5220    where
5221        T: std::convert::Into<crate::model::MongodbSslConfig>,
5222    {
5223        self.ssl_config = v.map(|x| x.into());
5224        self
5225    }
5226
5227    /// Sets the value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format].
5228    ///
5229    /// Note that all the setters affecting `mongodb_connection_format` are mutually
5230    /// exclusive.
5231    ///
5232    /// # Example
5233    /// ```ignore,no_run
5234    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5235    /// use google_cloud_datastream_v1::model::SrvConnectionFormat;
5236    /// let x = MongodbProfile::new().set_mongodb_connection_format(Some(
5237    ///     google_cloud_datastream_v1::model::mongodb_profile::MongodbConnectionFormat::SrvConnectionFormat(SrvConnectionFormat::default().into())));
5238    /// ```
5239    pub fn set_mongodb_connection_format<
5240        T: std::convert::Into<
5241                std::option::Option<crate::model::mongodb_profile::MongodbConnectionFormat>,
5242            >,
5243    >(
5244        mut self,
5245        v: T,
5246    ) -> Self {
5247        self.mongodb_connection_format = v.into();
5248        self
5249    }
5250
5251    /// The value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
5252    /// if it holds a `SrvConnectionFormat`, `None` if the field is not set or
5253    /// holds a different branch.
5254    pub fn srv_connection_format(
5255        &self,
5256    ) -> std::option::Option<&std::boxed::Box<crate::model::SrvConnectionFormat>> {
5257        #[allow(unreachable_patterns)]
5258        self.mongodb_connection_format
5259            .as_ref()
5260            .and_then(|v| match v {
5261                crate::model::mongodb_profile::MongodbConnectionFormat::SrvConnectionFormat(v) => {
5262                    std::option::Option::Some(v)
5263                }
5264                _ => std::option::Option::None,
5265            })
5266    }
5267
5268    /// Sets the value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
5269    /// to hold a `SrvConnectionFormat`.
5270    ///
5271    /// Note that all the setters affecting `mongodb_connection_format` are
5272    /// mutually exclusive.
5273    ///
5274    /// # Example
5275    /// ```ignore,no_run
5276    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5277    /// use google_cloud_datastream_v1::model::SrvConnectionFormat;
5278    /// let x = MongodbProfile::new().set_srv_connection_format(SrvConnectionFormat::default()/* use setters */);
5279    /// assert!(x.srv_connection_format().is_some());
5280    /// assert!(x.standard_connection_format().is_none());
5281    /// ```
5282    pub fn set_srv_connection_format<
5283        T: std::convert::Into<std::boxed::Box<crate::model::SrvConnectionFormat>>,
5284    >(
5285        mut self,
5286        v: T,
5287    ) -> Self {
5288        self.mongodb_connection_format = std::option::Option::Some(
5289            crate::model::mongodb_profile::MongodbConnectionFormat::SrvConnectionFormat(v.into()),
5290        );
5291        self
5292    }
5293
5294    /// The value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
5295    /// if it holds a `StandardConnectionFormat`, `None` if the field is not set or
5296    /// holds a different branch.
5297    pub fn standard_connection_format(
5298        &self,
5299    ) -> std::option::Option<&std::boxed::Box<crate::model::StandardConnectionFormat>> {
5300        #[allow(unreachable_patterns)]
5301        self.mongodb_connection_format.as_ref().and_then(|v| match v {
5302            crate::model::mongodb_profile::MongodbConnectionFormat::StandardConnectionFormat(v) => std::option::Option::Some(v),
5303            _ => std::option::Option::None,
5304        })
5305    }
5306
5307    /// Sets the value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
5308    /// to hold a `StandardConnectionFormat`.
5309    ///
5310    /// Note that all the setters affecting `mongodb_connection_format` are
5311    /// mutually exclusive.
5312    ///
5313    /// # Example
5314    /// ```ignore,no_run
5315    /// # use google_cloud_datastream_v1::model::MongodbProfile;
5316    /// use google_cloud_datastream_v1::model::StandardConnectionFormat;
5317    /// let x = MongodbProfile::new().set_standard_connection_format(StandardConnectionFormat::default()/* use setters */);
5318    /// assert!(x.standard_connection_format().is_some());
5319    /// assert!(x.srv_connection_format().is_none());
5320    /// ```
5321    pub fn set_standard_connection_format<
5322        T: std::convert::Into<std::boxed::Box<crate::model::StandardConnectionFormat>>,
5323    >(
5324        mut self,
5325        v: T,
5326    ) -> Self {
5327        self.mongodb_connection_format = std::option::Option::Some(
5328            crate::model::mongodb_profile::MongodbConnectionFormat::StandardConnectionFormat(
5329                v.into(),
5330            ),
5331        );
5332        self
5333    }
5334}
5335
5336impl wkt::message::Message for MongodbProfile {
5337    fn typename() -> &'static str {
5338        "type.googleapis.com/google.cloud.datastream.v1.MongodbProfile"
5339    }
5340}
5341
5342/// Defines additional types related to [MongodbProfile].
5343pub mod mongodb_profile {
5344    #[allow(unused_imports)]
5345    use super::*;
5346
5347    /// MongoDB connection format.
5348    /// Must specify either srv_connection_format or standard_connection_format.
5349    #[derive(Clone, Debug, PartialEq)]
5350    #[non_exhaustive]
5351    pub enum MongodbConnectionFormat {
5352        /// Srv connection format.
5353        SrvConnectionFormat(std::boxed::Box<crate::model::SrvConnectionFormat>),
5354        /// Standard connection format.
5355        StandardConnectionFormat(std::boxed::Box<crate::model::StandardConnectionFormat>),
5356    }
5357}
5358
5359/// A HostAddress represents a transport end point, which is the combination
5360/// of an IP address or hostname and a port number.
5361#[derive(Clone, Default, PartialEq)]
5362#[non_exhaustive]
5363pub struct HostAddress {
5364    /// Required. Hostname for the connection.
5365    pub hostname: std::string::String,
5366
5367    /// Optional. Port for the connection.
5368    pub port: i32,
5369
5370    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5371}
5372
5373impl HostAddress {
5374    /// Creates a new default instance.
5375    pub fn new() -> Self {
5376        std::default::Default::default()
5377    }
5378
5379    /// Sets the value of [hostname][crate::model::HostAddress::hostname].
5380    ///
5381    /// # Example
5382    /// ```ignore,no_run
5383    /// # use google_cloud_datastream_v1::model::HostAddress;
5384    /// let x = HostAddress::new().set_hostname("example");
5385    /// ```
5386    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5387        self.hostname = v.into();
5388        self
5389    }
5390
5391    /// Sets the value of [port][crate::model::HostAddress::port].
5392    ///
5393    /// # Example
5394    /// ```ignore,no_run
5395    /// # use google_cloud_datastream_v1::model::HostAddress;
5396    /// let x = HostAddress::new().set_port(42);
5397    /// ```
5398    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5399        self.port = v.into();
5400        self
5401    }
5402}
5403
5404impl wkt::message::Message for HostAddress {
5405    fn typename() -> &'static str {
5406        "type.googleapis.com/google.cloud.datastream.v1.HostAddress"
5407    }
5408}
5409
5410/// Srv connection format.
5411#[derive(Clone, Default, PartialEq)]
5412#[non_exhaustive]
5413pub struct SrvConnectionFormat {
5414    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5415}
5416
5417impl SrvConnectionFormat {
5418    /// Creates a new default instance.
5419    pub fn new() -> Self {
5420        std::default::Default::default()
5421    }
5422}
5423
5424impl wkt::message::Message for SrvConnectionFormat {
5425    fn typename() -> &'static str {
5426        "type.googleapis.com/google.cloud.datastream.v1.SrvConnectionFormat"
5427    }
5428}
5429
5430/// Standard connection format.
5431#[derive(Clone, Default, PartialEq)]
5432#[non_exhaustive]
5433pub struct StandardConnectionFormat {
5434    /// Optional. Specifies whether the client connects directly to the host[:port]
5435    /// in the connection URI.
5436    pub direct_connection: bool,
5437
5438    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5439}
5440
5441impl StandardConnectionFormat {
5442    /// Creates a new default instance.
5443    pub fn new() -> Self {
5444        std::default::Default::default()
5445    }
5446
5447    /// Sets the value of [direct_connection][crate::model::StandardConnectionFormat::direct_connection].
5448    ///
5449    /// # Example
5450    /// ```ignore,no_run
5451    /// # use google_cloud_datastream_v1::model::StandardConnectionFormat;
5452    /// let x = StandardConnectionFormat::new().set_direct_connection(true);
5453    /// ```
5454    pub fn set_direct_connection<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5455        self.direct_connection = v.into();
5456        self
5457    }
5458}
5459
5460impl wkt::message::Message for StandardConnectionFormat {
5461    fn typename() -> &'static str {
5462        "type.googleapis.com/google.cloud.datastream.v1.StandardConnectionFormat"
5463    }
5464}
5465
5466/// Cloud Storage bucket profile.
5467#[derive(Clone, Default, PartialEq)]
5468#[non_exhaustive]
5469pub struct GcsProfile {
5470    /// Required. The Cloud Storage bucket name.
5471    pub bucket: std::string::String,
5472
5473    /// The root path inside the Cloud Storage bucket.
5474    pub root_path: std::string::String,
5475
5476    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5477}
5478
5479impl GcsProfile {
5480    /// Creates a new default instance.
5481    pub fn new() -> Self {
5482        std::default::Default::default()
5483    }
5484
5485    /// Sets the value of [bucket][crate::model::GcsProfile::bucket].
5486    ///
5487    /// # Example
5488    /// ```ignore,no_run
5489    /// # use google_cloud_datastream_v1::model::GcsProfile;
5490    /// let x = GcsProfile::new().set_bucket("example");
5491    /// ```
5492    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5493        self.bucket = v.into();
5494        self
5495    }
5496
5497    /// Sets the value of [root_path][crate::model::GcsProfile::root_path].
5498    ///
5499    /// # Example
5500    /// ```ignore,no_run
5501    /// # use google_cloud_datastream_v1::model::GcsProfile;
5502    /// let x = GcsProfile::new().set_root_path("example");
5503    /// ```
5504    pub fn set_root_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5505        self.root_path = v.into();
5506        self
5507    }
5508}
5509
5510impl wkt::message::Message for GcsProfile {
5511    fn typename() -> &'static str {
5512        "type.googleapis.com/google.cloud.datastream.v1.GcsProfile"
5513    }
5514}
5515
5516/// BigQuery warehouse profile.
5517#[derive(Clone, Default, PartialEq)]
5518#[non_exhaustive]
5519pub struct BigQueryProfile {
5520    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5521}
5522
5523impl BigQueryProfile {
5524    /// Creates a new default instance.
5525    pub fn new() -> Self {
5526        std::default::Default::default()
5527    }
5528}
5529
5530impl wkt::message::Message for BigQueryProfile {
5531    fn typename() -> &'static str {
5532        "type.googleapis.com/google.cloud.datastream.v1.BigQueryProfile"
5533    }
5534}
5535
5536/// Static IP address connectivity. Used when the source database is configured
5537/// to allow incoming connections from the Datastream public IP addresses
5538/// for the region specified in the connection profile.
5539#[derive(Clone, Default, PartialEq)]
5540#[non_exhaustive]
5541pub struct StaticServiceIpConnectivity {
5542    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5543}
5544
5545impl StaticServiceIpConnectivity {
5546    /// Creates a new default instance.
5547    pub fn new() -> Self {
5548        std::default::Default::default()
5549    }
5550}
5551
5552impl wkt::message::Message for StaticServiceIpConnectivity {
5553    fn typename() -> &'static str {
5554        "type.googleapis.com/google.cloud.datastream.v1.StaticServiceIpConnectivity"
5555    }
5556}
5557
5558/// Forward SSH Tunnel connectivity.
5559#[derive(Clone, Default, PartialEq)]
5560#[non_exhaustive]
5561pub struct ForwardSshTunnelConnectivity {
5562    /// Required. Hostname for the SSH tunnel.
5563    pub hostname: std::string::String,
5564
5565    /// Required. Username for the SSH tunnel.
5566    pub username: std::string::String,
5567
5568    /// Port for the SSH tunnel, default value is 22.
5569    pub port: i32,
5570
5571    #[allow(missing_docs)]
5572    pub authentication_method:
5573        std::option::Option<crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod>,
5574
5575    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5576}
5577
5578impl ForwardSshTunnelConnectivity {
5579    /// Creates a new default instance.
5580    pub fn new() -> Self {
5581        std::default::Default::default()
5582    }
5583
5584    /// Sets the value of [hostname][crate::model::ForwardSshTunnelConnectivity::hostname].
5585    ///
5586    /// # Example
5587    /// ```ignore,no_run
5588    /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5589    /// let x = ForwardSshTunnelConnectivity::new().set_hostname("example");
5590    /// ```
5591    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5592        self.hostname = v.into();
5593        self
5594    }
5595
5596    /// Sets the value of [username][crate::model::ForwardSshTunnelConnectivity::username].
5597    ///
5598    /// # Example
5599    /// ```ignore,no_run
5600    /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5601    /// let x = ForwardSshTunnelConnectivity::new().set_username("example");
5602    /// ```
5603    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5604        self.username = v.into();
5605        self
5606    }
5607
5608    /// Sets the value of [port][crate::model::ForwardSshTunnelConnectivity::port].
5609    ///
5610    /// # Example
5611    /// ```ignore,no_run
5612    /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5613    /// let x = ForwardSshTunnelConnectivity::new().set_port(42);
5614    /// ```
5615    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5616        self.port = v.into();
5617        self
5618    }
5619
5620    /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method].
5621    ///
5622    /// Note that all the setters affecting `authentication_method` are mutually
5623    /// exclusive.
5624    ///
5625    /// # Example
5626    /// ```ignore,no_run
5627    /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5628    /// use google_cloud_datastream_v1::model::forward_ssh_tunnel_connectivity::AuthenticationMethod;
5629    /// let x = ForwardSshTunnelConnectivity::new().set_authentication_method(Some(AuthenticationMethod::Password("example".to_string())));
5630    /// ```
5631    pub fn set_authentication_method<
5632        T: std::convert::Into<
5633                std::option::Option<
5634                    crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod,
5635                >,
5636            >,
5637    >(
5638        mut self,
5639        v: T,
5640    ) -> Self {
5641        self.authentication_method = v.into();
5642        self
5643    }
5644
5645    /// The value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
5646    /// if it holds a `Password`, `None` if the field is not set or
5647    /// holds a different branch.
5648    pub fn password(&self) -> std::option::Option<&std::string::String> {
5649        #[allow(unreachable_patterns)]
5650        self.authentication_method.as_ref().and_then(|v| match v {
5651            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::Password(v) => {
5652                std::option::Option::Some(v)
5653            }
5654            _ => std::option::Option::None,
5655        })
5656    }
5657
5658    /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
5659    /// to hold a `Password`.
5660    ///
5661    /// Note that all the setters affecting `authentication_method` are
5662    /// mutually exclusive.
5663    ///
5664    /// # Example
5665    /// ```ignore,no_run
5666    /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5667    /// let x = ForwardSshTunnelConnectivity::new().set_password("example");
5668    /// assert!(x.password().is_some());
5669    /// assert!(x.private_key().is_none());
5670    /// ```
5671    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5672        self.authentication_method = std::option::Option::Some(
5673            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::Password(v.into()),
5674        );
5675        self
5676    }
5677
5678    /// The value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
5679    /// if it holds a `PrivateKey`, `None` if the field is not set or
5680    /// holds a different branch.
5681    pub fn private_key(&self) -> std::option::Option<&std::string::String> {
5682        #[allow(unreachable_patterns)]
5683        self.authentication_method.as_ref().and_then(|v| match v {
5684            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::PrivateKey(v) => {
5685                std::option::Option::Some(v)
5686            }
5687            _ => std::option::Option::None,
5688        })
5689    }
5690
5691    /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
5692    /// to hold a `PrivateKey`.
5693    ///
5694    /// Note that all the setters affecting `authentication_method` are
5695    /// mutually exclusive.
5696    ///
5697    /// # Example
5698    /// ```ignore,no_run
5699    /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5700    /// let x = ForwardSshTunnelConnectivity::new().set_private_key("example");
5701    /// assert!(x.private_key().is_some());
5702    /// assert!(x.password().is_none());
5703    /// ```
5704    pub fn set_private_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5705        self.authentication_method = std::option::Option::Some(
5706            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::PrivateKey(
5707                v.into(),
5708            ),
5709        );
5710        self
5711    }
5712}
5713
5714impl wkt::message::Message for ForwardSshTunnelConnectivity {
5715    fn typename() -> &'static str {
5716        "type.googleapis.com/google.cloud.datastream.v1.ForwardSshTunnelConnectivity"
5717    }
5718}
5719
5720/// Defines additional types related to [ForwardSshTunnelConnectivity].
5721pub mod forward_ssh_tunnel_connectivity {
5722    #[allow(unused_imports)]
5723    use super::*;
5724
5725    #[allow(missing_docs)]
5726    #[derive(Clone, Debug, PartialEq)]
5727    #[non_exhaustive]
5728    pub enum AuthenticationMethod {
5729        /// Input only. SSH password.
5730        Password(std::string::String),
5731        /// Input only. SSH private key.
5732        PrivateKey(std::string::String),
5733    }
5734}
5735
5736/// The VPC Peering configuration is used to create VPC peering between
5737/// Datastream and the consumer's VPC.
5738#[derive(Clone, Default, PartialEq)]
5739#[non_exhaustive]
5740pub struct VpcPeeringConfig {
5741    /// Required. Fully qualified name of the VPC that Datastream will peer to.
5742    /// Format: `projects/{project}/global/{networks}/{name}`
5743    pub vpc: std::string::String,
5744
5745    /// Required. A free subnet for peering. (CIDR of /29)
5746    pub subnet: std::string::String,
5747
5748    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5749}
5750
5751impl VpcPeeringConfig {
5752    /// Creates a new default instance.
5753    pub fn new() -> Self {
5754        std::default::Default::default()
5755    }
5756
5757    /// Sets the value of [vpc][crate::model::VpcPeeringConfig::vpc].
5758    ///
5759    /// # Example
5760    /// ```ignore,no_run
5761    /// # use google_cloud_datastream_v1::model::VpcPeeringConfig;
5762    /// let x = VpcPeeringConfig::new().set_vpc("example");
5763    /// ```
5764    pub fn set_vpc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5765        self.vpc = v.into();
5766        self
5767    }
5768
5769    /// Sets the value of [subnet][crate::model::VpcPeeringConfig::subnet].
5770    ///
5771    /// # Example
5772    /// ```ignore,no_run
5773    /// # use google_cloud_datastream_v1::model::VpcPeeringConfig;
5774    /// let x = VpcPeeringConfig::new().set_subnet("example");
5775    /// ```
5776    pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5777        self.subnet = v.into();
5778        self
5779    }
5780}
5781
5782impl wkt::message::Message for VpcPeeringConfig {
5783    fn typename() -> &'static str {
5784        "type.googleapis.com/google.cloud.datastream.v1.VpcPeeringConfig"
5785    }
5786}
5787
5788/// The PSC Interface configuration is used to create PSC Interface between
5789/// Datastream and the consumer's PSC.
5790#[derive(Clone, Default, PartialEq)]
5791#[non_exhaustive]
5792pub struct PscInterfaceConfig {
5793    /// Required. Fully qualified name of the Network Attachment that Datastream
5794    /// will connect to. Format:
5795    /// `projects/{project}/regions/{region}/networkAttachments/{name}`
5796    pub network_attachment: std::string::String,
5797
5798    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5799}
5800
5801impl PscInterfaceConfig {
5802    /// Creates a new default instance.
5803    pub fn new() -> Self {
5804        std::default::Default::default()
5805    }
5806
5807    /// Sets the value of [network_attachment][crate::model::PscInterfaceConfig::network_attachment].
5808    ///
5809    /// # Example
5810    /// ```ignore,no_run
5811    /// # use google_cloud_datastream_v1::model::PscInterfaceConfig;
5812    /// let x = PscInterfaceConfig::new().set_network_attachment("example");
5813    /// ```
5814    pub fn set_network_attachment<T: std::convert::Into<std::string::String>>(
5815        mut self,
5816        v: T,
5817    ) -> Self {
5818        self.network_attachment = v.into();
5819        self
5820    }
5821}
5822
5823impl wkt::message::Message for PscInterfaceConfig {
5824    fn typename() -> &'static str {
5825        "type.googleapis.com/google.cloud.datastream.v1.PscInterfaceConfig"
5826    }
5827}
5828
5829/// The PrivateConnection resource is used to establish private connectivity
5830/// between Datastream and a customer's network.
5831#[derive(Clone, Default, PartialEq)]
5832#[non_exhaustive]
5833pub struct PrivateConnection {
5834    /// Output only. Identifier. The resource's name.
5835    pub name: std::string::String,
5836
5837    /// Output only. The create time of the resource.
5838    pub create_time: std::option::Option<wkt::Timestamp>,
5839
5840    /// Output only. The update time of the resource.
5841    pub update_time: std::option::Option<wkt::Timestamp>,
5842
5843    /// Labels.
5844    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5845
5846    /// Required. Display name.
5847    pub display_name: std::string::String,
5848
5849    /// Output only. The state of the Private Connection.
5850    pub state: crate::model::private_connection::State,
5851
5852    /// Output only. In case of error, the details of the error in a user-friendly
5853    /// format.
5854    pub error: std::option::Option<crate::model::Error>,
5855
5856    /// Output only. Reserved for future use.
5857    pub satisfies_pzs: std::option::Option<bool>,
5858
5859    /// Output only. Reserved for future use.
5860    pub satisfies_pzi: std::option::Option<bool>,
5861
5862    /// VPC Peering Config.
5863    pub vpc_peering_config: std::option::Option<crate::model::VpcPeeringConfig>,
5864
5865    /// PSC Interface Config.
5866    pub psc_interface_config: std::option::Option<crate::model::PscInterfaceConfig>,
5867
5868    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5869}
5870
5871impl PrivateConnection {
5872    /// Creates a new default instance.
5873    pub fn new() -> Self {
5874        std::default::Default::default()
5875    }
5876
5877    /// Sets the value of [name][crate::model::PrivateConnection::name].
5878    ///
5879    /// # Example
5880    /// ```ignore,no_run
5881    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5882    /// # let project_id = "project_id";
5883    /// # let location_id = "location_id";
5884    /// # let private_connection_id = "private_connection_id";
5885    /// let x = PrivateConnection::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateConnections/{private_connection_id}"));
5886    /// ```
5887    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5888        self.name = v.into();
5889        self
5890    }
5891
5892    /// Sets the value of [create_time][crate::model::PrivateConnection::create_time].
5893    ///
5894    /// # Example
5895    /// ```ignore,no_run
5896    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5897    /// use wkt::Timestamp;
5898    /// let x = PrivateConnection::new().set_create_time(Timestamp::default()/* use setters */);
5899    /// ```
5900    pub fn set_create_time<T>(mut self, v: T) -> Self
5901    where
5902        T: std::convert::Into<wkt::Timestamp>,
5903    {
5904        self.create_time = std::option::Option::Some(v.into());
5905        self
5906    }
5907
5908    /// Sets or clears the value of [create_time][crate::model::PrivateConnection::create_time].
5909    ///
5910    /// # Example
5911    /// ```ignore,no_run
5912    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5913    /// use wkt::Timestamp;
5914    /// let x = PrivateConnection::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5915    /// let x = PrivateConnection::new().set_or_clear_create_time(None::<Timestamp>);
5916    /// ```
5917    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5918    where
5919        T: std::convert::Into<wkt::Timestamp>,
5920    {
5921        self.create_time = v.map(|x| x.into());
5922        self
5923    }
5924
5925    /// Sets the value of [update_time][crate::model::PrivateConnection::update_time].
5926    ///
5927    /// # Example
5928    /// ```ignore,no_run
5929    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5930    /// use wkt::Timestamp;
5931    /// let x = PrivateConnection::new().set_update_time(Timestamp::default()/* use setters */);
5932    /// ```
5933    pub fn set_update_time<T>(mut self, v: T) -> Self
5934    where
5935        T: std::convert::Into<wkt::Timestamp>,
5936    {
5937        self.update_time = std::option::Option::Some(v.into());
5938        self
5939    }
5940
5941    /// Sets or clears the value of [update_time][crate::model::PrivateConnection::update_time].
5942    ///
5943    /// # Example
5944    /// ```ignore,no_run
5945    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5946    /// use wkt::Timestamp;
5947    /// let x = PrivateConnection::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5948    /// let x = PrivateConnection::new().set_or_clear_update_time(None::<Timestamp>);
5949    /// ```
5950    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5951    where
5952        T: std::convert::Into<wkt::Timestamp>,
5953    {
5954        self.update_time = v.map(|x| x.into());
5955        self
5956    }
5957
5958    /// Sets the value of [labels][crate::model::PrivateConnection::labels].
5959    ///
5960    /// # Example
5961    /// ```ignore,no_run
5962    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5963    /// let x = PrivateConnection::new().set_labels([
5964    ///     ("key0", "abc"),
5965    ///     ("key1", "xyz"),
5966    /// ]);
5967    /// ```
5968    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5969    where
5970        T: std::iter::IntoIterator<Item = (K, V)>,
5971        K: std::convert::Into<std::string::String>,
5972        V: std::convert::Into<std::string::String>,
5973    {
5974        use std::iter::Iterator;
5975        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5976        self
5977    }
5978
5979    /// Sets the value of [display_name][crate::model::PrivateConnection::display_name].
5980    ///
5981    /// # Example
5982    /// ```ignore,no_run
5983    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5984    /// let x = PrivateConnection::new().set_display_name("example");
5985    /// ```
5986    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5987        self.display_name = v.into();
5988        self
5989    }
5990
5991    /// Sets the value of [state][crate::model::PrivateConnection::state].
5992    ///
5993    /// # Example
5994    /// ```ignore,no_run
5995    /// # use google_cloud_datastream_v1::model::PrivateConnection;
5996    /// use google_cloud_datastream_v1::model::private_connection::State;
5997    /// let x0 = PrivateConnection::new().set_state(State::Creating);
5998    /// let x1 = PrivateConnection::new().set_state(State::Created);
5999    /// let x2 = PrivateConnection::new().set_state(State::Failed);
6000    /// ```
6001    pub fn set_state<T: std::convert::Into<crate::model::private_connection::State>>(
6002        mut self,
6003        v: T,
6004    ) -> Self {
6005        self.state = v.into();
6006        self
6007    }
6008
6009    /// Sets the value of [error][crate::model::PrivateConnection::error].
6010    ///
6011    /// # Example
6012    /// ```ignore,no_run
6013    /// # use google_cloud_datastream_v1::model::PrivateConnection;
6014    /// use google_cloud_datastream_v1::model::Error;
6015    /// let x = PrivateConnection::new().set_error(Error::default()/* use setters */);
6016    /// ```
6017    pub fn set_error<T>(mut self, v: T) -> Self
6018    where
6019        T: std::convert::Into<crate::model::Error>,
6020    {
6021        self.error = std::option::Option::Some(v.into());
6022        self
6023    }
6024
6025    /// Sets or clears the value of [error][crate::model::PrivateConnection::error].
6026    ///
6027    /// # Example
6028    /// ```ignore,no_run
6029    /// # use google_cloud_datastream_v1::model::PrivateConnection;
6030    /// use google_cloud_datastream_v1::model::Error;
6031    /// let x = PrivateConnection::new().set_or_clear_error(Some(Error::default()/* use setters */));
6032    /// let x = PrivateConnection::new().set_or_clear_error(None::<Error>);
6033    /// ```
6034    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
6035    where
6036        T: std::convert::Into<crate::model::Error>,
6037    {
6038        self.error = v.map(|x| x.into());
6039        self
6040    }
6041
6042    /// Sets the value of [satisfies_pzs][crate::model::PrivateConnection::satisfies_pzs].
6043    ///
6044    /// # Example
6045    /// ```ignore,no_run
6046    /// # use google_cloud_datastream_v1::model::PrivateConnection;
6047    /// let x = PrivateConnection::new().set_satisfies_pzs(true);
6048    /// ```
6049    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
6050    where
6051        T: std::convert::Into<bool>,
6052    {
6053        self.satisfies_pzs = std::option::Option::Some(v.into());
6054        self
6055    }
6056
6057    /// Sets or clears the value of [satisfies_pzs][crate::model::PrivateConnection::satisfies_pzs].
6058    ///
6059    /// # Example
6060    /// ```ignore,no_run
6061    /// # use google_cloud_datastream_v1::model::PrivateConnection;
6062    /// let x = PrivateConnection::new().set_or_clear_satisfies_pzs(Some(false));
6063    /// let x = PrivateConnection::new().set_or_clear_satisfies_pzs(None::<bool>);
6064    /// ```
6065    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
6066    where
6067        T: std::convert::Into<bool>,
6068    {
6069        self.satisfies_pzs = v.map(|x| x.into());
6070        self
6071    }
6072
6073    /// Sets the value of [satisfies_pzi][crate::model::PrivateConnection::satisfies_pzi].
6074    ///
6075    /// # Example
6076    /// ```ignore,no_run
6077    /// # use google_cloud_datastream_v1::model::PrivateConnection;
6078    /// let x = PrivateConnection::new().set_satisfies_pzi(true);
6079    /// ```
6080    pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
6081    where
6082        T: std::convert::Into<bool>,
6083    {
6084        self.satisfies_pzi = std::option::Option::Some(v.into());
6085        self
6086    }
6087
6088    /// Sets or clears the value of [satisfies_pzi][crate::model::PrivateConnection::satisfies_pzi].
6089    ///
6090    /// # Example
6091    /// ```ignore,no_run
6092    /// # use google_cloud_datastream_v1::model::PrivateConnection;
6093    /// let x = PrivateConnection::new().set_or_clear_satisfies_pzi(Some(false));
6094    /// let x = PrivateConnection::new().set_or_clear_satisfies_pzi(None::<bool>);
6095    /// ```
6096    pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
6097    where
6098        T: std::convert::Into<bool>,
6099    {
6100        self.satisfies_pzi = v.map(|x| x.into());
6101        self
6102    }
6103
6104    /// Sets the value of [vpc_peering_config][crate::model::PrivateConnection::vpc_peering_config].
6105    ///
6106    /// # Example
6107    /// ```ignore,no_run
6108    /// # use google_cloud_datastream_v1::model::PrivateConnection;
6109    /// use google_cloud_datastream_v1::model::VpcPeeringConfig;
6110    /// let x = PrivateConnection::new().set_vpc_peering_config(VpcPeeringConfig::default()/* use setters */);
6111    /// ```
6112    pub fn set_vpc_peering_config<T>(mut self, v: T) -> Self
6113    where
6114        T: std::convert::Into<crate::model::VpcPeeringConfig>,
6115    {
6116        self.vpc_peering_config = std::option::Option::Some(v.into());
6117        self
6118    }
6119
6120    /// Sets or clears the value of [vpc_peering_config][crate::model::PrivateConnection::vpc_peering_config].
6121    ///
6122    /// # Example
6123    /// ```ignore,no_run
6124    /// # use google_cloud_datastream_v1::model::PrivateConnection;
6125    /// use google_cloud_datastream_v1::model::VpcPeeringConfig;
6126    /// let x = PrivateConnection::new().set_or_clear_vpc_peering_config(Some(VpcPeeringConfig::default()/* use setters */));
6127    /// let x = PrivateConnection::new().set_or_clear_vpc_peering_config(None::<VpcPeeringConfig>);
6128    /// ```
6129    pub fn set_or_clear_vpc_peering_config<T>(mut self, v: std::option::Option<T>) -> Self
6130    where
6131        T: std::convert::Into<crate::model::VpcPeeringConfig>,
6132    {
6133        self.vpc_peering_config = v.map(|x| x.into());
6134        self
6135    }
6136
6137    /// Sets the value of [psc_interface_config][crate::model::PrivateConnection::psc_interface_config].
6138    ///
6139    /// # Example
6140    /// ```ignore,no_run
6141    /// # use google_cloud_datastream_v1::model::PrivateConnection;
6142    /// use google_cloud_datastream_v1::model::PscInterfaceConfig;
6143    /// let x = PrivateConnection::new().set_psc_interface_config(PscInterfaceConfig::default()/* use setters */);
6144    /// ```
6145    pub fn set_psc_interface_config<T>(mut self, v: T) -> Self
6146    where
6147        T: std::convert::Into<crate::model::PscInterfaceConfig>,
6148    {
6149        self.psc_interface_config = std::option::Option::Some(v.into());
6150        self
6151    }
6152
6153    /// Sets or clears the value of [psc_interface_config][crate::model::PrivateConnection::psc_interface_config].
6154    ///
6155    /// # Example
6156    /// ```ignore,no_run
6157    /// # use google_cloud_datastream_v1::model::PrivateConnection;
6158    /// use google_cloud_datastream_v1::model::PscInterfaceConfig;
6159    /// let x = PrivateConnection::new().set_or_clear_psc_interface_config(Some(PscInterfaceConfig::default()/* use setters */));
6160    /// let x = PrivateConnection::new().set_or_clear_psc_interface_config(None::<PscInterfaceConfig>);
6161    /// ```
6162    pub fn set_or_clear_psc_interface_config<T>(mut self, v: std::option::Option<T>) -> Self
6163    where
6164        T: std::convert::Into<crate::model::PscInterfaceConfig>,
6165    {
6166        self.psc_interface_config = v.map(|x| x.into());
6167        self
6168    }
6169}
6170
6171impl wkt::message::Message for PrivateConnection {
6172    fn typename() -> &'static str {
6173        "type.googleapis.com/google.cloud.datastream.v1.PrivateConnection"
6174    }
6175}
6176
6177/// Defines additional types related to [PrivateConnection].
6178pub mod private_connection {
6179    #[allow(unused_imports)]
6180    use super::*;
6181
6182    /// Private Connection state.
6183    ///
6184    /// # Working with unknown values
6185    ///
6186    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6187    /// additional enum variants at any time. Adding new variants is not considered
6188    /// a breaking change. Applications should write their code in anticipation of:
6189    ///
6190    /// - New values appearing in future releases of the client library, **and**
6191    /// - New values received dynamically, without application changes.
6192    ///
6193    /// Please consult the [Working with enums] section in the user guide for some
6194    /// guidelines.
6195    ///
6196    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6197    #[derive(Clone, Debug, PartialEq)]
6198    #[non_exhaustive]
6199    pub enum State {
6200        /// Unspecified state.
6201        Unspecified,
6202        /// The private connection is in creation state - creating resources.
6203        Creating,
6204        /// The private connection has been created with all of its resources.
6205        Created,
6206        /// The private connection creation has failed.
6207        Failed,
6208        /// The private connection is being deleted.
6209        Deleting,
6210        /// Delete request has failed, resource is in invalid state.
6211        FailedToDelete,
6212        /// If set, the enum was initialized with an unknown value.
6213        ///
6214        /// Applications can examine the value using [State::value] or
6215        /// [State::name].
6216        UnknownValue(state::UnknownValue),
6217    }
6218
6219    #[doc(hidden)]
6220    pub mod state {
6221        #[allow(unused_imports)]
6222        use super::*;
6223        #[derive(Clone, Debug, PartialEq)]
6224        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6225    }
6226
6227    impl State {
6228        /// Gets the enum value.
6229        ///
6230        /// Returns `None` if the enum contains an unknown value deserialized from
6231        /// the string representation of enums.
6232        pub fn value(&self) -> std::option::Option<i32> {
6233            match self {
6234                Self::Unspecified => std::option::Option::Some(0),
6235                Self::Creating => std::option::Option::Some(1),
6236                Self::Created => std::option::Option::Some(2),
6237                Self::Failed => std::option::Option::Some(3),
6238                Self::Deleting => std::option::Option::Some(4),
6239                Self::FailedToDelete => std::option::Option::Some(5),
6240                Self::UnknownValue(u) => u.0.value(),
6241            }
6242        }
6243
6244        /// Gets the enum value as a string.
6245        ///
6246        /// Returns `None` if the enum contains an unknown value deserialized from
6247        /// the integer representation of enums.
6248        pub fn name(&self) -> std::option::Option<&str> {
6249            match self {
6250                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6251                Self::Creating => std::option::Option::Some("CREATING"),
6252                Self::Created => std::option::Option::Some("CREATED"),
6253                Self::Failed => std::option::Option::Some("FAILED"),
6254                Self::Deleting => std::option::Option::Some("DELETING"),
6255                Self::FailedToDelete => std::option::Option::Some("FAILED_TO_DELETE"),
6256                Self::UnknownValue(u) => u.0.name(),
6257            }
6258        }
6259    }
6260
6261    impl std::default::Default for State {
6262        fn default() -> Self {
6263            use std::convert::From;
6264            Self::from(0)
6265        }
6266    }
6267
6268    impl std::fmt::Display for State {
6269        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6270            wkt::internal::display_enum(f, self.name(), self.value())
6271        }
6272    }
6273
6274    impl std::convert::From<i32> for State {
6275        fn from(value: i32) -> Self {
6276            match value {
6277                0 => Self::Unspecified,
6278                1 => Self::Creating,
6279                2 => Self::Created,
6280                3 => Self::Failed,
6281                4 => Self::Deleting,
6282                5 => Self::FailedToDelete,
6283                _ => Self::UnknownValue(state::UnknownValue(
6284                    wkt::internal::UnknownEnumValue::Integer(value),
6285                )),
6286            }
6287        }
6288    }
6289
6290    impl std::convert::From<&str> for State {
6291        fn from(value: &str) -> Self {
6292            use std::string::ToString;
6293            match value {
6294                "STATE_UNSPECIFIED" => Self::Unspecified,
6295                "CREATING" => Self::Creating,
6296                "CREATED" => Self::Created,
6297                "FAILED" => Self::Failed,
6298                "DELETING" => Self::Deleting,
6299                "FAILED_TO_DELETE" => Self::FailedToDelete,
6300                _ => Self::UnknownValue(state::UnknownValue(
6301                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6302                )),
6303            }
6304        }
6305    }
6306
6307    impl serde::ser::Serialize for State {
6308        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6309        where
6310            S: serde::Serializer,
6311        {
6312            match self {
6313                Self::Unspecified => serializer.serialize_i32(0),
6314                Self::Creating => serializer.serialize_i32(1),
6315                Self::Created => serializer.serialize_i32(2),
6316                Self::Failed => serializer.serialize_i32(3),
6317                Self::Deleting => serializer.serialize_i32(4),
6318                Self::FailedToDelete => serializer.serialize_i32(5),
6319                Self::UnknownValue(u) => u.0.serialize(serializer),
6320            }
6321        }
6322    }
6323
6324    impl<'de> serde::de::Deserialize<'de> for State {
6325        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6326        where
6327            D: serde::Deserializer<'de>,
6328        {
6329            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6330                ".google.cloud.datastream.v1.PrivateConnection.State",
6331            ))
6332        }
6333    }
6334}
6335
6336/// Private Connectivity
6337#[derive(Clone, Default, PartialEq)]
6338#[non_exhaustive]
6339pub struct PrivateConnectivity {
6340    /// Required. A reference to a private connection resource.
6341    /// Format: `projects/{project}/locations/{location}/privateConnections/{name}`
6342    pub private_connection: std::string::String,
6343
6344    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6345}
6346
6347impl PrivateConnectivity {
6348    /// Creates a new default instance.
6349    pub fn new() -> Self {
6350        std::default::Default::default()
6351    }
6352
6353    /// Sets the value of [private_connection][crate::model::PrivateConnectivity::private_connection].
6354    ///
6355    /// # Example
6356    /// ```ignore,no_run
6357    /// # use google_cloud_datastream_v1::model::PrivateConnectivity;
6358    /// # let project_id = "project_id";
6359    /// # let location_id = "location_id";
6360    /// # let private_connection_id = "private_connection_id";
6361    /// let x = PrivateConnectivity::new().set_private_connection(format!("projects/{project_id}/locations/{location_id}/privateConnections/{private_connection_id}"));
6362    /// ```
6363    pub fn set_private_connection<T: std::convert::Into<std::string::String>>(
6364        mut self,
6365        v: T,
6366    ) -> Self {
6367        self.private_connection = v.into();
6368        self
6369    }
6370}
6371
6372impl wkt::message::Message for PrivateConnectivity {
6373    fn typename() -> &'static str {
6374        "type.googleapis.com/google.cloud.datastream.v1.PrivateConnectivity"
6375    }
6376}
6377
6378/// The route resource is the child of the private connection resource,
6379/// used for defining a route for a private connection.
6380#[derive(Clone, Default, PartialEq)]
6381#[non_exhaustive]
6382pub struct Route {
6383    /// Output only. Identifier. The resource's name.
6384    pub name: std::string::String,
6385
6386    /// Output only. The create time of the resource.
6387    pub create_time: std::option::Option<wkt::Timestamp>,
6388
6389    /// Output only. The update time of the resource.
6390    pub update_time: std::option::Option<wkt::Timestamp>,
6391
6392    /// Labels.
6393    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6394
6395    /// Required. Display name.
6396    pub display_name: std::string::String,
6397
6398    /// Required. Destination address for connection
6399    pub destination_address: std::string::String,
6400
6401    /// Destination port for connection
6402    pub destination_port: i32,
6403
6404    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6405}
6406
6407impl Route {
6408    /// Creates a new default instance.
6409    pub fn new() -> Self {
6410        std::default::Default::default()
6411    }
6412
6413    /// Sets the value of [name][crate::model::Route::name].
6414    ///
6415    /// # Example
6416    /// ```ignore,no_run
6417    /// # use google_cloud_datastream_v1::model::Route;
6418    /// # let project_id = "project_id";
6419    /// # let location_id = "location_id";
6420    /// # let private_connection_id = "private_connection_id";
6421    /// # let route_id = "route_id";
6422    /// let x = Route::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateConnections/{private_connection_id}/routes/{route_id}"));
6423    /// ```
6424    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6425        self.name = v.into();
6426        self
6427    }
6428
6429    /// Sets the value of [create_time][crate::model::Route::create_time].
6430    ///
6431    /// # Example
6432    /// ```ignore,no_run
6433    /// # use google_cloud_datastream_v1::model::Route;
6434    /// use wkt::Timestamp;
6435    /// let x = Route::new().set_create_time(Timestamp::default()/* use setters */);
6436    /// ```
6437    pub fn set_create_time<T>(mut self, v: T) -> Self
6438    where
6439        T: std::convert::Into<wkt::Timestamp>,
6440    {
6441        self.create_time = std::option::Option::Some(v.into());
6442        self
6443    }
6444
6445    /// Sets or clears the value of [create_time][crate::model::Route::create_time].
6446    ///
6447    /// # Example
6448    /// ```ignore,no_run
6449    /// # use google_cloud_datastream_v1::model::Route;
6450    /// use wkt::Timestamp;
6451    /// let x = Route::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6452    /// let x = Route::new().set_or_clear_create_time(None::<Timestamp>);
6453    /// ```
6454    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6455    where
6456        T: std::convert::Into<wkt::Timestamp>,
6457    {
6458        self.create_time = v.map(|x| x.into());
6459        self
6460    }
6461
6462    /// Sets the value of [update_time][crate::model::Route::update_time].
6463    ///
6464    /// # Example
6465    /// ```ignore,no_run
6466    /// # use google_cloud_datastream_v1::model::Route;
6467    /// use wkt::Timestamp;
6468    /// let x = Route::new().set_update_time(Timestamp::default()/* use setters */);
6469    /// ```
6470    pub fn set_update_time<T>(mut self, v: T) -> Self
6471    where
6472        T: std::convert::Into<wkt::Timestamp>,
6473    {
6474        self.update_time = std::option::Option::Some(v.into());
6475        self
6476    }
6477
6478    /// Sets or clears the value of [update_time][crate::model::Route::update_time].
6479    ///
6480    /// # Example
6481    /// ```ignore,no_run
6482    /// # use google_cloud_datastream_v1::model::Route;
6483    /// use wkt::Timestamp;
6484    /// let x = Route::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6485    /// let x = Route::new().set_or_clear_update_time(None::<Timestamp>);
6486    /// ```
6487    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6488    where
6489        T: std::convert::Into<wkt::Timestamp>,
6490    {
6491        self.update_time = v.map(|x| x.into());
6492        self
6493    }
6494
6495    /// Sets the value of [labels][crate::model::Route::labels].
6496    ///
6497    /// # Example
6498    /// ```ignore,no_run
6499    /// # use google_cloud_datastream_v1::model::Route;
6500    /// let x = Route::new().set_labels([
6501    ///     ("key0", "abc"),
6502    ///     ("key1", "xyz"),
6503    /// ]);
6504    /// ```
6505    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6506    where
6507        T: std::iter::IntoIterator<Item = (K, V)>,
6508        K: std::convert::Into<std::string::String>,
6509        V: std::convert::Into<std::string::String>,
6510    {
6511        use std::iter::Iterator;
6512        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6513        self
6514    }
6515
6516    /// Sets the value of [display_name][crate::model::Route::display_name].
6517    ///
6518    /// # Example
6519    /// ```ignore,no_run
6520    /// # use google_cloud_datastream_v1::model::Route;
6521    /// let x = Route::new().set_display_name("example");
6522    /// ```
6523    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6524        self.display_name = v.into();
6525        self
6526    }
6527
6528    /// Sets the value of [destination_address][crate::model::Route::destination_address].
6529    ///
6530    /// # Example
6531    /// ```ignore,no_run
6532    /// # use google_cloud_datastream_v1::model::Route;
6533    /// let x = Route::new().set_destination_address("example");
6534    /// ```
6535    pub fn set_destination_address<T: std::convert::Into<std::string::String>>(
6536        mut self,
6537        v: T,
6538    ) -> Self {
6539        self.destination_address = v.into();
6540        self
6541    }
6542
6543    /// Sets the value of [destination_port][crate::model::Route::destination_port].
6544    ///
6545    /// # Example
6546    /// ```ignore,no_run
6547    /// # use google_cloud_datastream_v1::model::Route;
6548    /// let x = Route::new().set_destination_port(42);
6549    /// ```
6550    pub fn set_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6551        self.destination_port = v.into();
6552        self
6553    }
6554}
6555
6556impl wkt::message::Message for Route {
6557    fn typename() -> &'static str {
6558        "type.googleapis.com/google.cloud.datastream.v1.Route"
6559    }
6560}
6561
6562/// MongoDB SSL configuration information.
6563#[derive(Clone, Default, PartialEq)]
6564#[non_exhaustive]
6565pub struct MongodbSslConfig {
6566    /// Optional. Input only. PEM-encoded private key associated with the Client
6567    /// Certificate. If this field is used then the 'client_certificate' and the
6568    /// 'ca_certificate' fields are mandatory.
6569    pub client_key: std::string::String,
6570
6571    /// Output only. Indicates whether the client_key field is set.
6572    pub client_key_set: bool,
6573
6574    /// Optional. Input only. PEM-encoded certificate that will be used by the
6575    /// replica to authenticate against the source database server. If this field
6576    /// is used then the 'client_key' and the 'ca_certificate' fields are
6577    /// mandatory.
6578    pub client_certificate: std::string::String,
6579
6580    /// Output only. Indicates whether the client_certificate field is set.
6581    pub client_certificate_set: bool,
6582
6583    /// Optional. Input only. PEM-encoded certificate of the CA that signed the
6584    /// source database server's certificate.
6585    pub ca_certificate: std::string::String,
6586
6587    /// Output only. Indicates whether the ca_certificate field is set.
6588    pub ca_certificate_set: bool,
6589
6590    /// Optional. Input only. A reference to a Secret Manager resource name storing
6591    /// the PEM-encoded private key associated with the Client Certificate. If this
6592    /// field is used then the 'client_certificate' and the 'ca_certificate' fields
6593    /// are mandatory. Mutually exclusive with the `client_key` field.
6594    pub secret_manager_stored_client_key: std::string::String,
6595
6596    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6597}
6598
6599impl MongodbSslConfig {
6600    /// Creates a new default instance.
6601    pub fn new() -> Self {
6602        std::default::Default::default()
6603    }
6604
6605    /// Sets the value of [client_key][crate::model::MongodbSslConfig::client_key].
6606    ///
6607    /// # Example
6608    /// ```ignore,no_run
6609    /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6610    /// let x = MongodbSslConfig::new().set_client_key("example");
6611    /// ```
6612    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6613        self.client_key = v.into();
6614        self
6615    }
6616
6617    /// Sets the value of [client_key_set][crate::model::MongodbSslConfig::client_key_set].
6618    ///
6619    /// # Example
6620    /// ```ignore,no_run
6621    /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6622    /// let x = MongodbSslConfig::new().set_client_key_set(true);
6623    /// ```
6624    pub fn set_client_key_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6625        self.client_key_set = v.into();
6626        self
6627    }
6628
6629    /// Sets the value of [client_certificate][crate::model::MongodbSslConfig::client_certificate].
6630    ///
6631    /// # Example
6632    /// ```ignore,no_run
6633    /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6634    /// let x = MongodbSslConfig::new().set_client_certificate("example");
6635    /// ```
6636    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
6637        mut self,
6638        v: T,
6639    ) -> Self {
6640        self.client_certificate = v.into();
6641        self
6642    }
6643
6644    /// Sets the value of [client_certificate_set][crate::model::MongodbSslConfig::client_certificate_set].
6645    ///
6646    /// # Example
6647    /// ```ignore,no_run
6648    /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6649    /// let x = MongodbSslConfig::new().set_client_certificate_set(true);
6650    /// ```
6651    pub fn set_client_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6652        self.client_certificate_set = v.into();
6653        self
6654    }
6655
6656    /// Sets the value of [ca_certificate][crate::model::MongodbSslConfig::ca_certificate].
6657    ///
6658    /// # Example
6659    /// ```ignore,no_run
6660    /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6661    /// let x = MongodbSslConfig::new().set_ca_certificate("example");
6662    /// ```
6663    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6664        self.ca_certificate = v.into();
6665        self
6666    }
6667
6668    /// Sets the value of [ca_certificate_set][crate::model::MongodbSslConfig::ca_certificate_set].
6669    ///
6670    /// # Example
6671    /// ```ignore,no_run
6672    /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6673    /// let x = MongodbSslConfig::new().set_ca_certificate_set(true);
6674    /// ```
6675    pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6676        self.ca_certificate_set = v.into();
6677        self
6678    }
6679
6680    /// Sets the value of [secret_manager_stored_client_key][crate::model::MongodbSslConfig::secret_manager_stored_client_key].
6681    ///
6682    /// # Example
6683    /// ```ignore,no_run
6684    /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6685    /// let x = MongodbSslConfig::new().set_secret_manager_stored_client_key("example");
6686    /// ```
6687    pub fn set_secret_manager_stored_client_key<T: std::convert::Into<std::string::String>>(
6688        mut self,
6689        v: T,
6690    ) -> Self {
6691        self.secret_manager_stored_client_key = v.into();
6692        self
6693    }
6694}
6695
6696impl wkt::message::Message for MongodbSslConfig {
6697    fn typename() -> &'static str {
6698        "type.googleapis.com/google.cloud.datastream.v1.MongodbSslConfig"
6699    }
6700}
6701
6702/// MySQL SSL configuration information.
6703#[derive(Clone, Default, PartialEq)]
6704#[non_exhaustive]
6705pub struct MysqlSslConfig {
6706    /// Optional. Input only. PEM-encoded private key associated with the Client
6707    /// Certificate. If this field is used then the 'client_certificate' and the
6708    /// 'ca_certificate' fields are mandatory.
6709    pub client_key: std::string::String,
6710
6711    /// Output only. Indicates whether the client_key field is set.
6712    pub client_key_set: bool,
6713
6714    /// Optional. Input only. PEM-encoded certificate that will be used by the
6715    /// replica to authenticate against the source database server. If this field
6716    /// is used then the 'client_key' and the 'ca_certificate' fields are
6717    /// mandatory.
6718    pub client_certificate: std::string::String,
6719
6720    /// Output only. Indicates whether the client_certificate field is set.
6721    pub client_certificate_set: bool,
6722
6723    /// Input only. PEM-encoded certificate of the CA that signed the source
6724    /// database server's certificate.
6725    pub ca_certificate: std::string::String,
6726
6727    /// Output only. Indicates whether the ca_certificate field is set.
6728    pub ca_certificate_set: bool,
6729
6730    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6731}
6732
6733impl MysqlSslConfig {
6734    /// Creates a new default instance.
6735    pub fn new() -> Self {
6736        std::default::Default::default()
6737    }
6738
6739    /// Sets the value of [client_key][crate::model::MysqlSslConfig::client_key].
6740    ///
6741    /// # Example
6742    /// ```ignore,no_run
6743    /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6744    /// let x = MysqlSslConfig::new().set_client_key("example");
6745    /// ```
6746    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6747        self.client_key = v.into();
6748        self
6749    }
6750
6751    /// Sets the value of [client_key_set][crate::model::MysqlSslConfig::client_key_set].
6752    ///
6753    /// # Example
6754    /// ```ignore,no_run
6755    /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6756    /// let x = MysqlSslConfig::new().set_client_key_set(true);
6757    /// ```
6758    pub fn set_client_key_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6759        self.client_key_set = v.into();
6760        self
6761    }
6762
6763    /// Sets the value of [client_certificate][crate::model::MysqlSslConfig::client_certificate].
6764    ///
6765    /// # Example
6766    /// ```ignore,no_run
6767    /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6768    /// let x = MysqlSslConfig::new().set_client_certificate("example");
6769    /// ```
6770    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
6771        mut self,
6772        v: T,
6773    ) -> Self {
6774        self.client_certificate = v.into();
6775        self
6776    }
6777
6778    /// Sets the value of [client_certificate_set][crate::model::MysqlSslConfig::client_certificate_set].
6779    ///
6780    /// # Example
6781    /// ```ignore,no_run
6782    /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6783    /// let x = MysqlSslConfig::new().set_client_certificate_set(true);
6784    /// ```
6785    pub fn set_client_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6786        self.client_certificate_set = v.into();
6787        self
6788    }
6789
6790    /// Sets the value of [ca_certificate][crate::model::MysqlSslConfig::ca_certificate].
6791    ///
6792    /// # Example
6793    /// ```ignore,no_run
6794    /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6795    /// let x = MysqlSslConfig::new().set_ca_certificate("example");
6796    /// ```
6797    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6798        self.ca_certificate = v.into();
6799        self
6800    }
6801
6802    /// Sets the value of [ca_certificate_set][crate::model::MysqlSslConfig::ca_certificate_set].
6803    ///
6804    /// # Example
6805    /// ```ignore,no_run
6806    /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6807    /// let x = MysqlSslConfig::new().set_ca_certificate_set(true);
6808    /// ```
6809    pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6810        self.ca_certificate_set = v.into();
6811        self
6812    }
6813}
6814
6815impl wkt::message::Message for MysqlSslConfig {
6816    fn typename() -> &'static str {
6817        "type.googleapis.com/google.cloud.datastream.v1.MysqlSslConfig"
6818    }
6819}
6820
6821/// Oracle SSL configuration information.
6822#[derive(Clone, Default, PartialEq)]
6823#[non_exhaustive]
6824pub struct OracleSslConfig {
6825    /// Input only. PEM-encoded certificate of the CA that signed the source
6826    /// database server's certificate.
6827    pub ca_certificate: std::string::String,
6828
6829    /// Output only. Indicates whether the ca_certificate field has been set for
6830    /// this Connection-Profile.
6831    pub ca_certificate_set: bool,
6832
6833    /// Optional. The distinguished name (DN) mentioned in the server
6834    /// certificate. This corresponds to SSL_SERVER_CERT_DN sqlnet parameter.
6835    /// Refer
6836    /// <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>
6837    /// If this field is not provided, the DN matching is not enforced.
6838    pub server_certificate_distinguished_name: std::string::String,
6839
6840    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6841}
6842
6843impl OracleSslConfig {
6844    /// Creates a new default instance.
6845    pub fn new() -> Self {
6846        std::default::Default::default()
6847    }
6848
6849    /// Sets the value of [ca_certificate][crate::model::OracleSslConfig::ca_certificate].
6850    ///
6851    /// # Example
6852    /// ```ignore,no_run
6853    /// # use google_cloud_datastream_v1::model::OracleSslConfig;
6854    /// let x = OracleSslConfig::new().set_ca_certificate("example");
6855    /// ```
6856    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6857        self.ca_certificate = v.into();
6858        self
6859    }
6860
6861    /// Sets the value of [ca_certificate_set][crate::model::OracleSslConfig::ca_certificate_set].
6862    ///
6863    /// # Example
6864    /// ```ignore,no_run
6865    /// # use google_cloud_datastream_v1::model::OracleSslConfig;
6866    /// let x = OracleSslConfig::new().set_ca_certificate_set(true);
6867    /// ```
6868    pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6869        self.ca_certificate_set = v.into();
6870        self
6871    }
6872
6873    /// Sets the value of [server_certificate_distinguished_name][crate::model::OracleSslConfig::server_certificate_distinguished_name].
6874    ///
6875    /// # Example
6876    /// ```ignore,no_run
6877    /// # use google_cloud_datastream_v1::model::OracleSslConfig;
6878    /// let x = OracleSslConfig::new().set_server_certificate_distinguished_name("example");
6879    /// ```
6880    pub fn set_server_certificate_distinguished_name<T: std::convert::Into<std::string::String>>(
6881        mut self,
6882        v: T,
6883    ) -> Self {
6884        self.server_certificate_distinguished_name = v.into();
6885        self
6886    }
6887}
6888
6889impl wkt::message::Message for OracleSslConfig {
6890    fn typename() -> &'static str {
6891        "type.googleapis.com/google.cloud.datastream.v1.OracleSslConfig"
6892    }
6893}
6894
6895/// PostgreSQL SSL configuration information.
6896#[derive(Clone, Default, PartialEq)]
6897#[non_exhaustive]
6898pub struct PostgresqlSslConfig {
6899    /// The encryption settings available for PostgreSQL connection profiles.
6900    /// This captures various SSL mode supported by PostgreSQL, which includes
6901    /// TLS encryption with server verification, TLS encryption with both server
6902    /// and client verification and no TLS encryption.
6903    pub encryption_setting:
6904        std::option::Option<crate::model::postgresql_ssl_config::EncryptionSetting>,
6905
6906    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6907}
6908
6909impl PostgresqlSslConfig {
6910    /// Creates a new default instance.
6911    pub fn new() -> Self {
6912        std::default::Default::default()
6913    }
6914
6915    /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting].
6916    ///
6917    /// Note that all the setters affecting `encryption_setting` are mutually
6918    /// exclusive.
6919    ///
6920    /// # Example
6921    /// ```ignore,no_run
6922    /// # use google_cloud_datastream_v1::model::PostgresqlSslConfig;
6923    /// use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerVerification;
6924    /// let x = PostgresqlSslConfig::new().set_encryption_setting(Some(
6925    ///     google_cloud_datastream_v1::model::postgresql_ssl_config::EncryptionSetting::ServerVerification(ServerVerification::default().into())));
6926    /// ```
6927    pub fn set_encryption_setting<
6928        T: std::convert::Into<
6929                std::option::Option<crate::model::postgresql_ssl_config::EncryptionSetting>,
6930            >,
6931    >(
6932        mut self,
6933        v: T,
6934    ) -> Self {
6935        self.encryption_setting = v.into();
6936        self
6937    }
6938
6939    /// The value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
6940    /// if it holds a `ServerVerification`, `None` if the field is not set or
6941    /// holds a different branch.
6942    pub fn server_verification(
6943        &self,
6944    ) -> std::option::Option<
6945        &std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
6946    > {
6947        #[allow(unreachable_patterns)]
6948        self.encryption_setting.as_ref().and_then(|v| match v {
6949            crate::model::postgresql_ssl_config::EncryptionSetting::ServerVerification(v) => {
6950                std::option::Option::Some(v)
6951            }
6952            _ => std::option::Option::None,
6953        })
6954    }
6955
6956    /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
6957    /// to hold a `ServerVerification`.
6958    ///
6959    /// Note that all the setters affecting `encryption_setting` are
6960    /// mutually exclusive.
6961    ///
6962    /// # Example
6963    /// ```ignore,no_run
6964    /// # use google_cloud_datastream_v1::model::PostgresqlSslConfig;
6965    /// use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerVerification;
6966    /// let x = PostgresqlSslConfig::new().set_server_verification(ServerVerification::default()/* use setters */);
6967    /// assert!(x.server_verification().is_some());
6968    /// assert!(x.server_and_client_verification().is_none());
6969    /// ```
6970    pub fn set_server_verification<
6971        T: std::convert::Into<
6972                std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
6973            >,
6974    >(
6975        mut self,
6976        v: T,
6977    ) -> Self {
6978        self.encryption_setting = std::option::Option::Some(
6979            crate::model::postgresql_ssl_config::EncryptionSetting::ServerVerification(v.into()),
6980        );
6981        self
6982    }
6983
6984    /// The value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
6985    /// if it holds a `ServerAndClientVerification`, `None` if the field is not set or
6986    /// holds a different branch.
6987    pub fn server_and_client_verification(
6988        &self,
6989    ) -> std::option::Option<
6990        &std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
6991    > {
6992        #[allow(unreachable_patterns)]
6993        self.encryption_setting.as_ref().and_then(|v| match v {
6994            crate::model::postgresql_ssl_config::EncryptionSetting::ServerAndClientVerification(
6995                v,
6996            ) => std::option::Option::Some(v),
6997            _ => std::option::Option::None,
6998        })
6999    }
7000
7001    /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
7002    /// to hold a `ServerAndClientVerification`.
7003    ///
7004    /// Note that all the setters affecting `encryption_setting` are
7005    /// mutually exclusive.
7006    ///
7007    /// # Example
7008    /// ```ignore,no_run
7009    /// # use google_cloud_datastream_v1::model::PostgresqlSslConfig;
7010    /// use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
7011    /// let x = PostgresqlSslConfig::new().set_server_and_client_verification(ServerAndClientVerification::default()/* use setters */);
7012    /// assert!(x.server_and_client_verification().is_some());
7013    /// assert!(x.server_verification().is_none());
7014    /// ```
7015    pub fn set_server_and_client_verification<
7016        T: std::convert::Into<
7017                std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
7018            >,
7019    >(
7020        mut self,
7021        v: T,
7022    ) -> Self {
7023        self.encryption_setting = std::option::Option::Some(
7024            crate::model::postgresql_ssl_config::EncryptionSetting::ServerAndClientVerification(
7025                v.into(),
7026            ),
7027        );
7028        self
7029    }
7030}
7031
7032impl wkt::message::Message for PostgresqlSslConfig {
7033    fn typename() -> &'static str {
7034        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig"
7035    }
7036}
7037
7038/// Defines additional types related to [PostgresqlSslConfig].
7039pub mod postgresql_ssl_config {
7040    #[allow(unused_imports)]
7041    use super::*;
7042
7043    /// Message represents the option where Datastream will enforce the encryption
7044    /// and authenticate the server identity. ca_certificate must be set if user
7045    /// selects this option.
7046    #[derive(Clone, Default, PartialEq)]
7047    #[non_exhaustive]
7048    pub struct ServerVerification {
7049        /// Required. Input only. PEM-encoded server root CA certificate.
7050        pub ca_certificate: std::string::String,
7051
7052        /// Optional. The hostname mentioned in the Subject or SAN extension of the
7053        /// server certificate. If this field is not provided, the hostname in the
7054        /// server certificate is not validated.
7055        pub server_certificate_hostname: std::string::String,
7056
7057        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7058    }
7059
7060    impl ServerVerification {
7061        /// Creates a new default instance.
7062        pub fn new() -> Self {
7063            std::default::Default::default()
7064        }
7065
7066        /// Sets the value of [ca_certificate][crate::model::postgresql_ssl_config::ServerVerification::ca_certificate].
7067        ///
7068        /// # Example
7069        /// ```ignore,no_run
7070        /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerVerification;
7071        /// let x = ServerVerification::new().set_ca_certificate("example");
7072        /// ```
7073        pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(
7074            mut self,
7075            v: T,
7076        ) -> Self {
7077            self.ca_certificate = v.into();
7078            self
7079        }
7080
7081        /// Sets the value of [server_certificate_hostname][crate::model::postgresql_ssl_config::ServerVerification::server_certificate_hostname].
7082        ///
7083        /// # Example
7084        /// ```ignore,no_run
7085        /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerVerification;
7086        /// let x = ServerVerification::new().set_server_certificate_hostname("example");
7087        /// ```
7088        pub fn set_server_certificate_hostname<T: std::convert::Into<std::string::String>>(
7089            mut self,
7090            v: T,
7091        ) -> Self {
7092            self.server_certificate_hostname = v.into();
7093            self
7094        }
7095    }
7096
7097    impl wkt::message::Message for ServerVerification {
7098        fn typename() -> &'static str {
7099            "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig.ServerVerification"
7100        }
7101    }
7102
7103    /// Message represents the option where Datastream will enforce the encryption
7104    /// and authenticate the server identity as well as the client identity.
7105    /// ca_certificate, client_certificate and client_key must be set if user
7106    /// selects this option.
7107    #[derive(Clone, Default, PartialEq)]
7108    #[non_exhaustive]
7109    pub struct ServerAndClientVerification {
7110        /// Required. Input only. PEM-encoded certificate used by the source database
7111        /// to authenticate the client identity (i.e., the Datastream's identity).
7112        /// This certificate is signed by either a root certificate trusted by the
7113        /// server or one or more intermediate certificates (which is stored with the
7114        /// leaf certificate) to link the this certificate to the trusted root
7115        /// certificate.
7116        pub client_certificate: std::string::String,
7117
7118        /// Optional. Input only. PEM-encoded private key associated with the client
7119        /// certificate. This value will be used during the SSL/TLS handshake,
7120        /// allowing the PostgreSQL server to authenticate the client's identity,
7121        /// i.e. identity of the Datastream.
7122        pub client_key: std::string::String,
7123
7124        /// Required. Input only. PEM-encoded server root CA certificate.
7125        pub ca_certificate: std::string::String,
7126
7127        /// Optional. The hostname mentioned in the Subject or SAN extension of the
7128        /// server certificate. If this field is not provided, the hostname in the
7129        /// server certificate is not validated.
7130        pub server_certificate_hostname: std::string::String,
7131
7132        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7133    }
7134
7135    impl ServerAndClientVerification {
7136        /// Creates a new default instance.
7137        pub fn new() -> Self {
7138            std::default::Default::default()
7139        }
7140
7141        /// Sets the value of [client_certificate][crate::model::postgresql_ssl_config::ServerAndClientVerification::client_certificate].
7142        ///
7143        /// # Example
7144        /// ```ignore,no_run
7145        /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
7146        /// let x = ServerAndClientVerification::new().set_client_certificate("example");
7147        /// ```
7148        pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
7149            mut self,
7150            v: T,
7151        ) -> Self {
7152            self.client_certificate = v.into();
7153            self
7154        }
7155
7156        /// Sets the value of [client_key][crate::model::postgresql_ssl_config::ServerAndClientVerification::client_key].
7157        ///
7158        /// # Example
7159        /// ```ignore,no_run
7160        /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
7161        /// let x = ServerAndClientVerification::new().set_client_key("example");
7162        /// ```
7163        pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7164            self.client_key = v.into();
7165            self
7166        }
7167
7168        /// Sets the value of [ca_certificate][crate::model::postgresql_ssl_config::ServerAndClientVerification::ca_certificate].
7169        ///
7170        /// # Example
7171        /// ```ignore,no_run
7172        /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
7173        /// let x = ServerAndClientVerification::new().set_ca_certificate("example");
7174        /// ```
7175        pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(
7176            mut self,
7177            v: T,
7178        ) -> Self {
7179            self.ca_certificate = v.into();
7180            self
7181        }
7182
7183        /// Sets the value of [server_certificate_hostname][crate::model::postgresql_ssl_config::ServerAndClientVerification::server_certificate_hostname].
7184        ///
7185        /// # Example
7186        /// ```ignore,no_run
7187        /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
7188        /// let x = ServerAndClientVerification::new().set_server_certificate_hostname("example");
7189        /// ```
7190        pub fn set_server_certificate_hostname<T: std::convert::Into<std::string::String>>(
7191            mut self,
7192            v: T,
7193        ) -> Self {
7194            self.server_certificate_hostname = v.into();
7195            self
7196        }
7197    }
7198
7199    impl wkt::message::Message for ServerAndClientVerification {
7200        fn typename() -> &'static str {
7201            "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig.ServerAndClientVerification"
7202        }
7203    }
7204
7205    /// The encryption settings available for PostgreSQL connection profiles.
7206    /// This captures various SSL mode supported by PostgreSQL, which includes
7207    /// TLS encryption with server verification, TLS encryption with both server
7208    /// and client verification and no TLS encryption.
7209    #[derive(Clone, Debug, PartialEq)]
7210    #[non_exhaustive]
7211    pub enum EncryptionSetting {
7212        ///  If this field is set, the communication will be encrypted with TLS
7213        /// encryption and the server identity will be authenticated.
7214        ServerVerification(
7215            std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
7216        ),
7217        /// If this field is set, the communication will be encrypted with TLS
7218        /// encryption and both the server identity and the client identity will be
7219        /// authenticated.
7220        ServerAndClientVerification(
7221            std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
7222        ),
7223    }
7224}
7225
7226/// A set of reusable connection configurations to be used as a source or
7227/// destination for a stream.
7228#[derive(Clone, Default, PartialEq)]
7229#[non_exhaustive]
7230pub struct ConnectionProfile {
7231    /// Output only. Identifier. The resource's name.
7232    pub name: std::string::String,
7233
7234    /// Output only. The create time of the resource.
7235    pub create_time: std::option::Option<wkt::Timestamp>,
7236
7237    /// Output only. The update time of the resource.
7238    pub update_time: std::option::Option<wkt::Timestamp>,
7239
7240    /// Labels.
7241    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7242
7243    /// Required. Display name.
7244    pub display_name: std::string::String,
7245
7246    /// Output only. Reserved for future use.
7247    pub satisfies_pzs: std::option::Option<bool>,
7248
7249    /// Output only. Reserved for future use.
7250    pub satisfies_pzi: std::option::Option<bool>,
7251
7252    /// Connection configuration for the ConnectionProfile.
7253    pub profile: std::option::Option<crate::model::connection_profile::Profile>,
7254
7255    /// Connectivity options used to establish a connection to the profile.
7256    pub connectivity: std::option::Option<crate::model::connection_profile::Connectivity>,
7257
7258    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7259}
7260
7261impl ConnectionProfile {
7262    /// Creates a new default instance.
7263    pub fn new() -> Self {
7264        std::default::Default::default()
7265    }
7266
7267    /// Sets the value of [name][crate::model::ConnectionProfile::name].
7268    ///
7269    /// # Example
7270    /// ```ignore,no_run
7271    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7272    /// # let project_id = "project_id";
7273    /// # let location_id = "location_id";
7274    /// # let connection_profile_id = "connection_profile_id";
7275    /// let x = ConnectionProfile::new().set_name(format!("projects/{project_id}/locations/{location_id}/connectionProfiles/{connection_profile_id}"));
7276    /// ```
7277    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7278        self.name = v.into();
7279        self
7280    }
7281
7282    /// Sets the value of [create_time][crate::model::ConnectionProfile::create_time].
7283    ///
7284    /// # Example
7285    /// ```ignore,no_run
7286    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7287    /// use wkt::Timestamp;
7288    /// let x = ConnectionProfile::new().set_create_time(Timestamp::default()/* use setters */);
7289    /// ```
7290    pub fn set_create_time<T>(mut self, v: T) -> Self
7291    where
7292        T: std::convert::Into<wkt::Timestamp>,
7293    {
7294        self.create_time = std::option::Option::Some(v.into());
7295        self
7296    }
7297
7298    /// Sets or clears the value of [create_time][crate::model::ConnectionProfile::create_time].
7299    ///
7300    /// # Example
7301    /// ```ignore,no_run
7302    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7303    /// use wkt::Timestamp;
7304    /// let x = ConnectionProfile::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7305    /// let x = ConnectionProfile::new().set_or_clear_create_time(None::<Timestamp>);
7306    /// ```
7307    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7308    where
7309        T: std::convert::Into<wkt::Timestamp>,
7310    {
7311        self.create_time = v.map(|x| x.into());
7312        self
7313    }
7314
7315    /// Sets the value of [update_time][crate::model::ConnectionProfile::update_time].
7316    ///
7317    /// # Example
7318    /// ```ignore,no_run
7319    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7320    /// use wkt::Timestamp;
7321    /// let x = ConnectionProfile::new().set_update_time(Timestamp::default()/* use setters */);
7322    /// ```
7323    pub fn set_update_time<T>(mut self, v: T) -> Self
7324    where
7325        T: std::convert::Into<wkt::Timestamp>,
7326    {
7327        self.update_time = std::option::Option::Some(v.into());
7328        self
7329    }
7330
7331    /// Sets or clears the value of [update_time][crate::model::ConnectionProfile::update_time].
7332    ///
7333    /// # Example
7334    /// ```ignore,no_run
7335    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7336    /// use wkt::Timestamp;
7337    /// let x = ConnectionProfile::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7338    /// let x = ConnectionProfile::new().set_or_clear_update_time(None::<Timestamp>);
7339    /// ```
7340    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7341    where
7342        T: std::convert::Into<wkt::Timestamp>,
7343    {
7344        self.update_time = v.map(|x| x.into());
7345        self
7346    }
7347
7348    /// Sets the value of [labels][crate::model::ConnectionProfile::labels].
7349    ///
7350    /// # Example
7351    /// ```ignore,no_run
7352    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7353    /// let x = ConnectionProfile::new().set_labels([
7354    ///     ("key0", "abc"),
7355    ///     ("key1", "xyz"),
7356    /// ]);
7357    /// ```
7358    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7359    where
7360        T: std::iter::IntoIterator<Item = (K, V)>,
7361        K: std::convert::Into<std::string::String>,
7362        V: std::convert::Into<std::string::String>,
7363    {
7364        use std::iter::Iterator;
7365        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7366        self
7367    }
7368
7369    /// Sets the value of [display_name][crate::model::ConnectionProfile::display_name].
7370    ///
7371    /// # Example
7372    /// ```ignore,no_run
7373    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7374    /// let x = ConnectionProfile::new().set_display_name("example");
7375    /// ```
7376    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7377        self.display_name = v.into();
7378        self
7379    }
7380
7381    /// Sets the value of [satisfies_pzs][crate::model::ConnectionProfile::satisfies_pzs].
7382    ///
7383    /// # Example
7384    /// ```ignore,no_run
7385    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7386    /// let x = ConnectionProfile::new().set_satisfies_pzs(true);
7387    /// ```
7388    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
7389    where
7390        T: std::convert::Into<bool>,
7391    {
7392        self.satisfies_pzs = std::option::Option::Some(v.into());
7393        self
7394    }
7395
7396    /// Sets or clears the value of [satisfies_pzs][crate::model::ConnectionProfile::satisfies_pzs].
7397    ///
7398    /// # Example
7399    /// ```ignore,no_run
7400    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7401    /// let x = ConnectionProfile::new().set_or_clear_satisfies_pzs(Some(false));
7402    /// let x = ConnectionProfile::new().set_or_clear_satisfies_pzs(None::<bool>);
7403    /// ```
7404    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
7405    where
7406        T: std::convert::Into<bool>,
7407    {
7408        self.satisfies_pzs = v.map(|x| x.into());
7409        self
7410    }
7411
7412    /// Sets the value of [satisfies_pzi][crate::model::ConnectionProfile::satisfies_pzi].
7413    ///
7414    /// # Example
7415    /// ```ignore,no_run
7416    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7417    /// let x = ConnectionProfile::new().set_satisfies_pzi(true);
7418    /// ```
7419    pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
7420    where
7421        T: std::convert::Into<bool>,
7422    {
7423        self.satisfies_pzi = std::option::Option::Some(v.into());
7424        self
7425    }
7426
7427    /// Sets or clears the value of [satisfies_pzi][crate::model::ConnectionProfile::satisfies_pzi].
7428    ///
7429    /// # Example
7430    /// ```ignore,no_run
7431    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7432    /// let x = ConnectionProfile::new().set_or_clear_satisfies_pzi(Some(false));
7433    /// let x = ConnectionProfile::new().set_or_clear_satisfies_pzi(None::<bool>);
7434    /// ```
7435    pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
7436    where
7437        T: std::convert::Into<bool>,
7438    {
7439        self.satisfies_pzi = v.map(|x| x.into());
7440        self
7441    }
7442
7443    /// Sets the value of [profile][crate::model::ConnectionProfile::profile].
7444    ///
7445    /// Note that all the setters affecting `profile` are mutually
7446    /// exclusive.
7447    ///
7448    /// # Example
7449    /// ```ignore,no_run
7450    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7451    /// use google_cloud_datastream_v1::model::OracleProfile;
7452    /// let x = ConnectionProfile::new().set_profile(Some(
7453    ///     google_cloud_datastream_v1::model::connection_profile::Profile::OracleProfile(OracleProfile::default().into())));
7454    /// ```
7455    pub fn set_profile<
7456        T: std::convert::Into<std::option::Option<crate::model::connection_profile::Profile>>,
7457    >(
7458        mut self,
7459        v: T,
7460    ) -> Self {
7461        self.profile = v.into();
7462        self
7463    }
7464
7465    /// The value of [profile][crate::model::ConnectionProfile::profile]
7466    /// if it holds a `OracleProfile`, `None` if the field is not set or
7467    /// holds a different branch.
7468    pub fn oracle_profile(
7469        &self,
7470    ) -> std::option::Option<&std::boxed::Box<crate::model::OracleProfile>> {
7471        #[allow(unreachable_patterns)]
7472        self.profile.as_ref().and_then(|v| match v {
7473            crate::model::connection_profile::Profile::OracleProfile(v) => {
7474                std::option::Option::Some(v)
7475            }
7476            _ => std::option::Option::None,
7477        })
7478    }
7479
7480    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7481    /// to hold a `OracleProfile`.
7482    ///
7483    /// Note that all the setters affecting `profile` are
7484    /// mutually exclusive.
7485    ///
7486    /// # Example
7487    /// ```ignore,no_run
7488    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7489    /// use google_cloud_datastream_v1::model::OracleProfile;
7490    /// let x = ConnectionProfile::new().set_oracle_profile(OracleProfile::default()/* use setters */);
7491    /// assert!(x.oracle_profile().is_some());
7492    /// assert!(x.gcs_profile().is_none());
7493    /// assert!(x.mysql_profile().is_none());
7494    /// assert!(x.bigquery_profile().is_none());
7495    /// assert!(x.postgresql_profile().is_none());
7496    /// assert!(x.sql_server_profile().is_none());
7497    /// assert!(x.salesforce_profile().is_none());
7498    /// assert!(x.mongodb_profile().is_none());
7499    /// ```
7500    pub fn set_oracle_profile<
7501        T: std::convert::Into<std::boxed::Box<crate::model::OracleProfile>>,
7502    >(
7503        mut self,
7504        v: T,
7505    ) -> Self {
7506        self.profile = std::option::Option::Some(
7507            crate::model::connection_profile::Profile::OracleProfile(v.into()),
7508        );
7509        self
7510    }
7511
7512    /// The value of [profile][crate::model::ConnectionProfile::profile]
7513    /// if it holds a `GcsProfile`, `None` if the field is not set or
7514    /// holds a different branch.
7515    pub fn gcs_profile(&self) -> std::option::Option<&std::boxed::Box<crate::model::GcsProfile>> {
7516        #[allow(unreachable_patterns)]
7517        self.profile.as_ref().and_then(|v| match v {
7518            crate::model::connection_profile::Profile::GcsProfile(v) => {
7519                std::option::Option::Some(v)
7520            }
7521            _ => std::option::Option::None,
7522        })
7523    }
7524
7525    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7526    /// to hold a `GcsProfile`.
7527    ///
7528    /// Note that all the setters affecting `profile` are
7529    /// mutually exclusive.
7530    ///
7531    /// # Example
7532    /// ```ignore,no_run
7533    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7534    /// use google_cloud_datastream_v1::model::GcsProfile;
7535    /// let x = ConnectionProfile::new().set_gcs_profile(GcsProfile::default()/* use setters */);
7536    /// assert!(x.gcs_profile().is_some());
7537    /// assert!(x.oracle_profile().is_none());
7538    /// assert!(x.mysql_profile().is_none());
7539    /// assert!(x.bigquery_profile().is_none());
7540    /// assert!(x.postgresql_profile().is_none());
7541    /// assert!(x.sql_server_profile().is_none());
7542    /// assert!(x.salesforce_profile().is_none());
7543    /// assert!(x.mongodb_profile().is_none());
7544    /// ```
7545    pub fn set_gcs_profile<T: std::convert::Into<std::boxed::Box<crate::model::GcsProfile>>>(
7546        mut self,
7547        v: T,
7548    ) -> Self {
7549        self.profile = std::option::Option::Some(
7550            crate::model::connection_profile::Profile::GcsProfile(v.into()),
7551        );
7552        self
7553    }
7554
7555    /// The value of [profile][crate::model::ConnectionProfile::profile]
7556    /// if it holds a `MysqlProfile`, `None` if the field is not set or
7557    /// holds a different branch.
7558    pub fn mysql_profile(
7559        &self,
7560    ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlProfile>> {
7561        #[allow(unreachable_patterns)]
7562        self.profile.as_ref().and_then(|v| match v {
7563            crate::model::connection_profile::Profile::MysqlProfile(v) => {
7564                std::option::Option::Some(v)
7565            }
7566            _ => std::option::Option::None,
7567        })
7568    }
7569
7570    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7571    /// to hold a `MysqlProfile`.
7572    ///
7573    /// Note that all the setters affecting `profile` are
7574    /// mutually exclusive.
7575    ///
7576    /// # Example
7577    /// ```ignore,no_run
7578    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7579    /// use google_cloud_datastream_v1::model::MysqlProfile;
7580    /// let x = ConnectionProfile::new().set_mysql_profile(MysqlProfile::default()/* use setters */);
7581    /// assert!(x.mysql_profile().is_some());
7582    /// assert!(x.oracle_profile().is_none());
7583    /// assert!(x.gcs_profile().is_none());
7584    /// assert!(x.bigquery_profile().is_none());
7585    /// assert!(x.postgresql_profile().is_none());
7586    /// assert!(x.sql_server_profile().is_none());
7587    /// assert!(x.salesforce_profile().is_none());
7588    /// assert!(x.mongodb_profile().is_none());
7589    /// ```
7590    pub fn set_mysql_profile<T: std::convert::Into<std::boxed::Box<crate::model::MysqlProfile>>>(
7591        mut self,
7592        v: T,
7593    ) -> Self {
7594        self.profile = std::option::Option::Some(
7595            crate::model::connection_profile::Profile::MysqlProfile(v.into()),
7596        );
7597        self
7598    }
7599
7600    /// The value of [profile][crate::model::ConnectionProfile::profile]
7601    /// if it holds a `BigqueryProfile`, `None` if the field is not set or
7602    /// holds a different branch.
7603    pub fn bigquery_profile(
7604        &self,
7605    ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryProfile>> {
7606        #[allow(unreachable_patterns)]
7607        self.profile.as_ref().and_then(|v| match v {
7608            crate::model::connection_profile::Profile::BigqueryProfile(v) => {
7609                std::option::Option::Some(v)
7610            }
7611            _ => std::option::Option::None,
7612        })
7613    }
7614
7615    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7616    /// to hold a `BigqueryProfile`.
7617    ///
7618    /// Note that all the setters affecting `profile` are
7619    /// mutually exclusive.
7620    ///
7621    /// # Example
7622    /// ```ignore,no_run
7623    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7624    /// use google_cloud_datastream_v1::model::BigQueryProfile;
7625    /// let x = ConnectionProfile::new().set_bigquery_profile(BigQueryProfile::default()/* use setters */);
7626    /// assert!(x.bigquery_profile().is_some());
7627    /// assert!(x.oracle_profile().is_none());
7628    /// assert!(x.gcs_profile().is_none());
7629    /// assert!(x.mysql_profile().is_none());
7630    /// assert!(x.postgresql_profile().is_none());
7631    /// assert!(x.sql_server_profile().is_none());
7632    /// assert!(x.salesforce_profile().is_none());
7633    /// assert!(x.mongodb_profile().is_none());
7634    /// ```
7635    pub fn set_bigquery_profile<
7636        T: std::convert::Into<std::boxed::Box<crate::model::BigQueryProfile>>,
7637    >(
7638        mut self,
7639        v: T,
7640    ) -> Self {
7641        self.profile = std::option::Option::Some(
7642            crate::model::connection_profile::Profile::BigqueryProfile(v.into()),
7643        );
7644        self
7645    }
7646
7647    /// The value of [profile][crate::model::ConnectionProfile::profile]
7648    /// if it holds a `PostgresqlProfile`, `None` if the field is not set or
7649    /// holds a different branch.
7650    pub fn postgresql_profile(
7651        &self,
7652    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlProfile>> {
7653        #[allow(unreachable_patterns)]
7654        self.profile.as_ref().and_then(|v| match v {
7655            crate::model::connection_profile::Profile::PostgresqlProfile(v) => {
7656                std::option::Option::Some(v)
7657            }
7658            _ => std::option::Option::None,
7659        })
7660    }
7661
7662    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7663    /// to hold a `PostgresqlProfile`.
7664    ///
7665    /// Note that all the setters affecting `profile` are
7666    /// mutually exclusive.
7667    ///
7668    /// # Example
7669    /// ```ignore,no_run
7670    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7671    /// use google_cloud_datastream_v1::model::PostgresqlProfile;
7672    /// let x = ConnectionProfile::new().set_postgresql_profile(PostgresqlProfile::default()/* use setters */);
7673    /// assert!(x.postgresql_profile().is_some());
7674    /// assert!(x.oracle_profile().is_none());
7675    /// assert!(x.gcs_profile().is_none());
7676    /// assert!(x.mysql_profile().is_none());
7677    /// assert!(x.bigquery_profile().is_none());
7678    /// assert!(x.sql_server_profile().is_none());
7679    /// assert!(x.salesforce_profile().is_none());
7680    /// assert!(x.mongodb_profile().is_none());
7681    /// ```
7682    pub fn set_postgresql_profile<
7683        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlProfile>>,
7684    >(
7685        mut self,
7686        v: T,
7687    ) -> Self {
7688        self.profile = std::option::Option::Some(
7689            crate::model::connection_profile::Profile::PostgresqlProfile(v.into()),
7690        );
7691        self
7692    }
7693
7694    /// The value of [profile][crate::model::ConnectionProfile::profile]
7695    /// if it holds a `SqlServerProfile`, `None` if the field is not set or
7696    /// holds a different branch.
7697    pub fn sql_server_profile(
7698        &self,
7699    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerProfile>> {
7700        #[allow(unreachable_patterns)]
7701        self.profile.as_ref().and_then(|v| match v {
7702            crate::model::connection_profile::Profile::SqlServerProfile(v) => {
7703                std::option::Option::Some(v)
7704            }
7705            _ => std::option::Option::None,
7706        })
7707    }
7708
7709    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7710    /// to hold a `SqlServerProfile`.
7711    ///
7712    /// Note that all the setters affecting `profile` are
7713    /// mutually exclusive.
7714    ///
7715    /// # Example
7716    /// ```ignore,no_run
7717    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7718    /// use google_cloud_datastream_v1::model::SqlServerProfile;
7719    /// let x = ConnectionProfile::new().set_sql_server_profile(SqlServerProfile::default()/* use setters */);
7720    /// assert!(x.sql_server_profile().is_some());
7721    /// assert!(x.oracle_profile().is_none());
7722    /// assert!(x.gcs_profile().is_none());
7723    /// assert!(x.mysql_profile().is_none());
7724    /// assert!(x.bigquery_profile().is_none());
7725    /// assert!(x.postgresql_profile().is_none());
7726    /// assert!(x.salesforce_profile().is_none());
7727    /// assert!(x.mongodb_profile().is_none());
7728    /// ```
7729    pub fn set_sql_server_profile<
7730        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerProfile>>,
7731    >(
7732        mut self,
7733        v: T,
7734    ) -> Self {
7735        self.profile = std::option::Option::Some(
7736            crate::model::connection_profile::Profile::SqlServerProfile(v.into()),
7737        );
7738        self
7739    }
7740
7741    /// The value of [profile][crate::model::ConnectionProfile::profile]
7742    /// if it holds a `SalesforceProfile`, `None` if the field is not set or
7743    /// holds a different branch.
7744    pub fn salesforce_profile(
7745        &self,
7746    ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceProfile>> {
7747        #[allow(unreachable_patterns)]
7748        self.profile.as_ref().and_then(|v| match v {
7749            crate::model::connection_profile::Profile::SalesforceProfile(v) => {
7750                std::option::Option::Some(v)
7751            }
7752            _ => std::option::Option::None,
7753        })
7754    }
7755
7756    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7757    /// to hold a `SalesforceProfile`.
7758    ///
7759    /// Note that all the setters affecting `profile` are
7760    /// mutually exclusive.
7761    ///
7762    /// # Example
7763    /// ```ignore,no_run
7764    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7765    /// use google_cloud_datastream_v1::model::SalesforceProfile;
7766    /// let x = ConnectionProfile::new().set_salesforce_profile(SalesforceProfile::default()/* use setters */);
7767    /// assert!(x.salesforce_profile().is_some());
7768    /// assert!(x.oracle_profile().is_none());
7769    /// assert!(x.gcs_profile().is_none());
7770    /// assert!(x.mysql_profile().is_none());
7771    /// assert!(x.bigquery_profile().is_none());
7772    /// assert!(x.postgresql_profile().is_none());
7773    /// assert!(x.sql_server_profile().is_none());
7774    /// assert!(x.mongodb_profile().is_none());
7775    /// ```
7776    pub fn set_salesforce_profile<
7777        T: std::convert::Into<std::boxed::Box<crate::model::SalesforceProfile>>,
7778    >(
7779        mut self,
7780        v: T,
7781    ) -> Self {
7782        self.profile = std::option::Option::Some(
7783            crate::model::connection_profile::Profile::SalesforceProfile(v.into()),
7784        );
7785        self
7786    }
7787
7788    /// The value of [profile][crate::model::ConnectionProfile::profile]
7789    /// if it holds a `MongodbProfile`, `None` if the field is not set or
7790    /// holds a different branch.
7791    pub fn mongodb_profile(
7792        &self,
7793    ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbProfile>> {
7794        #[allow(unreachable_patterns)]
7795        self.profile.as_ref().and_then(|v| match v {
7796            crate::model::connection_profile::Profile::MongodbProfile(v) => {
7797                std::option::Option::Some(v)
7798            }
7799            _ => std::option::Option::None,
7800        })
7801    }
7802
7803    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7804    /// to hold a `MongodbProfile`.
7805    ///
7806    /// Note that all the setters affecting `profile` are
7807    /// mutually exclusive.
7808    ///
7809    /// # Example
7810    /// ```ignore,no_run
7811    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7812    /// use google_cloud_datastream_v1::model::MongodbProfile;
7813    /// let x = ConnectionProfile::new().set_mongodb_profile(MongodbProfile::default()/* use setters */);
7814    /// assert!(x.mongodb_profile().is_some());
7815    /// assert!(x.oracle_profile().is_none());
7816    /// assert!(x.gcs_profile().is_none());
7817    /// assert!(x.mysql_profile().is_none());
7818    /// assert!(x.bigquery_profile().is_none());
7819    /// assert!(x.postgresql_profile().is_none());
7820    /// assert!(x.sql_server_profile().is_none());
7821    /// assert!(x.salesforce_profile().is_none());
7822    /// ```
7823    pub fn set_mongodb_profile<
7824        T: std::convert::Into<std::boxed::Box<crate::model::MongodbProfile>>,
7825    >(
7826        mut self,
7827        v: T,
7828    ) -> Self {
7829        self.profile = std::option::Option::Some(
7830            crate::model::connection_profile::Profile::MongodbProfile(v.into()),
7831        );
7832        self
7833    }
7834
7835    /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity].
7836    ///
7837    /// Note that all the setters affecting `connectivity` are mutually
7838    /// exclusive.
7839    ///
7840    /// # Example
7841    /// ```ignore,no_run
7842    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7843    /// use google_cloud_datastream_v1::model::StaticServiceIpConnectivity;
7844    /// let x = ConnectionProfile::new().set_connectivity(Some(
7845    ///     google_cloud_datastream_v1::model::connection_profile::Connectivity::StaticServiceIpConnectivity(StaticServiceIpConnectivity::default().into())));
7846    /// ```
7847    pub fn set_connectivity<
7848        T: std::convert::Into<std::option::Option<crate::model::connection_profile::Connectivity>>,
7849    >(
7850        mut self,
7851        v: T,
7852    ) -> Self {
7853        self.connectivity = v.into();
7854        self
7855    }
7856
7857    /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
7858    /// if it holds a `StaticServiceIpConnectivity`, `None` if the field is not set or
7859    /// holds a different branch.
7860    pub fn static_service_ip_connectivity(
7861        &self,
7862    ) -> std::option::Option<&std::boxed::Box<crate::model::StaticServiceIpConnectivity>> {
7863        #[allow(unreachable_patterns)]
7864        self.connectivity.as_ref().and_then(|v| match v {
7865            crate::model::connection_profile::Connectivity::StaticServiceIpConnectivity(v) => {
7866                std::option::Option::Some(v)
7867            }
7868            _ => std::option::Option::None,
7869        })
7870    }
7871
7872    /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
7873    /// to hold a `StaticServiceIpConnectivity`.
7874    ///
7875    /// Note that all the setters affecting `connectivity` are
7876    /// mutually exclusive.
7877    ///
7878    /// # Example
7879    /// ```ignore,no_run
7880    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7881    /// use google_cloud_datastream_v1::model::StaticServiceIpConnectivity;
7882    /// let x = ConnectionProfile::new().set_static_service_ip_connectivity(StaticServiceIpConnectivity::default()/* use setters */);
7883    /// assert!(x.static_service_ip_connectivity().is_some());
7884    /// assert!(x.forward_ssh_connectivity().is_none());
7885    /// assert!(x.private_connectivity().is_none());
7886    /// ```
7887    pub fn set_static_service_ip_connectivity<
7888        T: std::convert::Into<std::boxed::Box<crate::model::StaticServiceIpConnectivity>>,
7889    >(
7890        mut self,
7891        v: T,
7892    ) -> Self {
7893        self.connectivity = std::option::Option::Some(
7894            crate::model::connection_profile::Connectivity::StaticServiceIpConnectivity(v.into()),
7895        );
7896        self
7897    }
7898
7899    /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
7900    /// if it holds a `ForwardSshConnectivity`, `None` if the field is not set or
7901    /// holds a different branch.
7902    pub fn forward_ssh_connectivity(
7903        &self,
7904    ) -> std::option::Option<&std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>> {
7905        #[allow(unreachable_patterns)]
7906        self.connectivity.as_ref().and_then(|v| match v {
7907            crate::model::connection_profile::Connectivity::ForwardSshConnectivity(v) => {
7908                std::option::Option::Some(v)
7909            }
7910            _ => std::option::Option::None,
7911        })
7912    }
7913
7914    /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
7915    /// to hold a `ForwardSshConnectivity`.
7916    ///
7917    /// Note that all the setters affecting `connectivity` are
7918    /// mutually exclusive.
7919    ///
7920    /// # Example
7921    /// ```ignore,no_run
7922    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7923    /// use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
7924    /// let x = ConnectionProfile::new().set_forward_ssh_connectivity(ForwardSshTunnelConnectivity::default()/* use setters */);
7925    /// assert!(x.forward_ssh_connectivity().is_some());
7926    /// assert!(x.static_service_ip_connectivity().is_none());
7927    /// assert!(x.private_connectivity().is_none());
7928    /// ```
7929    pub fn set_forward_ssh_connectivity<
7930        T: std::convert::Into<std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>>,
7931    >(
7932        mut self,
7933        v: T,
7934    ) -> Self {
7935        self.connectivity = std::option::Option::Some(
7936            crate::model::connection_profile::Connectivity::ForwardSshConnectivity(v.into()),
7937        );
7938        self
7939    }
7940
7941    /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
7942    /// if it holds a `PrivateConnectivity`, `None` if the field is not set or
7943    /// holds a different branch.
7944    pub fn private_connectivity(
7945        &self,
7946    ) -> std::option::Option<&std::boxed::Box<crate::model::PrivateConnectivity>> {
7947        #[allow(unreachable_patterns)]
7948        self.connectivity.as_ref().and_then(|v| match v {
7949            crate::model::connection_profile::Connectivity::PrivateConnectivity(v) => {
7950                std::option::Option::Some(v)
7951            }
7952            _ => std::option::Option::None,
7953        })
7954    }
7955
7956    /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
7957    /// to hold a `PrivateConnectivity`.
7958    ///
7959    /// Note that all the setters affecting `connectivity` are
7960    /// mutually exclusive.
7961    ///
7962    /// # Example
7963    /// ```ignore,no_run
7964    /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7965    /// use google_cloud_datastream_v1::model::PrivateConnectivity;
7966    /// let x = ConnectionProfile::new().set_private_connectivity(PrivateConnectivity::default()/* use setters */);
7967    /// assert!(x.private_connectivity().is_some());
7968    /// assert!(x.static_service_ip_connectivity().is_none());
7969    /// assert!(x.forward_ssh_connectivity().is_none());
7970    /// ```
7971    pub fn set_private_connectivity<
7972        T: std::convert::Into<std::boxed::Box<crate::model::PrivateConnectivity>>,
7973    >(
7974        mut self,
7975        v: T,
7976    ) -> Self {
7977        self.connectivity = std::option::Option::Some(
7978            crate::model::connection_profile::Connectivity::PrivateConnectivity(v.into()),
7979        );
7980        self
7981    }
7982}
7983
7984impl wkt::message::Message for ConnectionProfile {
7985    fn typename() -> &'static str {
7986        "type.googleapis.com/google.cloud.datastream.v1.ConnectionProfile"
7987    }
7988}
7989
7990/// Defines additional types related to [ConnectionProfile].
7991pub mod connection_profile {
7992    #[allow(unused_imports)]
7993    use super::*;
7994
7995    /// Connection configuration for the ConnectionProfile.
7996    #[derive(Clone, Debug, PartialEq)]
7997    #[non_exhaustive]
7998    pub enum Profile {
7999        /// Oracle ConnectionProfile configuration.
8000        OracleProfile(std::boxed::Box<crate::model::OracleProfile>),
8001        /// Cloud Storage ConnectionProfile configuration.
8002        GcsProfile(std::boxed::Box<crate::model::GcsProfile>),
8003        /// MySQL ConnectionProfile configuration.
8004        MysqlProfile(std::boxed::Box<crate::model::MysqlProfile>),
8005        /// BigQuery Connection Profile configuration.
8006        BigqueryProfile(std::boxed::Box<crate::model::BigQueryProfile>),
8007        /// PostgreSQL Connection Profile configuration.
8008        PostgresqlProfile(std::boxed::Box<crate::model::PostgresqlProfile>),
8009        /// SQLServer Connection Profile configuration.
8010        SqlServerProfile(std::boxed::Box<crate::model::SqlServerProfile>),
8011        /// Salesforce Connection Profile configuration.
8012        SalesforceProfile(std::boxed::Box<crate::model::SalesforceProfile>),
8013        /// MongoDB Connection Profile configuration.
8014        MongodbProfile(std::boxed::Box<crate::model::MongodbProfile>),
8015    }
8016
8017    /// Connectivity options used to establish a connection to the profile.
8018    #[derive(Clone, Debug, PartialEq)]
8019    #[non_exhaustive]
8020    pub enum Connectivity {
8021        /// Static Service IP connectivity.
8022        StaticServiceIpConnectivity(std::boxed::Box<crate::model::StaticServiceIpConnectivity>),
8023        /// Forward SSH tunnel connectivity.
8024        ForwardSshConnectivity(std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>),
8025        /// Private connectivity.
8026        PrivateConnectivity(std::boxed::Box<crate::model::PrivateConnectivity>),
8027    }
8028}
8029
8030/// Oracle Column.
8031#[derive(Clone, Default, PartialEq)]
8032#[non_exhaustive]
8033pub struct OracleColumn {
8034    /// Column name.
8035    pub column: std::string::String,
8036
8037    /// The Oracle data type.
8038    pub data_type: std::string::String,
8039
8040    /// Column length.
8041    pub length: i32,
8042
8043    /// Column precision.
8044    pub precision: i32,
8045
8046    /// Column scale.
8047    pub scale: i32,
8048
8049    /// Column encoding.
8050    pub encoding: std::string::String,
8051
8052    /// Whether or not the column represents a primary key.
8053    pub primary_key: bool,
8054
8055    /// Whether or not the column can accept a null value.
8056    pub nullable: bool,
8057
8058    /// The ordinal position of the column in the table.
8059    pub ordinal_position: i32,
8060
8061    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8062}
8063
8064impl OracleColumn {
8065    /// Creates a new default instance.
8066    pub fn new() -> Self {
8067        std::default::Default::default()
8068    }
8069
8070    /// Sets the value of [column][crate::model::OracleColumn::column].
8071    ///
8072    /// # Example
8073    /// ```ignore,no_run
8074    /// # use google_cloud_datastream_v1::model::OracleColumn;
8075    /// let x = OracleColumn::new().set_column("example");
8076    /// ```
8077    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8078        self.column = v.into();
8079        self
8080    }
8081
8082    /// Sets the value of [data_type][crate::model::OracleColumn::data_type].
8083    ///
8084    /// # Example
8085    /// ```ignore,no_run
8086    /// # use google_cloud_datastream_v1::model::OracleColumn;
8087    /// let x = OracleColumn::new().set_data_type("example");
8088    /// ```
8089    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8090        self.data_type = v.into();
8091        self
8092    }
8093
8094    /// Sets the value of [length][crate::model::OracleColumn::length].
8095    ///
8096    /// # Example
8097    /// ```ignore,no_run
8098    /// # use google_cloud_datastream_v1::model::OracleColumn;
8099    /// let x = OracleColumn::new().set_length(42);
8100    /// ```
8101    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8102        self.length = v.into();
8103        self
8104    }
8105
8106    /// Sets the value of [precision][crate::model::OracleColumn::precision].
8107    ///
8108    /// # Example
8109    /// ```ignore,no_run
8110    /// # use google_cloud_datastream_v1::model::OracleColumn;
8111    /// let x = OracleColumn::new().set_precision(42);
8112    /// ```
8113    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8114        self.precision = v.into();
8115        self
8116    }
8117
8118    /// Sets the value of [scale][crate::model::OracleColumn::scale].
8119    ///
8120    /// # Example
8121    /// ```ignore,no_run
8122    /// # use google_cloud_datastream_v1::model::OracleColumn;
8123    /// let x = OracleColumn::new().set_scale(42);
8124    /// ```
8125    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8126        self.scale = v.into();
8127        self
8128    }
8129
8130    /// Sets the value of [encoding][crate::model::OracleColumn::encoding].
8131    ///
8132    /// # Example
8133    /// ```ignore,no_run
8134    /// # use google_cloud_datastream_v1::model::OracleColumn;
8135    /// let x = OracleColumn::new().set_encoding("example");
8136    /// ```
8137    pub fn set_encoding<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8138        self.encoding = v.into();
8139        self
8140    }
8141
8142    /// Sets the value of [primary_key][crate::model::OracleColumn::primary_key].
8143    ///
8144    /// # Example
8145    /// ```ignore,no_run
8146    /// # use google_cloud_datastream_v1::model::OracleColumn;
8147    /// let x = OracleColumn::new().set_primary_key(true);
8148    /// ```
8149    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8150        self.primary_key = v.into();
8151        self
8152    }
8153
8154    /// Sets the value of [nullable][crate::model::OracleColumn::nullable].
8155    ///
8156    /// # Example
8157    /// ```ignore,no_run
8158    /// # use google_cloud_datastream_v1::model::OracleColumn;
8159    /// let x = OracleColumn::new().set_nullable(true);
8160    /// ```
8161    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8162        self.nullable = v.into();
8163        self
8164    }
8165
8166    /// Sets the value of [ordinal_position][crate::model::OracleColumn::ordinal_position].
8167    ///
8168    /// # Example
8169    /// ```ignore,no_run
8170    /// # use google_cloud_datastream_v1::model::OracleColumn;
8171    /// let x = OracleColumn::new().set_ordinal_position(42);
8172    /// ```
8173    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8174        self.ordinal_position = v.into();
8175        self
8176    }
8177}
8178
8179impl wkt::message::Message for OracleColumn {
8180    fn typename() -> &'static str {
8181        "type.googleapis.com/google.cloud.datastream.v1.OracleColumn"
8182    }
8183}
8184
8185/// Oracle table.
8186#[derive(Clone, Default, PartialEq)]
8187#[non_exhaustive]
8188pub struct OracleTable {
8189    /// Table name.
8190    pub table: std::string::String,
8191
8192    /// Oracle columns in the schema.
8193    /// When unspecified as part of include/exclude objects, includes/excludes
8194    /// everything.
8195    pub oracle_columns: std::vec::Vec<crate::model::OracleColumn>,
8196
8197    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8198}
8199
8200impl OracleTable {
8201    /// Creates a new default instance.
8202    pub fn new() -> Self {
8203        std::default::Default::default()
8204    }
8205
8206    /// Sets the value of [table][crate::model::OracleTable::table].
8207    ///
8208    /// # Example
8209    /// ```ignore,no_run
8210    /// # use google_cloud_datastream_v1::model::OracleTable;
8211    /// let x = OracleTable::new().set_table("example");
8212    /// ```
8213    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8214        self.table = v.into();
8215        self
8216    }
8217
8218    /// Sets the value of [oracle_columns][crate::model::OracleTable::oracle_columns].
8219    ///
8220    /// # Example
8221    /// ```ignore,no_run
8222    /// # use google_cloud_datastream_v1::model::OracleTable;
8223    /// use google_cloud_datastream_v1::model::OracleColumn;
8224    /// let x = OracleTable::new()
8225    ///     .set_oracle_columns([
8226    ///         OracleColumn::default()/* use setters */,
8227    ///         OracleColumn::default()/* use (different) setters */,
8228    ///     ]);
8229    /// ```
8230    pub fn set_oracle_columns<T, V>(mut self, v: T) -> Self
8231    where
8232        T: std::iter::IntoIterator<Item = V>,
8233        V: std::convert::Into<crate::model::OracleColumn>,
8234    {
8235        use std::iter::Iterator;
8236        self.oracle_columns = v.into_iter().map(|i| i.into()).collect();
8237        self
8238    }
8239}
8240
8241impl wkt::message::Message for OracleTable {
8242    fn typename() -> &'static str {
8243        "type.googleapis.com/google.cloud.datastream.v1.OracleTable"
8244    }
8245}
8246
8247/// Oracle schema.
8248#[derive(Clone, Default, PartialEq)]
8249#[non_exhaustive]
8250pub struct OracleSchema {
8251    /// Schema name.
8252    pub schema: std::string::String,
8253
8254    /// Tables in the schema.
8255    pub oracle_tables: std::vec::Vec<crate::model::OracleTable>,
8256
8257    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8258}
8259
8260impl OracleSchema {
8261    /// Creates a new default instance.
8262    pub fn new() -> Self {
8263        std::default::Default::default()
8264    }
8265
8266    /// Sets the value of [schema][crate::model::OracleSchema::schema].
8267    ///
8268    /// # Example
8269    /// ```ignore,no_run
8270    /// # use google_cloud_datastream_v1::model::OracleSchema;
8271    /// let x = OracleSchema::new().set_schema("example");
8272    /// ```
8273    pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8274        self.schema = v.into();
8275        self
8276    }
8277
8278    /// Sets the value of [oracle_tables][crate::model::OracleSchema::oracle_tables].
8279    ///
8280    /// # Example
8281    /// ```ignore,no_run
8282    /// # use google_cloud_datastream_v1::model::OracleSchema;
8283    /// use google_cloud_datastream_v1::model::OracleTable;
8284    /// let x = OracleSchema::new()
8285    ///     .set_oracle_tables([
8286    ///         OracleTable::default()/* use setters */,
8287    ///         OracleTable::default()/* use (different) setters */,
8288    ///     ]);
8289    /// ```
8290    pub fn set_oracle_tables<T, V>(mut self, v: T) -> Self
8291    where
8292        T: std::iter::IntoIterator<Item = V>,
8293        V: std::convert::Into<crate::model::OracleTable>,
8294    {
8295        use std::iter::Iterator;
8296        self.oracle_tables = v.into_iter().map(|i| i.into()).collect();
8297        self
8298    }
8299}
8300
8301impl wkt::message::Message for OracleSchema {
8302    fn typename() -> &'static str {
8303        "type.googleapis.com/google.cloud.datastream.v1.OracleSchema"
8304    }
8305}
8306
8307/// Oracle database structure.
8308#[derive(Clone, Default, PartialEq)]
8309#[non_exhaustive]
8310pub struct OracleRdbms {
8311    /// Oracle schemas/databases in the database server.
8312    pub oracle_schemas: std::vec::Vec<crate::model::OracleSchema>,
8313
8314    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8315}
8316
8317impl OracleRdbms {
8318    /// Creates a new default instance.
8319    pub fn new() -> Self {
8320        std::default::Default::default()
8321    }
8322
8323    /// Sets the value of [oracle_schemas][crate::model::OracleRdbms::oracle_schemas].
8324    ///
8325    /// # Example
8326    /// ```ignore,no_run
8327    /// # use google_cloud_datastream_v1::model::OracleRdbms;
8328    /// use google_cloud_datastream_v1::model::OracleSchema;
8329    /// let x = OracleRdbms::new()
8330    ///     .set_oracle_schemas([
8331    ///         OracleSchema::default()/* use setters */,
8332    ///         OracleSchema::default()/* use (different) setters */,
8333    ///     ]);
8334    /// ```
8335    pub fn set_oracle_schemas<T, V>(mut self, v: T) -> Self
8336    where
8337        T: std::iter::IntoIterator<Item = V>,
8338        V: std::convert::Into<crate::model::OracleSchema>,
8339    {
8340        use std::iter::Iterator;
8341        self.oracle_schemas = v.into_iter().map(|i| i.into()).collect();
8342        self
8343    }
8344}
8345
8346impl wkt::message::Message for OracleRdbms {
8347    fn typename() -> &'static str {
8348        "type.googleapis.com/google.cloud.datastream.v1.OracleRdbms"
8349    }
8350}
8351
8352/// Oracle data source configuration
8353#[derive(Clone, Default, PartialEq)]
8354#[non_exhaustive]
8355pub struct OracleSourceConfig {
8356    /// Oracle objects to include in the stream.
8357    pub include_objects: std::option::Option<crate::model::OracleRdbms>,
8358
8359    /// Oracle objects to exclude from the stream.
8360    pub exclude_objects: std::option::Option<crate::model::OracleRdbms>,
8361
8362    /// Maximum number of concurrent CDC tasks. The number should be non-negative.
8363    /// If not set (or set to 0), the system's default value is used.
8364    pub max_concurrent_cdc_tasks: i32,
8365
8366    /// Maximum number of concurrent backfill tasks. The number should be
8367    /// non-negative. If not set (or set to 0), the system's default value is used.
8368    pub max_concurrent_backfill_tasks: i32,
8369
8370    /// The configuration for handle Oracle large objects.
8371    pub large_objects_handling:
8372        std::option::Option<crate::model::oracle_source_config::LargeObjectsHandling>,
8373
8374    /// Configuration to select the CDC method.
8375    pub cdc_method: std::option::Option<crate::model::oracle_source_config::CdcMethod>,
8376
8377    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8378}
8379
8380impl OracleSourceConfig {
8381    /// Creates a new default instance.
8382    pub fn new() -> Self {
8383        std::default::Default::default()
8384    }
8385
8386    /// Sets the value of [include_objects][crate::model::OracleSourceConfig::include_objects].
8387    ///
8388    /// # Example
8389    /// ```ignore,no_run
8390    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8391    /// use google_cloud_datastream_v1::model::OracleRdbms;
8392    /// let x = OracleSourceConfig::new().set_include_objects(OracleRdbms::default()/* use setters */);
8393    /// ```
8394    pub fn set_include_objects<T>(mut self, v: T) -> Self
8395    where
8396        T: std::convert::Into<crate::model::OracleRdbms>,
8397    {
8398        self.include_objects = std::option::Option::Some(v.into());
8399        self
8400    }
8401
8402    /// Sets or clears the value of [include_objects][crate::model::OracleSourceConfig::include_objects].
8403    ///
8404    /// # Example
8405    /// ```ignore,no_run
8406    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8407    /// use google_cloud_datastream_v1::model::OracleRdbms;
8408    /// let x = OracleSourceConfig::new().set_or_clear_include_objects(Some(OracleRdbms::default()/* use setters */));
8409    /// let x = OracleSourceConfig::new().set_or_clear_include_objects(None::<OracleRdbms>);
8410    /// ```
8411    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
8412    where
8413        T: std::convert::Into<crate::model::OracleRdbms>,
8414    {
8415        self.include_objects = v.map(|x| x.into());
8416        self
8417    }
8418
8419    /// Sets the value of [exclude_objects][crate::model::OracleSourceConfig::exclude_objects].
8420    ///
8421    /// # Example
8422    /// ```ignore,no_run
8423    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8424    /// use google_cloud_datastream_v1::model::OracleRdbms;
8425    /// let x = OracleSourceConfig::new().set_exclude_objects(OracleRdbms::default()/* use setters */);
8426    /// ```
8427    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
8428    where
8429        T: std::convert::Into<crate::model::OracleRdbms>,
8430    {
8431        self.exclude_objects = std::option::Option::Some(v.into());
8432        self
8433    }
8434
8435    /// Sets or clears the value of [exclude_objects][crate::model::OracleSourceConfig::exclude_objects].
8436    ///
8437    /// # Example
8438    /// ```ignore,no_run
8439    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8440    /// use google_cloud_datastream_v1::model::OracleRdbms;
8441    /// let x = OracleSourceConfig::new().set_or_clear_exclude_objects(Some(OracleRdbms::default()/* use setters */));
8442    /// let x = OracleSourceConfig::new().set_or_clear_exclude_objects(None::<OracleRdbms>);
8443    /// ```
8444    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
8445    where
8446        T: std::convert::Into<crate::model::OracleRdbms>,
8447    {
8448        self.exclude_objects = v.map(|x| x.into());
8449        self
8450    }
8451
8452    /// Sets the value of [max_concurrent_cdc_tasks][crate::model::OracleSourceConfig::max_concurrent_cdc_tasks].
8453    ///
8454    /// # Example
8455    /// ```ignore,no_run
8456    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8457    /// let x = OracleSourceConfig::new().set_max_concurrent_cdc_tasks(42);
8458    /// ```
8459    pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8460        self.max_concurrent_cdc_tasks = v.into();
8461        self
8462    }
8463
8464    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::OracleSourceConfig::max_concurrent_backfill_tasks].
8465    ///
8466    /// # Example
8467    /// ```ignore,no_run
8468    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8469    /// let x = OracleSourceConfig::new().set_max_concurrent_backfill_tasks(42);
8470    /// ```
8471    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8472        self.max_concurrent_backfill_tasks = v.into();
8473        self
8474    }
8475
8476    /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling].
8477    ///
8478    /// Note that all the setters affecting `large_objects_handling` are mutually
8479    /// exclusive.
8480    ///
8481    /// # Example
8482    /// ```ignore,no_run
8483    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8484    /// use google_cloud_datastream_v1::model::oracle_source_config::DropLargeObjects;
8485    /// let x = OracleSourceConfig::new().set_large_objects_handling(Some(
8486    ///     google_cloud_datastream_v1::model::oracle_source_config::LargeObjectsHandling::DropLargeObjects(DropLargeObjects::default().into())));
8487    /// ```
8488    pub fn set_large_objects_handling<
8489        T: std::convert::Into<
8490                std::option::Option<crate::model::oracle_source_config::LargeObjectsHandling>,
8491            >,
8492    >(
8493        mut self,
8494        v: T,
8495    ) -> Self {
8496        self.large_objects_handling = v.into();
8497        self
8498    }
8499
8500    /// The value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
8501    /// if it holds a `DropLargeObjects`, `None` if the field is not set or
8502    /// holds a different branch.
8503    pub fn drop_large_objects(
8504        &self,
8505    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>>
8506    {
8507        #[allow(unreachable_patterns)]
8508        self.large_objects_handling.as_ref().and_then(|v| match v {
8509            crate::model::oracle_source_config::LargeObjectsHandling::DropLargeObjects(v) => {
8510                std::option::Option::Some(v)
8511            }
8512            _ => std::option::Option::None,
8513        })
8514    }
8515
8516    /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
8517    /// to hold a `DropLargeObjects`.
8518    ///
8519    /// Note that all the setters affecting `large_objects_handling` are
8520    /// mutually exclusive.
8521    ///
8522    /// # Example
8523    /// ```ignore,no_run
8524    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8525    /// use google_cloud_datastream_v1::model::oracle_source_config::DropLargeObjects;
8526    /// let x = OracleSourceConfig::new().set_drop_large_objects(DropLargeObjects::default()/* use setters */);
8527    /// assert!(x.drop_large_objects().is_some());
8528    /// assert!(x.stream_large_objects().is_none());
8529    /// ```
8530    pub fn set_drop_large_objects<
8531        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>>,
8532    >(
8533        mut self,
8534        v: T,
8535    ) -> Self {
8536        self.large_objects_handling = std::option::Option::Some(
8537            crate::model::oracle_source_config::LargeObjectsHandling::DropLargeObjects(v.into()),
8538        );
8539        self
8540    }
8541
8542    /// The value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
8543    /// if it holds a `StreamLargeObjects`, `None` if the field is not set or
8544    /// holds a different branch.
8545    pub fn stream_large_objects(
8546        &self,
8547    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>>
8548    {
8549        #[allow(unreachable_patterns)]
8550        self.large_objects_handling.as_ref().and_then(|v| match v {
8551            crate::model::oracle_source_config::LargeObjectsHandling::StreamLargeObjects(v) => {
8552                std::option::Option::Some(v)
8553            }
8554            _ => std::option::Option::None,
8555        })
8556    }
8557
8558    /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
8559    /// to hold a `StreamLargeObjects`.
8560    ///
8561    /// Note that all the setters affecting `large_objects_handling` are
8562    /// mutually exclusive.
8563    ///
8564    /// # Example
8565    /// ```ignore,no_run
8566    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8567    /// use google_cloud_datastream_v1::model::oracle_source_config::StreamLargeObjects;
8568    /// let x = OracleSourceConfig::new().set_stream_large_objects(StreamLargeObjects::default()/* use setters */);
8569    /// assert!(x.stream_large_objects().is_some());
8570    /// assert!(x.drop_large_objects().is_none());
8571    /// ```
8572    pub fn set_stream_large_objects<
8573        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>>,
8574    >(
8575        mut self,
8576        v: T,
8577    ) -> Self {
8578        self.large_objects_handling = std::option::Option::Some(
8579            crate::model::oracle_source_config::LargeObjectsHandling::StreamLargeObjects(v.into()),
8580        );
8581        self
8582    }
8583
8584    /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method].
8585    ///
8586    /// Note that all the setters affecting `cdc_method` are mutually
8587    /// exclusive.
8588    ///
8589    /// # Example
8590    /// ```ignore,no_run
8591    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8592    /// use google_cloud_datastream_v1::model::oracle_source_config::LogMiner;
8593    /// let x = OracleSourceConfig::new().set_cdc_method(Some(
8594    ///     google_cloud_datastream_v1::model::oracle_source_config::CdcMethod::LogMiner(LogMiner::default().into())));
8595    /// ```
8596    pub fn set_cdc_method<
8597        T: std::convert::Into<std::option::Option<crate::model::oracle_source_config::CdcMethod>>,
8598    >(
8599        mut self,
8600        v: T,
8601    ) -> Self {
8602        self.cdc_method = v.into();
8603        self
8604    }
8605
8606    /// The value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
8607    /// if it holds a `LogMiner`, `None` if the field is not set or
8608    /// holds a different branch.
8609    pub fn log_miner(
8610        &self,
8611    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::LogMiner>> {
8612        #[allow(unreachable_patterns)]
8613        self.cdc_method.as_ref().and_then(|v| match v {
8614            crate::model::oracle_source_config::CdcMethod::LogMiner(v) => {
8615                std::option::Option::Some(v)
8616            }
8617            _ => std::option::Option::None,
8618        })
8619    }
8620
8621    /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
8622    /// to hold a `LogMiner`.
8623    ///
8624    /// Note that all the setters affecting `cdc_method` are
8625    /// mutually exclusive.
8626    ///
8627    /// # Example
8628    /// ```ignore,no_run
8629    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8630    /// use google_cloud_datastream_v1::model::oracle_source_config::LogMiner;
8631    /// let x = OracleSourceConfig::new().set_log_miner(LogMiner::default()/* use setters */);
8632    /// assert!(x.log_miner().is_some());
8633    /// assert!(x.binary_log_parser().is_none());
8634    /// ```
8635    pub fn set_log_miner<
8636        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::LogMiner>>,
8637    >(
8638        mut self,
8639        v: T,
8640    ) -> Self {
8641        self.cdc_method = std::option::Option::Some(
8642            crate::model::oracle_source_config::CdcMethod::LogMiner(v.into()),
8643        );
8644        self
8645    }
8646
8647    /// The value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
8648    /// if it holds a `BinaryLogParser`, `None` if the field is not set or
8649    /// holds a different branch.
8650    pub fn binary_log_parser(
8651        &self,
8652    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>>
8653    {
8654        #[allow(unreachable_patterns)]
8655        self.cdc_method.as_ref().and_then(|v| match v {
8656            crate::model::oracle_source_config::CdcMethod::BinaryLogParser(v) => {
8657                std::option::Option::Some(v)
8658            }
8659            _ => std::option::Option::None,
8660        })
8661    }
8662
8663    /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
8664    /// to hold a `BinaryLogParser`.
8665    ///
8666    /// Note that all the setters affecting `cdc_method` are
8667    /// mutually exclusive.
8668    ///
8669    /// # Example
8670    /// ```ignore,no_run
8671    /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8672    /// use google_cloud_datastream_v1::model::oracle_source_config::BinaryLogParser;
8673    /// let x = OracleSourceConfig::new().set_binary_log_parser(BinaryLogParser::default()/* use setters */);
8674    /// assert!(x.binary_log_parser().is_some());
8675    /// assert!(x.log_miner().is_none());
8676    /// ```
8677    pub fn set_binary_log_parser<
8678        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>>,
8679    >(
8680        mut self,
8681        v: T,
8682    ) -> Self {
8683        self.cdc_method = std::option::Option::Some(
8684            crate::model::oracle_source_config::CdcMethod::BinaryLogParser(v.into()),
8685        );
8686        self
8687    }
8688}
8689
8690impl wkt::message::Message for OracleSourceConfig {
8691    fn typename() -> &'static str {
8692        "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig"
8693    }
8694}
8695
8696/// Defines additional types related to [OracleSourceConfig].
8697pub mod oracle_source_config {
8698    #[allow(unused_imports)]
8699    use super::*;
8700
8701    /// Configuration to drop large object values.
8702    #[derive(Clone, Default, PartialEq)]
8703    #[non_exhaustive]
8704    pub struct DropLargeObjects {
8705        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8706    }
8707
8708    impl DropLargeObjects {
8709        /// Creates a new default instance.
8710        pub fn new() -> Self {
8711            std::default::Default::default()
8712        }
8713    }
8714
8715    impl wkt::message::Message for DropLargeObjects {
8716        fn typename() -> &'static str {
8717            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.DropLargeObjects"
8718        }
8719    }
8720
8721    /// Configuration to stream large object values.
8722    #[derive(Clone, Default, PartialEq)]
8723    #[non_exhaustive]
8724    pub struct StreamLargeObjects {
8725        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8726    }
8727
8728    impl StreamLargeObjects {
8729        /// Creates a new default instance.
8730        pub fn new() -> Self {
8731            std::default::Default::default()
8732        }
8733    }
8734
8735    impl wkt::message::Message for StreamLargeObjects {
8736        fn typename() -> &'static str {
8737            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.StreamLargeObjects"
8738        }
8739    }
8740
8741    /// Configuration to use LogMiner CDC method.
8742    #[derive(Clone, Default, PartialEq)]
8743    #[non_exhaustive]
8744    pub struct LogMiner {
8745        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8746    }
8747
8748    impl LogMiner {
8749        /// Creates a new default instance.
8750        pub fn new() -> Self {
8751            std::default::Default::default()
8752        }
8753    }
8754
8755    impl wkt::message::Message for LogMiner {
8756        fn typename() -> &'static str {
8757            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.LogMiner"
8758        }
8759    }
8760
8761    /// Configuration to use Binary Log Parser CDC technique.
8762    #[derive(Clone, Default, PartialEq)]
8763    #[non_exhaustive]
8764    pub struct BinaryLogParser {
8765        /// Configuration to specify how the log file should be accessed.
8766        pub log_file_access: std::option::Option<
8767            crate::model::oracle_source_config::binary_log_parser::LogFileAccess,
8768        >,
8769
8770        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8771    }
8772
8773    impl BinaryLogParser {
8774        /// Creates a new default instance.
8775        pub fn new() -> Self {
8776            std::default::Default::default()
8777        }
8778
8779        /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access].
8780        ///
8781        /// Note that all the setters affecting `log_file_access` are mutually
8782        /// exclusive.
8783        ///
8784        /// # Example
8785        /// ```ignore,no_run
8786        /// # use google_cloud_datastream_v1::model::oracle_source_config::BinaryLogParser;
8787        /// use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess;
8788        /// let x = BinaryLogParser::new().set_log_file_access(Some(
8789        ///     google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::LogFileAccess::OracleAsmLogFileAccess(OracleAsmLogFileAccess::default().into())));
8790        /// ```
8791        pub fn set_log_file_access<
8792            T: std::convert::Into<
8793                    std::option::Option<
8794                        crate::model::oracle_source_config::binary_log_parser::LogFileAccess,
8795                    >,
8796                >,
8797        >(
8798            mut self,
8799            v: T,
8800        ) -> Self {
8801            self.log_file_access = v.into();
8802            self
8803        }
8804
8805        /// The value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
8806        /// if it holds a `OracleAsmLogFileAccess`, `None` if the field is not set or
8807        /// holds a different branch.
8808        pub fn oracle_asm_log_file_access(
8809            &self,
8810        ) -> std::option::Option<
8811            &std::boxed::Box<
8812                crate::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess,
8813            >,
8814        > {
8815            #[allow(unreachable_patterns)]
8816            self.log_file_access.as_ref().and_then(|v| match v {
8817                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::OracleAsmLogFileAccess(v) => std::option::Option::Some(v),
8818                _ => std::option::Option::None,
8819            })
8820        }
8821
8822        /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
8823        /// to hold a `OracleAsmLogFileAccess`.
8824        ///
8825        /// Note that all the setters affecting `log_file_access` are
8826        /// mutually exclusive.
8827        ///
8828        /// # Example
8829        /// ```ignore,no_run
8830        /// # use google_cloud_datastream_v1::model::oracle_source_config::BinaryLogParser;
8831        /// use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess;
8832        /// let x = BinaryLogParser::new().set_oracle_asm_log_file_access(OracleAsmLogFileAccess::default()/* use setters */);
8833        /// assert!(x.oracle_asm_log_file_access().is_some());
8834        /// assert!(x.log_file_directories().is_none());
8835        /// ```
8836        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{
8837            self.log_file_access = std::option::Option::Some(
8838                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::OracleAsmLogFileAccess(
8839                    v.into()
8840                )
8841            );
8842            self
8843        }
8844
8845        /// The value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
8846        /// if it holds a `LogFileDirectories`, `None` if the field is not set or
8847        /// holds a different branch.
8848        pub fn log_file_directories(
8849            &self,
8850        ) -> std::option::Option<
8851            &std::boxed::Box<
8852                crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
8853            >,
8854        > {
8855            #[allow(unreachable_patterns)]
8856            self.log_file_access.as_ref().and_then(|v| match v {
8857                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::LogFileDirectories(v) => std::option::Option::Some(v),
8858                _ => std::option::Option::None,
8859            })
8860        }
8861
8862        /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
8863        /// to hold a `LogFileDirectories`.
8864        ///
8865        /// Note that all the setters affecting `log_file_access` are
8866        /// mutually exclusive.
8867        ///
8868        /// # Example
8869        /// ```ignore,no_run
8870        /// # use google_cloud_datastream_v1::model::oracle_source_config::BinaryLogParser;
8871        /// use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::LogFileDirectories;
8872        /// let x = BinaryLogParser::new().set_log_file_directories(LogFileDirectories::default()/* use setters */);
8873        /// assert!(x.log_file_directories().is_some());
8874        /// assert!(x.oracle_asm_log_file_access().is_none());
8875        /// ```
8876        pub fn set_log_file_directories<
8877            T: std::convert::Into<
8878                    std::boxed::Box<
8879                        crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
8880                    >,
8881                >,
8882        >(
8883            mut self,
8884            v: T,
8885        ) -> Self {
8886            self.log_file_access = std::option::Option::Some(
8887                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::LogFileDirectories(
8888                    v.into()
8889                )
8890            );
8891            self
8892        }
8893    }
8894
8895    impl wkt::message::Message for BinaryLogParser {
8896        fn typename() -> &'static str {
8897            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser"
8898        }
8899    }
8900
8901    /// Defines additional types related to [BinaryLogParser].
8902    pub mod binary_log_parser {
8903        #[allow(unused_imports)]
8904        use super::*;
8905
8906        /// Configuration to use Oracle ASM to access the log files.
8907        #[derive(Clone, Default, PartialEq)]
8908        #[non_exhaustive]
8909        pub struct OracleAsmLogFileAccess {
8910            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8911        }
8912
8913        impl OracleAsmLogFileAccess {
8914            /// Creates a new default instance.
8915            pub fn new() -> Self {
8916                std::default::Default::default()
8917            }
8918        }
8919
8920        impl wkt::message::Message for OracleAsmLogFileAccess {
8921            fn typename() -> &'static str {
8922                "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser.OracleAsmLogFileAccess"
8923            }
8924        }
8925
8926        /// Configuration to specify the Oracle directories to access the log files.
8927        #[derive(Clone, Default, PartialEq)]
8928        #[non_exhaustive]
8929        pub struct LogFileDirectories {
8930            /// Required. Oracle directory for online logs.
8931            pub online_log_directory: std::string::String,
8932
8933            /// Required. Oracle directory for archived logs.
8934            pub archived_log_directory: std::string::String,
8935
8936            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8937        }
8938
8939        impl LogFileDirectories {
8940            /// Creates a new default instance.
8941            pub fn new() -> Self {
8942                std::default::Default::default()
8943            }
8944
8945            /// Sets the value of [online_log_directory][crate::model::oracle_source_config::binary_log_parser::LogFileDirectories::online_log_directory].
8946            ///
8947            /// # Example
8948            /// ```ignore,no_run
8949            /// # use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::LogFileDirectories;
8950            /// let x = LogFileDirectories::new().set_online_log_directory("example");
8951            /// ```
8952            pub fn set_online_log_directory<T: std::convert::Into<std::string::String>>(
8953                mut self,
8954                v: T,
8955            ) -> Self {
8956                self.online_log_directory = v.into();
8957                self
8958            }
8959
8960            /// Sets the value of [archived_log_directory][crate::model::oracle_source_config::binary_log_parser::LogFileDirectories::archived_log_directory].
8961            ///
8962            /// # Example
8963            /// ```ignore,no_run
8964            /// # use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::LogFileDirectories;
8965            /// let x = LogFileDirectories::new().set_archived_log_directory("example");
8966            /// ```
8967            pub fn set_archived_log_directory<T: std::convert::Into<std::string::String>>(
8968                mut self,
8969                v: T,
8970            ) -> Self {
8971                self.archived_log_directory = v.into();
8972                self
8973            }
8974        }
8975
8976        impl wkt::message::Message for LogFileDirectories {
8977            fn typename() -> &'static str {
8978                "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser.LogFileDirectories"
8979            }
8980        }
8981
8982        /// Configuration to specify how the log file should be accessed.
8983        #[derive(Clone, Debug, PartialEq)]
8984        #[non_exhaustive]
8985        pub enum LogFileAccess {
8986            /// Use Oracle ASM.
8987            OracleAsmLogFileAccess(
8988                std::boxed::Box<
8989                    crate::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess,
8990                >,
8991            ),
8992            /// Use Oracle directories.
8993            LogFileDirectories(
8994                std::boxed::Box<
8995                    crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
8996                >,
8997            ),
8998        }
8999    }
9000
9001    /// The configuration for handle Oracle large objects.
9002    #[derive(Clone, Debug, PartialEq)]
9003    #[non_exhaustive]
9004    pub enum LargeObjectsHandling {
9005        /// Drop large object values.
9006        DropLargeObjects(std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>),
9007        /// Stream large object values.
9008        StreamLargeObjects(std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>),
9009    }
9010
9011    /// Configuration to select the CDC method.
9012    #[derive(Clone, Debug, PartialEq)]
9013    #[non_exhaustive]
9014    pub enum CdcMethod {
9015        /// Use LogMiner.
9016        LogMiner(std::boxed::Box<crate::model::oracle_source_config::LogMiner>),
9017        /// Use Binary Log Parser.
9018        BinaryLogParser(std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>),
9019    }
9020}
9021
9022/// PostgreSQL Column.
9023#[derive(Clone, Default, PartialEq)]
9024#[non_exhaustive]
9025pub struct PostgresqlColumn {
9026    /// Column name.
9027    pub column: std::string::String,
9028
9029    /// The PostgreSQL data type.
9030    pub data_type: std::string::String,
9031
9032    /// Column length.
9033    pub length: i32,
9034
9035    /// Column precision.
9036    pub precision: i32,
9037
9038    /// Column scale.
9039    pub scale: i32,
9040
9041    /// Whether or not the column represents a primary key.
9042    pub primary_key: bool,
9043
9044    /// Whether or not the column can accept a null value.
9045    pub nullable: bool,
9046
9047    /// The ordinal position of the column in the table.
9048    pub ordinal_position: i32,
9049
9050    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9051}
9052
9053impl PostgresqlColumn {
9054    /// Creates a new default instance.
9055    pub fn new() -> Self {
9056        std::default::Default::default()
9057    }
9058
9059    /// Sets the value of [column][crate::model::PostgresqlColumn::column].
9060    ///
9061    /// # Example
9062    /// ```ignore,no_run
9063    /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
9064    /// let x = PostgresqlColumn::new().set_column("example");
9065    /// ```
9066    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9067        self.column = v.into();
9068        self
9069    }
9070
9071    /// Sets the value of [data_type][crate::model::PostgresqlColumn::data_type].
9072    ///
9073    /// # Example
9074    /// ```ignore,no_run
9075    /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
9076    /// let x = PostgresqlColumn::new().set_data_type("example");
9077    /// ```
9078    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9079        self.data_type = v.into();
9080        self
9081    }
9082
9083    /// Sets the value of [length][crate::model::PostgresqlColumn::length].
9084    ///
9085    /// # Example
9086    /// ```ignore,no_run
9087    /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
9088    /// let x = PostgresqlColumn::new().set_length(42);
9089    /// ```
9090    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9091        self.length = v.into();
9092        self
9093    }
9094
9095    /// Sets the value of [precision][crate::model::PostgresqlColumn::precision].
9096    ///
9097    /// # Example
9098    /// ```ignore,no_run
9099    /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
9100    /// let x = PostgresqlColumn::new().set_precision(42);
9101    /// ```
9102    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9103        self.precision = v.into();
9104        self
9105    }
9106
9107    /// Sets the value of [scale][crate::model::PostgresqlColumn::scale].
9108    ///
9109    /// # Example
9110    /// ```ignore,no_run
9111    /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
9112    /// let x = PostgresqlColumn::new().set_scale(42);
9113    /// ```
9114    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9115        self.scale = v.into();
9116        self
9117    }
9118
9119    /// Sets the value of [primary_key][crate::model::PostgresqlColumn::primary_key].
9120    ///
9121    /// # Example
9122    /// ```ignore,no_run
9123    /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
9124    /// let x = PostgresqlColumn::new().set_primary_key(true);
9125    /// ```
9126    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9127        self.primary_key = v.into();
9128        self
9129    }
9130
9131    /// Sets the value of [nullable][crate::model::PostgresqlColumn::nullable].
9132    ///
9133    /// # Example
9134    /// ```ignore,no_run
9135    /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
9136    /// let x = PostgresqlColumn::new().set_nullable(true);
9137    /// ```
9138    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9139        self.nullable = v.into();
9140        self
9141    }
9142
9143    /// Sets the value of [ordinal_position][crate::model::PostgresqlColumn::ordinal_position].
9144    ///
9145    /// # Example
9146    /// ```ignore,no_run
9147    /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
9148    /// let x = PostgresqlColumn::new().set_ordinal_position(42);
9149    /// ```
9150    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9151        self.ordinal_position = v.into();
9152        self
9153    }
9154}
9155
9156impl wkt::message::Message for PostgresqlColumn {
9157    fn typename() -> &'static str {
9158        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlColumn"
9159    }
9160}
9161
9162/// PostgreSQL table.
9163#[derive(Clone, Default, PartialEq)]
9164#[non_exhaustive]
9165pub struct PostgresqlTable {
9166    /// Table name.
9167    pub table: std::string::String,
9168
9169    /// PostgreSQL columns in the schema.
9170    /// When unspecified as part of include/exclude objects,
9171    /// includes/excludes everything.
9172    pub postgresql_columns: std::vec::Vec<crate::model::PostgresqlColumn>,
9173
9174    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9175}
9176
9177impl PostgresqlTable {
9178    /// Creates a new default instance.
9179    pub fn new() -> Self {
9180        std::default::Default::default()
9181    }
9182
9183    /// Sets the value of [table][crate::model::PostgresqlTable::table].
9184    ///
9185    /// # Example
9186    /// ```ignore,no_run
9187    /// # use google_cloud_datastream_v1::model::PostgresqlTable;
9188    /// let x = PostgresqlTable::new().set_table("example");
9189    /// ```
9190    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9191        self.table = v.into();
9192        self
9193    }
9194
9195    /// Sets the value of [postgresql_columns][crate::model::PostgresqlTable::postgresql_columns].
9196    ///
9197    /// # Example
9198    /// ```ignore,no_run
9199    /// # use google_cloud_datastream_v1::model::PostgresqlTable;
9200    /// use google_cloud_datastream_v1::model::PostgresqlColumn;
9201    /// let x = PostgresqlTable::new()
9202    ///     .set_postgresql_columns([
9203    ///         PostgresqlColumn::default()/* use setters */,
9204    ///         PostgresqlColumn::default()/* use (different) setters */,
9205    ///     ]);
9206    /// ```
9207    pub fn set_postgresql_columns<T, V>(mut self, v: T) -> Self
9208    where
9209        T: std::iter::IntoIterator<Item = V>,
9210        V: std::convert::Into<crate::model::PostgresqlColumn>,
9211    {
9212        use std::iter::Iterator;
9213        self.postgresql_columns = v.into_iter().map(|i| i.into()).collect();
9214        self
9215    }
9216}
9217
9218impl wkt::message::Message for PostgresqlTable {
9219    fn typename() -> &'static str {
9220        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlTable"
9221    }
9222}
9223
9224/// PostgreSQL schema.
9225#[derive(Clone, Default, PartialEq)]
9226#[non_exhaustive]
9227pub struct PostgresqlSchema {
9228    /// Schema name.
9229    pub schema: std::string::String,
9230
9231    /// Tables in the schema.
9232    pub postgresql_tables: std::vec::Vec<crate::model::PostgresqlTable>,
9233
9234    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9235}
9236
9237impl PostgresqlSchema {
9238    /// Creates a new default instance.
9239    pub fn new() -> Self {
9240        std::default::Default::default()
9241    }
9242
9243    /// Sets the value of [schema][crate::model::PostgresqlSchema::schema].
9244    ///
9245    /// # Example
9246    /// ```ignore,no_run
9247    /// # use google_cloud_datastream_v1::model::PostgresqlSchema;
9248    /// let x = PostgresqlSchema::new().set_schema("example");
9249    /// ```
9250    pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9251        self.schema = v.into();
9252        self
9253    }
9254
9255    /// Sets the value of [postgresql_tables][crate::model::PostgresqlSchema::postgresql_tables].
9256    ///
9257    /// # Example
9258    /// ```ignore,no_run
9259    /// # use google_cloud_datastream_v1::model::PostgresqlSchema;
9260    /// use google_cloud_datastream_v1::model::PostgresqlTable;
9261    /// let x = PostgresqlSchema::new()
9262    ///     .set_postgresql_tables([
9263    ///         PostgresqlTable::default()/* use setters */,
9264    ///         PostgresqlTable::default()/* use (different) setters */,
9265    ///     ]);
9266    /// ```
9267    pub fn set_postgresql_tables<T, V>(mut self, v: T) -> Self
9268    where
9269        T: std::iter::IntoIterator<Item = V>,
9270        V: std::convert::Into<crate::model::PostgresqlTable>,
9271    {
9272        use std::iter::Iterator;
9273        self.postgresql_tables = v.into_iter().map(|i| i.into()).collect();
9274        self
9275    }
9276}
9277
9278impl wkt::message::Message for PostgresqlSchema {
9279    fn typename() -> &'static str {
9280        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSchema"
9281    }
9282}
9283
9284/// PostgreSQL database structure.
9285#[derive(Clone, Default, PartialEq)]
9286#[non_exhaustive]
9287pub struct PostgresqlRdbms {
9288    /// PostgreSQL schemas in the database server.
9289    pub postgresql_schemas: std::vec::Vec<crate::model::PostgresqlSchema>,
9290
9291    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9292}
9293
9294impl PostgresqlRdbms {
9295    /// Creates a new default instance.
9296    pub fn new() -> Self {
9297        std::default::Default::default()
9298    }
9299
9300    /// Sets the value of [postgresql_schemas][crate::model::PostgresqlRdbms::postgresql_schemas].
9301    ///
9302    /// # Example
9303    /// ```ignore,no_run
9304    /// # use google_cloud_datastream_v1::model::PostgresqlRdbms;
9305    /// use google_cloud_datastream_v1::model::PostgresqlSchema;
9306    /// let x = PostgresqlRdbms::new()
9307    ///     .set_postgresql_schemas([
9308    ///         PostgresqlSchema::default()/* use setters */,
9309    ///         PostgresqlSchema::default()/* use (different) setters */,
9310    ///     ]);
9311    /// ```
9312    pub fn set_postgresql_schemas<T, V>(mut self, v: T) -> Self
9313    where
9314        T: std::iter::IntoIterator<Item = V>,
9315        V: std::convert::Into<crate::model::PostgresqlSchema>,
9316    {
9317        use std::iter::Iterator;
9318        self.postgresql_schemas = v.into_iter().map(|i| i.into()).collect();
9319        self
9320    }
9321}
9322
9323impl wkt::message::Message for PostgresqlRdbms {
9324    fn typename() -> &'static str {
9325        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlRdbms"
9326    }
9327}
9328
9329/// PostgreSQL data source configuration
9330#[derive(Clone, Default, PartialEq)]
9331#[non_exhaustive]
9332pub struct PostgresqlSourceConfig {
9333    /// PostgreSQL objects to include in the stream.
9334    pub include_objects: std::option::Option<crate::model::PostgresqlRdbms>,
9335
9336    /// PostgreSQL objects to exclude from the stream.
9337    pub exclude_objects: std::option::Option<crate::model::PostgresqlRdbms>,
9338
9339    /// Required. Immutable. The name of the logical replication slot that's
9340    /// configured with the pgoutput plugin.
9341    pub replication_slot: std::string::String,
9342
9343    /// Required. The name of the publication that includes the set of all tables
9344    /// that are defined in the stream's include_objects.
9345    pub publication: std::string::String,
9346
9347    /// Maximum number of concurrent backfill tasks. The number should be non
9348    /// negative. If not set (or set to 0), the system's default value will be
9349    /// used.
9350    pub max_concurrent_backfill_tasks: i32,
9351
9352    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9353}
9354
9355impl PostgresqlSourceConfig {
9356    /// Creates a new default instance.
9357    pub fn new() -> Self {
9358        std::default::Default::default()
9359    }
9360
9361    /// Sets the value of [include_objects][crate::model::PostgresqlSourceConfig::include_objects].
9362    ///
9363    /// # Example
9364    /// ```ignore,no_run
9365    /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9366    /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
9367    /// let x = PostgresqlSourceConfig::new().set_include_objects(PostgresqlRdbms::default()/* use setters */);
9368    /// ```
9369    pub fn set_include_objects<T>(mut self, v: T) -> Self
9370    where
9371        T: std::convert::Into<crate::model::PostgresqlRdbms>,
9372    {
9373        self.include_objects = std::option::Option::Some(v.into());
9374        self
9375    }
9376
9377    /// Sets or clears the value of [include_objects][crate::model::PostgresqlSourceConfig::include_objects].
9378    ///
9379    /// # Example
9380    /// ```ignore,no_run
9381    /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9382    /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
9383    /// let x = PostgresqlSourceConfig::new().set_or_clear_include_objects(Some(PostgresqlRdbms::default()/* use setters */));
9384    /// let x = PostgresqlSourceConfig::new().set_or_clear_include_objects(None::<PostgresqlRdbms>);
9385    /// ```
9386    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
9387    where
9388        T: std::convert::Into<crate::model::PostgresqlRdbms>,
9389    {
9390        self.include_objects = v.map(|x| x.into());
9391        self
9392    }
9393
9394    /// Sets the value of [exclude_objects][crate::model::PostgresqlSourceConfig::exclude_objects].
9395    ///
9396    /// # Example
9397    /// ```ignore,no_run
9398    /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9399    /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
9400    /// let x = PostgresqlSourceConfig::new().set_exclude_objects(PostgresqlRdbms::default()/* use setters */);
9401    /// ```
9402    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
9403    where
9404        T: std::convert::Into<crate::model::PostgresqlRdbms>,
9405    {
9406        self.exclude_objects = std::option::Option::Some(v.into());
9407        self
9408    }
9409
9410    /// Sets or clears the value of [exclude_objects][crate::model::PostgresqlSourceConfig::exclude_objects].
9411    ///
9412    /// # Example
9413    /// ```ignore,no_run
9414    /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9415    /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
9416    /// let x = PostgresqlSourceConfig::new().set_or_clear_exclude_objects(Some(PostgresqlRdbms::default()/* use setters */));
9417    /// let x = PostgresqlSourceConfig::new().set_or_clear_exclude_objects(None::<PostgresqlRdbms>);
9418    /// ```
9419    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
9420    where
9421        T: std::convert::Into<crate::model::PostgresqlRdbms>,
9422    {
9423        self.exclude_objects = v.map(|x| x.into());
9424        self
9425    }
9426
9427    /// Sets the value of [replication_slot][crate::model::PostgresqlSourceConfig::replication_slot].
9428    ///
9429    /// # Example
9430    /// ```ignore,no_run
9431    /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9432    /// let x = PostgresqlSourceConfig::new().set_replication_slot("example");
9433    /// ```
9434    pub fn set_replication_slot<T: std::convert::Into<std::string::String>>(
9435        mut self,
9436        v: T,
9437    ) -> Self {
9438        self.replication_slot = v.into();
9439        self
9440    }
9441
9442    /// Sets the value of [publication][crate::model::PostgresqlSourceConfig::publication].
9443    ///
9444    /// # Example
9445    /// ```ignore,no_run
9446    /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9447    /// let x = PostgresqlSourceConfig::new().set_publication("example");
9448    /// ```
9449    pub fn set_publication<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9450        self.publication = v.into();
9451        self
9452    }
9453
9454    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::PostgresqlSourceConfig::max_concurrent_backfill_tasks].
9455    ///
9456    /// # Example
9457    /// ```ignore,no_run
9458    /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9459    /// let x = PostgresqlSourceConfig::new().set_max_concurrent_backfill_tasks(42);
9460    /// ```
9461    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9462        self.max_concurrent_backfill_tasks = v.into();
9463        self
9464    }
9465}
9466
9467impl wkt::message::Message for PostgresqlSourceConfig {
9468    fn typename() -> &'static str {
9469        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSourceConfig"
9470    }
9471}
9472
9473/// SQLServer Column.
9474#[derive(Clone, Default, PartialEq)]
9475#[non_exhaustive]
9476pub struct SqlServerColumn {
9477    /// Column name.
9478    pub column: std::string::String,
9479
9480    /// The SQLServer data type.
9481    pub data_type: std::string::String,
9482
9483    /// Column length.
9484    pub length: i32,
9485
9486    /// Column precision.
9487    pub precision: i32,
9488
9489    /// Column scale.
9490    pub scale: i32,
9491
9492    /// Whether or not the column represents a primary key.
9493    pub primary_key: bool,
9494
9495    /// Whether or not the column can accept a null value.
9496    pub nullable: bool,
9497
9498    /// The ordinal position of the column in the table.
9499    pub ordinal_position: i32,
9500
9501    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9502}
9503
9504impl SqlServerColumn {
9505    /// Creates a new default instance.
9506    pub fn new() -> Self {
9507        std::default::Default::default()
9508    }
9509
9510    /// Sets the value of [column][crate::model::SqlServerColumn::column].
9511    ///
9512    /// # Example
9513    /// ```ignore,no_run
9514    /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9515    /// let x = SqlServerColumn::new().set_column("example");
9516    /// ```
9517    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9518        self.column = v.into();
9519        self
9520    }
9521
9522    /// Sets the value of [data_type][crate::model::SqlServerColumn::data_type].
9523    ///
9524    /// # Example
9525    /// ```ignore,no_run
9526    /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9527    /// let x = SqlServerColumn::new().set_data_type("example");
9528    /// ```
9529    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9530        self.data_type = v.into();
9531        self
9532    }
9533
9534    /// Sets the value of [length][crate::model::SqlServerColumn::length].
9535    ///
9536    /// # Example
9537    /// ```ignore,no_run
9538    /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9539    /// let x = SqlServerColumn::new().set_length(42);
9540    /// ```
9541    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9542        self.length = v.into();
9543        self
9544    }
9545
9546    /// Sets the value of [precision][crate::model::SqlServerColumn::precision].
9547    ///
9548    /// # Example
9549    /// ```ignore,no_run
9550    /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9551    /// let x = SqlServerColumn::new().set_precision(42);
9552    /// ```
9553    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9554        self.precision = v.into();
9555        self
9556    }
9557
9558    /// Sets the value of [scale][crate::model::SqlServerColumn::scale].
9559    ///
9560    /// # Example
9561    /// ```ignore,no_run
9562    /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9563    /// let x = SqlServerColumn::new().set_scale(42);
9564    /// ```
9565    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9566        self.scale = v.into();
9567        self
9568    }
9569
9570    /// Sets the value of [primary_key][crate::model::SqlServerColumn::primary_key].
9571    ///
9572    /// # Example
9573    /// ```ignore,no_run
9574    /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9575    /// let x = SqlServerColumn::new().set_primary_key(true);
9576    /// ```
9577    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9578        self.primary_key = v.into();
9579        self
9580    }
9581
9582    /// Sets the value of [nullable][crate::model::SqlServerColumn::nullable].
9583    ///
9584    /// # Example
9585    /// ```ignore,no_run
9586    /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9587    /// let x = SqlServerColumn::new().set_nullable(true);
9588    /// ```
9589    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9590        self.nullable = v.into();
9591        self
9592    }
9593
9594    /// Sets the value of [ordinal_position][crate::model::SqlServerColumn::ordinal_position].
9595    ///
9596    /// # Example
9597    /// ```ignore,no_run
9598    /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9599    /// let x = SqlServerColumn::new().set_ordinal_position(42);
9600    /// ```
9601    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9602        self.ordinal_position = v.into();
9603        self
9604    }
9605}
9606
9607impl wkt::message::Message for SqlServerColumn {
9608    fn typename() -> &'static str {
9609        "type.googleapis.com/google.cloud.datastream.v1.SqlServerColumn"
9610    }
9611}
9612
9613/// SQLServer table.
9614#[derive(Clone, Default, PartialEq)]
9615#[non_exhaustive]
9616pub struct SqlServerTable {
9617    /// Table name.
9618    pub table: std::string::String,
9619
9620    /// SQLServer columns in the schema.
9621    /// When unspecified as part of include/exclude objects,
9622    /// includes/excludes everything.
9623    pub columns: std::vec::Vec<crate::model::SqlServerColumn>,
9624
9625    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9626}
9627
9628impl SqlServerTable {
9629    /// Creates a new default instance.
9630    pub fn new() -> Self {
9631        std::default::Default::default()
9632    }
9633
9634    /// Sets the value of [table][crate::model::SqlServerTable::table].
9635    ///
9636    /// # Example
9637    /// ```ignore,no_run
9638    /// # use google_cloud_datastream_v1::model::SqlServerTable;
9639    /// let x = SqlServerTable::new().set_table("example");
9640    /// ```
9641    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9642        self.table = v.into();
9643        self
9644    }
9645
9646    /// Sets the value of [columns][crate::model::SqlServerTable::columns].
9647    ///
9648    /// # Example
9649    /// ```ignore,no_run
9650    /// # use google_cloud_datastream_v1::model::SqlServerTable;
9651    /// use google_cloud_datastream_v1::model::SqlServerColumn;
9652    /// let x = SqlServerTable::new()
9653    ///     .set_columns([
9654    ///         SqlServerColumn::default()/* use setters */,
9655    ///         SqlServerColumn::default()/* use (different) setters */,
9656    ///     ]);
9657    /// ```
9658    pub fn set_columns<T, V>(mut self, v: T) -> Self
9659    where
9660        T: std::iter::IntoIterator<Item = V>,
9661        V: std::convert::Into<crate::model::SqlServerColumn>,
9662    {
9663        use std::iter::Iterator;
9664        self.columns = v.into_iter().map(|i| i.into()).collect();
9665        self
9666    }
9667}
9668
9669impl wkt::message::Message for SqlServerTable {
9670    fn typename() -> &'static str {
9671        "type.googleapis.com/google.cloud.datastream.v1.SqlServerTable"
9672    }
9673}
9674
9675/// SQLServer schema.
9676#[derive(Clone, Default, PartialEq)]
9677#[non_exhaustive]
9678pub struct SqlServerSchema {
9679    /// Schema name.
9680    pub schema: std::string::String,
9681
9682    /// Tables in the schema.
9683    pub tables: std::vec::Vec<crate::model::SqlServerTable>,
9684
9685    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9686}
9687
9688impl SqlServerSchema {
9689    /// Creates a new default instance.
9690    pub fn new() -> Self {
9691        std::default::Default::default()
9692    }
9693
9694    /// Sets the value of [schema][crate::model::SqlServerSchema::schema].
9695    ///
9696    /// # Example
9697    /// ```ignore,no_run
9698    /// # use google_cloud_datastream_v1::model::SqlServerSchema;
9699    /// let x = SqlServerSchema::new().set_schema("example");
9700    /// ```
9701    pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9702        self.schema = v.into();
9703        self
9704    }
9705
9706    /// Sets the value of [tables][crate::model::SqlServerSchema::tables].
9707    ///
9708    /// # Example
9709    /// ```ignore,no_run
9710    /// # use google_cloud_datastream_v1::model::SqlServerSchema;
9711    /// use google_cloud_datastream_v1::model::SqlServerTable;
9712    /// let x = SqlServerSchema::new()
9713    ///     .set_tables([
9714    ///         SqlServerTable::default()/* use setters */,
9715    ///         SqlServerTable::default()/* use (different) setters */,
9716    ///     ]);
9717    /// ```
9718    pub fn set_tables<T, V>(mut self, v: T) -> Self
9719    where
9720        T: std::iter::IntoIterator<Item = V>,
9721        V: std::convert::Into<crate::model::SqlServerTable>,
9722    {
9723        use std::iter::Iterator;
9724        self.tables = v.into_iter().map(|i| i.into()).collect();
9725        self
9726    }
9727}
9728
9729impl wkt::message::Message for SqlServerSchema {
9730    fn typename() -> &'static str {
9731        "type.googleapis.com/google.cloud.datastream.v1.SqlServerSchema"
9732    }
9733}
9734
9735/// SQLServer database structure.
9736#[derive(Clone, Default, PartialEq)]
9737#[non_exhaustive]
9738pub struct SqlServerRdbms {
9739    /// SQLServer schemas in the database server.
9740    pub schemas: std::vec::Vec<crate::model::SqlServerSchema>,
9741
9742    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9743}
9744
9745impl SqlServerRdbms {
9746    /// Creates a new default instance.
9747    pub fn new() -> Self {
9748        std::default::Default::default()
9749    }
9750
9751    /// Sets the value of [schemas][crate::model::SqlServerRdbms::schemas].
9752    ///
9753    /// # Example
9754    /// ```ignore,no_run
9755    /// # use google_cloud_datastream_v1::model::SqlServerRdbms;
9756    /// use google_cloud_datastream_v1::model::SqlServerSchema;
9757    /// let x = SqlServerRdbms::new()
9758    ///     .set_schemas([
9759    ///         SqlServerSchema::default()/* use setters */,
9760    ///         SqlServerSchema::default()/* use (different) setters */,
9761    ///     ]);
9762    /// ```
9763    pub fn set_schemas<T, V>(mut self, v: T) -> Self
9764    where
9765        T: std::iter::IntoIterator<Item = V>,
9766        V: std::convert::Into<crate::model::SqlServerSchema>,
9767    {
9768        use std::iter::Iterator;
9769        self.schemas = v.into_iter().map(|i| i.into()).collect();
9770        self
9771    }
9772}
9773
9774impl wkt::message::Message for SqlServerRdbms {
9775    fn typename() -> &'static str {
9776        "type.googleapis.com/google.cloud.datastream.v1.SqlServerRdbms"
9777    }
9778}
9779
9780/// SQLServer data source configuration
9781#[derive(Clone, Default, PartialEq)]
9782#[non_exhaustive]
9783pub struct SqlServerSourceConfig {
9784    /// SQLServer objects to include in the stream.
9785    pub include_objects: std::option::Option<crate::model::SqlServerRdbms>,
9786
9787    /// SQLServer objects to exclude from the stream.
9788    pub exclude_objects: std::option::Option<crate::model::SqlServerRdbms>,
9789
9790    /// Max concurrent CDC tasks.
9791    pub max_concurrent_cdc_tasks: i32,
9792
9793    /// Max concurrent backfill tasks.
9794    pub max_concurrent_backfill_tasks: i32,
9795
9796    /// Configuration to select the CDC read method for the stream.
9797    pub cdc_method: std::option::Option<crate::model::sql_server_source_config::CdcMethod>,
9798
9799    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9800}
9801
9802impl SqlServerSourceConfig {
9803    /// Creates a new default instance.
9804    pub fn new() -> Self {
9805        std::default::Default::default()
9806    }
9807
9808    /// Sets the value of [include_objects][crate::model::SqlServerSourceConfig::include_objects].
9809    ///
9810    /// # Example
9811    /// ```ignore,no_run
9812    /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9813    /// use google_cloud_datastream_v1::model::SqlServerRdbms;
9814    /// let x = SqlServerSourceConfig::new().set_include_objects(SqlServerRdbms::default()/* use setters */);
9815    /// ```
9816    pub fn set_include_objects<T>(mut self, v: T) -> Self
9817    where
9818        T: std::convert::Into<crate::model::SqlServerRdbms>,
9819    {
9820        self.include_objects = std::option::Option::Some(v.into());
9821        self
9822    }
9823
9824    /// Sets or clears the value of [include_objects][crate::model::SqlServerSourceConfig::include_objects].
9825    ///
9826    /// # Example
9827    /// ```ignore,no_run
9828    /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9829    /// use google_cloud_datastream_v1::model::SqlServerRdbms;
9830    /// let x = SqlServerSourceConfig::new().set_or_clear_include_objects(Some(SqlServerRdbms::default()/* use setters */));
9831    /// let x = SqlServerSourceConfig::new().set_or_clear_include_objects(None::<SqlServerRdbms>);
9832    /// ```
9833    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
9834    where
9835        T: std::convert::Into<crate::model::SqlServerRdbms>,
9836    {
9837        self.include_objects = v.map(|x| x.into());
9838        self
9839    }
9840
9841    /// Sets the value of [exclude_objects][crate::model::SqlServerSourceConfig::exclude_objects].
9842    ///
9843    /// # Example
9844    /// ```ignore,no_run
9845    /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9846    /// use google_cloud_datastream_v1::model::SqlServerRdbms;
9847    /// let x = SqlServerSourceConfig::new().set_exclude_objects(SqlServerRdbms::default()/* use setters */);
9848    /// ```
9849    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
9850    where
9851        T: std::convert::Into<crate::model::SqlServerRdbms>,
9852    {
9853        self.exclude_objects = std::option::Option::Some(v.into());
9854        self
9855    }
9856
9857    /// Sets or clears the value of [exclude_objects][crate::model::SqlServerSourceConfig::exclude_objects].
9858    ///
9859    /// # Example
9860    /// ```ignore,no_run
9861    /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9862    /// use google_cloud_datastream_v1::model::SqlServerRdbms;
9863    /// let x = SqlServerSourceConfig::new().set_or_clear_exclude_objects(Some(SqlServerRdbms::default()/* use setters */));
9864    /// let x = SqlServerSourceConfig::new().set_or_clear_exclude_objects(None::<SqlServerRdbms>);
9865    /// ```
9866    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
9867    where
9868        T: std::convert::Into<crate::model::SqlServerRdbms>,
9869    {
9870        self.exclude_objects = v.map(|x| x.into());
9871        self
9872    }
9873
9874    /// Sets the value of [max_concurrent_cdc_tasks][crate::model::SqlServerSourceConfig::max_concurrent_cdc_tasks].
9875    ///
9876    /// # Example
9877    /// ```ignore,no_run
9878    /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9879    /// let x = SqlServerSourceConfig::new().set_max_concurrent_cdc_tasks(42);
9880    /// ```
9881    pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9882        self.max_concurrent_cdc_tasks = v.into();
9883        self
9884    }
9885
9886    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::SqlServerSourceConfig::max_concurrent_backfill_tasks].
9887    ///
9888    /// # Example
9889    /// ```ignore,no_run
9890    /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9891    /// let x = SqlServerSourceConfig::new().set_max_concurrent_backfill_tasks(42);
9892    /// ```
9893    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9894        self.max_concurrent_backfill_tasks = v.into();
9895        self
9896    }
9897
9898    /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method].
9899    ///
9900    /// Note that all the setters affecting `cdc_method` are mutually
9901    /// exclusive.
9902    ///
9903    /// # Example
9904    /// ```ignore,no_run
9905    /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9906    /// use google_cloud_datastream_v1::model::SqlServerTransactionLogs;
9907    /// let x = SqlServerSourceConfig::new().set_cdc_method(Some(
9908    ///     google_cloud_datastream_v1::model::sql_server_source_config::CdcMethod::TransactionLogs(SqlServerTransactionLogs::default().into())));
9909    /// ```
9910    pub fn set_cdc_method<
9911        T: std::convert::Into<std::option::Option<crate::model::sql_server_source_config::CdcMethod>>,
9912    >(
9913        mut self,
9914        v: T,
9915    ) -> Self {
9916        self.cdc_method = v.into();
9917        self
9918    }
9919
9920    /// The value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
9921    /// if it holds a `TransactionLogs`, `None` if the field is not set or
9922    /// holds a different branch.
9923    pub fn transaction_logs(
9924        &self,
9925    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerTransactionLogs>> {
9926        #[allow(unreachable_patterns)]
9927        self.cdc_method.as_ref().and_then(|v| match v {
9928            crate::model::sql_server_source_config::CdcMethod::TransactionLogs(v) => {
9929                std::option::Option::Some(v)
9930            }
9931            _ => std::option::Option::None,
9932        })
9933    }
9934
9935    /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
9936    /// to hold a `TransactionLogs`.
9937    ///
9938    /// Note that all the setters affecting `cdc_method` are
9939    /// mutually exclusive.
9940    ///
9941    /// # Example
9942    /// ```ignore,no_run
9943    /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9944    /// use google_cloud_datastream_v1::model::SqlServerTransactionLogs;
9945    /// let x = SqlServerSourceConfig::new().set_transaction_logs(SqlServerTransactionLogs::default()/* use setters */);
9946    /// assert!(x.transaction_logs().is_some());
9947    /// assert!(x.change_tables().is_none());
9948    /// ```
9949    pub fn set_transaction_logs<
9950        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerTransactionLogs>>,
9951    >(
9952        mut self,
9953        v: T,
9954    ) -> Self {
9955        self.cdc_method = std::option::Option::Some(
9956            crate::model::sql_server_source_config::CdcMethod::TransactionLogs(v.into()),
9957        );
9958        self
9959    }
9960
9961    /// The value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
9962    /// if it holds a `ChangeTables`, `None` if the field is not set or
9963    /// holds a different branch.
9964    pub fn change_tables(
9965        &self,
9966    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerChangeTables>> {
9967        #[allow(unreachable_patterns)]
9968        self.cdc_method.as_ref().and_then(|v| match v {
9969            crate::model::sql_server_source_config::CdcMethod::ChangeTables(v) => {
9970                std::option::Option::Some(v)
9971            }
9972            _ => std::option::Option::None,
9973        })
9974    }
9975
9976    /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
9977    /// to hold a `ChangeTables`.
9978    ///
9979    /// Note that all the setters affecting `cdc_method` are
9980    /// mutually exclusive.
9981    ///
9982    /// # Example
9983    /// ```ignore,no_run
9984    /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9985    /// use google_cloud_datastream_v1::model::SqlServerChangeTables;
9986    /// let x = SqlServerSourceConfig::new().set_change_tables(SqlServerChangeTables::default()/* use setters */);
9987    /// assert!(x.change_tables().is_some());
9988    /// assert!(x.transaction_logs().is_none());
9989    /// ```
9990    pub fn set_change_tables<
9991        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerChangeTables>>,
9992    >(
9993        mut self,
9994        v: T,
9995    ) -> Self {
9996        self.cdc_method = std::option::Option::Some(
9997            crate::model::sql_server_source_config::CdcMethod::ChangeTables(v.into()),
9998        );
9999        self
10000    }
10001}
10002
10003impl wkt::message::Message for SqlServerSourceConfig {
10004    fn typename() -> &'static str {
10005        "type.googleapis.com/google.cloud.datastream.v1.SqlServerSourceConfig"
10006    }
10007}
10008
10009/// Defines additional types related to [SqlServerSourceConfig].
10010pub mod sql_server_source_config {
10011    #[allow(unused_imports)]
10012    use super::*;
10013
10014    /// Configuration to select the CDC read method for the stream.
10015    #[derive(Clone, Debug, PartialEq)]
10016    #[non_exhaustive]
10017    pub enum CdcMethod {
10018        /// CDC reader reads from transaction logs.
10019        TransactionLogs(std::boxed::Box<crate::model::SqlServerTransactionLogs>),
10020        /// CDC reader reads from change tables.
10021        ChangeTables(std::boxed::Box<crate::model::SqlServerChangeTables>),
10022    }
10023}
10024
10025/// Configuration to use Transaction Logs CDC read method.
10026#[derive(Clone, Default, PartialEq)]
10027#[non_exhaustive]
10028pub struct SqlServerTransactionLogs {
10029    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10030}
10031
10032impl SqlServerTransactionLogs {
10033    /// Creates a new default instance.
10034    pub fn new() -> Self {
10035        std::default::Default::default()
10036    }
10037}
10038
10039impl wkt::message::Message for SqlServerTransactionLogs {
10040    fn typename() -> &'static str {
10041        "type.googleapis.com/google.cloud.datastream.v1.SqlServerTransactionLogs"
10042    }
10043}
10044
10045/// Configuration to use Change Tables CDC read method.
10046#[derive(Clone, Default, PartialEq)]
10047#[non_exhaustive]
10048pub struct SqlServerChangeTables {
10049    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10050}
10051
10052impl SqlServerChangeTables {
10053    /// Creates a new default instance.
10054    pub fn new() -> Self {
10055        std::default::Default::default()
10056    }
10057}
10058
10059impl wkt::message::Message for SqlServerChangeTables {
10060    fn typename() -> &'static str {
10061        "type.googleapis.com/google.cloud.datastream.v1.SqlServerChangeTables"
10062    }
10063}
10064
10065/// MySQL Column.
10066#[derive(Clone, Default, PartialEq)]
10067#[non_exhaustive]
10068pub struct MysqlColumn {
10069    /// Column name.
10070    pub column: std::string::String,
10071
10072    /// The MySQL data type. Full data types list can be found here:
10073    /// <https://dev.mysql.com/doc/refman/8.0/en/data-types.html>
10074    pub data_type: std::string::String,
10075
10076    /// Column length.
10077    pub length: i32,
10078
10079    /// Column collation.
10080    pub collation: std::string::String,
10081
10082    /// Whether or not the column represents a primary key.
10083    pub primary_key: bool,
10084
10085    /// Whether or not the column can accept a null value.
10086    pub nullable: bool,
10087
10088    /// The ordinal position of the column in the table.
10089    pub ordinal_position: i32,
10090
10091    /// Column precision.
10092    pub precision: i32,
10093
10094    /// Column scale.
10095    pub scale: i32,
10096
10097    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10098}
10099
10100impl MysqlColumn {
10101    /// Creates a new default instance.
10102    pub fn new() -> Self {
10103        std::default::Default::default()
10104    }
10105
10106    /// Sets the value of [column][crate::model::MysqlColumn::column].
10107    ///
10108    /// # Example
10109    /// ```ignore,no_run
10110    /// # use google_cloud_datastream_v1::model::MysqlColumn;
10111    /// let x = MysqlColumn::new().set_column("example");
10112    /// ```
10113    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10114        self.column = v.into();
10115        self
10116    }
10117
10118    /// Sets the value of [data_type][crate::model::MysqlColumn::data_type].
10119    ///
10120    /// # Example
10121    /// ```ignore,no_run
10122    /// # use google_cloud_datastream_v1::model::MysqlColumn;
10123    /// let x = MysqlColumn::new().set_data_type("example");
10124    /// ```
10125    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10126        self.data_type = v.into();
10127        self
10128    }
10129
10130    /// Sets the value of [length][crate::model::MysqlColumn::length].
10131    ///
10132    /// # Example
10133    /// ```ignore,no_run
10134    /// # use google_cloud_datastream_v1::model::MysqlColumn;
10135    /// let x = MysqlColumn::new().set_length(42);
10136    /// ```
10137    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10138        self.length = v.into();
10139        self
10140    }
10141
10142    /// Sets the value of [collation][crate::model::MysqlColumn::collation].
10143    ///
10144    /// # Example
10145    /// ```ignore,no_run
10146    /// # use google_cloud_datastream_v1::model::MysqlColumn;
10147    /// let x = MysqlColumn::new().set_collation("example");
10148    /// ```
10149    pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10150        self.collation = v.into();
10151        self
10152    }
10153
10154    /// Sets the value of [primary_key][crate::model::MysqlColumn::primary_key].
10155    ///
10156    /// # Example
10157    /// ```ignore,no_run
10158    /// # use google_cloud_datastream_v1::model::MysqlColumn;
10159    /// let x = MysqlColumn::new().set_primary_key(true);
10160    /// ```
10161    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10162        self.primary_key = v.into();
10163        self
10164    }
10165
10166    /// Sets the value of [nullable][crate::model::MysqlColumn::nullable].
10167    ///
10168    /// # Example
10169    /// ```ignore,no_run
10170    /// # use google_cloud_datastream_v1::model::MysqlColumn;
10171    /// let x = MysqlColumn::new().set_nullable(true);
10172    /// ```
10173    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10174        self.nullable = v.into();
10175        self
10176    }
10177
10178    /// Sets the value of [ordinal_position][crate::model::MysqlColumn::ordinal_position].
10179    ///
10180    /// # Example
10181    /// ```ignore,no_run
10182    /// # use google_cloud_datastream_v1::model::MysqlColumn;
10183    /// let x = MysqlColumn::new().set_ordinal_position(42);
10184    /// ```
10185    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10186        self.ordinal_position = v.into();
10187        self
10188    }
10189
10190    /// Sets the value of [precision][crate::model::MysqlColumn::precision].
10191    ///
10192    /// # Example
10193    /// ```ignore,no_run
10194    /// # use google_cloud_datastream_v1::model::MysqlColumn;
10195    /// let x = MysqlColumn::new().set_precision(42);
10196    /// ```
10197    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10198        self.precision = v.into();
10199        self
10200    }
10201
10202    /// Sets the value of [scale][crate::model::MysqlColumn::scale].
10203    ///
10204    /// # Example
10205    /// ```ignore,no_run
10206    /// # use google_cloud_datastream_v1::model::MysqlColumn;
10207    /// let x = MysqlColumn::new().set_scale(42);
10208    /// ```
10209    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10210        self.scale = v.into();
10211        self
10212    }
10213}
10214
10215impl wkt::message::Message for MysqlColumn {
10216    fn typename() -> &'static str {
10217        "type.googleapis.com/google.cloud.datastream.v1.MysqlColumn"
10218    }
10219}
10220
10221/// MySQL table.
10222#[derive(Clone, Default, PartialEq)]
10223#[non_exhaustive]
10224pub struct MysqlTable {
10225    /// Table name.
10226    pub table: std::string::String,
10227
10228    /// MySQL columns in the database.
10229    /// When unspecified as part of include/exclude objects, includes/excludes
10230    /// everything.
10231    pub mysql_columns: std::vec::Vec<crate::model::MysqlColumn>,
10232
10233    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10234}
10235
10236impl MysqlTable {
10237    /// Creates a new default instance.
10238    pub fn new() -> Self {
10239        std::default::Default::default()
10240    }
10241
10242    /// Sets the value of [table][crate::model::MysqlTable::table].
10243    ///
10244    /// # Example
10245    /// ```ignore,no_run
10246    /// # use google_cloud_datastream_v1::model::MysqlTable;
10247    /// let x = MysqlTable::new().set_table("example");
10248    /// ```
10249    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10250        self.table = v.into();
10251        self
10252    }
10253
10254    /// Sets the value of [mysql_columns][crate::model::MysqlTable::mysql_columns].
10255    ///
10256    /// # Example
10257    /// ```ignore,no_run
10258    /// # use google_cloud_datastream_v1::model::MysqlTable;
10259    /// use google_cloud_datastream_v1::model::MysqlColumn;
10260    /// let x = MysqlTable::new()
10261    ///     .set_mysql_columns([
10262    ///         MysqlColumn::default()/* use setters */,
10263    ///         MysqlColumn::default()/* use (different) setters */,
10264    ///     ]);
10265    /// ```
10266    pub fn set_mysql_columns<T, V>(mut self, v: T) -> Self
10267    where
10268        T: std::iter::IntoIterator<Item = V>,
10269        V: std::convert::Into<crate::model::MysqlColumn>,
10270    {
10271        use std::iter::Iterator;
10272        self.mysql_columns = v.into_iter().map(|i| i.into()).collect();
10273        self
10274    }
10275}
10276
10277impl wkt::message::Message for MysqlTable {
10278    fn typename() -> &'static str {
10279        "type.googleapis.com/google.cloud.datastream.v1.MysqlTable"
10280    }
10281}
10282
10283/// MySQL database.
10284#[derive(Clone, Default, PartialEq)]
10285#[non_exhaustive]
10286pub struct MysqlDatabase {
10287    /// Database name.
10288    pub database: std::string::String,
10289
10290    /// Tables in the database.
10291    pub mysql_tables: std::vec::Vec<crate::model::MysqlTable>,
10292
10293    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10294}
10295
10296impl MysqlDatabase {
10297    /// Creates a new default instance.
10298    pub fn new() -> Self {
10299        std::default::Default::default()
10300    }
10301
10302    /// Sets the value of [database][crate::model::MysqlDatabase::database].
10303    ///
10304    /// # Example
10305    /// ```ignore,no_run
10306    /// # use google_cloud_datastream_v1::model::MysqlDatabase;
10307    /// let x = MysqlDatabase::new().set_database("example");
10308    /// ```
10309    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10310        self.database = v.into();
10311        self
10312    }
10313
10314    /// Sets the value of [mysql_tables][crate::model::MysqlDatabase::mysql_tables].
10315    ///
10316    /// # Example
10317    /// ```ignore,no_run
10318    /// # use google_cloud_datastream_v1::model::MysqlDatabase;
10319    /// use google_cloud_datastream_v1::model::MysqlTable;
10320    /// let x = MysqlDatabase::new()
10321    ///     .set_mysql_tables([
10322    ///         MysqlTable::default()/* use setters */,
10323    ///         MysqlTable::default()/* use (different) setters */,
10324    ///     ]);
10325    /// ```
10326    pub fn set_mysql_tables<T, V>(mut self, v: T) -> Self
10327    where
10328        T: std::iter::IntoIterator<Item = V>,
10329        V: std::convert::Into<crate::model::MysqlTable>,
10330    {
10331        use std::iter::Iterator;
10332        self.mysql_tables = v.into_iter().map(|i| i.into()).collect();
10333        self
10334    }
10335}
10336
10337impl wkt::message::Message for MysqlDatabase {
10338    fn typename() -> &'static str {
10339        "type.googleapis.com/google.cloud.datastream.v1.MysqlDatabase"
10340    }
10341}
10342
10343/// MySQL database structure
10344#[derive(Clone, Default, PartialEq)]
10345#[non_exhaustive]
10346pub struct MysqlRdbms {
10347    /// Mysql databases on the server
10348    pub mysql_databases: std::vec::Vec<crate::model::MysqlDatabase>,
10349
10350    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10351}
10352
10353impl MysqlRdbms {
10354    /// Creates a new default instance.
10355    pub fn new() -> Self {
10356        std::default::Default::default()
10357    }
10358
10359    /// Sets the value of [mysql_databases][crate::model::MysqlRdbms::mysql_databases].
10360    ///
10361    /// # Example
10362    /// ```ignore,no_run
10363    /// # use google_cloud_datastream_v1::model::MysqlRdbms;
10364    /// use google_cloud_datastream_v1::model::MysqlDatabase;
10365    /// let x = MysqlRdbms::new()
10366    ///     .set_mysql_databases([
10367    ///         MysqlDatabase::default()/* use setters */,
10368    ///         MysqlDatabase::default()/* use (different) setters */,
10369    ///     ]);
10370    /// ```
10371    pub fn set_mysql_databases<T, V>(mut self, v: T) -> Self
10372    where
10373        T: std::iter::IntoIterator<Item = V>,
10374        V: std::convert::Into<crate::model::MysqlDatabase>,
10375    {
10376        use std::iter::Iterator;
10377        self.mysql_databases = v.into_iter().map(|i| i.into()).collect();
10378        self
10379    }
10380}
10381
10382impl wkt::message::Message for MysqlRdbms {
10383    fn typename() -> &'static str {
10384        "type.googleapis.com/google.cloud.datastream.v1.MysqlRdbms"
10385    }
10386}
10387
10388/// MySQL source configuration
10389#[derive(Clone, Default, PartialEq)]
10390#[non_exhaustive]
10391pub struct MysqlSourceConfig {
10392    /// MySQL objects to retrieve from the source.
10393    pub include_objects: std::option::Option<crate::model::MysqlRdbms>,
10394
10395    /// MySQL objects to exclude from the stream.
10396    pub exclude_objects: std::option::Option<crate::model::MysqlRdbms>,
10397
10398    /// Maximum number of concurrent CDC tasks. The number should be non negative.
10399    /// If not set (or set to 0), the system's default value will be used.
10400    pub max_concurrent_cdc_tasks: i32,
10401
10402    /// Maximum number of concurrent backfill tasks. The number should be non
10403    /// negative. If not set (or set to 0), the system's default value will be
10404    /// used.
10405    pub max_concurrent_backfill_tasks: i32,
10406
10407    /// The CDC method to use for the stream.
10408    pub cdc_method: std::option::Option<crate::model::mysql_source_config::CdcMethod>,
10409
10410    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10411}
10412
10413impl MysqlSourceConfig {
10414    /// Creates a new default instance.
10415    pub fn new() -> Self {
10416        std::default::Default::default()
10417    }
10418
10419    /// Sets the value of [include_objects][crate::model::MysqlSourceConfig::include_objects].
10420    ///
10421    /// # Example
10422    /// ```ignore,no_run
10423    /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10424    /// use google_cloud_datastream_v1::model::MysqlRdbms;
10425    /// let x = MysqlSourceConfig::new().set_include_objects(MysqlRdbms::default()/* use setters */);
10426    /// ```
10427    pub fn set_include_objects<T>(mut self, v: T) -> Self
10428    where
10429        T: std::convert::Into<crate::model::MysqlRdbms>,
10430    {
10431        self.include_objects = std::option::Option::Some(v.into());
10432        self
10433    }
10434
10435    /// Sets or clears the value of [include_objects][crate::model::MysqlSourceConfig::include_objects].
10436    ///
10437    /// # Example
10438    /// ```ignore,no_run
10439    /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10440    /// use google_cloud_datastream_v1::model::MysqlRdbms;
10441    /// let x = MysqlSourceConfig::new().set_or_clear_include_objects(Some(MysqlRdbms::default()/* use setters */));
10442    /// let x = MysqlSourceConfig::new().set_or_clear_include_objects(None::<MysqlRdbms>);
10443    /// ```
10444    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
10445    where
10446        T: std::convert::Into<crate::model::MysqlRdbms>,
10447    {
10448        self.include_objects = v.map(|x| x.into());
10449        self
10450    }
10451
10452    /// Sets the value of [exclude_objects][crate::model::MysqlSourceConfig::exclude_objects].
10453    ///
10454    /// # Example
10455    /// ```ignore,no_run
10456    /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10457    /// use google_cloud_datastream_v1::model::MysqlRdbms;
10458    /// let x = MysqlSourceConfig::new().set_exclude_objects(MysqlRdbms::default()/* use setters */);
10459    /// ```
10460    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
10461    where
10462        T: std::convert::Into<crate::model::MysqlRdbms>,
10463    {
10464        self.exclude_objects = std::option::Option::Some(v.into());
10465        self
10466    }
10467
10468    /// Sets or clears the value of [exclude_objects][crate::model::MysqlSourceConfig::exclude_objects].
10469    ///
10470    /// # Example
10471    /// ```ignore,no_run
10472    /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10473    /// use google_cloud_datastream_v1::model::MysqlRdbms;
10474    /// let x = MysqlSourceConfig::new().set_or_clear_exclude_objects(Some(MysqlRdbms::default()/* use setters */));
10475    /// let x = MysqlSourceConfig::new().set_or_clear_exclude_objects(None::<MysqlRdbms>);
10476    /// ```
10477    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
10478    where
10479        T: std::convert::Into<crate::model::MysqlRdbms>,
10480    {
10481        self.exclude_objects = v.map(|x| x.into());
10482        self
10483    }
10484
10485    /// Sets the value of [max_concurrent_cdc_tasks][crate::model::MysqlSourceConfig::max_concurrent_cdc_tasks].
10486    ///
10487    /// # Example
10488    /// ```ignore,no_run
10489    /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10490    /// let x = MysqlSourceConfig::new().set_max_concurrent_cdc_tasks(42);
10491    /// ```
10492    pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10493        self.max_concurrent_cdc_tasks = v.into();
10494        self
10495    }
10496
10497    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::MysqlSourceConfig::max_concurrent_backfill_tasks].
10498    ///
10499    /// # Example
10500    /// ```ignore,no_run
10501    /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10502    /// let x = MysqlSourceConfig::new().set_max_concurrent_backfill_tasks(42);
10503    /// ```
10504    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10505        self.max_concurrent_backfill_tasks = v.into();
10506        self
10507    }
10508
10509    /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method].
10510    ///
10511    /// Note that all the setters affecting `cdc_method` are mutually
10512    /// exclusive.
10513    ///
10514    /// # Example
10515    /// ```ignore,no_run
10516    /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10517    /// use google_cloud_datastream_v1::model::mysql_source_config::BinaryLogPosition;
10518    /// let x = MysqlSourceConfig::new().set_cdc_method(Some(
10519    ///     google_cloud_datastream_v1::model::mysql_source_config::CdcMethod::BinaryLogPosition(BinaryLogPosition::default().into())));
10520    /// ```
10521    pub fn set_cdc_method<
10522        T: std::convert::Into<std::option::Option<crate::model::mysql_source_config::CdcMethod>>,
10523    >(
10524        mut self,
10525        v: T,
10526    ) -> Self {
10527        self.cdc_method = v.into();
10528        self
10529    }
10530
10531    /// The value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
10532    /// if it holds a `BinaryLogPosition`, `None` if the field is not set or
10533    /// holds a different branch.
10534    pub fn binary_log_position(
10535        &self,
10536    ) -> std::option::Option<&std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>>
10537    {
10538        #[allow(unreachable_patterns)]
10539        self.cdc_method.as_ref().and_then(|v| match v {
10540            crate::model::mysql_source_config::CdcMethod::BinaryLogPosition(v) => {
10541                std::option::Option::Some(v)
10542            }
10543            _ => std::option::Option::None,
10544        })
10545    }
10546
10547    /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
10548    /// to hold a `BinaryLogPosition`.
10549    ///
10550    /// Note that all the setters affecting `cdc_method` are
10551    /// mutually exclusive.
10552    ///
10553    /// # Example
10554    /// ```ignore,no_run
10555    /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10556    /// use google_cloud_datastream_v1::model::mysql_source_config::BinaryLogPosition;
10557    /// let x = MysqlSourceConfig::new().set_binary_log_position(BinaryLogPosition::default()/* use setters */);
10558    /// assert!(x.binary_log_position().is_some());
10559    /// assert!(x.gtid().is_none());
10560    /// ```
10561    pub fn set_binary_log_position<
10562        T: std::convert::Into<std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>>,
10563    >(
10564        mut self,
10565        v: T,
10566    ) -> Self {
10567        self.cdc_method = std::option::Option::Some(
10568            crate::model::mysql_source_config::CdcMethod::BinaryLogPosition(v.into()),
10569        );
10570        self
10571    }
10572
10573    /// The value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
10574    /// if it holds a `Gtid`, `None` if the field is not set or
10575    /// holds a different branch.
10576    pub fn gtid(
10577        &self,
10578    ) -> std::option::Option<&std::boxed::Box<crate::model::mysql_source_config::Gtid>> {
10579        #[allow(unreachable_patterns)]
10580        self.cdc_method.as_ref().and_then(|v| match v {
10581            crate::model::mysql_source_config::CdcMethod::Gtid(v) => std::option::Option::Some(v),
10582            _ => std::option::Option::None,
10583        })
10584    }
10585
10586    /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
10587    /// to hold a `Gtid`.
10588    ///
10589    /// Note that all the setters affecting `cdc_method` are
10590    /// mutually exclusive.
10591    ///
10592    /// # Example
10593    /// ```ignore,no_run
10594    /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10595    /// use google_cloud_datastream_v1::model::mysql_source_config::Gtid;
10596    /// let x = MysqlSourceConfig::new().set_gtid(Gtid::default()/* use setters */);
10597    /// assert!(x.gtid().is_some());
10598    /// assert!(x.binary_log_position().is_none());
10599    /// ```
10600    pub fn set_gtid<
10601        T: std::convert::Into<std::boxed::Box<crate::model::mysql_source_config::Gtid>>,
10602    >(
10603        mut self,
10604        v: T,
10605    ) -> Self {
10606        self.cdc_method =
10607            std::option::Option::Some(crate::model::mysql_source_config::CdcMethod::Gtid(v.into()));
10608        self
10609    }
10610}
10611
10612impl wkt::message::Message for MysqlSourceConfig {
10613    fn typename() -> &'static str {
10614        "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig"
10615    }
10616}
10617
10618/// Defines additional types related to [MysqlSourceConfig].
10619pub mod mysql_source_config {
10620    #[allow(unused_imports)]
10621    use super::*;
10622
10623    /// Use Binary log position based replication.
10624    #[derive(Clone, Default, PartialEq)]
10625    #[non_exhaustive]
10626    pub struct BinaryLogPosition {
10627        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10628    }
10629
10630    impl BinaryLogPosition {
10631        /// Creates a new default instance.
10632        pub fn new() -> Self {
10633            std::default::Default::default()
10634        }
10635    }
10636
10637    impl wkt::message::Message for BinaryLogPosition {
10638        fn typename() -> &'static str {
10639            "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig.BinaryLogPosition"
10640        }
10641    }
10642
10643    /// Use GTID based replication.
10644    #[derive(Clone, Default, PartialEq)]
10645    #[non_exhaustive]
10646    pub struct Gtid {
10647        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10648    }
10649
10650    impl Gtid {
10651        /// Creates a new default instance.
10652        pub fn new() -> Self {
10653            std::default::Default::default()
10654        }
10655    }
10656
10657    impl wkt::message::Message for Gtid {
10658        fn typename() -> &'static str {
10659            "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig.Gtid"
10660        }
10661    }
10662
10663    /// The CDC method to use for the stream.
10664    #[derive(Clone, Debug, PartialEq)]
10665    #[non_exhaustive]
10666    pub enum CdcMethod {
10667        /// Use Binary log position based replication.
10668        BinaryLogPosition(std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>),
10669        /// Use GTID based replication.
10670        Gtid(std::boxed::Box<crate::model::mysql_source_config::Gtid>),
10671    }
10672}
10673
10674/// Salesforce source configuration
10675#[derive(Clone, Default, PartialEq)]
10676#[non_exhaustive]
10677pub struct SalesforceSourceConfig {
10678    /// Salesforce objects to retrieve from the source.
10679    pub include_objects: std::option::Option<crate::model::SalesforceOrg>,
10680
10681    /// Salesforce objects to exclude from the stream.
10682    pub exclude_objects: std::option::Option<crate::model::SalesforceOrg>,
10683
10684    /// Required. Salesforce objects polling interval. The interval at which new
10685    /// changes will be polled for each object. The duration must be between 5
10686    /// minutes and 24 hours.
10687    pub polling_interval: std::option::Option<wkt::Duration>,
10688
10689    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10690}
10691
10692impl SalesforceSourceConfig {
10693    /// Creates a new default instance.
10694    pub fn new() -> Self {
10695        std::default::Default::default()
10696    }
10697
10698    /// Sets the value of [include_objects][crate::model::SalesforceSourceConfig::include_objects].
10699    ///
10700    /// # Example
10701    /// ```ignore,no_run
10702    /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10703    /// use google_cloud_datastream_v1::model::SalesforceOrg;
10704    /// let x = SalesforceSourceConfig::new().set_include_objects(SalesforceOrg::default()/* use setters */);
10705    /// ```
10706    pub fn set_include_objects<T>(mut self, v: T) -> Self
10707    where
10708        T: std::convert::Into<crate::model::SalesforceOrg>,
10709    {
10710        self.include_objects = std::option::Option::Some(v.into());
10711        self
10712    }
10713
10714    /// Sets or clears the value of [include_objects][crate::model::SalesforceSourceConfig::include_objects].
10715    ///
10716    /// # Example
10717    /// ```ignore,no_run
10718    /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10719    /// use google_cloud_datastream_v1::model::SalesforceOrg;
10720    /// let x = SalesforceSourceConfig::new().set_or_clear_include_objects(Some(SalesforceOrg::default()/* use setters */));
10721    /// let x = SalesforceSourceConfig::new().set_or_clear_include_objects(None::<SalesforceOrg>);
10722    /// ```
10723    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
10724    where
10725        T: std::convert::Into<crate::model::SalesforceOrg>,
10726    {
10727        self.include_objects = v.map(|x| x.into());
10728        self
10729    }
10730
10731    /// Sets the value of [exclude_objects][crate::model::SalesforceSourceConfig::exclude_objects].
10732    ///
10733    /// # Example
10734    /// ```ignore,no_run
10735    /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10736    /// use google_cloud_datastream_v1::model::SalesforceOrg;
10737    /// let x = SalesforceSourceConfig::new().set_exclude_objects(SalesforceOrg::default()/* use setters */);
10738    /// ```
10739    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
10740    where
10741        T: std::convert::Into<crate::model::SalesforceOrg>,
10742    {
10743        self.exclude_objects = std::option::Option::Some(v.into());
10744        self
10745    }
10746
10747    /// Sets or clears the value of [exclude_objects][crate::model::SalesforceSourceConfig::exclude_objects].
10748    ///
10749    /// # Example
10750    /// ```ignore,no_run
10751    /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10752    /// use google_cloud_datastream_v1::model::SalesforceOrg;
10753    /// let x = SalesforceSourceConfig::new().set_or_clear_exclude_objects(Some(SalesforceOrg::default()/* use setters */));
10754    /// let x = SalesforceSourceConfig::new().set_or_clear_exclude_objects(None::<SalesforceOrg>);
10755    /// ```
10756    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
10757    where
10758        T: std::convert::Into<crate::model::SalesforceOrg>,
10759    {
10760        self.exclude_objects = v.map(|x| x.into());
10761        self
10762    }
10763
10764    /// Sets the value of [polling_interval][crate::model::SalesforceSourceConfig::polling_interval].
10765    ///
10766    /// # Example
10767    /// ```ignore,no_run
10768    /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10769    /// use wkt::Duration;
10770    /// let x = SalesforceSourceConfig::new().set_polling_interval(Duration::default()/* use setters */);
10771    /// ```
10772    pub fn set_polling_interval<T>(mut self, v: T) -> Self
10773    where
10774        T: std::convert::Into<wkt::Duration>,
10775    {
10776        self.polling_interval = std::option::Option::Some(v.into());
10777        self
10778    }
10779
10780    /// Sets or clears the value of [polling_interval][crate::model::SalesforceSourceConfig::polling_interval].
10781    ///
10782    /// # Example
10783    /// ```ignore,no_run
10784    /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10785    /// use wkt::Duration;
10786    /// let x = SalesforceSourceConfig::new().set_or_clear_polling_interval(Some(Duration::default()/* use setters */));
10787    /// let x = SalesforceSourceConfig::new().set_or_clear_polling_interval(None::<Duration>);
10788    /// ```
10789    pub fn set_or_clear_polling_interval<T>(mut self, v: std::option::Option<T>) -> Self
10790    where
10791        T: std::convert::Into<wkt::Duration>,
10792    {
10793        self.polling_interval = v.map(|x| x.into());
10794        self
10795    }
10796}
10797
10798impl wkt::message::Message for SalesforceSourceConfig {
10799    fn typename() -> &'static str {
10800        "type.googleapis.com/google.cloud.datastream.v1.SalesforceSourceConfig"
10801    }
10802}
10803
10804/// Salesforce organization structure.
10805#[derive(Clone, Default, PartialEq)]
10806#[non_exhaustive]
10807pub struct SalesforceOrg {
10808    /// Salesforce objects in the database server.
10809    pub objects: std::vec::Vec<crate::model::SalesforceObject>,
10810
10811    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10812}
10813
10814impl SalesforceOrg {
10815    /// Creates a new default instance.
10816    pub fn new() -> Self {
10817        std::default::Default::default()
10818    }
10819
10820    /// Sets the value of [objects][crate::model::SalesforceOrg::objects].
10821    ///
10822    /// # Example
10823    /// ```ignore,no_run
10824    /// # use google_cloud_datastream_v1::model::SalesforceOrg;
10825    /// use google_cloud_datastream_v1::model::SalesforceObject;
10826    /// let x = SalesforceOrg::new()
10827    ///     .set_objects([
10828    ///         SalesforceObject::default()/* use setters */,
10829    ///         SalesforceObject::default()/* use (different) setters */,
10830    ///     ]);
10831    /// ```
10832    pub fn set_objects<T, V>(mut self, v: T) -> Self
10833    where
10834        T: std::iter::IntoIterator<Item = V>,
10835        V: std::convert::Into<crate::model::SalesforceObject>,
10836    {
10837        use std::iter::Iterator;
10838        self.objects = v.into_iter().map(|i| i.into()).collect();
10839        self
10840    }
10841}
10842
10843impl wkt::message::Message for SalesforceOrg {
10844    fn typename() -> &'static str {
10845        "type.googleapis.com/google.cloud.datastream.v1.SalesforceOrg"
10846    }
10847}
10848
10849/// Salesforce object.
10850#[derive(Clone, Default, PartialEq)]
10851#[non_exhaustive]
10852pub struct SalesforceObject {
10853    /// Object name.
10854    pub object_name: std::string::String,
10855
10856    /// Salesforce fields.
10857    /// When unspecified as part of include objects,
10858    /// includes everything, when unspecified as part of exclude objects,
10859    /// excludes nothing.
10860    pub fields: std::vec::Vec<crate::model::SalesforceField>,
10861
10862    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10863}
10864
10865impl SalesforceObject {
10866    /// Creates a new default instance.
10867    pub fn new() -> Self {
10868        std::default::Default::default()
10869    }
10870
10871    /// Sets the value of [object_name][crate::model::SalesforceObject::object_name].
10872    ///
10873    /// # Example
10874    /// ```ignore,no_run
10875    /// # use google_cloud_datastream_v1::model::SalesforceObject;
10876    /// let x = SalesforceObject::new().set_object_name("example");
10877    /// ```
10878    pub fn set_object_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10879        self.object_name = v.into();
10880        self
10881    }
10882
10883    /// Sets the value of [fields][crate::model::SalesforceObject::fields].
10884    ///
10885    /// # Example
10886    /// ```ignore,no_run
10887    /// # use google_cloud_datastream_v1::model::SalesforceObject;
10888    /// use google_cloud_datastream_v1::model::SalesforceField;
10889    /// let x = SalesforceObject::new()
10890    ///     .set_fields([
10891    ///         SalesforceField::default()/* use setters */,
10892    ///         SalesforceField::default()/* use (different) setters */,
10893    ///     ]);
10894    /// ```
10895    pub fn set_fields<T, V>(mut self, v: T) -> Self
10896    where
10897        T: std::iter::IntoIterator<Item = V>,
10898        V: std::convert::Into<crate::model::SalesforceField>,
10899    {
10900        use std::iter::Iterator;
10901        self.fields = v.into_iter().map(|i| i.into()).collect();
10902        self
10903    }
10904}
10905
10906impl wkt::message::Message for SalesforceObject {
10907    fn typename() -> &'static str {
10908        "type.googleapis.com/google.cloud.datastream.v1.SalesforceObject"
10909    }
10910}
10911
10912/// Salesforce field.
10913#[derive(Clone, Default, PartialEq)]
10914#[non_exhaustive]
10915pub struct SalesforceField {
10916    /// Field name.
10917    pub name: std::string::String,
10918
10919    /// The data type.
10920    pub data_type: std::string::String,
10921
10922    /// Indicates whether the field can accept nil values.
10923    pub nillable: bool,
10924
10925    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10926}
10927
10928impl SalesforceField {
10929    /// Creates a new default instance.
10930    pub fn new() -> Self {
10931        std::default::Default::default()
10932    }
10933
10934    /// Sets the value of [name][crate::model::SalesforceField::name].
10935    ///
10936    /// # Example
10937    /// ```ignore,no_run
10938    /// # use google_cloud_datastream_v1::model::SalesforceField;
10939    /// let x = SalesforceField::new().set_name("example");
10940    /// ```
10941    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10942        self.name = v.into();
10943        self
10944    }
10945
10946    /// Sets the value of [data_type][crate::model::SalesforceField::data_type].
10947    ///
10948    /// # Example
10949    /// ```ignore,no_run
10950    /// # use google_cloud_datastream_v1::model::SalesforceField;
10951    /// let x = SalesforceField::new().set_data_type("example");
10952    /// ```
10953    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10954        self.data_type = v.into();
10955        self
10956    }
10957
10958    /// Sets the value of [nillable][crate::model::SalesforceField::nillable].
10959    ///
10960    /// # Example
10961    /// ```ignore,no_run
10962    /// # use google_cloud_datastream_v1::model::SalesforceField;
10963    /// let x = SalesforceField::new().set_nillable(true);
10964    /// ```
10965    pub fn set_nillable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10966        self.nillable = v.into();
10967        self
10968    }
10969}
10970
10971impl wkt::message::Message for SalesforceField {
10972    fn typename() -> &'static str {
10973        "type.googleapis.com/google.cloud.datastream.v1.SalesforceField"
10974    }
10975}
10976
10977/// MongoDB source configuration.
10978#[derive(Clone, Default, PartialEq)]
10979#[non_exhaustive]
10980pub struct MongodbSourceConfig {
10981    /// MongoDB collections to include in the stream.
10982    pub include_objects: std::option::Option<crate::model::MongodbCluster>,
10983
10984    /// MongoDB collections to exclude from the stream.
10985    pub exclude_objects: std::option::Option<crate::model::MongodbCluster>,
10986
10987    /// Optional. Maximum number of concurrent backfill tasks. The number should be
10988    /// non-negative and less than or equal to 50. If not set (or set to 0), the
10989    /// system's default value is used
10990    pub max_concurrent_backfill_tasks: i32,
10991
10992    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10993}
10994
10995impl MongodbSourceConfig {
10996    /// Creates a new default instance.
10997    pub fn new() -> Self {
10998        std::default::Default::default()
10999    }
11000
11001    /// Sets the value of [include_objects][crate::model::MongodbSourceConfig::include_objects].
11002    ///
11003    /// # Example
11004    /// ```ignore,no_run
11005    /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
11006    /// use google_cloud_datastream_v1::model::MongodbCluster;
11007    /// let x = MongodbSourceConfig::new().set_include_objects(MongodbCluster::default()/* use setters */);
11008    /// ```
11009    pub fn set_include_objects<T>(mut self, v: T) -> Self
11010    where
11011        T: std::convert::Into<crate::model::MongodbCluster>,
11012    {
11013        self.include_objects = std::option::Option::Some(v.into());
11014        self
11015    }
11016
11017    /// Sets or clears the value of [include_objects][crate::model::MongodbSourceConfig::include_objects].
11018    ///
11019    /// # Example
11020    /// ```ignore,no_run
11021    /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
11022    /// use google_cloud_datastream_v1::model::MongodbCluster;
11023    /// let x = MongodbSourceConfig::new().set_or_clear_include_objects(Some(MongodbCluster::default()/* use setters */));
11024    /// let x = MongodbSourceConfig::new().set_or_clear_include_objects(None::<MongodbCluster>);
11025    /// ```
11026    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
11027    where
11028        T: std::convert::Into<crate::model::MongodbCluster>,
11029    {
11030        self.include_objects = v.map(|x| x.into());
11031        self
11032    }
11033
11034    /// Sets the value of [exclude_objects][crate::model::MongodbSourceConfig::exclude_objects].
11035    ///
11036    /// # Example
11037    /// ```ignore,no_run
11038    /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
11039    /// use google_cloud_datastream_v1::model::MongodbCluster;
11040    /// let x = MongodbSourceConfig::new().set_exclude_objects(MongodbCluster::default()/* use setters */);
11041    /// ```
11042    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
11043    where
11044        T: std::convert::Into<crate::model::MongodbCluster>,
11045    {
11046        self.exclude_objects = std::option::Option::Some(v.into());
11047        self
11048    }
11049
11050    /// Sets or clears the value of [exclude_objects][crate::model::MongodbSourceConfig::exclude_objects].
11051    ///
11052    /// # Example
11053    /// ```ignore,no_run
11054    /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
11055    /// use google_cloud_datastream_v1::model::MongodbCluster;
11056    /// let x = MongodbSourceConfig::new().set_or_clear_exclude_objects(Some(MongodbCluster::default()/* use setters */));
11057    /// let x = MongodbSourceConfig::new().set_or_clear_exclude_objects(None::<MongodbCluster>);
11058    /// ```
11059    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
11060    where
11061        T: std::convert::Into<crate::model::MongodbCluster>,
11062    {
11063        self.exclude_objects = v.map(|x| x.into());
11064        self
11065    }
11066
11067    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::MongodbSourceConfig::max_concurrent_backfill_tasks].
11068    ///
11069    /// # Example
11070    /// ```ignore,no_run
11071    /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
11072    /// let x = MongodbSourceConfig::new().set_max_concurrent_backfill_tasks(42);
11073    /// ```
11074    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11075        self.max_concurrent_backfill_tasks = v.into();
11076        self
11077    }
11078}
11079
11080impl wkt::message::Message for MongodbSourceConfig {
11081    fn typename() -> &'static str {
11082        "type.googleapis.com/google.cloud.datastream.v1.MongodbSourceConfig"
11083    }
11084}
11085
11086/// MongoDB Cluster structure.
11087#[derive(Clone, Default, PartialEq)]
11088#[non_exhaustive]
11089pub struct MongodbCluster {
11090    /// MongoDB databases in the cluster.
11091    pub databases: std::vec::Vec<crate::model::MongodbDatabase>,
11092
11093    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11094}
11095
11096impl MongodbCluster {
11097    /// Creates a new default instance.
11098    pub fn new() -> Self {
11099        std::default::Default::default()
11100    }
11101
11102    /// Sets the value of [databases][crate::model::MongodbCluster::databases].
11103    ///
11104    /// # Example
11105    /// ```ignore,no_run
11106    /// # use google_cloud_datastream_v1::model::MongodbCluster;
11107    /// use google_cloud_datastream_v1::model::MongodbDatabase;
11108    /// let x = MongodbCluster::new()
11109    ///     .set_databases([
11110    ///         MongodbDatabase::default()/* use setters */,
11111    ///         MongodbDatabase::default()/* use (different) setters */,
11112    ///     ]);
11113    /// ```
11114    pub fn set_databases<T, V>(mut self, v: T) -> Self
11115    where
11116        T: std::iter::IntoIterator<Item = V>,
11117        V: std::convert::Into<crate::model::MongodbDatabase>,
11118    {
11119        use std::iter::Iterator;
11120        self.databases = v.into_iter().map(|i| i.into()).collect();
11121        self
11122    }
11123}
11124
11125impl wkt::message::Message for MongodbCluster {
11126    fn typename() -> &'static str {
11127        "type.googleapis.com/google.cloud.datastream.v1.MongodbCluster"
11128    }
11129}
11130
11131/// MongoDB Database.
11132#[derive(Clone, Default, PartialEq)]
11133#[non_exhaustive]
11134pub struct MongodbDatabase {
11135    /// Database name.
11136    pub database: std::string::String,
11137
11138    /// Collections in the database.
11139    pub collections: std::vec::Vec<crate::model::MongodbCollection>,
11140
11141    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11142}
11143
11144impl MongodbDatabase {
11145    /// Creates a new default instance.
11146    pub fn new() -> Self {
11147        std::default::Default::default()
11148    }
11149
11150    /// Sets the value of [database][crate::model::MongodbDatabase::database].
11151    ///
11152    /// # Example
11153    /// ```ignore,no_run
11154    /// # use google_cloud_datastream_v1::model::MongodbDatabase;
11155    /// let x = MongodbDatabase::new().set_database("example");
11156    /// ```
11157    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11158        self.database = v.into();
11159        self
11160    }
11161
11162    /// Sets the value of [collections][crate::model::MongodbDatabase::collections].
11163    ///
11164    /// # Example
11165    /// ```ignore,no_run
11166    /// # use google_cloud_datastream_v1::model::MongodbDatabase;
11167    /// use google_cloud_datastream_v1::model::MongodbCollection;
11168    /// let x = MongodbDatabase::new()
11169    ///     .set_collections([
11170    ///         MongodbCollection::default()/* use setters */,
11171    ///         MongodbCollection::default()/* use (different) setters */,
11172    ///     ]);
11173    /// ```
11174    pub fn set_collections<T, V>(mut self, v: T) -> Self
11175    where
11176        T: std::iter::IntoIterator<Item = V>,
11177        V: std::convert::Into<crate::model::MongodbCollection>,
11178    {
11179        use std::iter::Iterator;
11180        self.collections = v.into_iter().map(|i| i.into()).collect();
11181        self
11182    }
11183}
11184
11185impl wkt::message::Message for MongodbDatabase {
11186    fn typename() -> &'static str {
11187        "type.googleapis.com/google.cloud.datastream.v1.MongodbDatabase"
11188    }
11189}
11190
11191/// MongoDB Collection.
11192#[derive(Clone, Default, PartialEq)]
11193#[non_exhaustive]
11194pub struct MongodbCollection {
11195    /// Collection name.
11196    pub collection: std::string::String,
11197
11198    /// Fields in the collection.
11199    pub fields: std::vec::Vec<crate::model::MongodbField>,
11200
11201    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11202}
11203
11204impl MongodbCollection {
11205    /// Creates a new default instance.
11206    pub fn new() -> Self {
11207        std::default::Default::default()
11208    }
11209
11210    /// Sets the value of [collection][crate::model::MongodbCollection::collection].
11211    ///
11212    /// # Example
11213    /// ```ignore,no_run
11214    /// # use google_cloud_datastream_v1::model::MongodbCollection;
11215    /// let x = MongodbCollection::new().set_collection("example");
11216    /// ```
11217    pub fn set_collection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11218        self.collection = v.into();
11219        self
11220    }
11221
11222    /// Sets the value of [fields][crate::model::MongodbCollection::fields].
11223    ///
11224    /// # Example
11225    /// ```ignore,no_run
11226    /// # use google_cloud_datastream_v1::model::MongodbCollection;
11227    /// use google_cloud_datastream_v1::model::MongodbField;
11228    /// let x = MongodbCollection::new()
11229    ///     .set_fields([
11230    ///         MongodbField::default()/* use setters */,
11231    ///         MongodbField::default()/* use (different) setters */,
11232    ///     ]);
11233    /// ```
11234    pub fn set_fields<T, V>(mut self, v: T) -> Self
11235    where
11236        T: std::iter::IntoIterator<Item = V>,
11237        V: std::convert::Into<crate::model::MongodbField>,
11238    {
11239        use std::iter::Iterator;
11240        self.fields = v.into_iter().map(|i| i.into()).collect();
11241        self
11242    }
11243}
11244
11245impl wkt::message::Message for MongodbCollection {
11246    fn typename() -> &'static str {
11247        "type.googleapis.com/google.cloud.datastream.v1.MongodbCollection"
11248    }
11249}
11250
11251/// MongoDB Field.
11252#[derive(Clone, Default, PartialEq)]
11253#[non_exhaustive]
11254pub struct MongodbField {
11255    /// Field name.
11256    pub field: std::string::String,
11257
11258    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11259}
11260
11261impl MongodbField {
11262    /// Creates a new default instance.
11263    pub fn new() -> Self {
11264        std::default::Default::default()
11265    }
11266
11267    /// Sets the value of [field][crate::model::MongodbField::field].
11268    ///
11269    /// # Example
11270    /// ```ignore,no_run
11271    /// # use google_cloud_datastream_v1::model::MongodbField;
11272    /// let x = MongodbField::new().set_field("example");
11273    /// ```
11274    pub fn set_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11275        self.field = v.into();
11276        self
11277    }
11278}
11279
11280impl wkt::message::Message for MongodbField {
11281    fn typename() -> &'static str {
11282        "type.googleapis.com/google.cloud.datastream.v1.MongodbField"
11283    }
11284}
11285
11286/// The configuration of the stream source.
11287#[derive(Clone, Default, PartialEq)]
11288#[non_exhaustive]
11289pub struct SourceConfig {
11290    /// Required. Source connection profile resource.
11291    /// Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
11292    pub source_connection_profile: std::string::String,
11293
11294    /// Stream configuration that is specific to the data source type.
11295    pub source_stream_config: std::option::Option<crate::model::source_config::SourceStreamConfig>,
11296
11297    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11298}
11299
11300impl SourceConfig {
11301    /// Creates a new default instance.
11302    pub fn new() -> Self {
11303        std::default::Default::default()
11304    }
11305
11306    /// Sets the value of [source_connection_profile][crate::model::SourceConfig::source_connection_profile].
11307    ///
11308    /// # Example
11309    /// ```ignore,no_run
11310    /// # use google_cloud_datastream_v1::model::SourceConfig;
11311    /// # let project_id = "project_id";
11312    /// # let location_id = "location_id";
11313    /// # let connection_profile_id = "connection_profile_id";
11314    /// let x = SourceConfig::new().set_source_connection_profile(format!("projects/{project_id}/locations/{location_id}/connectionProfiles/{connection_profile_id}"));
11315    /// ```
11316    pub fn set_source_connection_profile<T: std::convert::Into<std::string::String>>(
11317        mut self,
11318        v: T,
11319    ) -> Self {
11320        self.source_connection_profile = v.into();
11321        self
11322    }
11323
11324    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config].
11325    ///
11326    /// Note that all the setters affecting `source_stream_config` are mutually
11327    /// exclusive.
11328    ///
11329    /// # Example
11330    /// ```ignore,no_run
11331    /// # use google_cloud_datastream_v1::model::SourceConfig;
11332    /// use google_cloud_datastream_v1::model::OracleSourceConfig;
11333    /// let x = SourceConfig::new().set_source_stream_config(Some(
11334    ///     google_cloud_datastream_v1::model::source_config::SourceStreamConfig::OracleSourceConfig(OracleSourceConfig::default().into())));
11335    /// ```
11336    pub fn set_source_stream_config<
11337        T: std::convert::Into<std::option::Option<crate::model::source_config::SourceStreamConfig>>,
11338    >(
11339        mut self,
11340        v: T,
11341    ) -> Self {
11342        self.source_stream_config = v.into();
11343        self
11344    }
11345
11346    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11347    /// if it holds a `OracleSourceConfig`, `None` if the field is not set or
11348    /// holds a different branch.
11349    pub fn oracle_source_config(
11350        &self,
11351    ) -> std::option::Option<&std::boxed::Box<crate::model::OracleSourceConfig>> {
11352        #[allow(unreachable_patterns)]
11353        self.source_stream_config.as_ref().and_then(|v| match v {
11354            crate::model::source_config::SourceStreamConfig::OracleSourceConfig(v) => {
11355                std::option::Option::Some(v)
11356            }
11357            _ => std::option::Option::None,
11358        })
11359    }
11360
11361    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11362    /// to hold a `OracleSourceConfig`.
11363    ///
11364    /// Note that all the setters affecting `source_stream_config` are
11365    /// mutually exclusive.
11366    ///
11367    /// # Example
11368    /// ```ignore,no_run
11369    /// # use google_cloud_datastream_v1::model::SourceConfig;
11370    /// use google_cloud_datastream_v1::model::OracleSourceConfig;
11371    /// let x = SourceConfig::new().set_oracle_source_config(OracleSourceConfig::default()/* use setters */);
11372    /// assert!(x.oracle_source_config().is_some());
11373    /// assert!(x.mysql_source_config().is_none());
11374    /// assert!(x.postgresql_source_config().is_none());
11375    /// assert!(x.sql_server_source_config().is_none());
11376    /// assert!(x.salesforce_source_config().is_none());
11377    /// assert!(x.mongodb_source_config().is_none());
11378    /// ```
11379    pub fn set_oracle_source_config<
11380        T: std::convert::Into<std::boxed::Box<crate::model::OracleSourceConfig>>,
11381    >(
11382        mut self,
11383        v: T,
11384    ) -> Self {
11385        self.source_stream_config = std::option::Option::Some(
11386            crate::model::source_config::SourceStreamConfig::OracleSourceConfig(v.into()),
11387        );
11388        self
11389    }
11390
11391    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11392    /// if it holds a `MysqlSourceConfig`, `None` if the field is not set or
11393    /// holds a different branch.
11394    pub fn mysql_source_config(
11395        &self,
11396    ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlSourceConfig>> {
11397        #[allow(unreachable_patterns)]
11398        self.source_stream_config.as_ref().and_then(|v| match v {
11399            crate::model::source_config::SourceStreamConfig::MysqlSourceConfig(v) => {
11400                std::option::Option::Some(v)
11401            }
11402            _ => std::option::Option::None,
11403        })
11404    }
11405
11406    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11407    /// to hold a `MysqlSourceConfig`.
11408    ///
11409    /// Note that all the setters affecting `source_stream_config` are
11410    /// mutually exclusive.
11411    ///
11412    /// # Example
11413    /// ```ignore,no_run
11414    /// # use google_cloud_datastream_v1::model::SourceConfig;
11415    /// use google_cloud_datastream_v1::model::MysqlSourceConfig;
11416    /// let x = SourceConfig::new().set_mysql_source_config(MysqlSourceConfig::default()/* use setters */);
11417    /// assert!(x.mysql_source_config().is_some());
11418    /// assert!(x.oracle_source_config().is_none());
11419    /// assert!(x.postgresql_source_config().is_none());
11420    /// assert!(x.sql_server_source_config().is_none());
11421    /// assert!(x.salesforce_source_config().is_none());
11422    /// assert!(x.mongodb_source_config().is_none());
11423    /// ```
11424    pub fn set_mysql_source_config<
11425        T: std::convert::Into<std::boxed::Box<crate::model::MysqlSourceConfig>>,
11426    >(
11427        mut self,
11428        v: T,
11429    ) -> Self {
11430        self.source_stream_config = std::option::Option::Some(
11431            crate::model::source_config::SourceStreamConfig::MysqlSourceConfig(v.into()),
11432        );
11433        self
11434    }
11435
11436    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11437    /// if it holds a `PostgresqlSourceConfig`, `None` if the field is not set or
11438    /// holds a different branch.
11439    pub fn postgresql_source_config(
11440        &self,
11441    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlSourceConfig>> {
11442        #[allow(unreachable_patterns)]
11443        self.source_stream_config.as_ref().and_then(|v| match v {
11444            crate::model::source_config::SourceStreamConfig::PostgresqlSourceConfig(v) => {
11445                std::option::Option::Some(v)
11446            }
11447            _ => std::option::Option::None,
11448        })
11449    }
11450
11451    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11452    /// to hold a `PostgresqlSourceConfig`.
11453    ///
11454    /// Note that all the setters affecting `source_stream_config` are
11455    /// mutually exclusive.
11456    ///
11457    /// # Example
11458    /// ```ignore,no_run
11459    /// # use google_cloud_datastream_v1::model::SourceConfig;
11460    /// use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
11461    /// let x = SourceConfig::new().set_postgresql_source_config(PostgresqlSourceConfig::default()/* use setters */);
11462    /// assert!(x.postgresql_source_config().is_some());
11463    /// assert!(x.oracle_source_config().is_none());
11464    /// assert!(x.mysql_source_config().is_none());
11465    /// assert!(x.sql_server_source_config().is_none());
11466    /// assert!(x.salesforce_source_config().is_none());
11467    /// assert!(x.mongodb_source_config().is_none());
11468    /// ```
11469    pub fn set_postgresql_source_config<
11470        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlSourceConfig>>,
11471    >(
11472        mut self,
11473        v: T,
11474    ) -> Self {
11475        self.source_stream_config = std::option::Option::Some(
11476            crate::model::source_config::SourceStreamConfig::PostgresqlSourceConfig(v.into()),
11477        );
11478        self
11479    }
11480
11481    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11482    /// if it holds a `SqlServerSourceConfig`, `None` if the field is not set or
11483    /// holds a different branch.
11484    pub fn sql_server_source_config(
11485        &self,
11486    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerSourceConfig>> {
11487        #[allow(unreachable_patterns)]
11488        self.source_stream_config.as_ref().and_then(|v| match v {
11489            crate::model::source_config::SourceStreamConfig::SqlServerSourceConfig(v) => {
11490                std::option::Option::Some(v)
11491            }
11492            _ => std::option::Option::None,
11493        })
11494    }
11495
11496    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11497    /// to hold a `SqlServerSourceConfig`.
11498    ///
11499    /// Note that all the setters affecting `source_stream_config` are
11500    /// mutually exclusive.
11501    ///
11502    /// # Example
11503    /// ```ignore,no_run
11504    /// # use google_cloud_datastream_v1::model::SourceConfig;
11505    /// use google_cloud_datastream_v1::model::SqlServerSourceConfig;
11506    /// let x = SourceConfig::new().set_sql_server_source_config(SqlServerSourceConfig::default()/* use setters */);
11507    /// assert!(x.sql_server_source_config().is_some());
11508    /// assert!(x.oracle_source_config().is_none());
11509    /// assert!(x.mysql_source_config().is_none());
11510    /// assert!(x.postgresql_source_config().is_none());
11511    /// assert!(x.salesforce_source_config().is_none());
11512    /// assert!(x.mongodb_source_config().is_none());
11513    /// ```
11514    pub fn set_sql_server_source_config<
11515        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerSourceConfig>>,
11516    >(
11517        mut self,
11518        v: T,
11519    ) -> Self {
11520        self.source_stream_config = std::option::Option::Some(
11521            crate::model::source_config::SourceStreamConfig::SqlServerSourceConfig(v.into()),
11522        );
11523        self
11524    }
11525
11526    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11527    /// if it holds a `SalesforceSourceConfig`, `None` if the field is not set or
11528    /// holds a different branch.
11529    pub fn salesforce_source_config(
11530        &self,
11531    ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceSourceConfig>> {
11532        #[allow(unreachable_patterns)]
11533        self.source_stream_config.as_ref().and_then(|v| match v {
11534            crate::model::source_config::SourceStreamConfig::SalesforceSourceConfig(v) => {
11535                std::option::Option::Some(v)
11536            }
11537            _ => std::option::Option::None,
11538        })
11539    }
11540
11541    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11542    /// to hold a `SalesforceSourceConfig`.
11543    ///
11544    /// Note that all the setters affecting `source_stream_config` are
11545    /// mutually exclusive.
11546    ///
11547    /// # Example
11548    /// ```ignore,no_run
11549    /// # use google_cloud_datastream_v1::model::SourceConfig;
11550    /// use google_cloud_datastream_v1::model::SalesforceSourceConfig;
11551    /// let x = SourceConfig::new().set_salesforce_source_config(SalesforceSourceConfig::default()/* use setters */);
11552    /// assert!(x.salesforce_source_config().is_some());
11553    /// assert!(x.oracle_source_config().is_none());
11554    /// assert!(x.mysql_source_config().is_none());
11555    /// assert!(x.postgresql_source_config().is_none());
11556    /// assert!(x.sql_server_source_config().is_none());
11557    /// assert!(x.mongodb_source_config().is_none());
11558    /// ```
11559    pub fn set_salesforce_source_config<
11560        T: std::convert::Into<std::boxed::Box<crate::model::SalesforceSourceConfig>>,
11561    >(
11562        mut self,
11563        v: T,
11564    ) -> Self {
11565        self.source_stream_config = std::option::Option::Some(
11566            crate::model::source_config::SourceStreamConfig::SalesforceSourceConfig(v.into()),
11567        );
11568        self
11569    }
11570
11571    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11572    /// if it holds a `MongodbSourceConfig`, `None` if the field is not set or
11573    /// holds a different branch.
11574    pub fn mongodb_source_config(
11575        &self,
11576    ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbSourceConfig>> {
11577        #[allow(unreachable_patterns)]
11578        self.source_stream_config.as_ref().and_then(|v| match v {
11579            crate::model::source_config::SourceStreamConfig::MongodbSourceConfig(v) => {
11580                std::option::Option::Some(v)
11581            }
11582            _ => std::option::Option::None,
11583        })
11584    }
11585
11586    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11587    /// to hold a `MongodbSourceConfig`.
11588    ///
11589    /// Note that all the setters affecting `source_stream_config` are
11590    /// mutually exclusive.
11591    ///
11592    /// # Example
11593    /// ```ignore,no_run
11594    /// # use google_cloud_datastream_v1::model::SourceConfig;
11595    /// use google_cloud_datastream_v1::model::MongodbSourceConfig;
11596    /// let x = SourceConfig::new().set_mongodb_source_config(MongodbSourceConfig::default()/* use setters */);
11597    /// assert!(x.mongodb_source_config().is_some());
11598    /// assert!(x.oracle_source_config().is_none());
11599    /// assert!(x.mysql_source_config().is_none());
11600    /// assert!(x.postgresql_source_config().is_none());
11601    /// assert!(x.sql_server_source_config().is_none());
11602    /// assert!(x.salesforce_source_config().is_none());
11603    /// ```
11604    pub fn set_mongodb_source_config<
11605        T: std::convert::Into<std::boxed::Box<crate::model::MongodbSourceConfig>>,
11606    >(
11607        mut self,
11608        v: T,
11609    ) -> Self {
11610        self.source_stream_config = std::option::Option::Some(
11611            crate::model::source_config::SourceStreamConfig::MongodbSourceConfig(v.into()),
11612        );
11613        self
11614    }
11615}
11616
11617impl wkt::message::Message for SourceConfig {
11618    fn typename() -> &'static str {
11619        "type.googleapis.com/google.cloud.datastream.v1.SourceConfig"
11620    }
11621}
11622
11623/// Defines additional types related to [SourceConfig].
11624pub mod source_config {
11625    #[allow(unused_imports)]
11626    use super::*;
11627
11628    /// Stream configuration that is specific to the data source type.
11629    #[derive(Clone, Debug, PartialEq)]
11630    #[non_exhaustive]
11631    pub enum SourceStreamConfig {
11632        /// Oracle data source configuration.
11633        OracleSourceConfig(std::boxed::Box<crate::model::OracleSourceConfig>),
11634        /// MySQL data source configuration.
11635        MysqlSourceConfig(std::boxed::Box<crate::model::MysqlSourceConfig>),
11636        /// PostgreSQL data source configuration.
11637        PostgresqlSourceConfig(std::boxed::Box<crate::model::PostgresqlSourceConfig>),
11638        /// SQLServer data source configuration.
11639        SqlServerSourceConfig(std::boxed::Box<crate::model::SqlServerSourceConfig>),
11640        /// Salesforce data source configuration.
11641        SalesforceSourceConfig(std::boxed::Box<crate::model::SalesforceSourceConfig>),
11642        /// MongoDB data source configuration.
11643        MongodbSourceConfig(std::boxed::Box<crate::model::MongodbSourceConfig>),
11644    }
11645}
11646
11647/// AVRO file format configuration.
11648#[derive(Clone, Default, PartialEq)]
11649#[non_exhaustive]
11650pub struct AvroFileFormat {
11651    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11652}
11653
11654impl AvroFileFormat {
11655    /// Creates a new default instance.
11656    pub fn new() -> Self {
11657        std::default::Default::default()
11658    }
11659}
11660
11661impl wkt::message::Message for AvroFileFormat {
11662    fn typename() -> &'static str {
11663        "type.googleapis.com/google.cloud.datastream.v1.AvroFileFormat"
11664    }
11665}
11666
11667/// JSON file format configuration.
11668#[derive(Clone, Default, PartialEq)]
11669#[non_exhaustive]
11670pub struct JsonFileFormat {
11671    /// The schema file format along JSON data files.
11672    pub schema_file_format: crate::model::json_file_format::SchemaFileFormat,
11673
11674    /// Compression of the loaded JSON file.
11675    pub compression: crate::model::json_file_format::JsonCompression,
11676
11677    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11678}
11679
11680impl JsonFileFormat {
11681    /// Creates a new default instance.
11682    pub fn new() -> Self {
11683        std::default::Default::default()
11684    }
11685
11686    /// Sets the value of [schema_file_format][crate::model::JsonFileFormat::schema_file_format].
11687    ///
11688    /// # Example
11689    /// ```ignore,no_run
11690    /// # use google_cloud_datastream_v1::model::JsonFileFormat;
11691    /// use google_cloud_datastream_v1::model::json_file_format::SchemaFileFormat;
11692    /// let x0 = JsonFileFormat::new().set_schema_file_format(SchemaFileFormat::NoSchemaFile);
11693    /// let x1 = JsonFileFormat::new().set_schema_file_format(SchemaFileFormat::AvroSchemaFile);
11694    /// ```
11695    pub fn set_schema_file_format<
11696        T: std::convert::Into<crate::model::json_file_format::SchemaFileFormat>,
11697    >(
11698        mut self,
11699        v: T,
11700    ) -> Self {
11701        self.schema_file_format = v.into();
11702        self
11703    }
11704
11705    /// Sets the value of [compression][crate::model::JsonFileFormat::compression].
11706    ///
11707    /// # Example
11708    /// ```ignore,no_run
11709    /// # use google_cloud_datastream_v1::model::JsonFileFormat;
11710    /// use google_cloud_datastream_v1::model::json_file_format::JsonCompression;
11711    /// let x0 = JsonFileFormat::new().set_compression(JsonCompression::NoCompression);
11712    /// let x1 = JsonFileFormat::new().set_compression(JsonCompression::Gzip);
11713    /// ```
11714    pub fn set_compression<
11715        T: std::convert::Into<crate::model::json_file_format::JsonCompression>,
11716    >(
11717        mut self,
11718        v: T,
11719    ) -> Self {
11720        self.compression = v.into();
11721        self
11722    }
11723}
11724
11725impl wkt::message::Message for JsonFileFormat {
11726    fn typename() -> &'static str {
11727        "type.googleapis.com/google.cloud.datastream.v1.JsonFileFormat"
11728    }
11729}
11730
11731/// Defines additional types related to [JsonFileFormat].
11732pub mod json_file_format {
11733    #[allow(unused_imports)]
11734    use super::*;
11735
11736    /// Schema file format.
11737    ///
11738    /// # Working with unknown values
11739    ///
11740    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11741    /// additional enum variants at any time. Adding new variants is not considered
11742    /// a breaking change. Applications should write their code in anticipation of:
11743    ///
11744    /// - New values appearing in future releases of the client library, **and**
11745    /// - New values received dynamically, without application changes.
11746    ///
11747    /// Please consult the [Working with enums] section in the user guide for some
11748    /// guidelines.
11749    ///
11750    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11751    #[derive(Clone, Debug, PartialEq)]
11752    #[non_exhaustive]
11753    pub enum SchemaFileFormat {
11754        /// Unspecified schema file format.
11755        Unspecified,
11756        /// Do not attach schema file.
11757        NoSchemaFile,
11758        /// Avro schema format.
11759        AvroSchemaFile,
11760        /// If set, the enum was initialized with an unknown value.
11761        ///
11762        /// Applications can examine the value using [SchemaFileFormat::value] or
11763        /// [SchemaFileFormat::name].
11764        UnknownValue(schema_file_format::UnknownValue),
11765    }
11766
11767    #[doc(hidden)]
11768    pub mod schema_file_format {
11769        #[allow(unused_imports)]
11770        use super::*;
11771        #[derive(Clone, Debug, PartialEq)]
11772        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11773    }
11774
11775    impl SchemaFileFormat {
11776        /// Gets the enum value.
11777        ///
11778        /// Returns `None` if the enum contains an unknown value deserialized from
11779        /// the string representation of enums.
11780        pub fn value(&self) -> std::option::Option<i32> {
11781            match self {
11782                Self::Unspecified => std::option::Option::Some(0),
11783                Self::NoSchemaFile => std::option::Option::Some(1),
11784                Self::AvroSchemaFile => std::option::Option::Some(2),
11785                Self::UnknownValue(u) => u.0.value(),
11786            }
11787        }
11788
11789        /// Gets the enum value as a string.
11790        ///
11791        /// Returns `None` if the enum contains an unknown value deserialized from
11792        /// the integer representation of enums.
11793        pub fn name(&self) -> std::option::Option<&str> {
11794            match self {
11795                Self::Unspecified => std::option::Option::Some("SCHEMA_FILE_FORMAT_UNSPECIFIED"),
11796                Self::NoSchemaFile => std::option::Option::Some("NO_SCHEMA_FILE"),
11797                Self::AvroSchemaFile => std::option::Option::Some("AVRO_SCHEMA_FILE"),
11798                Self::UnknownValue(u) => u.0.name(),
11799            }
11800        }
11801    }
11802
11803    impl std::default::Default for SchemaFileFormat {
11804        fn default() -> Self {
11805            use std::convert::From;
11806            Self::from(0)
11807        }
11808    }
11809
11810    impl std::fmt::Display for SchemaFileFormat {
11811        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11812            wkt::internal::display_enum(f, self.name(), self.value())
11813        }
11814    }
11815
11816    impl std::convert::From<i32> for SchemaFileFormat {
11817        fn from(value: i32) -> Self {
11818            match value {
11819                0 => Self::Unspecified,
11820                1 => Self::NoSchemaFile,
11821                2 => Self::AvroSchemaFile,
11822                _ => Self::UnknownValue(schema_file_format::UnknownValue(
11823                    wkt::internal::UnknownEnumValue::Integer(value),
11824                )),
11825            }
11826        }
11827    }
11828
11829    impl std::convert::From<&str> for SchemaFileFormat {
11830        fn from(value: &str) -> Self {
11831            use std::string::ToString;
11832            match value {
11833                "SCHEMA_FILE_FORMAT_UNSPECIFIED" => Self::Unspecified,
11834                "NO_SCHEMA_FILE" => Self::NoSchemaFile,
11835                "AVRO_SCHEMA_FILE" => Self::AvroSchemaFile,
11836                _ => Self::UnknownValue(schema_file_format::UnknownValue(
11837                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11838                )),
11839            }
11840        }
11841    }
11842
11843    impl serde::ser::Serialize for SchemaFileFormat {
11844        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11845        where
11846            S: serde::Serializer,
11847        {
11848            match self {
11849                Self::Unspecified => serializer.serialize_i32(0),
11850                Self::NoSchemaFile => serializer.serialize_i32(1),
11851                Self::AvroSchemaFile => serializer.serialize_i32(2),
11852                Self::UnknownValue(u) => u.0.serialize(serializer),
11853            }
11854        }
11855    }
11856
11857    impl<'de> serde::de::Deserialize<'de> for SchemaFileFormat {
11858        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11859        where
11860            D: serde::Deserializer<'de>,
11861        {
11862            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SchemaFileFormat>::new(
11863                ".google.cloud.datastream.v1.JsonFileFormat.SchemaFileFormat",
11864            ))
11865        }
11866    }
11867
11868    /// Json file compression.
11869    ///
11870    /// # Working with unknown values
11871    ///
11872    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11873    /// additional enum variants at any time. Adding new variants is not considered
11874    /// a breaking change. Applications should write their code in anticipation of:
11875    ///
11876    /// - New values appearing in future releases of the client library, **and**
11877    /// - New values received dynamically, without application changes.
11878    ///
11879    /// Please consult the [Working with enums] section in the user guide for some
11880    /// guidelines.
11881    ///
11882    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11883    #[derive(Clone, Debug, PartialEq)]
11884    #[non_exhaustive]
11885    pub enum JsonCompression {
11886        /// Unspecified json file compression.
11887        Unspecified,
11888        /// Do not compress JSON file.
11889        NoCompression,
11890        /// Gzip compression.
11891        Gzip,
11892        /// If set, the enum was initialized with an unknown value.
11893        ///
11894        /// Applications can examine the value using [JsonCompression::value] or
11895        /// [JsonCompression::name].
11896        UnknownValue(json_compression::UnknownValue),
11897    }
11898
11899    #[doc(hidden)]
11900    pub mod json_compression {
11901        #[allow(unused_imports)]
11902        use super::*;
11903        #[derive(Clone, Debug, PartialEq)]
11904        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11905    }
11906
11907    impl JsonCompression {
11908        /// Gets the enum value.
11909        ///
11910        /// Returns `None` if the enum contains an unknown value deserialized from
11911        /// the string representation of enums.
11912        pub fn value(&self) -> std::option::Option<i32> {
11913            match self {
11914                Self::Unspecified => std::option::Option::Some(0),
11915                Self::NoCompression => std::option::Option::Some(1),
11916                Self::Gzip => std::option::Option::Some(2),
11917                Self::UnknownValue(u) => u.0.value(),
11918            }
11919        }
11920
11921        /// Gets the enum value as a string.
11922        ///
11923        /// Returns `None` if the enum contains an unknown value deserialized from
11924        /// the integer representation of enums.
11925        pub fn name(&self) -> std::option::Option<&str> {
11926            match self {
11927                Self::Unspecified => std::option::Option::Some("JSON_COMPRESSION_UNSPECIFIED"),
11928                Self::NoCompression => std::option::Option::Some("NO_COMPRESSION"),
11929                Self::Gzip => std::option::Option::Some("GZIP"),
11930                Self::UnknownValue(u) => u.0.name(),
11931            }
11932        }
11933    }
11934
11935    impl std::default::Default for JsonCompression {
11936        fn default() -> Self {
11937            use std::convert::From;
11938            Self::from(0)
11939        }
11940    }
11941
11942    impl std::fmt::Display for JsonCompression {
11943        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11944            wkt::internal::display_enum(f, self.name(), self.value())
11945        }
11946    }
11947
11948    impl std::convert::From<i32> for JsonCompression {
11949        fn from(value: i32) -> Self {
11950            match value {
11951                0 => Self::Unspecified,
11952                1 => Self::NoCompression,
11953                2 => Self::Gzip,
11954                _ => Self::UnknownValue(json_compression::UnknownValue(
11955                    wkt::internal::UnknownEnumValue::Integer(value),
11956                )),
11957            }
11958        }
11959    }
11960
11961    impl std::convert::From<&str> for JsonCompression {
11962        fn from(value: &str) -> Self {
11963            use std::string::ToString;
11964            match value {
11965                "JSON_COMPRESSION_UNSPECIFIED" => Self::Unspecified,
11966                "NO_COMPRESSION" => Self::NoCompression,
11967                "GZIP" => Self::Gzip,
11968                _ => Self::UnknownValue(json_compression::UnknownValue(
11969                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11970                )),
11971            }
11972        }
11973    }
11974
11975    impl serde::ser::Serialize for JsonCompression {
11976        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11977        where
11978            S: serde::Serializer,
11979        {
11980            match self {
11981                Self::Unspecified => serializer.serialize_i32(0),
11982                Self::NoCompression => serializer.serialize_i32(1),
11983                Self::Gzip => serializer.serialize_i32(2),
11984                Self::UnknownValue(u) => u.0.serialize(serializer),
11985            }
11986        }
11987    }
11988
11989    impl<'de> serde::de::Deserialize<'de> for JsonCompression {
11990        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11991        where
11992            D: serde::Deserializer<'de>,
11993        {
11994            deserializer.deserialize_any(wkt::internal::EnumVisitor::<JsonCompression>::new(
11995                ".google.cloud.datastream.v1.JsonFileFormat.JsonCompression",
11996            ))
11997        }
11998    }
11999}
12000
12001/// Google Cloud Storage destination configuration
12002#[derive(Clone, Default, PartialEq)]
12003#[non_exhaustive]
12004pub struct GcsDestinationConfig {
12005    /// Path inside the Cloud Storage bucket to write data to.
12006    pub path: std::string::String,
12007
12008    /// The maximum file size to be saved in the bucket.
12009    pub file_rotation_mb: i32,
12010
12011    /// The maximum duration for which new events are added before a file is
12012    /// closed and a new file is created. Values within the range of 15-60 seconds
12013    /// are allowed.
12014    pub file_rotation_interval: std::option::Option<wkt::Duration>,
12015
12016    /// File Format that the data should be written in.
12017    pub file_format: std::option::Option<crate::model::gcs_destination_config::FileFormat>,
12018
12019    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12020}
12021
12022impl GcsDestinationConfig {
12023    /// Creates a new default instance.
12024    pub fn new() -> Self {
12025        std::default::Default::default()
12026    }
12027
12028    /// Sets the value of [path][crate::model::GcsDestinationConfig::path].
12029    ///
12030    /// # Example
12031    /// ```ignore,no_run
12032    /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
12033    /// let x = GcsDestinationConfig::new().set_path("example");
12034    /// ```
12035    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12036        self.path = v.into();
12037        self
12038    }
12039
12040    /// Sets the value of [file_rotation_mb][crate::model::GcsDestinationConfig::file_rotation_mb].
12041    ///
12042    /// # Example
12043    /// ```ignore,no_run
12044    /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
12045    /// let x = GcsDestinationConfig::new().set_file_rotation_mb(42);
12046    /// ```
12047    pub fn set_file_rotation_mb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12048        self.file_rotation_mb = v.into();
12049        self
12050    }
12051
12052    /// Sets the value of [file_rotation_interval][crate::model::GcsDestinationConfig::file_rotation_interval].
12053    ///
12054    /// # Example
12055    /// ```ignore,no_run
12056    /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
12057    /// use wkt::Duration;
12058    /// let x = GcsDestinationConfig::new().set_file_rotation_interval(Duration::default()/* use setters */);
12059    /// ```
12060    pub fn set_file_rotation_interval<T>(mut self, v: T) -> Self
12061    where
12062        T: std::convert::Into<wkt::Duration>,
12063    {
12064        self.file_rotation_interval = std::option::Option::Some(v.into());
12065        self
12066    }
12067
12068    /// Sets or clears the value of [file_rotation_interval][crate::model::GcsDestinationConfig::file_rotation_interval].
12069    ///
12070    /// # Example
12071    /// ```ignore,no_run
12072    /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
12073    /// use wkt::Duration;
12074    /// let x = GcsDestinationConfig::new().set_or_clear_file_rotation_interval(Some(Duration::default()/* use setters */));
12075    /// let x = GcsDestinationConfig::new().set_or_clear_file_rotation_interval(None::<Duration>);
12076    /// ```
12077    pub fn set_or_clear_file_rotation_interval<T>(mut self, v: std::option::Option<T>) -> Self
12078    where
12079        T: std::convert::Into<wkt::Duration>,
12080    {
12081        self.file_rotation_interval = v.map(|x| x.into());
12082        self
12083    }
12084
12085    /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format].
12086    ///
12087    /// Note that all the setters affecting `file_format` are mutually
12088    /// exclusive.
12089    ///
12090    /// # Example
12091    /// ```ignore,no_run
12092    /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
12093    /// use google_cloud_datastream_v1::model::AvroFileFormat;
12094    /// let x = GcsDestinationConfig::new().set_file_format(Some(
12095    ///     google_cloud_datastream_v1::model::gcs_destination_config::FileFormat::AvroFileFormat(AvroFileFormat::default().into())));
12096    /// ```
12097    pub fn set_file_format<
12098        T: std::convert::Into<std::option::Option<crate::model::gcs_destination_config::FileFormat>>,
12099    >(
12100        mut self,
12101        v: T,
12102    ) -> Self {
12103        self.file_format = v.into();
12104        self
12105    }
12106
12107    /// The value of [file_format][crate::model::GcsDestinationConfig::file_format]
12108    /// if it holds a `AvroFileFormat`, `None` if the field is not set or
12109    /// holds a different branch.
12110    pub fn avro_file_format(
12111        &self,
12112    ) -> std::option::Option<&std::boxed::Box<crate::model::AvroFileFormat>> {
12113        #[allow(unreachable_patterns)]
12114        self.file_format.as_ref().and_then(|v| match v {
12115            crate::model::gcs_destination_config::FileFormat::AvroFileFormat(v) => {
12116                std::option::Option::Some(v)
12117            }
12118            _ => std::option::Option::None,
12119        })
12120    }
12121
12122    /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format]
12123    /// to hold a `AvroFileFormat`.
12124    ///
12125    /// Note that all the setters affecting `file_format` are
12126    /// mutually exclusive.
12127    ///
12128    /// # Example
12129    /// ```ignore,no_run
12130    /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
12131    /// use google_cloud_datastream_v1::model::AvroFileFormat;
12132    /// let x = GcsDestinationConfig::new().set_avro_file_format(AvroFileFormat::default()/* use setters */);
12133    /// assert!(x.avro_file_format().is_some());
12134    /// assert!(x.json_file_format().is_none());
12135    /// ```
12136    pub fn set_avro_file_format<
12137        T: std::convert::Into<std::boxed::Box<crate::model::AvroFileFormat>>,
12138    >(
12139        mut self,
12140        v: T,
12141    ) -> Self {
12142        self.file_format = std::option::Option::Some(
12143            crate::model::gcs_destination_config::FileFormat::AvroFileFormat(v.into()),
12144        );
12145        self
12146    }
12147
12148    /// The value of [file_format][crate::model::GcsDestinationConfig::file_format]
12149    /// if it holds a `JsonFileFormat`, `None` if the field is not set or
12150    /// holds a different branch.
12151    pub fn json_file_format(
12152        &self,
12153    ) -> std::option::Option<&std::boxed::Box<crate::model::JsonFileFormat>> {
12154        #[allow(unreachable_patterns)]
12155        self.file_format.as_ref().and_then(|v| match v {
12156            crate::model::gcs_destination_config::FileFormat::JsonFileFormat(v) => {
12157                std::option::Option::Some(v)
12158            }
12159            _ => std::option::Option::None,
12160        })
12161    }
12162
12163    /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format]
12164    /// to hold a `JsonFileFormat`.
12165    ///
12166    /// Note that all the setters affecting `file_format` are
12167    /// mutually exclusive.
12168    ///
12169    /// # Example
12170    /// ```ignore,no_run
12171    /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
12172    /// use google_cloud_datastream_v1::model::JsonFileFormat;
12173    /// let x = GcsDestinationConfig::new().set_json_file_format(JsonFileFormat::default()/* use setters */);
12174    /// assert!(x.json_file_format().is_some());
12175    /// assert!(x.avro_file_format().is_none());
12176    /// ```
12177    pub fn set_json_file_format<
12178        T: std::convert::Into<std::boxed::Box<crate::model::JsonFileFormat>>,
12179    >(
12180        mut self,
12181        v: T,
12182    ) -> Self {
12183        self.file_format = std::option::Option::Some(
12184            crate::model::gcs_destination_config::FileFormat::JsonFileFormat(v.into()),
12185        );
12186        self
12187    }
12188}
12189
12190impl wkt::message::Message for GcsDestinationConfig {
12191    fn typename() -> &'static str {
12192        "type.googleapis.com/google.cloud.datastream.v1.GcsDestinationConfig"
12193    }
12194}
12195
12196/// Defines additional types related to [GcsDestinationConfig].
12197pub mod gcs_destination_config {
12198    #[allow(unused_imports)]
12199    use super::*;
12200
12201    /// File Format that the data should be written in.
12202    #[derive(Clone, Debug, PartialEq)]
12203    #[non_exhaustive]
12204    pub enum FileFormat {
12205        /// AVRO file format configuration.
12206        AvroFileFormat(std::boxed::Box<crate::model::AvroFileFormat>),
12207        /// JSON file format configuration.
12208        JsonFileFormat(std::boxed::Box<crate::model::JsonFileFormat>),
12209    }
12210}
12211
12212/// BigQuery destination configuration
12213#[derive(Clone, Default, PartialEq)]
12214#[non_exhaustive]
12215pub struct BigQueryDestinationConfig {
12216    /// The guaranteed data freshness (in seconds) when querying tables created by
12217    /// the stream. Editing this field will only affect new tables created in the
12218    /// future, but existing tables will not be impacted. Lower values mean that
12219    /// queries will return fresher data, but may result in higher cost.
12220    pub data_freshness: std::option::Option<wkt::Duration>,
12221
12222    /// Optional. Big Lake Managed Tables (BLMT) configuration.
12223    pub blmt_config: std::option::Option<crate::model::big_query_destination_config::BlmtConfig>,
12224
12225    /// Target dataset(s) configuration.
12226    pub dataset_config:
12227        std::option::Option<crate::model::big_query_destination_config::DatasetConfig>,
12228
12229    #[allow(missing_docs)]
12230    pub write_mode: std::option::Option<crate::model::big_query_destination_config::WriteMode>,
12231
12232    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12233}
12234
12235impl BigQueryDestinationConfig {
12236    /// Creates a new default instance.
12237    pub fn new() -> Self {
12238        std::default::Default::default()
12239    }
12240
12241    /// Sets the value of [data_freshness][crate::model::BigQueryDestinationConfig::data_freshness].
12242    ///
12243    /// # Example
12244    /// ```ignore,no_run
12245    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12246    /// use wkt::Duration;
12247    /// let x = BigQueryDestinationConfig::new().set_data_freshness(Duration::default()/* use setters */);
12248    /// ```
12249    pub fn set_data_freshness<T>(mut self, v: T) -> Self
12250    where
12251        T: std::convert::Into<wkt::Duration>,
12252    {
12253        self.data_freshness = std::option::Option::Some(v.into());
12254        self
12255    }
12256
12257    /// Sets or clears the value of [data_freshness][crate::model::BigQueryDestinationConfig::data_freshness].
12258    ///
12259    /// # Example
12260    /// ```ignore,no_run
12261    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12262    /// use wkt::Duration;
12263    /// let x = BigQueryDestinationConfig::new().set_or_clear_data_freshness(Some(Duration::default()/* use setters */));
12264    /// let x = BigQueryDestinationConfig::new().set_or_clear_data_freshness(None::<Duration>);
12265    /// ```
12266    pub fn set_or_clear_data_freshness<T>(mut self, v: std::option::Option<T>) -> Self
12267    where
12268        T: std::convert::Into<wkt::Duration>,
12269    {
12270        self.data_freshness = v.map(|x| x.into());
12271        self
12272    }
12273
12274    /// Sets the value of [blmt_config][crate::model::BigQueryDestinationConfig::blmt_config].
12275    ///
12276    /// # Example
12277    /// ```ignore,no_run
12278    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12279    /// use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12280    /// let x = BigQueryDestinationConfig::new().set_blmt_config(BlmtConfig::default()/* use setters */);
12281    /// ```
12282    pub fn set_blmt_config<T>(mut self, v: T) -> Self
12283    where
12284        T: std::convert::Into<crate::model::big_query_destination_config::BlmtConfig>,
12285    {
12286        self.blmt_config = std::option::Option::Some(v.into());
12287        self
12288    }
12289
12290    /// Sets or clears the value of [blmt_config][crate::model::BigQueryDestinationConfig::blmt_config].
12291    ///
12292    /// # Example
12293    /// ```ignore,no_run
12294    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12295    /// use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12296    /// let x = BigQueryDestinationConfig::new().set_or_clear_blmt_config(Some(BlmtConfig::default()/* use setters */));
12297    /// let x = BigQueryDestinationConfig::new().set_or_clear_blmt_config(None::<BlmtConfig>);
12298    /// ```
12299    pub fn set_or_clear_blmt_config<T>(mut self, v: std::option::Option<T>) -> Self
12300    where
12301        T: std::convert::Into<crate::model::big_query_destination_config::BlmtConfig>,
12302    {
12303        self.blmt_config = v.map(|x| x.into());
12304        self
12305    }
12306
12307    /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config].
12308    ///
12309    /// Note that all the setters affecting `dataset_config` are mutually
12310    /// exclusive.
12311    ///
12312    /// # Example
12313    /// ```ignore,no_run
12314    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12315    /// use google_cloud_datastream_v1::model::big_query_destination_config::SingleTargetDataset;
12316    /// let x = BigQueryDestinationConfig::new().set_dataset_config(Some(
12317    ///     google_cloud_datastream_v1::model::big_query_destination_config::DatasetConfig::SingleTargetDataset(SingleTargetDataset::default().into())));
12318    /// ```
12319    pub fn set_dataset_config<
12320        T: std::convert::Into<
12321                std::option::Option<crate::model::big_query_destination_config::DatasetConfig>,
12322            >,
12323    >(
12324        mut self,
12325        v: T,
12326    ) -> Self {
12327        self.dataset_config = v.into();
12328        self
12329    }
12330
12331    /// The value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
12332    /// if it holds a `SingleTargetDataset`, `None` if the field is not set or
12333    /// holds a different branch.
12334    pub fn single_target_dataset(
12335        &self,
12336    ) -> std::option::Option<
12337        &std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
12338    > {
12339        #[allow(unreachable_patterns)]
12340        self.dataset_config.as_ref().and_then(|v| match v {
12341            crate::model::big_query_destination_config::DatasetConfig::SingleTargetDataset(v) => {
12342                std::option::Option::Some(v)
12343            }
12344            _ => std::option::Option::None,
12345        })
12346    }
12347
12348    /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
12349    /// to hold a `SingleTargetDataset`.
12350    ///
12351    /// Note that all the setters affecting `dataset_config` are
12352    /// mutually exclusive.
12353    ///
12354    /// # Example
12355    /// ```ignore,no_run
12356    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12357    /// use google_cloud_datastream_v1::model::big_query_destination_config::SingleTargetDataset;
12358    /// let x = BigQueryDestinationConfig::new().set_single_target_dataset(SingleTargetDataset::default()/* use setters */);
12359    /// assert!(x.single_target_dataset().is_some());
12360    /// assert!(x.source_hierarchy_datasets().is_none());
12361    /// ```
12362    pub fn set_single_target_dataset<
12363        T: std::convert::Into<
12364                std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
12365            >,
12366    >(
12367        mut self,
12368        v: T,
12369    ) -> Self {
12370        self.dataset_config = std::option::Option::Some(
12371            crate::model::big_query_destination_config::DatasetConfig::SingleTargetDataset(
12372                v.into(),
12373            ),
12374        );
12375        self
12376    }
12377
12378    /// The value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
12379    /// if it holds a `SourceHierarchyDatasets`, `None` if the field is not set or
12380    /// holds a different branch.
12381    pub fn source_hierarchy_datasets(
12382        &self,
12383    ) -> std::option::Option<
12384        &std::boxed::Box<crate::model::big_query_destination_config::SourceHierarchyDatasets>,
12385    > {
12386        #[allow(unreachable_patterns)]
12387        self.dataset_config.as_ref().and_then(|v| match v {
12388            crate::model::big_query_destination_config::DatasetConfig::SourceHierarchyDatasets(
12389                v,
12390            ) => std::option::Option::Some(v),
12391            _ => std::option::Option::None,
12392        })
12393    }
12394
12395    /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
12396    /// to hold a `SourceHierarchyDatasets`.
12397    ///
12398    /// Note that all the setters affecting `dataset_config` are
12399    /// mutually exclusive.
12400    ///
12401    /// # Example
12402    /// ```ignore,no_run
12403    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12404    /// use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12405    /// let x = BigQueryDestinationConfig::new().set_source_hierarchy_datasets(SourceHierarchyDatasets::default()/* use setters */);
12406    /// assert!(x.source_hierarchy_datasets().is_some());
12407    /// assert!(x.single_target_dataset().is_none());
12408    /// ```
12409    pub fn set_source_hierarchy_datasets<
12410        T: std::convert::Into<
12411                std::boxed::Box<
12412                    crate::model::big_query_destination_config::SourceHierarchyDatasets,
12413                >,
12414            >,
12415    >(
12416        mut self,
12417        v: T,
12418    ) -> Self {
12419        self.dataset_config = std::option::Option::Some(
12420            crate::model::big_query_destination_config::DatasetConfig::SourceHierarchyDatasets(
12421                v.into(),
12422            ),
12423        );
12424        self
12425    }
12426
12427    /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode].
12428    ///
12429    /// Note that all the setters affecting `write_mode` are mutually
12430    /// exclusive.
12431    ///
12432    /// # Example
12433    /// ```ignore,no_run
12434    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12435    /// use google_cloud_datastream_v1::model::big_query_destination_config::Merge;
12436    /// let x = BigQueryDestinationConfig::new().set_write_mode(Some(
12437    ///     google_cloud_datastream_v1::model::big_query_destination_config::WriteMode::Merge(Merge::default().into())));
12438    /// ```
12439    pub fn set_write_mode<
12440        T: std::convert::Into<
12441                std::option::Option<crate::model::big_query_destination_config::WriteMode>,
12442            >,
12443    >(
12444        mut self,
12445        v: T,
12446    ) -> Self {
12447        self.write_mode = v.into();
12448        self
12449    }
12450
12451    /// The value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
12452    /// if it holds a `Merge`, `None` if the field is not set or
12453    /// holds a different branch.
12454    pub fn merge(
12455        &self,
12456    ) -> std::option::Option<&std::boxed::Box<crate::model::big_query_destination_config::Merge>>
12457    {
12458        #[allow(unreachable_patterns)]
12459        self.write_mode.as_ref().and_then(|v| match v {
12460            crate::model::big_query_destination_config::WriteMode::Merge(v) => {
12461                std::option::Option::Some(v)
12462            }
12463            _ => std::option::Option::None,
12464        })
12465    }
12466
12467    /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
12468    /// to hold a `Merge`.
12469    ///
12470    /// Note that all the setters affecting `write_mode` are
12471    /// mutually exclusive.
12472    ///
12473    /// # Example
12474    /// ```ignore,no_run
12475    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12476    /// use google_cloud_datastream_v1::model::big_query_destination_config::Merge;
12477    /// let x = BigQueryDestinationConfig::new().set_merge(Merge::default()/* use setters */);
12478    /// assert!(x.merge().is_some());
12479    /// assert!(x.append_only().is_none());
12480    /// ```
12481    pub fn set_merge<
12482        T: std::convert::Into<std::boxed::Box<crate::model::big_query_destination_config::Merge>>,
12483    >(
12484        mut self,
12485        v: T,
12486    ) -> Self {
12487        self.write_mode = std::option::Option::Some(
12488            crate::model::big_query_destination_config::WriteMode::Merge(v.into()),
12489        );
12490        self
12491    }
12492
12493    /// The value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
12494    /// if it holds a `AppendOnly`, `None` if the field is not set or
12495    /// holds a different branch.
12496    pub fn append_only(
12497        &self,
12498    ) -> std::option::Option<&std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>>
12499    {
12500        #[allow(unreachable_patterns)]
12501        self.write_mode.as_ref().and_then(|v| match v {
12502            crate::model::big_query_destination_config::WriteMode::AppendOnly(v) => {
12503                std::option::Option::Some(v)
12504            }
12505            _ => std::option::Option::None,
12506        })
12507    }
12508
12509    /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
12510    /// to hold a `AppendOnly`.
12511    ///
12512    /// Note that all the setters affecting `write_mode` are
12513    /// mutually exclusive.
12514    ///
12515    /// # Example
12516    /// ```ignore,no_run
12517    /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12518    /// use google_cloud_datastream_v1::model::big_query_destination_config::AppendOnly;
12519    /// let x = BigQueryDestinationConfig::new().set_append_only(AppendOnly::default()/* use setters */);
12520    /// assert!(x.append_only().is_some());
12521    /// assert!(x.merge().is_none());
12522    /// ```
12523    pub fn set_append_only<
12524        T: std::convert::Into<std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>>,
12525    >(
12526        mut self,
12527        v: T,
12528    ) -> Self {
12529        self.write_mode = std::option::Option::Some(
12530            crate::model::big_query_destination_config::WriteMode::AppendOnly(v.into()),
12531        );
12532        self
12533    }
12534}
12535
12536impl wkt::message::Message for BigQueryDestinationConfig {
12537    fn typename() -> &'static str {
12538        "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig"
12539    }
12540}
12541
12542/// Defines additional types related to [BigQueryDestinationConfig].
12543pub mod big_query_destination_config {
12544    #[allow(unused_imports)]
12545    use super::*;
12546
12547    /// A single target dataset to which all data will be streamed.
12548    #[derive(Clone, Default, PartialEq)]
12549    #[non_exhaustive]
12550    pub struct SingleTargetDataset {
12551        /// The dataset ID of the target dataset.
12552        /// DatasetIds allowed characters:
12553        /// <https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets#datasetreference>.
12554        pub dataset_id: std::string::String,
12555
12556        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12557    }
12558
12559    impl SingleTargetDataset {
12560        /// Creates a new default instance.
12561        pub fn new() -> Self {
12562            std::default::Default::default()
12563        }
12564
12565        /// Sets the value of [dataset_id][crate::model::big_query_destination_config::SingleTargetDataset::dataset_id].
12566        ///
12567        /// # Example
12568        /// ```ignore,no_run
12569        /// # use google_cloud_datastream_v1::model::big_query_destination_config::SingleTargetDataset;
12570        /// let x = SingleTargetDataset::new().set_dataset_id("example");
12571        /// ```
12572        pub fn set_dataset_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12573            self.dataset_id = v.into();
12574            self
12575        }
12576    }
12577
12578    impl wkt::message::Message for SingleTargetDataset {
12579        fn typename() -> &'static str {
12580            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SingleTargetDataset"
12581        }
12582    }
12583
12584    /// Destination datasets are created so that hierarchy of the destination data
12585    /// objects matches the source hierarchy.
12586    #[derive(Clone, Default, PartialEq)]
12587    #[non_exhaustive]
12588    pub struct SourceHierarchyDatasets {
12589        /// The dataset template to use for dynamic dataset creation.
12590        pub dataset_template: std::option::Option<
12591            crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate,
12592        >,
12593
12594        /// Optional. The project id of the BigQuery dataset. If not specified, the
12595        /// project will be inferred from the stream resource.
12596        pub project_id: std::option::Option<std::string::String>,
12597
12598        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12599    }
12600
12601    impl SourceHierarchyDatasets {
12602        /// Creates a new default instance.
12603        pub fn new() -> Self {
12604            std::default::Default::default()
12605        }
12606
12607        /// Sets the value of [dataset_template][crate::model::big_query_destination_config::SourceHierarchyDatasets::dataset_template].
12608        ///
12609        /// # Example
12610        /// ```ignore,no_run
12611        /// # use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12612        /// use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12613        /// let x = SourceHierarchyDatasets::new().set_dataset_template(DatasetTemplate::default()/* use setters */);
12614        /// ```
12615        pub fn set_dataset_template<T>(mut self, v: T) -> Self
12616        where T: std::convert::Into<crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate>
12617        {
12618            self.dataset_template = std::option::Option::Some(v.into());
12619            self
12620        }
12621
12622        /// Sets or clears the value of [dataset_template][crate::model::big_query_destination_config::SourceHierarchyDatasets::dataset_template].
12623        ///
12624        /// # Example
12625        /// ```ignore,no_run
12626        /// # use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12627        /// use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12628        /// let x = SourceHierarchyDatasets::new().set_or_clear_dataset_template(Some(DatasetTemplate::default()/* use setters */));
12629        /// let x = SourceHierarchyDatasets::new().set_or_clear_dataset_template(None::<DatasetTemplate>);
12630        /// ```
12631        pub fn set_or_clear_dataset_template<T>(mut self, v: std::option::Option<T>) -> Self
12632        where T: std::convert::Into<crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate>
12633        {
12634            self.dataset_template = v.map(|x| x.into());
12635            self
12636        }
12637
12638        /// Sets the value of [project_id][crate::model::big_query_destination_config::SourceHierarchyDatasets::project_id].
12639        ///
12640        /// # Example
12641        /// ```ignore,no_run
12642        /// # use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12643        /// let x = SourceHierarchyDatasets::new().set_project_id("example");
12644        /// ```
12645        pub fn set_project_id<T>(mut self, v: T) -> Self
12646        where
12647            T: std::convert::Into<std::string::String>,
12648        {
12649            self.project_id = std::option::Option::Some(v.into());
12650            self
12651        }
12652
12653        /// Sets or clears the value of [project_id][crate::model::big_query_destination_config::SourceHierarchyDatasets::project_id].
12654        ///
12655        /// # Example
12656        /// ```ignore,no_run
12657        /// # use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12658        /// let x = SourceHierarchyDatasets::new().set_or_clear_project_id(Some("example"));
12659        /// let x = SourceHierarchyDatasets::new().set_or_clear_project_id(None::<String>);
12660        /// ```
12661        pub fn set_or_clear_project_id<T>(mut self, v: std::option::Option<T>) -> Self
12662        where
12663            T: std::convert::Into<std::string::String>,
12664        {
12665            self.project_id = v.map(|x| x.into());
12666            self
12667        }
12668    }
12669
12670    impl wkt::message::Message for SourceHierarchyDatasets {
12671        fn typename() -> &'static str {
12672            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SourceHierarchyDatasets"
12673        }
12674    }
12675
12676    /// Defines additional types related to [SourceHierarchyDatasets].
12677    pub mod source_hierarchy_datasets {
12678        #[allow(unused_imports)]
12679        use super::*;
12680
12681        /// Dataset template used for dynamic dataset creation.
12682        #[derive(Clone, Default, PartialEq)]
12683        #[non_exhaustive]
12684        pub struct DatasetTemplate {
12685            /// Required. The geographic location where the dataset should reside. See
12686            /// <https://cloud.google.com/bigquery/docs/locations> for supported
12687            /// locations.
12688            pub location: std::string::String,
12689
12690            /// If supplied, every created dataset will have its name prefixed by the
12691            /// provided value. The prefix and name will be separated by an underscore.
12692            /// i.e. \<prefix\>_<dataset_name>.
12693            pub dataset_id_prefix: std::string::String,
12694
12695            /// Describes the Cloud KMS encryption key that will be used to
12696            /// protect destination BigQuery table. The BigQuery Service Account
12697            /// associated with your project requires access to this encryption key.
12698            /// i.e.
12699            /// projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{cryptoKey}.
12700            /// See <https://cloud.google.com/bigquery/docs/customer-managed-encryption>
12701            /// for more information.
12702            pub kms_key_name: std::string::String,
12703
12704            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12705        }
12706
12707        impl DatasetTemplate {
12708            /// Creates a new default instance.
12709            pub fn new() -> Self {
12710                std::default::Default::default()
12711            }
12712
12713            /// Sets the value of [location][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::location].
12714            ///
12715            /// # Example
12716            /// ```ignore,no_run
12717            /// # use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12718            /// let x = DatasetTemplate::new().set_location("example");
12719            /// ```
12720            pub fn set_location<T: std::convert::Into<std::string::String>>(
12721                mut self,
12722                v: T,
12723            ) -> Self {
12724                self.location = v.into();
12725                self
12726            }
12727
12728            /// Sets the value of [dataset_id_prefix][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::dataset_id_prefix].
12729            ///
12730            /// # Example
12731            /// ```ignore,no_run
12732            /// # use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12733            /// let x = DatasetTemplate::new().set_dataset_id_prefix("example");
12734            /// ```
12735            pub fn set_dataset_id_prefix<T: std::convert::Into<std::string::String>>(
12736                mut self,
12737                v: T,
12738            ) -> Self {
12739                self.dataset_id_prefix = v.into();
12740                self
12741            }
12742
12743            /// Sets the value of [kms_key_name][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::kms_key_name].
12744            ///
12745            /// # Example
12746            /// ```ignore,no_run
12747            /// # use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12748            /// let x = DatasetTemplate::new().set_kms_key_name("example");
12749            /// ```
12750            pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(
12751                mut self,
12752                v: T,
12753            ) -> Self {
12754                self.kms_key_name = v.into();
12755                self
12756            }
12757        }
12758
12759        impl wkt::message::Message for DatasetTemplate {
12760            fn typename() -> &'static str {
12761                "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SourceHierarchyDatasets.DatasetTemplate"
12762            }
12763        }
12764    }
12765
12766    /// The configuration for BLMT.
12767    #[derive(Clone, Default, PartialEq)]
12768    #[non_exhaustive]
12769    pub struct BlmtConfig {
12770        /// Required. The Cloud Storage bucket name.
12771        pub bucket: std::string::String,
12772
12773        /// The root path inside the Cloud Storage bucket.
12774        pub root_path: std::string::String,
12775
12776        /// Required. The bigquery connection.
12777        /// Format: `{project}.{location}.{name}`
12778        pub connection_name: std::string::String,
12779
12780        /// Required. The file format.
12781        pub file_format: crate::model::big_query_destination_config::blmt_config::FileFormat,
12782
12783        /// Required. The table format.
12784        pub table_format: crate::model::big_query_destination_config::blmt_config::TableFormat,
12785
12786        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12787    }
12788
12789    impl BlmtConfig {
12790        /// Creates a new default instance.
12791        pub fn new() -> Self {
12792            std::default::Default::default()
12793        }
12794
12795        /// Sets the value of [bucket][crate::model::big_query_destination_config::BlmtConfig::bucket].
12796        ///
12797        /// # Example
12798        /// ```ignore,no_run
12799        /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12800        /// let x = BlmtConfig::new().set_bucket("example");
12801        /// ```
12802        pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12803            self.bucket = v.into();
12804            self
12805        }
12806
12807        /// Sets the value of [root_path][crate::model::big_query_destination_config::BlmtConfig::root_path].
12808        ///
12809        /// # Example
12810        /// ```ignore,no_run
12811        /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12812        /// let x = BlmtConfig::new().set_root_path("example");
12813        /// ```
12814        pub fn set_root_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12815            self.root_path = v.into();
12816            self
12817        }
12818
12819        /// Sets the value of [connection_name][crate::model::big_query_destination_config::BlmtConfig::connection_name].
12820        ///
12821        /// # Example
12822        /// ```ignore,no_run
12823        /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12824        /// let x = BlmtConfig::new().set_connection_name("example");
12825        /// ```
12826        pub fn set_connection_name<T: std::convert::Into<std::string::String>>(
12827            mut self,
12828            v: T,
12829        ) -> Self {
12830            self.connection_name = v.into();
12831            self
12832        }
12833
12834        /// Sets the value of [file_format][crate::model::big_query_destination_config::BlmtConfig::file_format].
12835        ///
12836        /// # Example
12837        /// ```ignore,no_run
12838        /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12839        /// use google_cloud_datastream_v1::model::big_query_destination_config::blmt_config::FileFormat;
12840        /// let x0 = BlmtConfig::new().set_file_format(FileFormat::Parquet);
12841        /// ```
12842        pub fn set_file_format<
12843            T: std::convert::Into<crate::model::big_query_destination_config::blmt_config::FileFormat>,
12844        >(
12845            mut self,
12846            v: T,
12847        ) -> Self {
12848            self.file_format = v.into();
12849            self
12850        }
12851
12852        /// Sets the value of [table_format][crate::model::big_query_destination_config::BlmtConfig::table_format].
12853        ///
12854        /// # Example
12855        /// ```ignore,no_run
12856        /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12857        /// use google_cloud_datastream_v1::model::big_query_destination_config::blmt_config::TableFormat;
12858        /// let x0 = BlmtConfig::new().set_table_format(TableFormat::Iceberg);
12859        /// ```
12860        pub fn set_table_format<
12861            T: std::convert::Into<
12862                    crate::model::big_query_destination_config::blmt_config::TableFormat,
12863                >,
12864        >(
12865            mut self,
12866            v: T,
12867        ) -> Self {
12868            self.table_format = v.into();
12869            self
12870        }
12871    }
12872
12873    impl wkt::message::Message for BlmtConfig {
12874        fn typename() -> &'static str {
12875            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig"
12876        }
12877    }
12878
12879    /// Defines additional types related to [BlmtConfig].
12880    pub mod blmt_config {
12881        #[allow(unused_imports)]
12882        use super::*;
12883
12884        /// Supported file formats for BigLake managed tables.
12885        ///
12886        /// # Working with unknown values
12887        ///
12888        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12889        /// additional enum variants at any time. Adding new variants is not considered
12890        /// a breaking change. Applications should write their code in anticipation of:
12891        ///
12892        /// - New values appearing in future releases of the client library, **and**
12893        /// - New values received dynamically, without application changes.
12894        ///
12895        /// Please consult the [Working with enums] section in the user guide for some
12896        /// guidelines.
12897        ///
12898        /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12899        #[derive(Clone, Debug, PartialEq)]
12900        #[non_exhaustive]
12901        pub enum FileFormat {
12902            /// Default value.
12903            Unspecified,
12904            /// Parquet file format.
12905            Parquet,
12906            /// If set, the enum was initialized with an unknown value.
12907            ///
12908            /// Applications can examine the value using [FileFormat::value] or
12909            /// [FileFormat::name].
12910            UnknownValue(file_format::UnknownValue),
12911        }
12912
12913        #[doc(hidden)]
12914        pub mod file_format {
12915            #[allow(unused_imports)]
12916            use super::*;
12917            #[derive(Clone, Debug, PartialEq)]
12918            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12919        }
12920
12921        impl FileFormat {
12922            /// Gets the enum value.
12923            ///
12924            /// Returns `None` if the enum contains an unknown value deserialized from
12925            /// the string representation of enums.
12926            pub fn value(&self) -> std::option::Option<i32> {
12927                match self {
12928                    Self::Unspecified => std::option::Option::Some(0),
12929                    Self::Parquet => std::option::Option::Some(1),
12930                    Self::UnknownValue(u) => u.0.value(),
12931                }
12932            }
12933
12934            /// Gets the enum value as a string.
12935            ///
12936            /// Returns `None` if the enum contains an unknown value deserialized from
12937            /// the integer representation of enums.
12938            pub fn name(&self) -> std::option::Option<&str> {
12939                match self {
12940                    Self::Unspecified => std::option::Option::Some("FILE_FORMAT_UNSPECIFIED"),
12941                    Self::Parquet => std::option::Option::Some("PARQUET"),
12942                    Self::UnknownValue(u) => u.0.name(),
12943                }
12944            }
12945        }
12946
12947        impl std::default::Default for FileFormat {
12948            fn default() -> Self {
12949                use std::convert::From;
12950                Self::from(0)
12951            }
12952        }
12953
12954        impl std::fmt::Display for FileFormat {
12955            fn fmt(
12956                &self,
12957                f: &mut std::fmt::Formatter<'_>,
12958            ) -> std::result::Result<(), std::fmt::Error> {
12959                wkt::internal::display_enum(f, self.name(), self.value())
12960            }
12961        }
12962
12963        impl std::convert::From<i32> for FileFormat {
12964            fn from(value: i32) -> Self {
12965                match value {
12966                    0 => Self::Unspecified,
12967                    1 => Self::Parquet,
12968                    _ => Self::UnknownValue(file_format::UnknownValue(
12969                        wkt::internal::UnknownEnumValue::Integer(value),
12970                    )),
12971                }
12972            }
12973        }
12974
12975        impl std::convert::From<&str> for FileFormat {
12976            fn from(value: &str) -> Self {
12977                use std::string::ToString;
12978                match value {
12979                    "FILE_FORMAT_UNSPECIFIED" => Self::Unspecified,
12980                    "PARQUET" => Self::Parquet,
12981                    _ => Self::UnknownValue(file_format::UnknownValue(
12982                        wkt::internal::UnknownEnumValue::String(value.to_string()),
12983                    )),
12984                }
12985            }
12986        }
12987
12988        impl serde::ser::Serialize for FileFormat {
12989            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12990            where
12991                S: serde::Serializer,
12992            {
12993                match self {
12994                    Self::Unspecified => serializer.serialize_i32(0),
12995                    Self::Parquet => serializer.serialize_i32(1),
12996                    Self::UnknownValue(u) => u.0.serialize(serializer),
12997                }
12998            }
12999        }
13000
13001        impl<'de> serde::de::Deserialize<'de> for FileFormat {
13002            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13003            where
13004                D: serde::Deserializer<'de>,
13005            {
13006                deserializer.deserialize_any(wkt::internal::EnumVisitor::<FileFormat>::new(
13007                    ".google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig.FileFormat",
13008                ))
13009            }
13010        }
13011
13012        /// Supported table formats for BigLake managed tables.
13013        ///
13014        /// # Working with unknown values
13015        ///
13016        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13017        /// additional enum variants at any time. Adding new variants is not considered
13018        /// a breaking change. Applications should write their code in anticipation of:
13019        ///
13020        /// - New values appearing in future releases of the client library, **and**
13021        /// - New values received dynamically, without application changes.
13022        ///
13023        /// Please consult the [Working with enums] section in the user guide for some
13024        /// guidelines.
13025        ///
13026        /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13027        #[derive(Clone, Debug, PartialEq)]
13028        #[non_exhaustive]
13029        pub enum TableFormat {
13030            /// Default value.
13031            Unspecified,
13032            /// Iceberg table format.
13033            Iceberg,
13034            /// If set, the enum was initialized with an unknown value.
13035            ///
13036            /// Applications can examine the value using [TableFormat::value] or
13037            /// [TableFormat::name].
13038            UnknownValue(table_format::UnknownValue),
13039        }
13040
13041        #[doc(hidden)]
13042        pub mod table_format {
13043            #[allow(unused_imports)]
13044            use super::*;
13045            #[derive(Clone, Debug, PartialEq)]
13046            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13047        }
13048
13049        impl TableFormat {
13050            /// Gets the enum value.
13051            ///
13052            /// Returns `None` if the enum contains an unknown value deserialized from
13053            /// the string representation of enums.
13054            pub fn value(&self) -> std::option::Option<i32> {
13055                match self {
13056                    Self::Unspecified => std::option::Option::Some(0),
13057                    Self::Iceberg => std::option::Option::Some(1),
13058                    Self::UnknownValue(u) => u.0.value(),
13059                }
13060            }
13061
13062            /// Gets the enum value as a string.
13063            ///
13064            /// Returns `None` if the enum contains an unknown value deserialized from
13065            /// the integer representation of enums.
13066            pub fn name(&self) -> std::option::Option<&str> {
13067                match self {
13068                    Self::Unspecified => std::option::Option::Some("TABLE_FORMAT_UNSPECIFIED"),
13069                    Self::Iceberg => std::option::Option::Some("ICEBERG"),
13070                    Self::UnknownValue(u) => u.0.name(),
13071                }
13072            }
13073        }
13074
13075        impl std::default::Default for TableFormat {
13076            fn default() -> Self {
13077                use std::convert::From;
13078                Self::from(0)
13079            }
13080        }
13081
13082        impl std::fmt::Display for TableFormat {
13083            fn fmt(
13084                &self,
13085                f: &mut std::fmt::Formatter<'_>,
13086            ) -> std::result::Result<(), std::fmt::Error> {
13087                wkt::internal::display_enum(f, self.name(), self.value())
13088            }
13089        }
13090
13091        impl std::convert::From<i32> for TableFormat {
13092            fn from(value: i32) -> Self {
13093                match value {
13094                    0 => Self::Unspecified,
13095                    1 => Self::Iceberg,
13096                    _ => Self::UnknownValue(table_format::UnknownValue(
13097                        wkt::internal::UnknownEnumValue::Integer(value),
13098                    )),
13099                }
13100            }
13101        }
13102
13103        impl std::convert::From<&str> for TableFormat {
13104            fn from(value: &str) -> Self {
13105                use std::string::ToString;
13106                match value {
13107                    "TABLE_FORMAT_UNSPECIFIED" => Self::Unspecified,
13108                    "ICEBERG" => Self::Iceberg,
13109                    _ => Self::UnknownValue(table_format::UnknownValue(
13110                        wkt::internal::UnknownEnumValue::String(value.to_string()),
13111                    )),
13112                }
13113            }
13114        }
13115
13116        impl serde::ser::Serialize for TableFormat {
13117            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13118            where
13119                S: serde::Serializer,
13120            {
13121                match self {
13122                    Self::Unspecified => serializer.serialize_i32(0),
13123                    Self::Iceberg => serializer.serialize_i32(1),
13124                    Self::UnknownValue(u) => u.0.serialize(serializer),
13125                }
13126            }
13127        }
13128
13129        impl<'de> serde::de::Deserialize<'de> for TableFormat {
13130            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13131            where
13132                D: serde::Deserializer<'de>,
13133            {
13134                deserializer.deserialize_any(wkt::internal::EnumVisitor::<TableFormat>::new(
13135                    ".google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig.TableFormat",
13136                ))
13137            }
13138        }
13139    }
13140
13141    /// AppendOnly mode defines that all changes to a table will be written to the
13142    /// destination table.
13143    #[derive(Clone, Default, PartialEq)]
13144    #[non_exhaustive]
13145    pub struct AppendOnly {
13146        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13147    }
13148
13149    impl AppendOnly {
13150        /// Creates a new default instance.
13151        pub fn new() -> Self {
13152            std::default::Default::default()
13153        }
13154    }
13155
13156    impl wkt::message::Message for AppendOnly {
13157        fn typename() -> &'static str {
13158            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.AppendOnly"
13159        }
13160    }
13161
13162    /// Merge mode defines that all changes to a table will be merged at the
13163    /// destination table.
13164    #[derive(Clone, Default, PartialEq)]
13165    #[non_exhaustive]
13166    pub struct Merge {
13167        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13168    }
13169
13170    impl Merge {
13171        /// Creates a new default instance.
13172        pub fn new() -> Self {
13173            std::default::Default::default()
13174        }
13175    }
13176
13177    impl wkt::message::Message for Merge {
13178        fn typename() -> &'static str {
13179            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.Merge"
13180        }
13181    }
13182
13183    /// Target dataset(s) configuration.
13184    #[derive(Clone, Debug, PartialEq)]
13185    #[non_exhaustive]
13186    pub enum DatasetConfig {
13187        /// Single destination dataset.
13188        SingleTargetDataset(
13189            std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
13190        ),
13191        /// Source hierarchy datasets.
13192        SourceHierarchyDatasets(
13193            std::boxed::Box<crate::model::big_query_destination_config::SourceHierarchyDatasets>,
13194        ),
13195    }
13196
13197    #[allow(missing_docs)]
13198    #[derive(Clone, Debug, PartialEq)]
13199    #[non_exhaustive]
13200    pub enum WriteMode {
13201        /// The standard mode
13202        Merge(std::boxed::Box<crate::model::big_query_destination_config::Merge>),
13203        /// Append only mode
13204        AppendOnly(std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>),
13205    }
13206}
13207
13208/// The configuration of the stream destination.
13209#[derive(Clone, Default, PartialEq)]
13210#[non_exhaustive]
13211pub struct DestinationConfig {
13212    /// Required. Destination connection profile resource.
13213    /// Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
13214    pub destination_connection_profile: std::string::String,
13215
13216    /// Stream configuration that is specific to the data destination type.
13217    pub destination_stream_config:
13218        std::option::Option<crate::model::destination_config::DestinationStreamConfig>,
13219
13220    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13221}
13222
13223impl DestinationConfig {
13224    /// Creates a new default instance.
13225    pub fn new() -> Self {
13226        std::default::Default::default()
13227    }
13228
13229    /// Sets the value of [destination_connection_profile][crate::model::DestinationConfig::destination_connection_profile].
13230    ///
13231    /// # Example
13232    /// ```ignore,no_run
13233    /// # use google_cloud_datastream_v1::model::DestinationConfig;
13234    /// # let project_id = "project_id";
13235    /// # let location_id = "location_id";
13236    /// # let connection_profile_id = "connection_profile_id";
13237    /// let x = DestinationConfig::new().set_destination_connection_profile(format!("projects/{project_id}/locations/{location_id}/connectionProfiles/{connection_profile_id}"));
13238    /// ```
13239    pub fn set_destination_connection_profile<T: std::convert::Into<std::string::String>>(
13240        mut self,
13241        v: T,
13242    ) -> Self {
13243        self.destination_connection_profile = v.into();
13244        self
13245    }
13246
13247    /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config].
13248    ///
13249    /// Note that all the setters affecting `destination_stream_config` are mutually
13250    /// exclusive.
13251    ///
13252    /// # Example
13253    /// ```ignore,no_run
13254    /// # use google_cloud_datastream_v1::model::DestinationConfig;
13255    /// use google_cloud_datastream_v1::model::GcsDestinationConfig;
13256    /// let x = DestinationConfig::new().set_destination_stream_config(Some(
13257    ///     google_cloud_datastream_v1::model::destination_config::DestinationStreamConfig::GcsDestinationConfig(GcsDestinationConfig::default().into())));
13258    /// ```
13259    pub fn set_destination_stream_config<
13260        T: std::convert::Into<
13261                std::option::Option<crate::model::destination_config::DestinationStreamConfig>,
13262            >,
13263    >(
13264        mut self,
13265        v: T,
13266    ) -> Self {
13267        self.destination_stream_config = v.into();
13268        self
13269    }
13270
13271    /// The value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
13272    /// if it holds a `GcsDestinationConfig`, `None` if the field is not set or
13273    /// holds a different branch.
13274    pub fn gcs_destination_config(
13275        &self,
13276    ) -> std::option::Option<&std::boxed::Box<crate::model::GcsDestinationConfig>> {
13277        #[allow(unreachable_patterns)]
13278        self.destination_stream_config
13279            .as_ref()
13280            .and_then(|v| match v {
13281                crate::model::destination_config::DestinationStreamConfig::GcsDestinationConfig(
13282                    v,
13283                ) => std::option::Option::Some(v),
13284                _ => std::option::Option::None,
13285            })
13286    }
13287
13288    /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
13289    /// to hold a `GcsDestinationConfig`.
13290    ///
13291    /// Note that all the setters affecting `destination_stream_config` are
13292    /// mutually exclusive.
13293    ///
13294    /// # Example
13295    /// ```ignore,no_run
13296    /// # use google_cloud_datastream_v1::model::DestinationConfig;
13297    /// use google_cloud_datastream_v1::model::GcsDestinationConfig;
13298    /// let x = DestinationConfig::new().set_gcs_destination_config(GcsDestinationConfig::default()/* use setters */);
13299    /// assert!(x.gcs_destination_config().is_some());
13300    /// assert!(x.bigquery_destination_config().is_none());
13301    /// ```
13302    pub fn set_gcs_destination_config<
13303        T: std::convert::Into<std::boxed::Box<crate::model::GcsDestinationConfig>>,
13304    >(
13305        mut self,
13306        v: T,
13307    ) -> Self {
13308        self.destination_stream_config = std::option::Option::Some(
13309            crate::model::destination_config::DestinationStreamConfig::GcsDestinationConfig(
13310                v.into(),
13311            ),
13312        );
13313        self
13314    }
13315
13316    /// The value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
13317    /// if it holds a `BigqueryDestinationConfig`, `None` if the field is not set or
13318    /// holds a different branch.
13319    pub fn bigquery_destination_config(
13320        &self,
13321    ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryDestinationConfig>> {
13322        #[allow(unreachable_patterns)]
13323        self.destination_stream_config.as_ref().and_then(|v| match v {
13324            crate::model::destination_config::DestinationStreamConfig::BigqueryDestinationConfig(v) => std::option::Option::Some(v),
13325            _ => std::option::Option::None,
13326        })
13327    }
13328
13329    /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
13330    /// to hold a `BigqueryDestinationConfig`.
13331    ///
13332    /// Note that all the setters affecting `destination_stream_config` are
13333    /// mutually exclusive.
13334    ///
13335    /// # Example
13336    /// ```ignore,no_run
13337    /// # use google_cloud_datastream_v1::model::DestinationConfig;
13338    /// use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
13339    /// let x = DestinationConfig::new().set_bigquery_destination_config(BigQueryDestinationConfig::default()/* use setters */);
13340    /// assert!(x.bigquery_destination_config().is_some());
13341    /// assert!(x.gcs_destination_config().is_none());
13342    /// ```
13343    pub fn set_bigquery_destination_config<
13344        T: std::convert::Into<std::boxed::Box<crate::model::BigQueryDestinationConfig>>,
13345    >(
13346        mut self,
13347        v: T,
13348    ) -> Self {
13349        self.destination_stream_config = std::option::Option::Some(
13350            crate::model::destination_config::DestinationStreamConfig::BigqueryDestinationConfig(
13351                v.into(),
13352            ),
13353        );
13354        self
13355    }
13356}
13357
13358impl wkt::message::Message for DestinationConfig {
13359    fn typename() -> &'static str {
13360        "type.googleapis.com/google.cloud.datastream.v1.DestinationConfig"
13361    }
13362}
13363
13364/// Defines additional types related to [DestinationConfig].
13365pub mod destination_config {
13366    #[allow(unused_imports)]
13367    use super::*;
13368
13369    /// Stream configuration that is specific to the data destination type.
13370    #[derive(Clone, Debug, PartialEq)]
13371    #[non_exhaustive]
13372    pub enum DestinationStreamConfig {
13373        /// A configuration for how data should be loaded to Cloud Storage.
13374        GcsDestinationConfig(std::boxed::Box<crate::model::GcsDestinationConfig>),
13375        /// BigQuery destination configuration.
13376        BigqueryDestinationConfig(std::boxed::Box<crate::model::BigQueryDestinationConfig>),
13377    }
13378}
13379
13380/// A resource representing streaming data from a source to a destination.
13381#[derive(Clone, Default, PartialEq)]
13382#[non_exhaustive]
13383pub struct Stream {
13384    /// Output only. Identifier. The stream's name.
13385    pub name: std::string::String,
13386
13387    /// Output only. The creation time of the stream.
13388    pub create_time: std::option::Option<wkt::Timestamp>,
13389
13390    /// Output only. The last update time of the stream.
13391    pub update_time: std::option::Option<wkt::Timestamp>,
13392
13393    /// Labels.
13394    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
13395
13396    /// Required. Display name.
13397    pub display_name: std::string::String,
13398
13399    /// Required. Source connection profile configuration.
13400    pub source_config: std::option::Option<crate::model::SourceConfig>,
13401
13402    /// Required. Destination connection profile configuration.
13403    pub destination_config: std::option::Option<crate::model::DestinationConfig>,
13404
13405    /// The state of the stream.
13406    pub state: crate::model::stream::State,
13407
13408    /// Output only. Errors on the Stream.
13409    pub errors: std::vec::Vec<crate::model::Error>,
13410
13411    /// Immutable. A reference to a KMS encryption key.
13412    /// If provided, it will be used to encrypt the data.
13413    /// If left blank, data will be encrypted using an internal Stream-specific
13414    /// encryption key provisioned through KMS.
13415    pub customer_managed_encryption_key: std::option::Option<std::string::String>,
13416
13417    /// Output only. If the stream was recovered, the time of the last recovery.
13418    /// Note: This field is currently experimental.
13419    pub last_recovery_time: std::option::Option<wkt::Timestamp>,
13420
13421    /// Output only. Reserved for future use.
13422    pub satisfies_pzs: std::option::Option<bool>,
13423
13424    /// Output only. Reserved for future use.
13425    pub satisfies_pzi: std::option::Option<bool>,
13426
13427    /// Stream backfill strategy.
13428    pub backfill_strategy: std::option::Option<crate::model::stream::BackfillStrategy>,
13429
13430    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13431}
13432
13433impl Stream {
13434    /// Creates a new default instance.
13435    pub fn new() -> Self {
13436        std::default::Default::default()
13437    }
13438
13439    /// Sets the value of [name][crate::model::Stream::name].
13440    ///
13441    /// # Example
13442    /// ```ignore,no_run
13443    /// # use google_cloud_datastream_v1::model::Stream;
13444    /// # let project_id = "project_id";
13445    /// # let location_id = "location_id";
13446    /// # let stream_id = "stream_id";
13447    /// let x = Stream::new().set_name(format!("projects/{project_id}/locations/{location_id}/streams/{stream_id}"));
13448    /// ```
13449    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13450        self.name = v.into();
13451        self
13452    }
13453
13454    /// Sets the value of [create_time][crate::model::Stream::create_time].
13455    ///
13456    /// # Example
13457    /// ```ignore,no_run
13458    /// # use google_cloud_datastream_v1::model::Stream;
13459    /// use wkt::Timestamp;
13460    /// let x = Stream::new().set_create_time(Timestamp::default()/* use setters */);
13461    /// ```
13462    pub fn set_create_time<T>(mut self, v: T) -> Self
13463    where
13464        T: std::convert::Into<wkt::Timestamp>,
13465    {
13466        self.create_time = std::option::Option::Some(v.into());
13467        self
13468    }
13469
13470    /// Sets or clears the value of [create_time][crate::model::Stream::create_time].
13471    ///
13472    /// # Example
13473    /// ```ignore,no_run
13474    /// # use google_cloud_datastream_v1::model::Stream;
13475    /// use wkt::Timestamp;
13476    /// let x = Stream::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
13477    /// let x = Stream::new().set_or_clear_create_time(None::<Timestamp>);
13478    /// ```
13479    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13480    where
13481        T: std::convert::Into<wkt::Timestamp>,
13482    {
13483        self.create_time = v.map(|x| x.into());
13484        self
13485    }
13486
13487    /// Sets the value of [update_time][crate::model::Stream::update_time].
13488    ///
13489    /// # Example
13490    /// ```ignore,no_run
13491    /// # use google_cloud_datastream_v1::model::Stream;
13492    /// use wkt::Timestamp;
13493    /// let x = Stream::new().set_update_time(Timestamp::default()/* use setters */);
13494    /// ```
13495    pub fn set_update_time<T>(mut self, v: T) -> Self
13496    where
13497        T: std::convert::Into<wkt::Timestamp>,
13498    {
13499        self.update_time = std::option::Option::Some(v.into());
13500        self
13501    }
13502
13503    /// Sets or clears the value of [update_time][crate::model::Stream::update_time].
13504    ///
13505    /// # Example
13506    /// ```ignore,no_run
13507    /// # use google_cloud_datastream_v1::model::Stream;
13508    /// use wkt::Timestamp;
13509    /// let x = Stream::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
13510    /// let x = Stream::new().set_or_clear_update_time(None::<Timestamp>);
13511    /// ```
13512    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13513    where
13514        T: std::convert::Into<wkt::Timestamp>,
13515    {
13516        self.update_time = v.map(|x| x.into());
13517        self
13518    }
13519
13520    /// Sets the value of [labels][crate::model::Stream::labels].
13521    ///
13522    /// # Example
13523    /// ```ignore,no_run
13524    /// # use google_cloud_datastream_v1::model::Stream;
13525    /// let x = Stream::new().set_labels([
13526    ///     ("key0", "abc"),
13527    ///     ("key1", "xyz"),
13528    /// ]);
13529    /// ```
13530    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
13531    where
13532        T: std::iter::IntoIterator<Item = (K, V)>,
13533        K: std::convert::Into<std::string::String>,
13534        V: std::convert::Into<std::string::String>,
13535    {
13536        use std::iter::Iterator;
13537        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13538        self
13539    }
13540
13541    /// Sets the value of [display_name][crate::model::Stream::display_name].
13542    ///
13543    /// # Example
13544    /// ```ignore,no_run
13545    /// # use google_cloud_datastream_v1::model::Stream;
13546    /// let x = Stream::new().set_display_name("example");
13547    /// ```
13548    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13549        self.display_name = v.into();
13550        self
13551    }
13552
13553    /// Sets the value of [source_config][crate::model::Stream::source_config].
13554    ///
13555    /// # Example
13556    /// ```ignore,no_run
13557    /// # use google_cloud_datastream_v1::model::Stream;
13558    /// use google_cloud_datastream_v1::model::SourceConfig;
13559    /// let x = Stream::new().set_source_config(SourceConfig::default()/* use setters */);
13560    /// ```
13561    pub fn set_source_config<T>(mut self, v: T) -> Self
13562    where
13563        T: std::convert::Into<crate::model::SourceConfig>,
13564    {
13565        self.source_config = std::option::Option::Some(v.into());
13566        self
13567    }
13568
13569    /// Sets or clears the value of [source_config][crate::model::Stream::source_config].
13570    ///
13571    /// # Example
13572    /// ```ignore,no_run
13573    /// # use google_cloud_datastream_v1::model::Stream;
13574    /// use google_cloud_datastream_v1::model::SourceConfig;
13575    /// let x = Stream::new().set_or_clear_source_config(Some(SourceConfig::default()/* use setters */));
13576    /// let x = Stream::new().set_or_clear_source_config(None::<SourceConfig>);
13577    /// ```
13578    pub fn set_or_clear_source_config<T>(mut self, v: std::option::Option<T>) -> Self
13579    where
13580        T: std::convert::Into<crate::model::SourceConfig>,
13581    {
13582        self.source_config = v.map(|x| x.into());
13583        self
13584    }
13585
13586    /// Sets the value of [destination_config][crate::model::Stream::destination_config].
13587    ///
13588    /// # Example
13589    /// ```ignore,no_run
13590    /// # use google_cloud_datastream_v1::model::Stream;
13591    /// use google_cloud_datastream_v1::model::DestinationConfig;
13592    /// let x = Stream::new().set_destination_config(DestinationConfig::default()/* use setters */);
13593    /// ```
13594    pub fn set_destination_config<T>(mut self, v: T) -> Self
13595    where
13596        T: std::convert::Into<crate::model::DestinationConfig>,
13597    {
13598        self.destination_config = std::option::Option::Some(v.into());
13599        self
13600    }
13601
13602    /// Sets or clears the value of [destination_config][crate::model::Stream::destination_config].
13603    ///
13604    /// # Example
13605    /// ```ignore,no_run
13606    /// # use google_cloud_datastream_v1::model::Stream;
13607    /// use google_cloud_datastream_v1::model::DestinationConfig;
13608    /// let x = Stream::new().set_or_clear_destination_config(Some(DestinationConfig::default()/* use setters */));
13609    /// let x = Stream::new().set_or_clear_destination_config(None::<DestinationConfig>);
13610    /// ```
13611    pub fn set_or_clear_destination_config<T>(mut self, v: std::option::Option<T>) -> Self
13612    where
13613        T: std::convert::Into<crate::model::DestinationConfig>,
13614    {
13615        self.destination_config = v.map(|x| x.into());
13616        self
13617    }
13618
13619    /// Sets the value of [state][crate::model::Stream::state].
13620    ///
13621    /// # Example
13622    /// ```ignore,no_run
13623    /// # use google_cloud_datastream_v1::model::Stream;
13624    /// use google_cloud_datastream_v1::model::stream::State;
13625    /// let x0 = Stream::new().set_state(State::NotStarted);
13626    /// let x1 = Stream::new().set_state(State::Running);
13627    /// let x2 = Stream::new().set_state(State::Paused);
13628    /// ```
13629    pub fn set_state<T: std::convert::Into<crate::model::stream::State>>(mut self, v: T) -> Self {
13630        self.state = v.into();
13631        self
13632    }
13633
13634    /// Sets the value of [errors][crate::model::Stream::errors].
13635    ///
13636    /// # Example
13637    /// ```ignore,no_run
13638    /// # use google_cloud_datastream_v1::model::Stream;
13639    /// use google_cloud_datastream_v1::model::Error;
13640    /// let x = Stream::new()
13641    ///     .set_errors([
13642    ///         Error::default()/* use setters */,
13643    ///         Error::default()/* use (different) setters */,
13644    ///     ]);
13645    /// ```
13646    pub fn set_errors<T, V>(mut self, v: T) -> Self
13647    where
13648        T: std::iter::IntoIterator<Item = V>,
13649        V: std::convert::Into<crate::model::Error>,
13650    {
13651        use std::iter::Iterator;
13652        self.errors = v.into_iter().map(|i| i.into()).collect();
13653        self
13654    }
13655
13656    /// Sets the value of [customer_managed_encryption_key][crate::model::Stream::customer_managed_encryption_key].
13657    ///
13658    /// # Example
13659    /// ```ignore,no_run
13660    /// # use google_cloud_datastream_v1::model::Stream;
13661    /// let x = Stream::new().set_customer_managed_encryption_key("example");
13662    /// ```
13663    pub fn set_customer_managed_encryption_key<T>(mut self, v: T) -> Self
13664    where
13665        T: std::convert::Into<std::string::String>,
13666    {
13667        self.customer_managed_encryption_key = std::option::Option::Some(v.into());
13668        self
13669    }
13670
13671    /// Sets or clears the value of [customer_managed_encryption_key][crate::model::Stream::customer_managed_encryption_key].
13672    ///
13673    /// # Example
13674    /// ```ignore,no_run
13675    /// # use google_cloud_datastream_v1::model::Stream;
13676    /// let x = Stream::new().set_or_clear_customer_managed_encryption_key(Some("example"));
13677    /// let x = Stream::new().set_or_clear_customer_managed_encryption_key(None::<String>);
13678    /// ```
13679    pub fn set_or_clear_customer_managed_encryption_key<T>(
13680        mut self,
13681        v: std::option::Option<T>,
13682    ) -> Self
13683    where
13684        T: std::convert::Into<std::string::String>,
13685    {
13686        self.customer_managed_encryption_key = v.map(|x| x.into());
13687        self
13688    }
13689
13690    /// Sets the value of [last_recovery_time][crate::model::Stream::last_recovery_time].
13691    ///
13692    /// # Example
13693    /// ```ignore,no_run
13694    /// # use google_cloud_datastream_v1::model::Stream;
13695    /// use wkt::Timestamp;
13696    /// let x = Stream::new().set_last_recovery_time(Timestamp::default()/* use setters */);
13697    /// ```
13698    pub fn set_last_recovery_time<T>(mut self, v: T) -> Self
13699    where
13700        T: std::convert::Into<wkt::Timestamp>,
13701    {
13702        self.last_recovery_time = std::option::Option::Some(v.into());
13703        self
13704    }
13705
13706    /// Sets or clears the value of [last_recovery_time][crate::model::Stream::last_recovery_time].
13707    ///
13708    /// # Example
13709    /// ```ignore,no_run
13710    /// # use google_cloud_datastream_v1::model::Stream;
13711    /// use wkt::Timestamp;
13712    /// let x = Stream::new().set_or_clear_last_recovery_time(Some(Timestamp::default()/* use setters */));
13713    /// let x = Stream::new().set_or_clear_last_recovery_time(None::<Timestamp>);
13714    /// ```
13715    pub fn set_or_clear_last_recovery_time<T>(mut self, v: std::option::Option<T>) -> Self
13716    where
13717        T: std::convert::Into<wkt::Timestamp>,
13718    {
13719        self.last_recovery_time = v.map(|x| x.into());
13720        self
13721    }
13722
13723    /// Sets the value of [satisfies_pzs][crate::model::Stream::satisfies_pzs].
13724    ///
13725    /// # Example
13726    /// ```ignore,no_run
13727    /// # use google_cloud_datastream_v1::model::Stream;
13728    /// let x = Stream::new().set_satisfies_pzs(true);
13729    /// ```
13730    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
13731    where
13732        T: std::convert::Into<bool>,
13733    {
13734        self.satisfies_pzs = std::option::Option::Some(v.into());
13735        self
13736    }
13737
13738    /// Sets or clears the value of [satisfies_pzs][crate::model::Stream::satisfies_pzs].
13739    ///
13740    /// # Example
13741    /// ```ignore,no_run
13742    /// # use google_cloud_datastream_v1::model::Stream;
13743    /// let x = Stream::new().set_or_clear_satisfies_pzs(Some(false));
13744    /// let x = Stream::new().set_or_clear_satisfies_pzs(None::<bool>);
13745    /// ```
13746    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
13747    where
13748        T: std::convert::Into<bool>,
13749    {
13750        self.satisfies_pzs = v.map(|x| x.into());
13751        self
13752    }
13753
13754    /// Sets the value of [satisfies_pzi][crate::model::Stream::satisfies_pzi].
13755    ///
13756    /// # Example
13757    /// ```ignore,no_run
13758    /// # use google_cloud_datastream_v1::model::Stream;
13759    /// let x = Stream::new().set_satisfies_pzi(true);
13760    /// ```
13761    pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
13762    where
13763        T: std::convert::Into<bool>,
13764    {
13765        self.satisfies_pzi = std::option::Option::Some(v.into());
13766        self
13767    }
13768
13769    /// Sets or clears the value of [satisfies_pzi][crate::model::Stream::satisfies_pzi].
13770    ///
13771    /// # Example
13772    /// ```ignore,no_run
13773    /// # use google_cloud_datastream_v1::model::Stream;
13774    /// let x = Stream::new().set_or_clear_satisfies_pzi(Some(false));
13775    /// let x = Stream::new().set_or_clear_satisfies_pzi(None::<bool>);
13776    /// ```
13777    pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
13778    where
13779        T: std::convert::Into<bool>,
13780    {
13781        self.satisfies_pzi = v.map(|x| x.into());
13782        self
13783    }
13784
13785    /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy].
13786    ///
13787    /// Note that all the setters affecting `backfill_strategy` are mutually
13788    /// exclusive.
13789    ///
13790    /// # Example
13791    /// ```ignore,no_run
13792    /// # use google_cloud_datastream_v1::model::Stream;
13793    /// use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13794    /// let x = Stream::new().set_backfill_strategy(Some(
13795    ///     google_cloud_datastream_v1::model::stream::BackfillStrategy::BackfillAll(BackfillAllStrategy::default().into())));
13796    /// ```
13797    pub fn set_backfill_strategy<
13798        T: std::convert::Into<std::option::Option<crate::model::stream::BackfillStrategy>>,
13799    >(
13800        mut self,
13801        v: T,
13802    ) -> Self {
13803        self.backfill_strategy = v.into();
13804        self
13805    }
13806
13807    /// The value of [backfill_strategy][crate::model::Stream::backfill_strategy]
13808    /// if it holds a `BackfillAll`, `None` if the field is not set or
13809    /// holds a different branch.
13810    pub fn backfill_all(
13811        &self,
13812    ) -> std::option::Option<&std::boxed::Box<crate::model::stream::BackfillAllStrategy>> {
13813        #[allow(unreachable_patterns)]
13814        self.backfill_strategy.as_ref().and_then(|v| match v {
13815            crate::model::stream::BackfillStrategy::BackfillAll(v) => std::option::Option::Some(v),
13816            _ => std::option::Option::None,
13817        })
13818    }
13819
13820    /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy]
13821    /// to hold a `BackfillAll`.
13822    ///
13823    /// Note that all the setters affecting `backfill_strategy` are
13824    /// mutually exclusive.
13825    ///
13826    /// # Example
13827    /// ```ignore,no_run
13828    /// # use google_cloud_datastream_v1::model::Stream;
13829    /// use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13830    /// let x = Stream::new().set_backfill_all(BackfillAllStrategy::default()/* use setters */);
13831    /// assert!(x.backfill_all().is_some());
13832    /// assert!(x.backfill_none().is_none());
13833    /// ```
13834    pub fn set_backfill_all<
13835        T: std::convert::Into<std::boxed::Box<crate::model::stream::BackfillAllStrategy>>,
13836    >(
13837        mut self,
13838        v: T,
13839    ) -> Self {
13840        self.backfill_strategy = std::option::Option::Some(
13841            crate::model::stream::BackfillStrategy::BackfillAll(v.into()),
13842        );
13843        self
13844    }
13845
13846    /// The value of [backfill_strategy][crate::model::Stream::backfill_strategy]
13847    /// if it holds a `BackfillNone`, `None` if the field is not set or
13848    /// holds a different branch.
13849    pub fn backfill_none(
13850        &self,
13851    ) -> std::option::Option<&std::boxed::Box<crate::model::stream::BackfillNoneStrategy>> {
13852        #[allow(unreachable_patterns)]
13853        self.backfill_strategy.as_ref().and_then(|v| match v {
13854            crate::model::stream::BackfillStrategy::BackfillNone(v) => std::option::Option::Some(v),
13855            _ => std::option::Option::None,
13856        })
13857    }
13858
13859    /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy]
13860    /// to hold a `BackfillNone`.
13861    ///
13862    /// Note that all the setters affecting `backfill_strategy` are
13863    /// mutually exclusive.
13864    ///
13865    /// # Example
13866    /// ```ignore,no_run
13867    /// # use google_cloud_datastream_v1::model::Stream;
13868    /// use google_cloud_datastream_v1::model::stream::BackfillNoneStrategy;
13869    /// let x = Stream::new().set_backfill_none(BackfillNoneStrategy::default()/* use setters */);
13870    /// assert!(x.backfill_none().is_some());
13871    /// assert!(x.backfill_all().is_none());
13872    /// ```
13873    pub fn set_backfill_none<
13874        T: std::convert::Into<std::boxed::Box<crate::model::stream::BackfillNoneStrategy>>,
13875    >(
13876        mut self,
13877        v: T,
13878    ) -> Self {
13879        self.backfill_strategy = std::option::Option::Some(
13880            crate::model::stream::BackfillStrategy::BackfillNone(v.into()),
13881        );
13882        self
13883    }
13884}
13885
13886impl wkt::message::Message for Stream {
13887    fn typename() -> &'static str {
13888        "type.googleapis.com/google.cloud.datastream.v1.Stream"
13889    }
13890}
13891
13892/// Defines additional types related to [Stream].
13893pub mod stream {
13894    #[allow(unused_imports)]
13895    use super::*;
13896
13897    /// Backfill strategy to automatically backfill the Stream's objects.
13898    /// Specific objects can be excluded.
13899    #[derive(Clone, Default, PartialEq)]
13900    #[non_exhaustive]
13901    pub struct BackfillAllStrategy {
13902        /// List of objects to exclude.
13903        pub excluded_objects:
13904            std::option::Option<crate::model::stream::backfill_all_strategy::ExcludedObjects>,
13905
13906        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13907    }
13908
13909    impl BackfillAllStrategy {
13910        /// Creates a new default instance.
13911        pub fn new() -> Self {
13912            std::default::Default::default()
13913        }
13914
13915        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects].
13916        ///
13917        /// Note that all the setters affecting `excluded_objects` are mutually
13918        /// exclusive.
13919        ///
13920        /// # Example
13921        /// ```ignore,no_run
13922        /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13923        /// use google_cloud_datastream_v1::model::OracleRdbms;
13924        /// let x = BackfillAllStrategy::new().set_excluded_objects(Some(
13925        ///     google_cloud_datastream_v1::model::stream::backfill_all_strategy::ExcludedObjects::OracleExcludedObjects(OracleRdbms::default().into())));
13926        /// ```
13927        pub fn set_excluded_objects<
13928            T: std::convert::Into<
13929                    std::option::Option<
13930                        crate::model::stream::backfill_all_strategy::ExcludedObjects,
13931                    >,
13932                >,
13933        >(
13934            mut self,
13935            v: T,
13936        ) -> Self {
13937            self.excluded_objects = v.into();
13938            self
13939        }
13940
13941        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13942        /// if it holds a `OracleExcludedObjects`, `None` if the field is not set or
13943        /// holds a different branch.
13944        pub fn oracle_excluded_objects(
13945            &self,
13946        ) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
13947            #[allow(unreachable_patterns)]
13948            self.excluded_objects.as_ref().and_then(|v| match v {
13949                crate::model::stream::backfill_all_strategy::ExcludedObjects::OracleExcludedObjects(v) => std::option::Option::Some(v),
13950                _ => std::option::Option::None,
13951            })
13952        }
13953
13954        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13955        /// to hold a `OracleExcludedObjects`.
13956        ///
13957        /// Note that all the setters affecting `excluded_objects` are
13958        /// mutually exclusive.
13959        ///
13960        /// # Example
13961        /// ```ignore,no_run
13962        /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13963        /// use google_cloud_datastream_v1::model::OracleRdbms;
13964        /// let x = BackfillAllStrategy::new().set_oracle_excluded_objects(OracleRdbms::default()/* use setters */);
13965        /// assert!(x.oracle_excluded_objects().is_some());
13966        /// assert!(x.mysql_excluded_objects().is_none());
13967        /// assert!(x.postgresql_excluded_objects().is_none());
13968        /// assert!(x.sql_server_excluded_objects().is_none());
13969        /// assert!(x.salesforce_excluded_objects().is_none());
13970        /// assert!(x.mongodb_excluded_objects().is_none());
13971        /// ```
13972        pub fn set_oracle_excluded_objects<
13973            T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>,
13974        >(
13975            mut self,
13976            v: T,
13977        ) -> Self {
13978            self.excluded_objects = std::option::Option::Some(
13979                crate::model::stream::backfill_all_strategy::ExcludedObjects::OracleExcludedObjects(
13980                    v.into(),
13981                ),
13982            );
13983            self
13984        }
13985
13986        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13987        /// if it holds a `MysqlExcludedObjects`, `None` if the field is not set or
13988        /// holds a different branch.
13989        pub fn mysql_excluded_objects(
13990            &self,
13991        ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
13992            #[allow(unreachable_patterns)]
13993            self.excluded_objects.as_ref().and_then(|v| match v {
13994                crate::model::stream::backfill_all_strategy::ExcludedObjects::MysqlExcludedObjects(v) => std::option::Option::Some(v),
13995                _ => std::option::Option::None,
13996            })
13997        }
13998
13999        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
14000        /// to hold a `MysqlExcludedObjects`.
14001        ///
14002        /// Note that all the setters affecting `excluded_objects` are
14003        /// mutually exclusive.
14004        ///
14005        /// # Example
14006        /// ```ignore,no_run
14007        /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
14008        /// use google_cloud_datastream_v1::model::MysqlRdbms;
14009        /// let x = BackfillAllStrategy::new().set_mysql_excluded_objects(MysqlRdbms::default()/* use setters */);
14010        /// assert!(x.mysql_excluded_objects().is_some());
14011        /// assert!(x.oracle_excluded_objects().is_none());
14012        /// assert!(x.postgresql_excluded_objects().is_none());
14013        /// assert!(x.sql_server_excluded_objects().is_none());
14014        /// assert!(x.salesforce_excluded_objects().is_none());
14015        /// assert!(x.mongodb_excluded_objects().is_none());
14016        /// ```
14017        pub fn set_mysql_excluded_objects<
14018            T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>,
14019        >(
14020            mut self,
14021            v: T,
14022        ) -> Self {
14023            self.excluded_objects = std::option::Option::Some(
14024                crate::model::stream::backfill_all_strategy::ExcludedObjects::MysqlExcludedObjects(
14025                    v.into(),
14026                ),
14027            );
14028            self
14029        }
14030
14031        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
14032        /// if it holds a `PostgresqlExcludedObjects`, `None` if the field is not set or
14033        /// holds a different branch.
14034        pub fn postgresql_excluded_objects(
14035            &self,
14036        ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
14037            #[allow(unreachable_patterns)]
14038            self.excluded_objects.as_ref().and_then(|v| match v {
14039                crate::model::stream::backfill_all_strategy::ExcludedObjects::PostgresqlExcludedObjects(v) => std::option::Option::Some(v),
14040                _ => std::option::Option::None,
14041            })
14042        }
14043
14044        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
14045        /// to hold a `PostgresqlExcludedObjects`.
14046        ///
14047        /// Note that all the setters affecting `excluded_objects` are
14048        /// mutually exclusive.
14049        ///
14050        /// # Example
14051        /// ```ignore,no_run
14052        /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
14053        /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
14054        /// let x = BackfillAllStrategy::new().set_postgresql_excluded_objects(PostgresqlRdbms::default()/* use setters */);
14055        /// assert!(x.postgresql_excluded_objects().is_some());
14056        /// assert!(x.oracle_excluded_objects().is_none());
14057        /// assert!(x.mysql_excluded_objects().is_none());
14058        /// assert!(x.sql_server_excluded_objects().is_none());
14059        /// assert!(x.salesforce_excluded_objects().is_none());
14060        /// assert!(x.mongodb_excluded_objects().is_none());
14061        /// ```
14062        pub fn set_postgresql_excluded_objects<
14063            T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
14064        >(
14065            mut self,
14066            v: T,
14067        ) -> Self {
14068            self.excluded_objects = std::option::Option::Some(
14069                crate::model::stream::backfill_all_strategy::ExcludedObjects::PostgresqlExcludedObjects(
14070                    v.into()
14071                )
14072            );
14073            self
14074        }
14075
14076        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
14077        /// if it holds a `SqlServerExcludedObjects`, `None` if the field is not set or
14078        /// holds a different branch.
14079        pub fn sql_server_excluded_objects(
14080            &self,
14081        ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
14082            #[allow(unreachable_patterns)]
14083            self.excluded_objects.as_ref().and_then(|v| match v {
14084                crate::model::stream::backfill_all_strategy::ExcludedObjects::SqlServerExcludedObjects(v) => std::option::Option::Some(v),
14085                _ => std::option::Option::None,
14086            })
14087        }
14088
14089        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
14090        /// to hold a `SqlServerExcludedObjects`.
14091        ///
14092        /// Note that all the setters affecting `excluded_objects` are
14093        /// mutually exclusive.
14094        ///
14095        /// # Example
14096        /// ```ignore,no_run
14097        /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
14098        /// use google_cloud_datastream_v1::model::SqlServerRdbms;
14099        /// let x = BackfillAllStrategy::new().set_sql_server_excluded_objects(SqlServerRdbms::default()/* use setters */);
14100        /// assert!(x.sql_server_excluded_objects().is_some());
14101        /// assert!(x.oracle_excluded_objects().is_none());
14102        /// assert!(x.mysql_excluded_objects().is_none());
14103        /// assert!(x.postgresql_excluded_objects().is_none());
14104        /// assert!(x.salesforce_excluded_objects().is_none());
14105        /// assert!(x.mongodb_excluded_objects().is_none());
14106        /// ```
14107        pub fn set_sql_server_excluded_objects<
14108            T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
14109        >(
14110            mut self,
14111            v: T,
14112        ) -> Self {
14113            self.excluded_objects = std::option::Option::Some(
14114                crate::model::stream::backfill_all_strategy::ExcludedObjects::SqlServerExcludedObjects(
14115                    v.into()
14116                )
14117            );
14118            self
14119        }
14120
14121        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
14122        /// if it holds a `SalesforceExcludedObjects`, `None` if the field is not set or
14123        /// holds a different branch.
14124        pub fn salesforce_excluded_objects(
14125            &self,
14126        ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceOrg>> {
14127            #[allow(unreachable_patterns)]
14128            self.excluded_objects.as_ref().and_then(|v| match v {
14129                crate::model::stream::backfill_all_strategy::ExcludedObjects::SalesforceExcludedObjects(v) => std::option::Option::Some(v),
14130                _ => std::option::Option::None,
14131            })
14132        }
14133
14134        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
14135        /// to hold a `SalesforceExcludedObjects`.
14136        ///
14137        /// Note that all the setters affecting `excluded_objects` are
14138        /// mutually exclusive.
14139        ///
14140        /// # Example
14141        /// ```ignore,no_run
14142        /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
14143        /// use google_cloud_datastream_v1::model::SalesforceOrg;
14144        /// let x = BackfillAllStrategy::new().set_salesforce_excluded_objects(SalesforceOrg::default()/* use setters */);
14145        /// assert!(x.salesforce_excluded_objects().is_some());
14146        /// assert!(x.oracle_excluded_objects().is_none());
14147        /// assert!(x.mysql_excluded_objects().is_none());
14148        /// assert!(x.postgresql_excluded_objects().is_none());
14149        /// assert!(x.sql_server_excluded_objects().is_none());
14150        /// assert!(x.mongodb_excluded_objects().is_none());
14151        /// ```
14152        pub fn set_salesforce_excluded_objects<
14153            T: std::convert::Into<std::boxed::Box<crate::model::SalesforceOrg>>,
14154        >(
14155            mut self,
14156            v: T,
14157        ) -> Self {
14158            self.excluded_objects = std::option::Option::Some(
14159                crate::model::stream::backfill_all_strategy::ExcludedObjects::SalesforceExcludedObjects(
14160                    v.into()
14161                )
14162            );
14163            self
14164        }
14165
14166        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
14167        /// if it holds a `MongodbExcludedObjects`, `None` if the field is not set or
14168        /// holds a different branch.
14169        pub fn mongodb_excluded_objects(
14170            &self,
14171        ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbCluster>> {
14172            #[allow(unreachable_patterns)]
14173            self.excluded_objects.as_ref().and_then(|v| match v {
14174                crate::model::stream::backfill_all_strategy::ExcludedObjects::MongodbExcludedObjects(v) => std::option::Option::Some(v),
14175                _ => std::option::Option::None,
14176            })
14177        }
14178
14179        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
14180        /// to hold a `MongodbExcludedObjects`.
14181        ///
14182        /// Note that all the setters affecting `excluded_objects` are
14183        /// mutually exclusive.
14184        ///
14185        /// # Example
14186        /// ```ignore,no_run
14187        /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
14188        /// use google_cloud_datastream_v1::model::MongodbCluster;
14189        /// let x = BackfillAllStrategy::new().set_mongodb_excluded_objects(MongodbCluster::default()/* use setters */);
14190        /// assert!(x.mongodb_excluded_objects().is_some());
14191        /// assert!(x.oracle_excluded_objects().is_none());
14192        /// assert!(x.mysql_excluded_objects().is_none());
14193        /// assert!(x.postgresql_excluded_objects().is_none());
14194        /// assert!(x.sql_server_excluded_objects().is_none());
14195        /// assert!(x.salesforce_excluded_objects().is_none());
14196        /// ```
14197        pub fn set_mongodb_excluded_objects<
14198            T: std::convert::Into<std::boxed::Box<crate::model::MongodbCluster>>,
14199        >(
14200            mut self,
14201            v: T,
14202        ) -> Self {
14203            self.excluded_objects = std::option::Option::Some(
14204                crate::model::stream::backfill_all_strategy::ExcludedObjects::MongodbExcludedObjects(
14205                    v.into()
14206                )
14207            );
14208            self
14209        }
14210    }
14211
14212    impl wkt::message::Message for BackfillAllStrategy {
14213        fn typename() -> &'static str {
14214            "type.googleapis.com/google.cloud.datastream.v1.Stream.BackfillAllStrategy"
14215        }
14216    }
14217
14218    /// Defines additional types related to [BackfillAllStrategy].
14219    pub mod backfill_all_strategy {
14220        #[allow(unused_imports)]
14221        use super::*;
14222
14223        /// List of objects to exclude.
14224        #[derive(Clone, Debug, PartialEq)]
14225        #[non_exhaustive]
14226        pub enum ExcludedObjects {
14227            /// Oracle data source objects to avoid backfilling.
14228            OracleExcludedObjects(std::boxed::Box<crate::model::OracleRdbms>),
14229            /// MySQL data source objects to avoid backfilling.
14230            MysqlExcludedObjects(std::boxed::Box<crate::model::MysqlRdbms>),
14231            /// PostgreSQL data source objects to avoid backfilling.
14232            PostgresqlExcludedObjects(std::boxed::Box<crate::model::PostgresqlRdbms>),
14233            /// SQLServer data source objects to avoid backfilling
14234            SqlServerExcludedObjects(std::boxed::Box<crate::model::SqlServerRdbms>),
14235            /// Salesforce data source objects to avoid backfilling
14236            SalesforceExcludedObjects(std::boxed::Box<crate::model::SalesforceOrg>),
14237            /// MongoDB data source objects to avoid backfilling
14238            MongodbExcludedObjects(std::boxed::Box<crate::model::MongodbCluster>),
14239        }
14240    }
14241
14242    /// Backfill strategy to disable automatic backfill for the Stream's objects.
14243    #[derive(Clone, Default, PartialEq)]
14244    #[non_exhaustive]
14245    pub struct BackfillNoneStrategy {
14246        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14247    }
14248
14249    impl BackfillNoneStrategy {
14250        /// Creates a new default instance.
14251        pub fn new() -> Self {
14252            std::default::Default::default()
14253        }
14254    }
14255
14256    impl wkt::message::Message for BackfillNoneStrategy {
14257        fn typename() -> &'static str {
14258            "type.googleapis.com/google.cloud.datastream.v1.Stream.BackfillNoneStrategy"
14259        }
14260    }
14261
14262    /// Stream state.
14263    ///
14264    /// # Working with unknown values
14265    ///
14266    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14267    /// additional enum variants at any time. Adding new variants is not considered
14268    /// a breaking change. Applications should write their code in anticipation of:
14269    ///
14270    /// - New values appearing in future releases of the client library, **and**
14271    /// - New values received dynamically, without application changes.
14272    ///
14273    /// Please consult the [Working with enums] section in the user guide for some
14274    /// guidelines.
14275    ///
14276    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14277    #[derive(Clone, Debug, PartialEq)]
14278    #[non_exhaustive]
14279    pub enum State {
14280        /// Unspecified stream state.
14281        Unspecified,
14282        /// The stream has been created but has not yet started streaming data.
14283        NotStarted,
14284        /// The stream is running.
14285        Running,
14286        /// The stream is paused.
14287        Paused,
14288        /// The stream is in maintenance mode.
14289        ///
14290        /// Updates are rejected on the resource in this state.
14291        Maintenance,
14292        /// The stream is experiencing an error that is preventing data from being
14293        /// streamed.
14294        Failed,
14295        /// The stream has experienced a terminal failure.
14296        FailedPermanently,
14297        /// The stream is starting, but not yet running.
14298        Starting,
14299        /// The Stream is no longer reading new events, but still writing events in
14300        /// the buffer.
14301        Draining,
14302        /// If set, the enum was initialized with an unknown value.
14303        ///
14304        /// Applications can examine the value using [State::value] or
14305        /// [State::name].
14306        UnknownValue(state::UnknownValue),
14307    }
14308
14309    #[doc(hidden)]
14310    pub mod state {
14311        #[allow(unused_imports)]
14312        use super::*;
14313        #[derive(Clone, Debug, PartialEq)]
14314        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14315    }
14316
14317    impl State {
14318        /// Gets the enum value.
14319        ///
14320        /// Returns `None` if the enum contains an unknown value deserialized from
14321        /// the string representation of enums.
14322        pub fn value(&self) -> std::option::Option<i32> {
14323            match self {
14324                Self::Unspecified => std::option::Option::Some(0),
14325                Self::NotStarted => std::option::Option::Some(1),
14326                Self::Running => std::option::Option::Some(2),
14327                Self::Paused => std::option::Option::Some(3),
14328                Self::Maintenance => std::option::Option::Some(4),
14329                Self::Failed => std::option::Option::Some(5),
14330                Self::FailedPermanently => std::option::Option::Some(6),
14331                Self::Starting => std::option::Option::Some(7),
14332                Self::Draining => std::option::Option::Some(8),
14333                Self::UnknownValue(u) => u.0.value(),
14334            }
14335        }
14336
14337        /// Gets the enum value as a string.
14338        ///
14339        /// Returns `None` if the enum contains an unknown value deserialized from
14340        /// the integer representation of enums.
14341        pub fn name(&self) -> std::option::Option<&str> {
14342            match self {
14343                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14344                Self::NotStarted => std::option::Option::Some("NOT_STARTED"),
14345                Self::Running => std::option::Option::Some("RUNNING"),
14346                Self::Paused => std::option::Option::Some("PAUSED"),
14347                Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
14348                Self::Failed => std::option::Option::Some("FAILED"),
14349                Self::FailedPermanently => std::option::Option::Some("FAILED_PERMANENTLY"),
14350                Self::Starting => std::option::Option::Some("STARTING"),
14351                Self::Draining => std::option::Option::Some("DRAINING"),
14352                Self::UnknownValue(u) => u.0.name(),
14353            }
14354        }
14355    }
14356
14357    impl std::default::Default for State {
14358        fn default() -> Self {
14359            use std::convert::From;
14360            Self::from(0)
14361        }
14362    }
14363
14364    impl std::fmt::Display for State {
14365        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14366            wkt::internal::display_enum(f, self.name(), self.value())
14367        }
14368    }
14369
14370    impl std::convert::From<i32> for State {
14371        fn from(value: i32) -> Self {
14372            match value {
14373                0 => Self::Unspecified,
14374                1 => Self::NotStarted,
14375                2 => Self::Running,
14376                3 => Self::Paused,
14377                4 => Self::Maintenance,
14378                5 => Self::Failed,
14379                6 => Self::FailedPermanently,
14380                7 => Self::Starting,
14381                8 => Self::Draining,
14382                _ => Self::UnknownValue(state::UnknownValue(
14383                    wkt::internal::UnknownEnumValue::Integer(value),
14384                )),
14385            }
14386        }
14387    }
14388
14389    impl std::convert::From<&str> for State {
14390        fn from(value: &str) -> Self {
14391            use std::string::ToString;
14392            match value {
14393                "STATE_UNSPECIFIED" => Self::Unspecified,
14394                "NOT_STARTED" => Self::NotStarted,
14395                "RUNNING" => Self::Running,
14396                "PAUSED" => Self::Paused,
14397                "MAINTENANCE" => Self::Maintenance,
14398                "FAILED" => Self::Failed,
14399                "FAILED_PERMANENTLY" => Self::FailedPermanently,
14400                "STARTING" => Self::Starting,
14401                "DRAINING" => Self::Draining,
14402                _ => Self::UnknownValue(state::UnknownValue(
14403                    wkt::internal::UnknownEnumValue::String(value.to_string()),
14404                )),
14405            }
14406        }
14407    }
14408
14409    impl serde::ser::Serialize for State {
14410        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14411        where
14412            S: serde::Serializer,
14413        {
14414            match self {
14415                Self::Unspecified => serializer.serialize_i32(0),
14416                Self::NotStarted => serializer.serialize_i32(1),
14417                Self::Running => serializer.serialize_i32(2),
14418                Self::Paused => serializer.serialize_i32(3),
14419                Self::Maintenance => serializer.serialize_i32(4),
14420                Self::Failed => serializer.serialize_i32(5),
14421                Self::FailedPermanently => serializer.serialize_i32(6),
14422                Self::Starting => serializer.serialize_i32(7),
14423                Self::Draining => serializer.serialize_i32(8),
14424                Self::UnknownValue(u) => u.0.serialize(serializer),
14425            }
14426        }
14427    }
14428
14429    impl<'de> serde::de::Deserialize<'de> for State {
14430        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14431        where
14432            D: serde::Deserializer<'de>,
14433        {
14434            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14435                ".google.cloud.datastream.v1.Stream.State",
14436            ))
14437        }
14438    }
14439
14440    /// Stream backfill strategy.
14441    #[derive(Clone, Debug, PartialEq)]
14442    #[non_exhaustive]
14443    pub enum BackfillStrategy {
14444        /// Automatically backfill objects included in the stream source
14445        /// configuration. Specific objects can be excluded.
14446        BackfillAll(std::boxed::Box<crate::model::stream::BackfillAllStrategy>),
14447        /// Do not automatically backfill any objects.
14448        BackfillNone(std::boxed::Box<crate::model::stream::BackfillNoneStrategy>),
14449    }
14450}
14451
14452/// A specific stream object (e.g a specific DB table).
14453#[derive(Clone, Default, PartialEq)]
14454#[non_exhaustive]
14455pub struct StreamObject {
14456    /// Output only. Identifier. The object resource's name.
14457    pub name: std::string::String,
14458
14459    /// Output only. The creation time of the object.
14460    pub create_time: std::option::Option<wkt::Timestamp>,
14461
14462    /// Output only. The last update time of the object.
14463    pub update_time: std::option::Option<wkt::Timestamp>,
14464
14465    /// Required. Display name.
14466    pub display_name: std::string::String,
14467
14468    /// Output only. Active errors on the object.
14469    pub errors: std::vec::Vec<crate::model::Error>,
14470
14471    /// The latest backfill job that was initiated for the stream object.
14472    pub backfill_job: std::option::Option<crate::model::BackfillJob>,
14473
14474    /// The object identifier in the data source.
14475    pub source_object: std::option::Option<crate::model::SourceObjectIdentifier>,
14476
14477    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14478}
14479
14480impl StreamObject {
14481    /// Creates a new default instance.
14482    pub fn new() -> Self {
14483        std::default::Default::default()
14484    }
14485
14486    /// Sets the value of [name][crate::model::StreamObject::name].
14487    ///
14488    /// # Example
14489    /// ```ignore,no_run
14490    /// # use google_cloud_datastream_v1::model::StreamObject;
14491    /// # let project_id = "project_id";
14492    /// # let location_id = "location_id";
14493    /// # let stream_id = "stream_id";
14494    /// # let object_id = "object_id";
14495    /// let x = StreamObject::new().set_name(format!("projects/{project_id}/locations/{location_id}/streams/{stream_id}/objects/{object_id}"));
14496    /// ```
14497    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14498        self.name = v.into();
14499        self
14500    }
14501
14502    /// Sets the value of [create_time][crate::model::StreamObject::create_time].
14503    ///
14504    /// # Example
14505    /// ```ignore,no_run
14506    /// # use google_cloud_datastream_v1::model::StreamObject;
14507    /// use wkt::Timestamp;
14508    /// let x = StreamObject::new().set_create_time(Timestamp::default()/* use setters */);
14509    /// ```
14510    pub fn set_create_time<T>(mut self, v: T) -> Self
14511    where
14512        T: std::convert::Into<wkt::Timestamp>,
14513    {
14514        self.create_time = std::option::Option::Some(v.into());
14515        self
14516    }
14517
14518    /// Sets or clears the value of [create_time][crate::model::StreamObject::create_time].
14519    ///
14520    /// # Example
14521    /// ```ignore,no_run
14522    /// # use google_cloud_datastream_v1::model::StreamObject;
14523    /// use wkt::Timestamp;
14524    /// let x = StreamObject::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
14525    /// let x = StreamObject::new().set_or_clear_create_time(None::<Timestamp>);
14526    /// ```
14527    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14528    where
14529        T: std::convert::Into<wkt::Timestamp>,
14530    {
14531        self.create_time = v.map(|x| x.into());
14532        self
14533    }
14534
14535    /// Sets the value of [update_time][crate::model::StreamObject::update_time].
14536    ///
14537    /// # Example
14538    /// ```ignore,no_run
14539    /// # use google_cloud_datastream_v1::model::StreamObject;
14540    /// use wkt::Timestamp;
14541    /// let x = StreamObject::new().set_update_time(Timestamp::default()/* use setters */);
14542    /// ```
14543    pub fn set_update_time<T>(mut self, v: T) -> Self
14544    where
14545        T: std::convert::Into<wkt::Timestamp>,
14546    {
14547        self.update_time = std::option::Option::Some(v.into());
14548        self
14549    }
14550
14551    /// Sets or clears the value of [update_time][crate::model::StreamObject::update_time].
14552    ///
14553    /// # Example
14554    /// ```ignore,no_run
14555    /// # use google_cloud_datastream_v1::model::StreamObject;
14556    /// use wkt::Timestamp;
14557    /// let x = StreamObject::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
14558    /// let x = StreamObject::new().set_or_clear_update_time(None::<Timestamp>);
14559    /// ```
14560    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
14561    where
14562        T: std::convert::Into<wkt::Timestamp>,
14563    {
14564        self.update_time = v.map(|x| x.into());
14565        self
14566    }
14567
14568    /// Sets the value of [display_name][crate::model::StreamObject::display_name].
14569    ///
14570    /// # Example
14571    /// ```ignore,no_run
14572    /// # use google_cloud_datastream_v1::model::StreamObject;
14573    /// let x = StreamObject::new().set_display_name("example");
14574    /// ```
14575    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14576        self.display_name = v.into();
14577        self
14578    }
14579
14580    /// Sets the value of [errors][crate::model::StreamObject::errors].
14581    ///
14582    /// # Example
14583    /// ```ignore,no_run
14584    /// # use google_cloud_datastream_v1::model::StreamObject;
14585    /// use google_cloud_datastream_v1::model::Error;
14586    /// let x = StreamObject::new()
14587    ///     .set_errors([
14588    ///         Error::default()/* use setters */,
14589    ///         Error::default()/* use (different) setters */,
14590    ///     ]);
14591    /// ```
14592    pub fn set_errors<T, V>(mut self, v: T) -> Self
14593    where
14594        T: std::iter::IntoIterator<Item = V>,
14595        V: std::convert::Into<crate::model::Error>,
14596    {
14597        use std::iter::Iterator;
14598        self.errors = v.into_iter().map(|i| i.into()).collect();
14599        self
14600    }
14601
14602    /// Sets the value of [backfill_job][crate::model::StreamObject::backfill_job].
14603    ///
14604    /// # Example
14605    /// ```ignore,no_run
14606    /// # use google_cloud_datastream_v1::model::StreamObject;
14607    /// use google_cloud_datastream_v1::model::BackfillJob;
14608    /// let x = StreamObject::new().set_backfill_job(BackfillJob::default()/* use setters */);
14609    /// ```
14610    pub fn set_backfill_job<T>(mut self, v: T) -> Self
14611    where
14612        T: std::convert::Into<crate::model::BackfillJob>,
14613    {
14614        self.backfill_job = std::option::Option::Some(v.into());
14615        self
14616    }
14617
14618    /// Sets or clears the value of [backfill_job][crate::model::StreamObject::backfill_job].
14619    ///
14620    /// # Example
14621    /// ```ignore,no_run
14622    /// # use google_cloud_datastream_v1::model::StreamObject;
14623    /// use google_cloud_datastream_v1::model::BackfillJob;
14624    /// let x = StreamObject::new().set_or_clear_backfill_job(Some(BackfillJob::default()/* use setters */));
14625    /// let x = StreamObject::new().set_or_clear_backfill_job(None::<BackfillJob>);
14626    /// ```
14627    pub fn set_or_clear_backfill_job<T>(mut self, v: std::option::Option<T>) -> Self
14628    where
14629        T: std::convert::Into<crate::model::BackfillJob>,
14630    {
14631        self.backfill_job = v.map(|x| x.into());
14632        self
14633    }
14634
14635    /// Sets the value of [source_object][crate::model::StreamObject::source_object].
14636    ///
14637    /// # Example
14638    /// ```ignore,no_run
14639    /// # use google_cloud_datastream_v1::model::StreamObject;
14640    /// use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14641    /// let x = StreamObject::new().set_source_object(SourceObjectIdentifier::default()/* use setters */);
14642    /// ```
14643    pub fn set_source_object<T>(mut self, v: T) -> Self
14644    where
14645        T: std::convert::Into<crate::model::SourceObjectIdentifier>,
14646    {
14647        self.source_object = std::option::Option::Some(v.into());
14648        self
14649    }
14650
14651    /// Sets or clears the value of [source_object][crate::model::StreamObject::source_object].
14652    ///
14653    /// # Example
14654    /// ```ignore,no_run
14655    /// # use google_cloud_datastream_v1::model::StreamObject;
14656    /// use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14657    /// let x = StreamObject::new().set_or_clear_source_object(Some(SourceObjectIdentifier::default()/* use setters */));
14658    /// let x = StreamObject::new().set_or_clear_source_object(None::<SourceObjectIdentifier>);
14659    /// ```
14660    pub fn set_or_clear_source_object<T>(mut self, v: std::option::Option<T>) -> Self
14661    where
14662        T: std::convert::Into<crate::model::SourceObjectIdentifier>,
14663    {
14664        self.source_object = v.map(|x| x.into());
14665        self
14666    }
14667}
14668
14669impl wkt::message::Message for StreamObject {
14670    fn typename() -> &'static str {
14671        "type.googleapis.com/google.cloud.datastream.v1.StreamObject"
14672    }
14673}
14674
14675/// Represents an identifier of an object in the data source.
14676#[derive(Clone, Default, PartialEq)]
14677#[non_exhaustive]
14678pub struct SourceObjectIdentifier {
14679    /// The identifier for an object in the data source.
14680    pub source_identifier:
14681        std::option::Option<crate::model::source_object_identifier::SourceIdentifier>,
14682
14683    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14684}
14685
14686impl SourceObjectIdentifier {
14687    /// Creates a new default instance.
14688    pub fn new() -> Self {
14689        std::default::Default::default()
14690    }
14691
14692    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier].
14693    ///
14694    /// Note that all the setters affecting `source_identifier` are mutually
14695    /// exclusive.
14696    ///
14697    /// # Example
14698    /// ```ignore,no_run
14699    /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14700    /// use google_cloud_datastream_v1::model::source_object_identifier::OracleObjectIdentifier;
14701    /// let x = SourceObjectIdentifier::new().set_source_identifier(Some(
14702    ///     google_cloud_datastream_v1::model::source_object_identifier::SourceIdentifier::OracleIdentifier(OracleObjectIdentifier::default().into())));
14703    /// ```
14704    pub fn set_source_identifier<
14705        T: std::convert::Into<
14706                std::option::Option<crate::model::source_object_identifier::SourceIdentifier>,
14707            >,
14708    >(
14709        mut self,
14710        v: T,
14711    ) -> Self {
14712        self.source_identifier = v.into();
14713        self
14714    }
14715
14716    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14717    /// if it holds a `OracleIdentifier`, `None` if the field is not set or
14718    /// holds a different branch.
14719    pub fn oracle_identifier(
14720        &self,
14721    ) -> std::option::Option<
14722        &std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
14723    > {
14724        #[allow(unreachable_patterns)]
14725        self.source_identifier.as_ref().and_then(|v| match v {
14726            crate::model::source_object_identifier::SourceIdentifier::OracleIdentifier(v) => {
14727                std::option::Option::Some(v)
14728            }
14729            _ => std::option::Option::None,
14730        })
14731    }
14732
14733    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14734    /// to hold a `OracleIdentifier`.
14735    ///
14736    /// Note that all the setters affecting `source_identifier` are
14737    /// mutually exclusive.
14738    ///
14739    /// # Example
14740    /// ```ignore,no_run
14741    /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14742    /// use google_cloud_datastream_v1::model::source_object_identifier::OracleObjectIdentifier;
14743    /// let x = SourceObjectIdentifier::new().set_oracle_identifier(OracleObjectIdentifier::default()/* use setters */);
14744    /// assert!(x.oracle_identifier().is_some());
14745    /// assert!(x.mysql_identifier().is_none());
14746    /// assert!(x.postgresql_identifier().is_none());
14747    /// assert!(x.sql_server_identifier().is_none());
14748    /// assert!(x.salesforce_identifier().is_none());
14749    /// assert!(x.mongodb_identifier().is_none());
14750    /// ```
14751    pub fn set_oracle_identifier<
14752        T: std::convert::Into<
14753                std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
14754            >,
14755    >(
14756        mut self,
14757        v: T,
14758    ) -> Self {
14759        self.source_identifier = std::option::Option::Some(
14760            crate::model::source_object_identifier::SourceIdentifier::OracleIdentifier(v.into()),
14761        );
14762        self
14763    }
14764
14765    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14766    /// if it holds a `MysqlIdentifier`, `None` if the field is not set or
14767    /// holds a different branch.
14768    pub fn mysql_identifier(
14769        &self,
14770    ) -> std::option::Option<
14771        &std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
14772    > {
14773        #[allow(unreachable_patterns)]
14774        self.source_identifier.as_ref().and_then(|v| match v {
14775            crate::model::source_object_identifier::SourceIdentifier::MysqlIdentifier(v) => {
14776                std::option::Option::Some(v)
14777            }
14778            _ => std::option::Option::None,
14779        })
14780    }
14781
14782    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14783    /// to hold a `MysqlIdentifier`.
14784    ///
14785    /// Note that all the setters affecting `source_identifier` are
14786    /// mutually exclusive.
14787    ///
14788    /// # Example
14789    /// ```ignore,no_run
14790    /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14791    /// use google_cloud_datastream_v1::model::source_object_identifier::MysqlObjectIdentifier;
14792    /// let x = SourceObjectIdentifier::new().set_mysql_identifier(MysqlObjectIdentifier::default()/* use setters */);
14793    /// assert!(x.mysql_identifier().is_some());
14794    /// assert!(x.oracle_identifier().is_none());
14795    /// assert!(x.postgresql_identifier().is_none());
14796    /// assert!(x.sql_server_identifier().is_none());
14797    /// assert!(x.salesforce_identifier().is_none());
14798    /// assert!(x.mongodb_identifier().is_none());
14799    /// ```
14800    pub fn set_mysql_identifier<
14801        T: std::convert::Into<
14802                std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
14803            >,
14804    >(
14805        mut self,
14806        v: T,
14807    ) -> Self {
14808        self.source_identifier = std::option::Option::Some(
14809            crate::model::source_object_identifier::SourceIdentifier::MysqlIdentifier(v.into()),
14810        );
14811        self
14812    }
14813
14814    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14815    /// if it holds a `PostgresqlIdentifier`, `None` if the field is not set or
14816    /// holds a different branch.
14817    pub fn postgresql_identifier(
14818        &self,
14819    ) -> std::option::Option<
14820        &std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
14821    > {
14822        #[allow(unreachable_patterns)]
14823        self.source_identifier.as_ref().and_then(|v| match v {
14824            crate::model::source_object_identifier::SourceIdentifier::PostgresqlIdentifier(v) => {
14825                std::option::Option::Some(v)
14826            }
14827            _ => std::option::Option::None,
14828        })
14829    }
14830
14831    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14832    /// to hold a `PostgresqlIdentifier`.
14833    ///
14834    /// Note that all the setters affecting `source_identifier` are
14835    /// mutually exclusive.
14836    ///
14837    /// # Example
14838    /// ```ignore,no_run
14839    /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14840    /// use google_cloud_datastream_v1::model::source_object_identifier::PostgresqlObjectIdentifier;
14841    /// let x = SourceObjectIdentifier::new().set_postgresql_identifier(PostgresqlObjectIdentifier::default()/* use setters */);
14842    /// assert!(x.postgresql_identifier().is_some());
14843    /// assert!(x.oracle_identifier().is_none());
14844    /// assert!(x.mysql_identifier().is_none());
14845    /// assert!(x.sql_server_identifier().is_none());
14846    /// assert!(x.salesforce_identifier().is_none());
14847    /// assert!(x.mongodb_identifier().is_none());
14848    /// ```
14849    pub fn set_postgresql_identifier<
14850        T: std::convert::Into<
14851                std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
14852            >,
14853    >(
14854        mut self,
14855        v: T,
14856    ) -> Self {
14857        self.source_identifier = std::option::Option::Some(
14858            crate::model::source_object_identifier::SourceIdentifier::PostgresqlIdentifier(
14859                v.into(),
14860            ),
14861        );
14862        self
14863    }
14864
14865    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14866    /// if it holds a `SqlServerIdentifier`, `None` if the field is not set or
14867    /// holds a different branch.
14868    pub fn sql_server_identifier(
14869        &self,
14870    ) -> std::option::Option<
14871        &std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
14872    > {
14873        #[allow(unreachable_patterns)]
14874        self.source_identifier.as_ref().and_then(|v| match v {
14875            crate::model::source_object_identifier::SourceIdentifier::SqlServerIdentifier(v) => {
14876                std::option::Option::Some(v)
14877            }
14878            _ => std::option::Option::None,
14879        })
14880    }
14881
14882    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14883    /// to hold a `SqlServerIdentifier`.
14884    ///
14885    /// Note that all the setters affecting `source_identifier` are
14886    /// mutually exclusive.
14887    ///
14888    /// # Example
14889    /// ```ignore,no_run
14890    /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14891    /// use google_cloud_datastream_v1::model::source_object_identifier::SqlServerObjectIdentifier;
14892    /// let x = SourceObjectIdentifier::new().set_sql_server_identifier(SqlServerObjectIdentifier::default()/* use setters */);
14893    /// assert!(x.sql_server_identifier().is_some());
14894    /// assert!(x.oracle_identifier().is_none());
14895    /// assert!(x.mysql_identifier().is_none());
14896    /// assert!(x.postgresql_identifier().is_none());
14897    /// assert!(x.salesforce_identifier().is_none());
14898    /// assert!(x.mongodb_identifier().is_none());
14899    /// ```
14900    pub fn set_sql_server_identifier<
14901        T: std::convert::Into<
14902                std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
14903            >,
14904    >(
14905        mut self,
14906        v: T,
14907    ) -> Self {
14908        self.source_identifier = std::option::Option::Some(
14909            crate::model::source_object_identifier::SourceIdentifier::SqlServerIdentifier(v.into()),
14910        );
14911        self
14912    }
14913
14914    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14915    /// if it holds a `SalesforceIdentifier`, `None` if the field is not set or
14916    /// holds a different branch.
14917    pub fn salesforce_identifier(
14918        &self,
14919    ) -> std::option::Option<
14920        &std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>,
14921    > {
14922        #[allow(unreachable_patterns)]
14923        self.source_identifier.as_ref().and_then(|v| match v {
14924            crate::model::source_object_identifier::SourceIdentifier::SalesforceIdentifier(v) => {
14925                std::option::Option::Some(v)
14926            }
14927            _ => std::option::Option::None,
14928        })
14929    }
14930
14931    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14932    /// to hold a `SalesforceIdentifier`.
14933    ///
14934    /// Note that all the setters affecting `source_identifier` are
14935    /// mutually exclusive.
14936    ///
14937    /// # Example
14938    /// ```ignore,no_run
14939    /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14940    /// use google_cloud_datastream_v1::model::source_object_identifier::SalesforceObjectIdentifier;
14941    /// let x = SourceObjectIdentifier::new().set_salesforce_identifier(SalesforceObjectIdentifier::default()/* use setters */);
14942    /// assert!(x.salesforce_identifier().is_some());
14943    /// assert!(x.oracle_identifier().is_none());
14944    /// assert!(x.mysql_identifier().is_none());
14945    /// assert!(x.postgresql_identifier().is_none());
14946    /// assert!(x.sql_server_identifier().is_none());
14947    /// assert!(x.mongodb_identifier().is_none());
14948    /// ```
14949    pub fn set_salesforce_identifier<
14950        T: std::convert::Into<
14951                std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>,
14952            >,
14953    >(
14954        mut self,
14955        v: T,
14956    ) -> Self {
14957        self.source_identifier = std::option::Option::Some(
14958            crate::model::source_object_identifier::SourceIdentifier::SalesforceIdentifier(
14959                v.into(),
14960            ),
14961        );
14962        self
14963    }
14964
14965    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14966    /// if it holds a `MongodbIdentifier`, `None` if the field is not set or
14967    /// holds a different branch.
14968    pub fn mongodb_identifier(
14969        &self,
14970    ) -> std::option::Option<
14971        &std::boxed::Box<crate::model::source_object_identifier::MongodbObjectIdentifier>,
14972    > {
14973        #[allow(unreachable_patterns)]
14974        self.source_identifier.as_ref().and_then(|v| match v {
14975            crate::model::source_object_identifier::SourceIdentifier::MongodbIdentifier(v) => {
14976                std::option::Option::Some(v)
14977            }
14978            _ => std::option::Option::None,
14979        })
14980    }
14981
14982    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14983    /// to hold a `MongodbIdentifier`.
14984    ///
14985    /// Note that all the setters affecting `source_identifier` are
14986    /// mutually exclusive.
14987    ///
14988    /// # Example
14989    /// ```ignore,no_run
14990    /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14991    /// use google_cloud_datastream_v1::model::source_object_identifier::MongodbObjectIdentifier;
14992    /// let x = SourceObjectIdentifier::new().set_mongodb_identifier(MongodbObjectIdentifier::default()/* use setters */);
14993    /// assert!(x.mongodb_identifier().is_some());
14994    /// assert!(x.oracle_identifier().is_none());
14995    /// assert!(x.mysql_identifier().is_none());
14996    /// assert!(x.postgresql_identifier().is_none());
14997    /// assert!(x.sql_server_identifier().is_none());
14998    /// assert!(x.salesforce_identifier().is_none());
14999    /// ```
15000    pub fn set_mongodb_identifier<
15001        T: std::convert::Into<
15002                std::boxed::Box<crate::model::source_object_identifier::MongodbObjectIdentifier>,
15003            >,
15004    >(
15005        mut self,
15006        v: T,
15007    ) -> Self {
15008        self.source_identifier = std::option::Option::Some(
15009            crate::model::source_object_identifier::SourceIdentifier::MongodbIdentifier(v.into()),
15010        );
15011        self
15012    }
15013}
15014
15015impl wkt::message::Message for SourceObjectIdentifier {
15016    fn typename() -> &'static str {
15017        "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier"
15018    }
15019}
15020
15021/// Defines additional types related to [SourceObjectIdentifier].
15022pub mod source_object_identifier {
15023    #[allow(unused_imports)]
15024    use super::*;
15025
15026    /// Oracle data source object identifier.
15027    #[derive(Clone, Default, PartialEq)]
15028    #[non_exhaustive]
15029    pub struct OracleObjectIdentifier {
15030        /// Required. The schema name.
15031        pub schema: std::string::String,
15032
15033        /// Required. The table name.
15034        pub table: std::string::String,
15035
15036        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15037    }
15038
15039    impl OracleObjectIdentifier {
15040        /// Creates a new default instance.
15041        pub fn new() -> Self {
15042            std::default::Default::default()
15043        }
15044
15045        /// Sets the value of [schema][crate::model::source_object_identifier::OracleObjectIdentifier::schema].
15046        ///
15047        /// # Example
15048        /// ```ignore,no_run
15049        /// # use google_cloud_datastream_v1::model::source_object_identifier::OracleObjectIdentifier;
15050        /// let x = OracleObjectIdentifier::new().set_schema("example");
15051        /// ```
15052        pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15053            self.schema = v.into();
15054            self
15055        }
15056
15057        /// Sets the value of [table][crate::model::source_object_identifier::OracleObjectIdentifier::table].
15058        ///
15059        /// # Example
15060        /// ```ignore,no_run
15061        /// # use google_cloud_datastream_v1::model::source_object_identifier::OracleObjectIdentifier;
15062        /// let x = OracleObjectIdentifier::new().set_table("example");
15063        /// ```
15064        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15065            self.table = v.into();
15066            self
15067        }
15068    }
15069
15070    impl wkt::message::Message for OracleObjectIdentifier {
15071        fn typename() -> &'static str {
15072            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.OracleObjectIdentifier"
15073        }
15074    }
15075
15076    /// PostgreSQL data source object identifier.
15077    #[derive(Clone, Default, PartialEq)]
15078    #[non_exhaustive]
15079    pub struct PostgresqlObjectIdentifier {
15080        /// Required. The schema name.
15081        pub schema: std::string::String,
15082
15083        /// Required. The table name.
15084        pub table: std::string::String,
15085
15086        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15087    }
15088
15089    impl PostgresqlObjectIdentifier {
15090        /// Creates a new default instance.
15091        pub fn new() -> Self {
15092            std::default::Default::default()
15093        }
15094
15095        /// Sets the value of [schema][crate::model::source_object_identifier::PostgresqlObjectIdentifier::schema].
15096        ///
15097        /// # Example
15098        /// ```ignore,no_run
15099        /// # use google_cloud_datastream_v1::model::source_object_identifier::PostgresqlObjectIdentifier;
15100        /// let x = PostgresqlObjectIdentifier::new().set_schema("example");
15101        /// ```
15102        pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15103            self.schema = v.into();
15104            self
15105        }
15106
15107        /// Sets the value of [table][crate::model::source_object_identifier::PostgresqlObjectIdentifier::table].
15108        ///
15109        /// # Example
15110        /// ```ignore,no_run
15111        /// # use google_cloud_datastream_v1::model::source_object_identifier::PostgresqlObjectIdentifier;
15112        /// let x = PostgresqlObjectIdentifier::new().set_table("example");
15113        /// ```
15114        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15115            self.table = v.into();
15116            self
15117        }
15118    }
15119
15120    impl wkt::message::Message for PostgresqlObjectIdentifier {
15121        fn typename() -> &'static str {
15122            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.PostgresqlObjectIdentifier"
15123        }
15124    }
15125
15126    /// Mysql data source object identifier.
15127    #[derive(Clone, Default, PartialEq)]
15128    #[non_exhaustive]
15129    pub struct MysqlObjectIdentifier {
15130        /// Required. The database name.
15131        pub database: std::string::String,
15132
15133        /// Required. The table name.
15134        pub table: std::string::String,
15135
15136        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15137    }
15138
15139    impl MysqlObjectIdentifier {
15140        /// Creates a new default instance.
15141        pub fn new() -> Self {
15142            std::default::Default::default()
15143        }
15144
15145        /// Sets the value of [database][crate::model::source_object_identifier::MysqlObjectIdentifier::database].
15146        ///
15147        /// # Example
15148        /// ```ignore,no_run
15149        /// # use google_cloud_datastream_v1::model::source_object_identifier::MysqlObjectIdentifier;
15150        /// let x = MysqlObjectIdentifier::new().set_database("example");
15151        /// ```
15152        pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15153            self.database = v.into();
15154            self
15155        }
15156
15157        /// Sets the value of [table][crate::model::source_object_identifier::MysqlObjectIdentifier::table].
15158        ///
15159        /// # Example
15160        /// ```ignore,no_run
15161        /// # use google_cloud_datastream_v1::model::source_object_identifier::MysqlObjectIdentifier;
15162        /// let x = MysqlObjectIdentifier::new().set_table("example");
15163        /// ```
15164        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15165            self.table = v.into();
15166            self
15167        }
15168    }
15169
15170    impl wkt::message::Message for MysqlObjectIdentifier {
15171        fn typename() -> &'static str {
15172            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.MysqlObjectIdentifier"
15173        }
15174    }
15175
15176    /// SQLServer data source object identifier.
15177    #[derive(Clone, Default, PartialEq)]
15178    #[non_exhaustive]
15179    pub struct SqlServerObjectIdentifier {
15180        /// Required. The schema name.
15181        pub schema: std::string::String,
15182
15183        /// Required. The table name.
15184        pub table: std::string::String,
15185
15186        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15187    }
15188
15189    impl SqlServerObjectIdentifier {
15190        /// Creates a new default instance.
15191        pub fn new() -> Self {
15192            std::default::Default::default()
15193        }
15194
15195        /// Sets the value of [schema][crate::model::source_object_identifier::SqlServerObjectIdentifier::schema].
15196        ///
15197        /// # Example
15198        /// ```ignore,no_run
15199        /// # use google_cloud_datastream_v1::model::source_object_identifier::SqlServerObjectIdentifier;
15200        /// let x = SqlServerObjectIdentifier::new().set_schema("example");
15201        /// ```
15202        pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15203            self.schema = v.into();
15204            self
15205        }
15206
15207        /// Sets the value of [table][crate::model::source_object_identifier::SqlServerObjectIdentifier::table].
15208        ///
15209        /// # Example
15210        /// ```ignore,no_run
15211        /// # use google_cloud_datastream_v1::model::source_object_identifier::SqlServerObjectIdentifier;
15212        /// let x = SqlServerObjectIdentifier::new().set_table("example");
15213        /// ```
15214        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15215            self.table = v.into();
15216            self
15217        }
15218    }
15219
15220    impl wkt::message::Message for SqlServerObjectIdentifier {
15221        fn typename() -> &'static str {
15222            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.SqlServerObjectIdentifier"
15223        }
15224    }
15225
15226    /// Salesforce data source object identifier.
15227    #[derive(Clone, Default, PartialEq)]
15228    #[non_exhaustive]
15229    pub struct SalesforceObjectIdentifier {
15230        /// Required. The object name.
15231        pub object_name: std::string::String,
15232
15233        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15234    }
15235
15236    impl SalesforceObjectIdentifier {
15237        /// Creates a new default instance.
15238        pub fn new() -> Self {
15239            std::default::Default::default()
15240        }
15241
15242        /// Sets the value of [object_name][crate::model::source_object_identifier::SalesforceObjectIdentifier::object_name].
15243        ///
15244        /// # Example
15245        /// ```ignore,no_run
15246        /// # use google_cloud_datastream_v1::model::source_object_identifier::SalesforceObjectIdentifier;
15247        /// let x = SalesforceObjectIdentifier::new().set_object_name("example");
15248        /// ```
15249        pub fn set_object_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15250            self.object_name = v.into();
15251            self
15252        }
15253    }
15254
15255    impl wkt::message::Message for SalesforceObjectIdentifier {
15256        fn typename() -> &'static str {
15257            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.SalesforceObjectIdentifier"
15258        }
15259    }
15260
15261    /// MongoDB data source object identifier.
15262    #[derive(Clone, Default, PartialEq)]
15263    #[non_exhaustive]
15264    pub struct MongodbObjectIdentifier {
15265        /// Required. The database name.
15266        pub database: std::string::String,
15267
15268        /// Required. The collection name.
15269        pub collection: std::string::String,
15270
15271        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15272    }
15273
15274    impl MongodbObjectIdentifier {
15275        /// Creates a new default instance.
15276        pub fn new() -> Self {
15277            std::default::Default::default()
15278        }
15279
15280        /// Sets the value of [database][crate::model::source_object_identifier::MongodbObjectIdentifier::database].
15281        ///
15282        /// # Example
15283        /// ```ignore,no_run
15284        /// # use google_cloud_datastream_v1::model::source_object_identifier::MongodbObjectIdentifier;
15285        /// let x = MongodbObjectIdentifier::new().set_database("example");
15286        /// ```
15287        pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15288            self.database = v.into();
15289            self
15290        }
15291
15292        /// Sets the value of [collection][crate::model::source_object_identifier::MongodbObjectIdentifier::collection].
15293        ///
15294        /// # Example
15295        /// ```ignore,no_run
15296        /// # use google_cloud_datastream_v1::model::source_object_identifier::MongodbObjectIdentifier;
15297        /// let x = MongodbObjectIdentifier::new().set_collection("example");
15298        /// ```
15299        pub fn set_collection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15300            self.collection = v.into();
15301            self
15302        }
15303    }
15304
15305    impl wkt::message::Message for MongodbObjectIdentifier {
15306        fn typename() -> &'static str {
15307            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.MongodbObjectIdentifier"
15308        }
15309    }
15310
15311    /// The identifier for an object in the data source.
15312    #[derive(Clone, Debug, PartialEq)]
15313    #[non_exhaustive]
15314    pub enum SourceIdentifier {
15315        /// Oracle data source object identifier.
15316        OracleIdentifier(
15317            std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
15318        ),
15319        /// Mysql data source object identifier.
15320        MysqlIdentifier(
15321            std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
15322        ),
15323        /// PostgreSQL data source object identifier.
15324        PostgresqlIdentifier(
15325            std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
15326        ),
15327        /// SQLServer data source object identifier.
15328        SqlServerIdentifier(
15329            std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
15330        ),
15331        /// Salesforce data source object identifier.
15332        SalesforceIdentifier(
15333            std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>,
15334        ),
15335        /// MongoDB data source object identifier.
15336        MongodbIdentifier(
15337            std::boxed::Box<crate::model::source_object_identifier::MongodbObjectIdentifier>,
15338        ),
15339    }
15340}
15341
15342/// Represents a backfill job on a specific stream object.
15343#[derive(Clone, Default, PartialEq)]
15344#[non_exhaustive]
15345pub struct BackfillJob {
15346    /// Output only. Backfill job state.
15347    pub state: crate::model::backfill_job::State,
15348
15349    /// Backfill job's triggering reason.
15350    pub trigger: crate::model::backfill_job::Trigger,
15351
15352    /// Output only. Backfill job's start time.
15353    pub last_start_time: std::option::Option<wkt::Timestamp>,
15354
15355    /// Output only. Backfill job's end time.
15356    pub last_end_time: std::option::Option<wkt::Timestamp>,
15357
15358    /// Output only. Errors which caused the backfill job to fail.
15359    pub errors: std::vec::Vec<crate::model::Error>,
15360
15361    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15362}
15363
15364impl BackfillJob {
15365    /// Creates a new default instance.
15366    pub fn new() -> Self {
15367        std::default::Default::default()
15368    }
15369
15370    /// Sets the value of [state][crate::model::BackfillJob::state].
15371    ///
15372    /// # Example
15373    /// ```ignore,no_run
15374    /// # use google_cloud_datastream_v1::model::BackfillJob;
15375    /// use google_cloud_datastream_v1::model::backfill_job::State;
15376    /// let x0 = BackfillJob::new().set_state(State::NotStarted);
15377    /// let x1 = BackfillJob::new().set_state(State::Pending);
15378    /// let x2 = BackfillJob::new().set_state(State::Active);
15379    /// ```
15380    pub fn set_state<T: std::convert::Into<crate::model::backfill_job::State>>(
15381        mut self,
15382        v: T,
15383    ) -> Self {
15384        self.state = v.into();
15385        self
15386    }
15387
15388    /// Sets the value of [trigger][crate::model::BackfillJob::trigger].
15389    ///
15390    /// # Example
15391    /// ```ignore,no_run
15392    /// # use google_cloud_datastream_v1::model::BackfillJob;
15393    /// use google_cloud_datastream_v1::model::backfill_job::Trigger;
15394    /// let x0 = BackfillJob::new().set_trigger(Trigger::Automatic);
15395    /// let x1 = BackfillJob::new().set_trigger(Trigger::Manual);
15396    /// ```
15397    pub fn set_trigger<T: std::convert::Into<crate::model::backfill_job::Trigger>>(
15398        mut self,
15399        v: T,
15400    ) -> Self {
15401        self.trigger = v.into();
15402        self
15403    }
15404
15405    /// Sets the value of [last_start_time][crate::model::BackfillJob::last_start_time].
15406    ///
15407    /// # Example
15408    /// ```ignore,no_run
15409    /// # use google_cloud_datastream_v1::model::BackfillJob;
15410    /// use wkt::Timestamp;
15411    /// let x = BackfillJob::new().set_last_start_time(Timestamp::default()/* use setters */);
15412    /// ```
15413    pub fn set_last_start_time<T>(mut self, v: T) -> Self
15414    where
15415        T: std::convert::Into<wkt::Timestamp>,
15416    {
15417        self.last_start_time = std::option::Option::Some(v.into());
15418        self
15419    }
15420
15421    /// Sets or clears the value of [last_start_time][crate::model::BackfillJob::last_start_time].
15422    ///
15423    /// # Example
15424    /// ```ignore,no_run
15425    /// # use google_cloud_datastream_v1::model::BackfillJob;
15426    /// use wkt::Timestamp;
15427    /// let x = BackfillJob::new().set_or_clear_last_start_time(Some(Timestamp::default()/* use setters */));
15428    /// let x = BackfillJob::new().set_or_clear_last_start_time(None::<Timestamp>);
15429    /// ```
15430    pub fn set_or_clear_last_start_time<T>(mut self, v: std::option::Option<T>) -> Self
15431    where
15432        T: std::convert::Into<wkt::Timestamp>,
15433    {
15434        self.last_start_time = v.map(|x| x.into());
15435        self
15436    }
15437
15438    /// Sets the value of [last_end_time][crate::model::BackfillJob::last_end_time].
15439    ///
15440    /// # Example
15441    /// ```ignore,no_run
15442    /// # use google_cloud_datastream_v1::model::BackfillJob;
15443    /// use wkt::Timestamp;
15444    /// let x = BackfillJob::new().set_last_end_time(Timestamp::default()/* use setters */);
15445    /// ```
15446    pub fn set_last_end_time<T>(mut self, v: T) -> Self
15447    where
15448        T: std::convert::Into<wkt::Timestamp>,
15449    {
15450        self.last_end_time = std::option::Option::Some(v.into());
15451        self
15452    }
15453
15454    /// Sets or clears the value of [last_end_time][crate::model::BackfillJob::last_end_time].
15455    ///
15456    /// # Example
15457    /// ```ignore,no_run
15458    /// # use google_cloud_datastream_v1::model::BackfillJob;
15459    /// use wkt::Timestamp;
15460    /// let x = BackfillJob::new().set_or_clear_last_end_time(Some(Timestamp::default()/* use setters */));
15461    /// let x = BackfillJob::new().set_or_clear_last_end_time(None::<Timestamp>);
15462    /// ```
15463    pub fn set_or_clear_last_end_time<T>(mut self, v: std::option::Option<T>) -> Self
15464    where
15465        T: std::convert::Into<wkt::Timestamp>,
15466    {
15467        self.last_end_time = v.map(|x| x.into());
15468        self
15469    }
15470
15471    /// Sets the value of [errors][crate::model::BackfillJob::errors].
15472    ///
15473    /// # Example
15474    /// ```ignore,no_run
15475    /// # use google_cloud_datastream_v1::model::BackfillJob;
15476    /// use google_cloud_datastream_v1::model::Error;
15477    /// let x = BackfillJob::new()
15478    ///     .set_errors([
15479    ///         Error::default()/* use setters */,
15480    ///         Error::default()/* use (different) setters */,
15481    ///     ]);
15482    /// ```
15483    pub fn set_errors<T, V>(mut self, v: T) -> Self
15484    where
15485        T: std::iter::IntoIterator<Item = V>,
15486        V: std::convert::Into<crate::model::Error>,
15487    {
15488        use std::iter::Iterator;
15489        self.errors = v.into_iter().map(|i| i.into()).collect();
15490        self
15491    }
15492}
15493
15494impl wkt::message::Message for BackfillJob {
15495    fn typename() -> &'static str {
15496        "type.googleapis.com/google.cloud.datastream.v1.BackfillJob"
15497    }
15498}
15499
15500/// Defines additional types related to [BackfillJob].
15501pub mod backfill_job {
15502    #[allow(unused_imports)]
15503    use super::*;
15504
15505    /// State of the stream object's backfill job.
15506    ///
15507    /// # Working with unknown values
15508    ///
15509    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15510    /// additional enum variants at any time. Adding new variants is not considered
15511    /// a breaking change. Applications should write their code in anticipation of:
15512    ///
15513    /// - New values appearing in future releases of the client library, **and**
15514    /// - New values received dynamically, without application changes.
15515    ///
15516    /// Please consult the [Working with enums] section in the user guide for some
15517    /// guidelines.
15518    ///
15519    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15520    #[derive(Clone, Debug, PartialEq)]
15521    #[non_exhaustive]
15522    pub enum State {
15523        /// Default value.
15524        Unspecified,
15525        /// Backfill job was never started for the stream object (stream has backfill
15526        /// strategy defined as manual or object was explicitly excluded from
15527        /// automatic backfill).
15528        NotStarted,
15529        /// Backfill job will start pending available resources.
15530        Pending,
15531        /// Backfill job is running.
15532        Active,
15533        /// Backfill job stopped (next job run will start from beginning).
15534        Stopped,
15535        /// Backfill job failed (due to an error).
15536        Failed,
15537        /// Backfill completed successfully.
15538        Completed,
15539        /// Backfill job failed since the table structure is currently unsupported
15540        /// for backfill.
15541        Unsupported,
15542        /// If set, the enum was initialized with an unknown value.
15543        ///
15544        /// Applications can examine the value using [State::value] or
15545        /// [State::name].
15546        UnknownValue(state::UnknownValue),
15547    }
15548
15549    #[doc(hidden)]
15550    pub mod state {
15551        #[allow(unused_imports)]
15552        use super::*;
15553        #[derive(Clone, Debug, PartialEq)]
15554        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15555    }
15556
15557    impl State {
15558        /// Gets the enum value.
15559        ///
15560        /// Returns `None` if the enum contains an unknown value deserialized from
15561        /// the string representation of enums.
15562        pub fn value(&self) -> std::option::Option<i32> {
15563            match self {
15564                Self::Unspecified => std::option::Option::Some(0),
15565                Self::NotStarted => std::option::Option::Some(1),
15566                Self::Pending => std::option::Option::Some(2),
15567                Self::Active => std::option::Option::Some(3),
15568                Self::Stopped => std::option::Option::Some(4),
15569                Self::Failed => std::option::Option::Some(5),
15570                Self::Completed => std::option::Option::Some(6),
15571                Self::Unsupported => std::option::Option::Some(7),
15572                Self::UnknownValue(u) => u.0.value(),
15573            }
15574        }
15575
15576        /// Gets the enum value as a string.
15577        ///
15578        /// Returns `None` if the enum contains an unknown value deserialized from
15579        /// the integer representation of enums.
15580        pub fn name(&self) -> std::option::Option<&str> {
15581            match self {
15582                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
15583                Self::NotStarted => std::option::Option::Some("NOT_STARTED"),
15584                Self::Pending => std::option::Option::Some("PENDING"),
15585                Self::Active => std::option::Option::Some("ACTIVE"),
15586                Self::Stopped => std::option::Option::Some("STOPPED"),
15587                Self::Failed => std::option::Option::Some("FAILED"),
15588                Self::Completed => std::option::Option::Some("COMPLETED"),
15589                Self::Unsupported => std::option::Option::Some("UNSUPPORTED"),
15590                Self::UnknownValue(u) => u.0.name(),
15591            }
15592        }
15593    }
15594
15595    impl std::default::Default for State {
15596        fn default() -> Self {
15597            use std::convert::From;
15598            Self::from(0)
15599        }
15600    }
15601
15602    impl std::fmt::Display for State {
15603        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15604            wkt::internal::display_enum(f, self.name(), self.value())
15605        }
15606    }
15607
15608    impl std::convert::From<i32> for State {
15609        fn from(value: i32) -> Self {
15610            match value {
15611                0 => Self::Unspecified,
15612                1 => Self::NotStarted,
15613                2 => Self::Pending,
15614                3 => Self::Active,
15615                4 => Self::Stopped,
15616                5 => Self::Failed,
15617                6 => Self::Completed,
15618                7 => Self::Unsupported,
15619                _ => Self::UnknownValue(state::UnknownValue(
15620                    wkt::internal::UnknownEnumValue::Integer(value),
15621                )),
15622            }
15623        }
15624    }
15625
15626    impl std::convert::From<&str> for State {
15627        fn from(value: &str) -> Self {
15628            use std::string::ToString;
15629            match value {
15630                "STATE_UNSPECIFIED" => Self::Unspecified,
15631                "NOT_STARTED" => Self::NotStarted,
15632                "PENDING" => Self::Pending,
15633                "ACTIVE" => Self::Active,
15634                "STOPPED" => Self::Stopped,
15635                "FAILED" => Self::Failed,
15636                "COMPLETED" => Self::Completed,
15637                "UNSUPPORTED" => Self::Unsupported,
15638                _ => Self::UnknownValue(state::UnknownValue(
15639                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15640                )),
15641            }
15642        }
15643    }
15644
15645    impl serde::ser::Serialize for State {
15646        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15647        where
15648            S: serde::Serializer,
15649        {
15650            match self {
15651                Self::Unspecified => serializer.serialize_i32(0),
15652                Self::NotStarted => serializer.serialize_i32(1),
15653                Self::Pending => serializer.serialize_i32(2),
15654                Self::Active => serializer.serialize_i32(3),
15655                Self::Stopped => serializer.serialize_i32(4),
15656                Self::Failed => serializer.serialize_i32(5),
15657                Self::Completed => serializer.serialize_i32(6),
15658                Self::Unsupported => serializer.serialize_i32(7),
15659                Self::UnknownValue(u) => u.0.serialize(serializer),
15660            }
15661        }
15662    }
15663
15664    impl<'de> serde::de::Deserialize<'de> for State {
15665        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15666        where
15667            D: serde::Deserializer<'de>,
15668        {
15669            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
15670                ".google.cloud.datastream.v1.BackfillJob.State",
15671            ))
15672        }
15673    }
15674
15675    /// Triggering reason for a backfill job.
15676    ///
15677    /// # Working with unknown values
15678    ///
15679    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15680    /// additional enum variants at any time. Adding new variants is not considered
15681    /// a breaking change. Applications should write their code in anticipation of:
15682    ///
15683    /// - New values appearing in future releases of the client library, **and**
15684    /// - New values received dynamically, without application changes.
15685    ///
15686    /// Please consult the [Working with enums] section in the user guide for some
15687    /// guidelines.
15688    ///
15689    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15690    #[derive(Clone, Debug, PartialEq)]
15691    #[non_exhaustive]
15692    pub enum Trigger {
15693        /// Default value.
15694        Unspecified,
15695        /// Object backfill job was triggered automatically according to the stream's
15696        /// backfill strategy.
15697        Automatic,
15698        /// Object backfill job was triggered manually using the dedicated API.
15699        Manual,
15700        /// If set, the enum was initialized with an unknown value.
15701        ///
15702        /// Applications can examine the value using [Trigger::value] or
15703        /// [Trigger::name].
15704        UnknownValue(trigger::UnknownValue),
15705    }
15706
15707    #[doc(hidden)]
15708    pub mod trigger {
15709        #[allow(unused_imports)]
15710        use super::*;
15711        #[derive(Clone, Debug, PartialEq)]
15712        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15713    }
15714
15715    impl Trigger {
15716        /// Gets the enum value.
15717        ///
15718        /// Returns `None` if the enum contains an unknown value deserialized from
15719        /// the string representation of enums.
15720        pub fn value(&self) -> std::option::Option<i32> {
15721            match self {
15722                Self::Unspecified => std::option::Option::Some(0),
15723                Self::Automatic => std::option::Option::Some(1),
15724                Self::Manual => std::option::Option::Some(2),
15725                Self::UnknownValue(u) => u.0.value(),
15726            }
15727        }
15728
15729        /// Gets the enum value as a string.
15730        ///
15731        /// Returns `None` if the enum contains an unknown value deserialized from
15732        /// the integer representation of enums.
15733        pub fn name(&self) -> std::option::Option<&str> {
15734            match self {
15735                Self::Unspecified => std::option::Option::Some("TRIGGER_UNSPECIFIED"),
15736                Self::Automatic => std::option::Option::Some("AUTOMATIC"),
15737                Self::Manual => std::option::Option::Some("MANUAL"),
15738                Self::UnknownValue(u) => u.0.name(),
15739            }
15740        }
15741    }
15742
15743    impl std::default::Default for Trigger {
15744        fn default() -> Self {
15745            use std::convert::From;
15746            Self::from(0)
15747        }
15748    }
15749
15750    impl std::fmt::Display for Trigger {
15751        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15752            wkt::internal::display_enum(f, self.name(), self.value())
15753        }
15754    }
15755
15756    impl std::convert::From<i32> for Trigger {
15757        fn from(value: i32) -> Self {
15758            match value {
15759                0 => Self::Unspecified,
15760                1 => Self::Automatic,
15761                2 => Self::Manual,
15762                _ => Self::UnknownValue(trigger::UnknownValue(
15763                    wkt::internal::UnknownEnumValue::Integer(value),
15764                )),
15765            }
15766        }
15767    }
15768
15769    impl std::convert::From<&str> for Trigger {
15770        fn from(value: &str) -> Self {
15771            use std::string::ToString;
15772            match value {
15773                "TRIGGER_UNSPECIFIED" => Self::Unspecified,
15774                "AUTOMATIC" => Self::Automatic,
15775                "MANUAL" => Self::Manual,
15776                _ => Self::UnknownValue(trigger::UnknownValue(
15777                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15778                )),
15779            }
15780        }
15781    }
15782
15783    impl serde::ser::Serialize for Trigger {
15784        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15785        where
15786            S: serde::Serializer,
15787        {
15788            match self {
15789                Self::Unspecified => serializer.serialize_i32(0),
15790                Self::Automatic => serializer.serialize_i32(1),
15791                Self::Manual => serializer.serialize_i32(2),
15792                Self::UnknownValue(u) => u.0.serialize(serializer),
15793            }
15794        }
15795    }
15796
15797    impl<'de> serde::de::Deserialize<'de> for Trigger {
15798        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15799        where
15800            D: serde::Deserializer<'de>,
15801        {
15802            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Trigger>::new(
15803                ".google.cloud.datastream.v1.BackfillJob.Trigger",
15804            ))
15805        }
15806    }
15807}
15808
15809/// Represent a user-facing Error.
15810#[derive(Clone, Default, PartialEq)]
15811#[non_exhaustive]
15812pub struct Error {
15813    /// A title that explains the reason for the error.
15814    pub reason: std::string::String,
15815
15816    /// A unique identifier for this specific error,
15817    /// allowing it to be traced throughout the system in logs and API responses.
15818    pub error_uuid: std::string::String,
15819
15820    /// A message containing more information about the error that occurred.
15821    pub message: std::string::String,
15822
15823    /// The time when the error occurred.
15824    pub error_time: std::option::Option<wkt::Timestamp>,
15825
15826    /// Additional information about the error.
15827    pub details: std::collections::HashMap<std::string::String, std::string::String>,
15828
15829    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15830}
15831
15832impl Error {
15833    /// Creates a new default instance.
15834    pub fn new() -> Self {
15835        std::default::Default::default()
15836    }
15837
15838    /// Sets the value of [reason][crate::model::Error::reason].
15839    ///
15840    /// # Example
15841    /// ```ignore,no_run
15842    /// # use google_cloud_datastream_v1::model::Error;
15843    /// let x = Error::new().set_reason("example");
15844    /// ```
15845    pub fn set_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15846        self.reason = v.into();
15847        self
15848    }
15849
15850    /// Sets the value of [error_uuid][crate::model::Error::error_uuid].
15851    ///
15852    /// # Example
15853    /// ```ignore,no_run
15854    /// # use google_cloud_datastream_v1::model::Error;
15855    /// let x = Error::new().set_error_uuid("example");
15856    /// ```
15857    pub fn set_error_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15858        self.error_uuid = v.into();
15859        self
15860    }
15861
15862    /// Sets the value of [message][crate::model::Error::message].
15863    ///
15864    /// # Example
15865    /// ```ignore,no_run
15866    /// # use google_cloud_datastream_v1::model::Error;
15867    /// let x = Error::new().set_message("example");
15868    /// ```
15869    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15870        self.message = v.into();
15871        self
15872    }
15873
15874    /// Sets the value of [error_time][crate::model::Error::error_time].
15875    ///
15876    /// # Example
15877    /// ```ignore,no_run
15878    /// # use google_cloud_datastream_v1::model::Error;
15879    /// use wkt::Timestamp;
15880    /// let x = Error::new().set_error_time(Timestamp::default()/* use setters */);
15881    /// ```
15882    pub fn set_error_time<T>(mut self, v: T) -> Self
15883    where
15884        T: std::convert::Into<wkt::Timestamp>,
15885    {
15886        self.error_time = std::option::Option::Some(v.into());
15887        self
15888    }
15889
15890    /// Sets or clears the value of [error_time][crate::model::Error::error_time].
15891    ///
15892    /// # Example
15893    /// ```ignore,no_run
15894    /// # use google_cloud_datastream_v1::model::Error;
15895    /// use wkt::Timestamp;
15896    /// let x = Error::new().set_or_clear_error_time(Some(Timestamp::default()/* use setters */));
15897    /// let x = Error::new().set_or_clear_error_time(None::<Timestamp>);
15898    /// ```
15899    pub fn set_or_clear_error_time<T>(mut self, v: std::option::Option<T>) -> Self
15900    where
15901        T: std::convert::Into<wkt::Timestamp>,
15902    {
15903        self.error_time = v.map(|x| x.into());
15904        self
15905    }
15906
15907    /// Sets the value of [details][crate::model::Error::details].
15908    ///
15909    /// # Example
15910    /// ```ignore,no_run
15911    /// # use google_cloud_datastream_v1::model::Error;
15912    /// let x = Error::new().set_details([
15913    ///     ("key0", "abc"),
15914    ///     ("key1", "xyz"),
15915    /// ]);
15916    /// ```
15917    pub fn set_details<T, K, V>(mut self, v: T) -> Self
15918    where
15919        T: std::iter::IntoIterator<Item = (K, V)>,
15920        K: std::convert::Into<std::string::String>,
15921        V: std::convert::Into<std::string::String>,
15922    {
15923        use std::iter::Iterator;
15924        self.details = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
15925        self
15926    }
15927}
15928
15929impl wkt::message::Message for Error {
15930    fn typename() -> &'static str {
15931        "type.googleapis.com/google.cloud.datastream.v1.Error"
15932    }
15933}
15934
15935/// Contains the current validation results.
15936#[derive(Clone, Default, PartialEq)]
15937#[non_exhaustive]
15938pub struct ValidationResult {
15939    /// A list of validations (includes both executed as well as not executed
15940    /// validations).
15941    pub validations: std::vec::Vec<crate::model::Validation>,
15942
15943    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15944}
15945
15946impl ValidationResult {
15947    /// Creates a new default instance.
15948    pub fn new() -> Self {
15949        std::default::Default::default()
15950    }
15951
15952    /// Sets the value of [validations][crate::model::ValidationResult::validations].
15953    ///
15954    /// # Example
15955    /// ```ignore,no_run
15956    /// # use google_cloud_datastream_v1::model::ValidationResult;
15957    /// use google_cloud_datastream_v1::model::Validation;
15958    /// let x = ValidationResult::new()
15959    ///     .set_validations([
15960    ///         Validation::default()/* use setters */,
15961    ///         Validation::default()/* use (different) setters */,
15962    ///     ]);
15963    /// ```
15964    pub fn set_validations<T, V>(mut self, v: T) -> Self
15965    where
15966        T: std::iter::IntoIterator<Item = V>,
15967        V: std::convert::Into<crate::model::Validation>,
15968    {
15969        use std::iter::Iterator;
15970        self.validations = v.into_iter().map(|i| i.into()).collect();
15971        self
15972    }
15973}
15974
15975impl wkt::message::Message for ValidationResult {
15976    fn typename() -> &'static str {
15977        "type.googleapis.com/google.cloud.datastream.v1.ValidationResult"
15978    }
15979}
15980
15981/// A validation to perform on a stream.
15982#[derive(Clone, Default, PartialEq)]
15983#[non_exhaustive]
15984pub struct Validation {
15985    /// A short description of the validation.
15986    pub description: std::string::String,
15987
15988    /// Output only. Validation execution status.
15989    pub state: crate::model::validation::State,
15990
15991    /// Messages reflecting the validation results.
15992    pub message: std::vec::Vec<crate::model::ValidationMessage>,
15993
15994    /// A custom code identifying this validation.
15995    pub code: std::string::String,
15996
15997    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15998}
15999
16000impl Validation {
16001    /// Creates a new default instance.
16002    pub fn new() -> Self {
16003        std::default::Default::default()
16004    }
16005
16006    /// Sets the value of [description][crate::model::Validation::description].
16007    ///
16008    /// # Example
16009    /// ```ignore,no_run
16010    /// # use google_cloud_datastream_v1::model::Validation;
16011    /// let x = Validation::new().set_description("example");
16012    /// ```
16013    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16014        self.description = v.into();
16015        self
16016    }
16017
16018    /// Sets the value of [state][crate::model::Validation::state].
16019    ///
16020    /// # Example
16021    /// ```ignore,no_run
16022    /// # use google_cloud_datastream_v1::model::Validation;
16023    /// use google_cloud_datastream_v1::model::validation::State;
16024    /// let x0 = Validation::new().set_state(State::NotExecuted);
16025    /// let x1 = Validation::new().set_state(State::Failed);
16026    /// let x2 = Validation::new().set_state(State::Passed);
16027    /// ```
16028    pub fn set_state<T: std::convert::Into<crate::model::validation::State>>(
16029        mut self,
16030        v: T,
16031    ) -> Self {
16032        self.state = v.into();
16033        self
16034    }
16035
16036    /// Sets the value of [message][crate::model::Validation::message].
16037    ///
16038    /// # Example
16039    /// ```ignore,no_run
16040    /// # use google_cloud_datastream_v1::model::Validation;
16041    /// use google_cloud_datastream_v1::model::ValidationMessage;
16042    /// let x = Validation::new()
16043    ///     .set_message([
16044    ///         ValidationMessage::default()/* use setters */,
16045    ///         ValidationMessage::default()/* use (different) setters */,
16046    ///     ]);
16047    /// ```
16048    pub fn set_message<T, V>(mut self, v: T) -> Self
16049    where
16050        T: std::iter::IntoIterator<Item = V>,
16051        V: std::convert::Into<crate::model::ValidationMessage>,
16052    {
16053        use std::iter::Iterator;
16054        self.message = v.into_iter().map(|i| i.into()).collect();
16055        self
16056    }
16057
16058    /// Sets the value of [code][crate::model::Validation::code].
16059    ///
16060    /// # Example
16061    /// ```ignore,no_run
16062    /// # use google_cloud_datastream_v1::model::Validation;
16063    /// let x = Validation::new().set_code("example");
16064    /// ```
16065    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16066        self.code = v.into();
16067        self
16068    }
16069}
16070
16071impl wkt::message::Message for Validation {
16072    fn typename() -> &'static str {
16073        "type.googleapis.com/google.cloud.datastream.v1.Validation"
16074    }
16075}
16076
16077/// Defines additional types related to [Validation].
16078pub mod validation {
16079    #[allow(unused_imports)]
16080    use super::*;
16081
16082    /// Validation execution state.
16083    ///
16084    /// # Working with unknown values
16085    ///
16086    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16087    /// additional enum variants at any time. Adding new variants is not considered
16088    /// a breaking change. Applications should write their code in anticipation of:
16089    ///
16090    /// - New values appearing in future releases of the client library, **and**
16091    /// - New values received dynamically, without application changes.
16092    ///
16093    /// Please consult the [Working with enums] section in the user guide for some
16094    /// guidelines.
16095    ///
16096    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16097    #[derive(Clone, Debug, PartialEq)]
16098    #[non_exhaustive]
16099    pub enum State {
16100        /// Unspecified state.
16101        Unspecified,
16102        /// Validation did not execute.
16103        NotExecuted,
16104        /// Validation failed.
16105        Failed,
16106        /// Validation passed.
16107        Passed,
16108        /// Validation executed with warnings.
16109        Warning,
16110        /// If set, the enum was initialized with an unknown value.
16111        ///
16112        /// Applications can examine the value using [State::value] or
16113        /// [State::name].
16114        UnknownValue(state::UnknownValue),
16115    }
16116
16117    #[doc(hidden)]
16118    pub mod state {
16119        #[allow(unused_imports)]
16120        use super::*;
16121        #[derive(Clone, Debug, PartialEq)]
16122        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16123    }
16124
16125    impl State {
16126        /// Gets the enum value.
16127        ///
16128        /// Returns `None` if the enum contains an unknown value deserialized from
16129        /// the string representation of enums.
16130        pub fn value(&self) -> std::option::Option<i32> {
16131            match self {
16132                Self::Unspecified => std::option::Option::Some(0),
16133                Self::NotExecuted => std::option::Option::Some(1),
16134                Self::Failed => std::option::Option::Some(2),
16135                Self::Passed => std::option::Option::Some(3),
16136                Self::Warning => std::option::Option::Some(4),
16137                Self::UnknownValue(u) => u.0.value(),
16138            }
16139        }
16140
16141        /// Gets the enum value as a string.
16142        ///
16143        /// Returns `None` if the enum contains an unknown value deserialized from
16144        /// the integer representation of enums.
16145        pub fn name(&self) -> std::option::Option<&str> {
16146            match self {
16147                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16148                Self::NotExecuted => std::option::Option::Some("NOT_EXECUTED"),
16149                Self::Failed => std::option::Option::Some("FAILED"),
16150                Self::Passed => std::option::Option::Some("PASSED"),
16151                Self::Warning => std::option::Option::Some("WARNING"),
16152                Self::UnknownValue(u) => u.0.name(),
16153            }
16154        }
16155    }
16156
16157    impl std::default::Default for State {
16158        fn default() -> Self {
16159            use std::convert::From;
16160            Self::from(0)
16161        }
16162    }
16163
16164    impl std::fmt::Display for State {
16165        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16166            wkt::internal::display_enum(f, self.name(), self.value())
16167        }
16168    }
16169
16170    impl std::convert::From<i32> for State {
16171        fn from(value: i32) -> Self {
16172            match value {
16173                0 => Self::Unspecified,
16174                1 => Self::NotExecuted,
16175                2 => Self::Failed,
16176                3 => Self::Passed,
16177                4 => Self::Warning,
16178                _ => Self::UnknownValue(state::UnknownValue(
16179                    wkt::internal::UnknownEnumValue::Integer(value),
16180                )),
16181            }
16182        }
16183    }
16184
16185    impl std::convert::From<&str> for State {
16186        fn from(value: &str) -> Self {
16187            use std::string::ToString;
16188            match value {
16189                "STATE_UNSPECIFIED" => Self::Unspecified,
16190                "NOT_EXECUTED" => Self::NotExecuted,
16191                "FAILED" => Self::Failed,
16192                "PASSED" => Self::Passed,
16193                "WARNING" => Self::Warning,
16194                _ => Self::UnknownValue(state::UnknownValue(
16195                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16196                )),
16197            }
16198        }
16199    }
16200
16201    impl serde::ser::Serialize for State {
16202        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16203        where
16204            S: serde::Serializer,
16205        {
16206            match self {
16207                Self::Unspecified => serializer.serialize_i32(0),
16208                Self::NotExecuted => serializer.serialize_i32(1),
16209                Self::Failed => serializer.serialize_i32(2),
16210                Self::Passed => serializer.serialize_i32(3),
16211                Self::Warning => serializer.serialize_i32(4),
16212                Self::UnknownValue(u) => u.0.serialize(serializer),
16213            }
16214        }
16215    }
16216
16217    impl<'de> serde::de::Deserialize<'de> for State {
16218        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16219        where
16220            D: serde::Deserializer<'de>,
16221        {
16222            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16223                ".google.cloud.datastream.v1.Validation.State",
16224            ))
16225        }
16226    }
16227}
16228
16229/// Represent user-facing validation result message.
16230#[derive(Clone, Default, PartialEq)]
16231#[non_exhaustive]
16232pub struct ValidationMessage {
16233    /// The result of the validation.
16234    pub message: std::string::String,
16235
16236    /// Message severity level (warning or error).
16237    pub level: crate::model::validation_message::Level,
16238
16239    /// Additional metadata related to the result.
16240    pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
16241
16242    /// A custom code identifying this specific message.
16243    pub code: std::string::String,
16244
16245    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16246}
16247
16248impl ValidationMessage {
16249    /// Creates a new default instance.
16250    pub fn new() -> Self {
16251        std::default::Default::default()
16252    }
16253
16254    /// Sets the value of [message][crate::model::ValidationMessage::message].
16255    ///
16256    /// # Example
16257    /// ```ignore,no_run
16258    /// # use google_cloud_datastream_v1::model::ValidationMessage;
16259    /// let x = ValidationMessage::new().set_message("example");
16260    /// ```
16261    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16262        self.message = v.into();
16263        self
16264    }
16265
16266    /// Sets the value of [level][crate::model::ValidationMessage::level].
16267    ///
16268    /// # Example
16269    /// ```ignore,no_run
16270    /// # use google_cloud_datastream_v1::model::ValidationMessage;
16271    /// use google_cloud_datastream_v1::model::validation_message::Level;
16272    /// let x0 = ValidationMessage::new().set_level(Level::Warning);
16273    /// let x1 = ValidationMessage::new().set_level(Level::Error);
16274    /// ```
16275    pub fn set_level<T: std::convert::Into<crate::model::validation_message::Level>>(
16276        mut self,
16277        v: T,
16278    ) -> Self {
16279        self.level = v.into();
16280        self
16281    }
16282
16283    /// Sets the value of [metadata][crate::model::ValidationMessage::metadata].
16284    ///
16285    /// # Example
16286    /// ```ignore,no_run
16287    /// # use google_cloud_datastream_v1::model::ValidationMessage;
16288    /// let x = ValidationMessage::new().set_metadata([
16289    ///     ("key0", "abc"),
16290    ///     ("key1", "xyz"),
16291    /// ]);
16292    /// ```
16293    pub fn set_metadata<T, K, V>(mut self, v: T) -> Self
16294    where
16295        T: std::iter::IntoIterator<Item = (K, V)>,
16296        K: std::convert::Into<std::string::String>,
16297        V: std::convert::Into<std::string::String>,
16298    {
16299        use std::iter::Iterator;
16300        self.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16301        self
16302    }
16303
16304    /// Sets the value of [code][crate::model::ValidationMessage::code].
16305    ///
16306    /// # Example
16307    /// ```ignore,no_run
16308    /// # use google_cloud_datastream_v1::model::ValidationMessage;
16309    /// let x = ValidationMessage::new().set_code("example");
16310    /// ```
16311    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16312        self.code = v.into();
16313        self
16314    }
16315}
16316
16317impl wkt::message::Message for ValidationMessage {
16318    fn typename() -> &'static str {
16319        "type.googleapis.com/google.cloud.datastream.v1.ValidationMessage"
16320    }
16321}
16322
16323/// Defines additional types related to [ValidationMessage].
16324pub mod validation_message {
16325    #[allow(unused_imports)]
16326    use super::*;
16327
16328    /// Validation message level.
16329    ///
16330    /// # Working with unknown values
16331    ///
16332    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16333    /// additional enum variants at any time. Adding new variants is not considered
16334    /// a breaking change. Applications should write their code in anticipation of:
16335    ///
16336    /// - New values appearing in future releases of the client library, **and**
16337    /// - New values received dynamically, without application changes.
16338    ///
16339    /// Please consult the [Working with enums] section in the user guide for some
16340    /// guidelines.
16341    ///
16342    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16343    #[derive(Clone, Debug, PartialEq)]
16344    #[non_exhaustive]
16345    pub enum Level {
16346        /// Unspecified level.
16347        Unspecified,
16348        /// Potentially cause issues with the Stream.
16349        Warning,
16350        /// Definitely cause issues with the Stream.
16351        Error,
16352        /// If set, the enum was initialized with an unknown value.
16353        ///
16354        /// Applications can examine the value using [Level::value] or
16355        /// [Level::name].
16356        UnknownValue(level::UnknownValue),
16357    }
16358
16359    #[doc(hidden)]
16360    pub mod level {
16361        #[allow(unused_imports)]
16362        use super::*;
16363        #[derive(Clone, Debug, PartialEq)]
16364        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16365    }
16366
16367    impl Level {
16368        /// Gets the enum value.
16369        ///
16370        /// Returns `None` if the enum contains an unknown value deserialized from
16371        /// the string representation of enums.
16372        pub fn value(&self) -> std::option::Option<i32> {
16373            match self {
16374                Self::Unspecified => std::option::Option::Some(0),
16375                Self::Warning => std::option::Option::Some(1),
16376                Self::Error => std::option::Option::Some(2),
16377                Self::UnknownValue(u) => u.0.value(),
16378            }
16379        }
16380
16381        /// Gets the enum value as a string.
16382        ///
16383        /// Returns `None` if the enum contains an unknown value deserialized from
16384        /// the integer representation of enums.
16385        pub fn name(&self) -> std::option::Option<&str> {
16386            match self {
16387                Self::Unspecified => std::option::Option::Some("LEVEL_UNSPECIFIED"),
16388                Self::Warning => std::option::Option::Some("WARNING"),
16389                Self::Error => std::option::Option::Some("ERROR"),
16390                Self::UnknownValue(u) => u.0.name(),
16391            }
16392        }
16393    }
16394
16395    impl std::default::Default for Level {
16396        fn default() -> Self {
16397            use std::convert::From;
16398            Self::from(0)
16399        }
16400    }
16401
16402    impl std::fmt::Display for Level {
16403        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16404            wkt::internal::display_enum(f, self.name(), self.value())
16405        }
16406    }
16407
16408    impl std::convert::From<i32> for Level {
16409        fn from(value: i32) -> Self {
16410            match value {
16411                0 => Self::Unspecified,
16412                1 => Self::Warning,
16413                2 => Self::Error,
16414                _ => Self::UnknownValue(level::UnknownValue(
16415                    wkt::internal::UnknownEnumValue::Integer(value),
16416                )),
16417            }
16418        }
16419    }
16420
16421    impl std::convert::From<&str> for Level {
16422        fn from(value: &str) -> Self {
16423            use std::string::ToString;
16424            match value {
16425                "LEVEL_UNSPECIFIED" => Self::Unspecified,
16426                "WARNING" => Self::Warning,
16427                "ERROR" => Self::Error,
16428                _ => Self::UnknownValue(level::UnknownValue(
16429                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16430                )),
16431            }
16432        }
16433    }
16434
16435    impl serde::ser::Serialize for Level {
16436        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16437        where
16438            S: serde::Serializer,
16439        {
16440            match self {
16441                Self::Unspecified => serializer.serialize_i32(0),
16442                Self::Warning => serializer.serialize_i32(1),
16443                Self::Error => serializer.serialize_i32(2),
16444                Self::UnknownValue(u) => u.0.serialize(serializer),
16445            }
16446        }
16447    }
16448
16449    impl<'de> serde::de::Deserialize<'de> for Level {
16450        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16451        where
16452            D: serde::Deserializer<'de>,
16453        {
16454            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Level>::new(
16455                ".google.cloud.datastream.v1.ValidationMessage.Level",
16456            ))
16457        }
16458    }
16459}
16460
16461/// The strategy that the stream uses for CDC replication.
16462#[derive(Clone, Default, PartialEq)]
16463#[non_exhaustive]
16464pub struct CdcStrategy {
16465    /// The position to start reading from when starting, resuming, or recovering
16466    /// the stream.
16467    /// If not set, the system's default value will be used.
16468    pub start_position: std::option::Option<crate::model::cdc_strategy::StartPosition>,
16469
16470    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16471}
16472
16473impl CdcStrategy {
16474    /// Creates a new default instance.
16475    pub fn new() -> Self {
16476        std::default::Default::default()
16477    }
16478
16479    /// Sets the value of [start_position][crate::model::CdcStrategy::start_position].
16480    ///
16481    /// Note that all the setters affecting `start_position` are mutually
16482    /// exclusive.
16483    ///
16484    /// # Example
16485    /// ```ignore,no_run
16486    /// # use google_cloud_datastream_v1::model::CdcStrategy;
16487    /// use google_cloud_datastream_v1::model::cdc_strategy::MostRecentStartPosition;
16488    /// let x = CdcStrategy::new().set_start_position(Some(
16489    ///     google_cloud_datastream_v1::model::cdc_strategy::StartPosition::MostRecentStartPosition(MostRecentStartPosition::default().into())));
16490    /// ```
16491    pub fn set_start_position<
16492        T: std::convert::Into<std::option::Option<crate::model::cdc_strategy::StartPosition>>,
16493    >(
16494        mut self,
16495        v: T,
16496    ) -> Self {
16497        self.start_position = v.into();
16498        self
16499    }
16500
16501    /// The value of [start_position][crate::model::CdcStrategy::start_position]
16502    /// if it holds a `MostRecentStartPosition`, `None` if the field is not set or
16503    /// holds a different branch.
16504    pub fn most_recent_start_position(
16505        &self,
16506    ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>>
16507    {
16508        #[allow(unreachable_patterns)]
16509        self.start_position.as_ref().and_then(|v| match v {
16510            crate::model::cdc_strategy::StartPosition::MostRecentStartPosition(v) => {
16511                std::option::Option::Some(v)
16512            }
16513            _ => std::option::Option::None,
16514        })
16515    }
16516
16517    /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
16518    /// to hold a `MostRecentStartPosition`.
16519    ///
16520    /// Note that all the setters affecting `start_position` are
16521    /// mutually exclusive.
16522    ///
16523    /// # Example
16524    /// ```ignore,no_run
16525    /// # use google_cloud_datastream_v1::model::CdcStrategy;
16526    /// use google_cloud_datastream_v1::model::cdc_strategy::MostRecentStartPosition;
16527    /// let x = CdcStrategy::new().set_most_recent_start_position(MostRecentStartPosition::default()/* use setters */);
16528    /// assert!(x.most_recent_start_position().is_some());
16529    /// assert!(x.next_available_start_position().is_none());
16530    /// assert!(x.specific_start_position().is_none());
16531    /// ```
16532    pub fn set_most_recent_start_position<
16533        T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>>,
16534    >(
16535        mut self,
16536        v: T,
16537    ) -> Self {
16538        self.start_position = std::option::Option::Some(
16539            crate::model::cdc_strategy::StartPosition::MostRecentStartPosition(v.into()),
16540        );
16541        self
16542    }
16543
16544    /// The value of [start_position][crate::model::CdcStrategy::start_position]
16545    /// if it holds a `NextAvailableStartPosition`, `None` if the field is not set or
16546    /// holds a different branch.
16547    pub fn next_available_start_position(
16548        &self,
16549    ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>>
16550    {
16551        #[allow(unreachable_patterns)]
16552        self.start_position.as_ref().and_then(|v| match v {
16553            crate::model::cdc_strategy::StartPosition::NextAvailableStartPosition(v) => {
16554                std::option::Option::Some(v)
16555            }
16556            _ => std::option::Option::None,
16557        })
16558    }
16559
16560    /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
16561    /// to hold a `NextAvailableStartPosition`.
16562    ///
16563    /// Note that all the setters affecting `start_position` are
16564    /// mutually exclusive.
16565    ///
16566    /// # Example
16567    /// ```ignore,no_run
16568    /// # use google_cloud_datastream_v1::model::CdcStrategy;
16569    /// use google_cloud_datastream_v1::model::cdc_strategy::NextAvailableStartPosition;
16570    /// let x = CdcStrategy::new().set_next_available_start_position(NextAvailableStartPosition::default()/* use setters */);
16571    /// assert!(x.next_available_start_position().is_some());
16572    /// assert!(x.most_recent_start_position().is_none());
16573    /// assert!(x.specific_start_position().is_none());
16574    /// ```
16575    pub fn set_next_available_start_position<
16576        T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>>,
16577    >(
16578        mut self,
16579        v: T,
16580    ) -> Self {
16581        self.start_position = std::option::Option::Some(
16582            crate::model::cdc_strategy::StartPosition::NextAvailableStartPosition(v.into()),
16583        );
16584        self
16585    }
16586
16587    /// The value of [start_position][crate::model::CdcStrategy::start_position]
16588    /// if it holds a `SpecificStartPosition`, `None` if the field is not set or
16589    /// holds a different branch.
16590    pub fn specific_start_position(
16591        &self,
16592    ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>>
16593    {
16594        #[allow(unreachable_patterns)]
16595        self.start_position.as_ref().and_then(|v| match v {
16596            crate::model::cdc_strategy::StartPosition::SpecificStartPosition(v) => {
16597                std::option::Option::Some(v)
16598            }
16599            _ => std::option::Option::None,
16600        })
16601    }
16602
16603    /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
16604    /// to hold a `SpecificStartPosition`.
16605    ///
16606    /// Note that all the setters affecting `start_position` are
16607    /// mutually exclusive.
16608    ///
16609    /// # Example
16610    /// ```ignore,no_run
16611    /// # use google_cloud_datastream_v1::model::CdcStrategy;
16612    /// use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16613    /// let x = CdcStrategy::new().set_specific_start_position(SpecificStartPosition::default()/* use setters */);
16614    /// assert!(x.specific_start_position().is_some());
16615    /// assert!(x.most_recent_start_position().is_none());
16616    /// assert!(x.next_available_start_position().is_none());
16617    /// ```
16618    pub fn set_specific_start_position<
16619        T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>>,
16620    >(
16621        mut self,
16622        v: T,
16623    ) -> Self {
16624        self.start_position = std::option::Option::Some(
16625            crate::model::cdc_strategy::StartPosition::SpecificStartPosition(v.into()),
16626        );
16627        self
16628    }
16629}
16630
16631impl wkt::message::Message for CdcStrategy {
16632    fn typename() -> &'static str {
16633        "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy"
16634    }
16635}
16636
16637/// Defines additional types related to [CdcStrategy].
16638pub mod cdc_strategy {
16639    #[allow(unused_imports)]
16640    use super::*;
16641
16642    /// CDC strategy to start replicating from the most recent position in the
16643    /// source.
16644    #[derive(Clone, Default, PartialEq)]
16645    #[non_exhaustive]
16646    pub struct MostRecentStartPosition {
16647        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16648    }
16649
16650    impl MostRecentStartPosition {
16651        /// Creates a new default instance.
16652        pub fn new() -> Self {
16653            std::default::Default::default()
16654        }
16655    }
16656
16657    impl wkt::message::Message for MostRecentStartPosition {
16658        fn typename() -> &'static str {
16659            "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.MostRecentStartPosition"
16660        }
16661    }
16662
16663    /// CDC strategy to resume replication from the next available position in the
16664    /// source.
16665    #[derive(Clone, Default, PartialEq)]
16666    #[non_exhaustive]
16667    pub struct NextAvailableStartPosition {
16668        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16669    }
16670
16671    impl NextAvailableStartPosition {
16672        /// Creates a new default instance.
16673        pub fn new() -> Self {
16674            std::default::Default::default()
16675        }
16676    }
16677
16678    impl wkt::message::Message for NextAvailableStartPosition {
16679        fn typename() -> &'static str {
16680            "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.NextAvailableStartPosition"
16681        }
16682    }
16683
16684    /// CDC strategy to start replicating from a specific position in the source.
16685    #[derive(Clone, Default, PartialEq)]
16686    #[non_exhaustive]
16687    pub struct SpecificStartPosition {
16688        #[allow(missing_docs)]
16689        pub position:
16690            std::option::Option<crate::model::cdc_strategy::specific_start_position::Position>,
16691
16692        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16693    }
16694
16695    impl SpecificStartPosition {
16696        /// Creates a new default instance.
16697        pub fn new() -> Self {
16698            std::default::Default::default()
16699        }
16700
16701        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position].
16702        ///
16703        /// Note that all the setters affecting `position` are mutually
16704        /// exclusive.
16705        ///
16706        /// # Example
16707        /// ```ignore,no_run
16708        /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16709        /// use google_cloud_datastream_v1::model::MysqlLogPosition;
16710        /// let x = SpecificStartPosition::new().set_position(Some(
16711        ///     google_cloud_datastream_v1::model::cdc_strategy::specific_start_position::Position::MysqlLogPosition(MysqlLogPosition::default().into())));
16712        /// ```
16713        pub fn set_position<
16714            T: std::convert::Into<
16715                    std::option::Option<
16716                        crate::model::cdc_strategy::specific_start_position::Position,
16717                    >,
16718                >,
16719        >(
16720            mut self,
16721            v: T,
16722        ) -> Self {
16723            self.position = v.into();
16724            self
16725        }
16726
16727        /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16728        /// if it holds a `MysqlLogPosition`, `None` if the field is not set or
16729        /// holds a different branch.
16730        pub fn mysql_log_position(
16731            &self,
16732        ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlLogPosition>> {
16733            #[allow(unreachable_patterns)]
16734            self.position.as_ref().and_then(|v| match v {
16735                crate::model::cdc_strategy::specific_start_position::Position::MysqlLogPosition(
16736                    v,
16737                ) => std::option::Option::Some(v),
16738                _ => std::option::Option::None,
16739            })
16740        }
16741
16742        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16743        /// to hold a `MysqlLogPosition`.
16744        ///
16745        /// Note that all the setters affecting `position` are
16746        /// mutually exclusive.
16747        ///
16748        /// # Example
16749        /// ```ignore,no_run
16750        /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16751        /// use google_cloud_datastream_v1::model::MysqlLogPosition;
16752        /// let x = SpecificStartPosition::new().set_mysql_log_position(MysqlLogPosition::default()/* use setters */);
16753        /// assert!(x.mysql_log_position().is_some());
16754        /// assert!(x.oracle_scn_position().is_none());
16755        /// assert!(x.sql_server_lsn_position().is_none());
16756        /// assert!(x.mysql_gtid_position().is_none());
16757        /// ```
16758        pub fn set_mysql_log_position<
16759            T: std::convert::Into<std::boxed::Box<crate::model::MysqlLogPosition>>,
16760        >(
16761            mut self,
16762            v: T,
16763        ) -> Self {
16764            self.position = std::option::Option::Some(
16765                crate::model::cdc_strategy::specific_start_position::Position::MysqlLogPosition(
16766                    v.into(),
16767                ),
16768            );
16769            self
16770        }
16771
16772        /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16773        /// if it holds a `OracleScnPosition`, `None` if the field is not set or
16774        /// holds a different branch.
16775        pub fn oracle_scn_position(
16776            &self,
16777        ) -> std::option::Option<&std::boxed::Box<crate::model::OracleScnPosition>> {
16778            #[allow(unreachable_patterns)]
16779            self.position.as_ref().and_then(|v| match v {
16780                crate::model::cdc_strategy::specific_start_position::Position::OracleScnPosition(v) => std::option::Option::Some(v),
16781                _ => std::option::Option::None,
16782            })
16783        }
16784
16785        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16786        /// to hold a `OracleScnPosition`.
16787        ///
16788        /// Note that all the setters affecting `position` are
16789        /// mutually exclusive.
16790        ///
16791        /// # Example
16792        /// ```ignore,no_run
16793        /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16794        /// use google_cloud_datastream_v1::model::OracleScnPosition;
16795        /// let x = SpecificStartPosition::new().set_oracle_scn_position(OracleScnPosition::default()/* use setters */);
16796        /// assert!(x.oracle_scn_position().is_some());
16797        /// assert!(x.mysql_log_position().is_none());
16798        /// assert!(x.sql_server_lsn_position().is_none());
16799        /// assert!(x.mysql_gtid_position().is_none());
16800        /// ```
16801        pub fn set_oracle_scn_position<
16802            T: std::convert::Into<std::boxed::Box<crate::model::OracleScnPosition>>,
16803        >(
16804            mut self,
16805            v: T,
16806        ) -> Self {
16807            self.position = std::option::Option::Some(
16808                crate::model::cdc_strategy::specific_start_position::Position::OracleScnPosition(
16809                    v.into(),
16810                ),
16811            );
16812            self
16813        }
16814
16815        /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16816        /// if it holds a `SqlServerLsnPosition`, `None` if the field is not set or
16817        /// holds a different branch.
16818        pub fn sql_server_lsn_position(
16819            &self,
16820        ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerLsnPosition>> {
16821            #[allow(unreachable_patterns)]
16822            self.position.as_ref().and_then(|v| match v {
16823                crate::model::cdc_strategy::specific_start_position::Position::SqlServerLsnPosition(v) => std::option::Option::Some(v),
16824                _ => std::option::Option::None,
16825            })
16826        }
16827
16828        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16829        /// to hold a `SqlServerLsnPosition`.
16830        ///
16831        /// Note that all the setters affecting `position` are
16832        /// mutually exclusive.
16833        ///
16834        /// # Example
16835        /// ```ignore,no_run
16836        /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16837        /// use google_cloud_datastream_v1::model::SqlServerLsnPosition;
16838        /// let x = SpecificStartPosition::new().set_sql_server_lsn_position(SqlServerLsnPosition::default()/* use setters */);
16839        /// assert!(x.sql_server_lsn_position().is_some());
16840        /// assert!(x.mysql_log_position().is_none());
16841        /// assert!(x.oracle_scn_position().is_none());
16842        /// assert!(x.mysql_gtid_position().is_none());
16843        /// ```
16844        pub fn set_sql_server_lsn_position<
16845            T: std::convert::Into<std::boxed::Box<crate::model::SqlServerLsnPosition>>,
16846        >(
16847            mut self,
16848            v: T,
16849        ) -> Self {
16850            self.position = std::option::Option::Some(
16851                crate::model::cdc_strategy::specific_start_position::Position::SqlServerLsnPosition(
16852                    v.into(),
16853                ),
16854            );
16855            self
16856        }
16857
16858        /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16859        /// if it holds a `MysqlGtidPosition`, `None` if the field is not set or
16860        /// holds a different branch.
16861        pub fn mysql_gtid_position(
16862            &self,
16863        ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlGtidPosition>> {
16864            #[allow(unreachable_patterns)]
16865            self.position.as_ref().and_then(|v| match v {
16866                crate::model::cdc_strategy::specific_start_position::Position::MysqlGtidPosition(v) => std::option::Option::Some(v),
16867                _ => std::option::Option::None,
16868            })
16869        }
16870
16871        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16872        /// to hold a `MysqlGtidPosition`.
16873        ///
16874        /// Note that all the setters affecting `position` are
16875        /// mutually exclusive.
16876        ///
16877        /// # Example
16878        /// ```ignore,no_run
16879        /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16880        /// use google_cloud_datastream_v1::model::MysqlGtidPosition;
16881        /// let x = SpecificStartPosition::new().set_mysql_gtid_position(MysqlGtidPosition::default()/* use setters */);
16882        /// assert!(x.mysql_gtid_position().is_some());
16883        /// assert!(x.mysql_log_position().is_none());
16884        /// assert!(x.oracle_scn_position().is_none());
16885        /// assert!(x.sql_server_lsn_position().is_none());
16886        /// ```
16887        pub fn set_mysql_gtid_position<
16888            T: std::convert::Into<std::boxed::Box<crate::model::MysqlGtidPosition>>,
16889        >(
16890            mut self,
16891            v: T,
16892        ) -> Self {
16893            self.position = std::option::Option::Some(
16894                crate::model::cdc_strategy::specific_start_position::Position::MysqlGtidPosition(
16895                    v.into(),
16896                ),
16897            );
16898            self
16899        }
16900    }
16901
16902    impl wkt::message::Message for SpecificStartPosition {
16903        fn typename() -> &'static str {
16904            "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.SpecificStartPosition"
16905        }
16906    }
16907
16908    /// Defines additional types related to [SpecificStartPosition].
16909    pub mod specific_start_position {
16910        #[allow(unused_imports)]
16911        use super::*;
16912
16913        #[allow(missing_docs)]
16914        #[derive(Clone, Debug, PartialEq)]
16915        #[non_exhaustive]
16916        pub enum Position {
16917            /// MySQL specific log position to start replicating from.
16918            MysqlLogPosition(std::boxed::Box<crate::model::MysqlLogPosition>),
16919            /// Oracle SCN to start replicating from.
16920            OracleScnPosition(std::boxed::Box<crate::model::OracleScnPosition>),
16921            /// SqlServer LSN to start replicating from.
16922            SqlServerLsnPosition(std::boxed::Box<crate::model::SqlServerLsnPosition>),
16923            /// MySQL GTID set to start replicating from.
16924            MysqlGtidPosition(std::boxed::Box<crate::model::MysqlGtidPosition>),
16925        }
16926    }
16927
16928    /// The position to start reading from when starting, resuming, or recovering
16929    /// the stream.
16930    /// If not set, the system's default value will be used.
16931    #[derive(Clone, Debug, PartialEq)]
16932    #[non_exhaustive]
16933    pub enum StartPosition {
16934        /// Optional. Start replicating from the most recent position in the source.
16935        MostRecentStartPosition(
16936            std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>,
16937        ),
16938        /// Optional. Resume replication from the next available position in the
16939        /// source.
16940        NextAvailableStartPosition(
16941            std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>,
16942        ),
16943        /// Optional. Start replicating from a specific position in the source.
16944        SpecificStartPosition(std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>),
16945    }
16946}
16947
16948/// SQL Server LSN position
16949#[derive(Clone, Default, PartialEq)]
16950#[non_exhaustive]
16951pub struct SqlServerLsnPosition {
16952    /// Required. Log sequence number (LSN) from where Logs will be read
16953    pub lsn: std::string::String,
16954
16955    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16956}
16957
16958impl SqlServerLsnPosition {
16959    /// Creates a new default instance.
16960    pub fn new() -> Self {
16961        std::default::Default::default()
16962    }
16963
16964    /// Sets the value of [lsn][crate::model::SqlServerLsnPosition::lsn].
16965    ///
16966    /// # Example
16967    /// ```ignore,no_run
16968    /// # use google_cloud_datastream_v1::model::SqlServerLsnPosition;
16969    /// let x = SqlServerLsnPosition::new().set_lsn("example");
16970    /// ```
16971    pub fn set_lsn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16972        self.lsn = v.into();
16973        self
16974    }
16975}
16976
16977impl wkt::message::Message for SqlServerLsnPosition {
16978    fn typename() -> &'static str {
16979        "type.googleapis.com/google.cloud.datastream.v1.SqlServerLsnPosition"
16980    }
16981}
16982
16983/// Oracle SCN position
16984#[derive(Clone, Default, PartialEq)]
16985#[non_exhaustive]
16986pub struct OracleScnPosition {
16987    /// Required. SCN number from where Logs will be read
16988    pub scn: i64,
16989
16990    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16991}
16992
16993impl OracleScnPosition {
16994    /// Creates a new default instance.
16995    pub fn new() -> Self {
16996        std::default::Default::default()
16997    }
16998
16999    /// Sets the value of [scn][crate::model::OracleScnPosition::scn].
17000    ///
17001    /// # Example
17002    /// ```ignore,no_run
17003    /// # use google_cloud_datastream_v1::model::OracleScnPosition;
17004    /// let x = OracleScnPosition::new().set_scn(42);
17005    /// ```
17006    pub fn set_scn<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
17007        self.scn = v.into();
17008        self
17009    }
17010}
17011
17012impl wkt::message::Message for OracleScnPosition {
17013    fn typename() -> &'static str {
17014        "type.googleapis.com/google.cloud.datastream.v1.OracleScnPosition"
17015    }
17016}
17017
17018/// MySQL log position
17019#[derive(Clone, Default, PartialEq)]
17020#[non_exhaustive]
17021pub struct MysqlLogPosition {
17022    /// Required. The binary log file name.
17023    pub log_file: std::string::String,
17024
17025    /// Optional. The position within the binary log file. Default is head of file.
17026    pub log_position: std::option::Option<i32>,
17027
17028    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17029}
17030
17031impl MysqlLogPosition {
17032    /// Creates a new default instance.
17033    pub fn new() -> Self {
17034        std::default::Default::default()
17035    }
17036
17037    /// Sets the value of [log_file][crate::model::MysqlLogPosition::log_file].
17038    ///
17039    /// # Example
17040    /// ```ignore,no_run
17041    /// # use google_cloud_datastream_v1::model::MysqlLogPosition;
17042    /// let x = MysqlLogPosition::new().set_log_file("example");
17043    /// ```
17044    pub fn set_log_file<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17045        self.log_file = v.into();
17046        self
17047    }
17048
17049    /// Sets the value of [log_position][crate::model::MysqlLogPosition::log_position].
17050    ///
17051    /// # Example
17052    /// ```ignore,no_run
17053    /// # use google_cloud_datastream_v1::model::MysqlLogPosition;
17054    /// let x = MysqlLogPosition::new().set_log_position(42);
17055    /// ```
17056    pub fn set_log_position<T>(mut self, v: T) -> Self
17057    where
17058        T: std::convert::Into<i32>,
17059    {
17060        self.log_position = std::option::Option::Some(v.into());
17061        self
17062    }
17063
17064    /// Sets or clears the value of [log_position][crate::model::MysqlLogPosition::log_position].
17065    ///
17066    /// # Example
17067    /// ```ignore,no_run
17068    /// # use google_cloud_datastream_v1::model::MysqlLogPosition;
17069    /// let x = MysqlLogPosition::new().set_or_clear_log_position(Some(42));
17070    /// let x = MysqlLogPosition::new().set_or_clear_log_position(None::<i32>);
17071    /// ```
17072    pub fn set_or_clear_log_position<T>(mut self, v: std::option::Option<T>) -> Self
17073    where
17074        T: std::convert::Into<i32>,
17075    {
17076        self.log_position = v.map(|x| x.into());
17077        self
17078    }
17079}
17080
17081impl wkt::message::Message for MysqlLogPosition {
17082    fn typename() -> &'static str {
17083        "type.googleapis.com/google.cloud.datastream.v1.MysqlLogPosition"
17084    }
17085}
17086
17087/// MySQL GTID position
17088#[derive(Clone, Default, PartialEq)]
17089#[non_exhaustive]
17090pub struct MysqlGtidPosition {
17091    /// Required. The gtid set to start replication from.
17092    pub gtid_set: std::string::String,
17093
17094    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17095}
17096
17097impl MysqlGtidPosition {
17098    /// Creates a new default instance.
17099    pub fn new() -> Self {
17100        std::default::Default::default()
17101    }
17102
17103    /// Sets the value of [gtid_set][crate::model::MysqlGtidPosition::gtid_set].
17104    ///
17105    /// # Example
17106    /// ```ignore,no_run
17107    /// # use google_cloud_datastream_v1::model::MysqlGtidPosition;
17108    /// let x = MysqlGtidPosition::new().set_gtid_set("example");
17109    /// ```
17110    pub fn set_gtid_set<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17111        self.gtid_set = v.into();
17112        self
17113    }
17114}
17115
17116impl wkt::message::Message for MysqlGtidPosition {
17117    fn typename() -> &'static str {
17118        "type.googleapis.com/google.cloud.datastream.v1.MysqlGtidPosition"
17119    }
17120}