google_cloud_datastream_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate lazy_static;
25extern crate location;
26extern crate longrunning;
27extern crate lro;
28extern crate reqwest;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// Request message for 'discover' ConnectionProfile request.
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct DiscoverConnectionProfileRequest {
44    /// Required. The parent resource of the connection profile type. Must be in
45    /// the format `projects/*/locations/*`.
46    pub parent: std::string::String,
47
48    /// The connection profile on which to run discover.
49    pub target: std::option::Option<crate::model::discover_connection_profile_request::Target>,
50
51    /// The depth of the retrieved hierarchy of data objects.
52    pub hierarchy:
53        std::option::Option<crate::model::discover_connection_profile_request::Hierarchy>,
54
55    /// The data object to populate with child data objects and metadata.
56    pub data_object:
57        std::option::Option<crate::model::discover_connection_profile_request::DataObject>,
58
59    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
60}
61
62impl DiscoverConnectionProfileRequest {
63    pub fn new() -> Self {
64        std::default::Default::default()
65    }
66
67    /// Sets the value of [parent][crate::model::DiscoverConnectionProfileRequest::parent].
68    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
69        self.parent = v.into();
70        self
71    }
72
73    /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target].
74    ///
75    /// Note that all the setters affecting `target` are mutually
76    /// exclusive.
77    pub fn set_target<
78        T: std::convert::Into<
79                std::option::Option<crate::model::discover_connection_profile_request::Target>,
80            >,
81    >(
82        mut self,
83        v: T,
84    ) -> Self {
85        self.target = v.into();
86        self
87    }
88
89    /// The value of [target][crate::model::DiscoverConnectionProfileRequest::target]
90    /// if it holds a `ConnectionProfile`, `None` if the field is not set or
91    /// holds a different branch.
92    pub fn connection_profile(
93        &self,
94    ) -> std::option::Option<&std::boxed::Box<crate::model::ConnectionProfile>> {
95        #[allow(unreachable_patterns)]
96        self.target.as_ref().and_then(|v| match v {
97            crate::model::discover_connection_profile_request::Target::ConnectionProfile(v) => {
98                std::option::Option::Some(v)
99            }
100            _ => std::option::Option::None,
101        })
102    }
103
104    /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target]
105    /// to hold a `ConnectionProfile`.
106    ///
107    /// Note that all the setters affecting `target` are
108    /// mutually exclusive.
109    pub fn set_connection_profile<
110        T: std::convert::Into<std::boxed::Box<crate::model::ConnectionProfile>>,
111    >(
112        mut self,
113        v: T,
114    ) -> Self {
115        self.target = std::option::Option::Some(
116            crate::model::discover_connection_profile_request::Target::ConnectionProfile(v.into()),
117        );
118        self
119    }
120
121    /// The value of [target][crate::model::DiscoverConnectionProfileRequest::target]
122    /// if it holds a `ConnectionProfileName`, `None` if the field is not set or
123    /// holds a different branch.
124    pub fn connection_profile_name(&self) -> std::option::Option<&std::string::String> {
125        #[allow(unreachable_patterns)]
126        self.target.as_ref().and_then(|v| match v {
127            crate::model::discover_connection_profile_request::Target::ConnectionProfileName(v) => {
128                std::option::Option::Some(v)
129            }
130            _ => std::option::Option::None,
131        })
132    }
133
134    /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target]
135    /// to hold a `ConnectionProfileName`.
136    ///
137    /// Note that all the setters affecting `target` are
138    /// mutually exclusive.
139    pub fn set_connection_profile_name<T: std::convert::Into<std::string::String>>(
140        mut self,
141        v: T,
142    ) -> Self {
143        self.target = std::option::Option::Some(
144            crate::model::discover_connection_profile_request::Target::ConnectionProfileName(
145                v.into(),
146            ),
147        );
148        self
149    }
150
151    /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy].
152    ///
153    /// Note that all the setters affecting `hierarchy` are mutually
154    /// exclusive.
155    pub fn set_hierarchy<
156        T: std::convert::Into<
157                std::option::Option<crate::model::discover_connection_profile_request::Hierarchy>,
158            >,
159    >(
160        mut self,
161        v: T,
162    ) -> Self {
163        self.hierarchy = v.into();
164        self
165    }
166
167    /// The value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
168    /// if it holds a `FullHierarchy`, `None` if the field is not set or
169    /// holds a different branch.
170    pub fn full_hierarchy(&self) -> std::option::Option<&bool> {
171        #[allow(unreachable_patterns)]
172        self.hierarchy.as_ref().and_then(|v| match v {
173            crate::model::discover_connection_profile_request::Hierarchy::FullHierarchy(v) => {
174                std::option::Option::Some(v)
175            }
176            _ => std::option::Option::None,
177        })
178    }
179
180    /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
181    /// to hold a `FullHierarchy`.
182    ///
183    /// Note that all the setters affecting `hierarchy` are
184    /// mutually exclusive.
185    pub fn set_full_hierarchy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
186        self.hierarchy = std::option::Option::Some(
187            crate::model::discover_connection_profile_request::Hierarchy::FullHierarchy(v.into()),
188        );
189        self
190    }
191
192    /// The value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
193    /// if it holds a `HierarchyDepth`, `None` if the field is not set or
194    /// holds a different branch.
195    pub fn hierarchy_depth(&self) -> std::option::Option<&i32> {
196        #[allow(unreachable_patterns)]
197        self.hierarchy.as_ref().and_then(|v| match v {
198            crate::model::discover_connection_profile_request::Hierarchy::HierarchyDepth(v) => {
199                std::option::Option::Some(v)
200            }
201            _ => std::option::Option::None,
202        })
203    }
204
205    /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
206    /// to hold a `HierarchyDepth`.
207    ///
208    /// Note that all the setters affecting `hierarchy` are
209    /// mutually exclusive.
210    pub fn set_hierarchy_depth<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
211        self.hierarchy = std::option::Option::Some(
212            crate::model::discover_connection_profile_request::Hierarchy::HierarchyDepth(v.into()),
213        );
214        self
215    }
216
217    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object].
218    ///
219    /// Note that all the setters affecting `data_object` are mutually
220    /// exclusive.
221    pub fn set_data_object<
222        T: std::convert::Into<
223                std::option::Option<crate::model::discover_connection_profile_request::DataObject>,
224            >,
225    >(
226        mut self,
227        v: T,
228    ) -> Self {
229        self.data_object = v.into();
230        self
231    }
232
233    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
234    /// if it holds a `OracleRdbms`, `None` if the field is not set or
235    /// holds a different branch.
236    pub fn oracle_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
237        #[allow(unreachable_patterns)]
238        self.data_object.as_ref().and_then(|v| match v {
239            crate::model::discover_connection_profile_request::DataObject::OracleRdbms(v) => {
240                std::option::Option::Some(v)
241            }
242            _ => std::option::Option::None,
243        })
244    }
245
246    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
247    /// to hold a `OracleRdbms`.
248    ///
249    /// Note that all the setters affecting `data_object` are
250    /// mutually exclusive.
251    pub fn set_oracle_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>>(
252        mut self,
253        v: T,
254    ) -> Self {
255        self.data_object = std::option::Option::Some(
256            crate::model::discover_connection_profile_request::DataObject::OracleRdbms(v.into()),
257        );
258        self
259    }
260
261    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
262    /// if it holds a `MysqlRdbms`, `None` if the field is not set or
263    /// holds a different branch.
264    pub fn mysql_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
265        #[allow(unreachable_patterns)]
266        self.data_object.as_ref().and_then(|v| match v {
267            crate::model::discover_connection_profile_request::DataObject::MysqlRdbms(v) => {
268                std::option::Option::Some(v)
269            }
270            _ => std::option::Option::None,
271        })
272    }
273
274    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
275    /// to hold a `MysqlRdbms`.
276    ///
277    /// Note that all the setters affecting `data_object` are
278    /// mutually exclusive.
279    pub fn set_mysql_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>>(
280        mut self,
281        v: T,
282    ) -> Self {
283        self.data_object = std::option::Option::Some(
284            crate::model::discover_connection_profile_request::DataObject::MysqlRdbms(v.into()),
285        );
286        self
287    }
288
289    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
290    /// if it holds a `PostgresqlRdbms`, `None` if the field is not set or
291    /// holds a different branch.
292    pub fn postgresql_rdbms(
293        &self,
294    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
295        #[allow(unreachable_patterns)]
296        self.data_object.as_ref().and_then(|v| match v {
297            crate::model::discover_connection_profile_request::DataObject::PostgresqlRdbms(v) => {
298                std::option::Option::Some(v)
299            }
300            _ => std::option::Option::None,
301        })
302    }
303
304    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
305    /// to hold a `PostgresqlRdbms`.
306    ///
307    /// Note that all the setters affecting `data_object` are
308    /// mutually exclusive.
309    pub fn set_postgresql_rdbms<
310        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
311    >(
312        mut self,
313        v: T,
314    ) -> Self {
315        self.data_object = std::option::Option::Some(
316            crate::model::discover_connection_profile_request::DataObject::PostgresqlRdbms(
317                v.into(),
318            ),
319        );
320        self
321    }
322
323    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
324    /// if it holds a `SqlServerRdbms`, `None` if the field is not set or
325    /// holds a different branch.
326    pub fn sql_server_rdbms(
327        &self,
328    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
329        #[allow(unreachable_patterns)]
330        self.data_object.as_ref().and_then(|v| match v {
331            crate::model::discover_connection_profile_request::DataObject::SqlServerRdbms(v) => {
332                std::option::Option::Some(v)
333            }
334            _ => std::option::Option::None,
335        })
336    }
337
338    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
339    /// to hold a `SqlServerRdbms`.
340    ///
341    /// Note that all the setters affecting `data_object` are
342    /// mutually exclusive.
343    pub fn set_sql_server_rdbms<
344        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
345    >(
346        mut self,
347        v: T,
348    ) -> Self {
349        self.data_object = std::option::Option::Some(
350            crate::model::discover_connection_profile_request::DataObject::SqlServerRdbms(v.into()),
351        );
352        self
353    }
354
355    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
356    /// if it holds a `SalesforceOrg`, `None` if the field is not set or
357    /// holds a different branch.
358    pub fn salesforce_org(
359        &self,
360    ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceOrg>> {
361        #[allow(unreachable_patterns)]
362        self.data_object.as_ref().and_then(|v| match v {
363            crate::model::discover_connection_profile_request::DataObject::SalesforceOrg(v) => {
364                std::option::Option::Some(v)
365            }
366            _ => std::option::Option::None,
367        })
368    }
369
370    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
371    /// to hold a `SalesforceOrg`.
372    ///
373    /// Note that all the setters affecting `data_object` are
374    /// mutually exclusive.
375    pub fn set_salesforce_org<
376        T: std::convert::Into<std::boxed::Box<crate::model::SalesforceOrg>>,
377    >(
378        mut self,
379        v: T,
380    ) -> Self {
381        self.data_object = std::option::Option::Some(
382            crate::model::discover_connection_profile_request::DataObject::SalesforceOrg(v.into()),
383        );
384        self
385    }
386
387    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
388    /// if it holds a `MongodbCluster`, `None` if the field is not set or
389    /// holds a different branch.
390    pub fn mongodb_cluster(
391        &self,
392    ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbCluster>> {
393        #[allow(unreachable_patterns)]
394        self.data_object.as_ref().and_then(|v| match v {
395            crate::model::discover_connection_profile_request::DataObject::MongodbCluster(v) => {
396                std::option::Option::Some(v)
397            }
398            _ => std::option::Option::None,
399        })
400    }
401
402    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
403    /// to hold a `MongodbCluster`.
404    ///
405    /// Note that all the setters affecting `data_object` are
406    /// mutually exclusive.
407    pub fn set_mongodb_cluster<
408        T: std::convert::Into<std::boxed::Box<crate::model::MongodbCluster>>,
409    >(
410        mut self,
411        v: T,
412    ) -> Self {
413        self.data_object = std::option::Option::Some(
414            crate::model::discover_connection_profile_request::DataObject::MongodbCluster(v.into()),
415        );
416        self
417    }
418}
419
420impl wkt::message::Message for DiscoverConnectionProfileRequest {
421    fn typename() -> &'static str {
422        "type.googleapis.com/google.cloud.datastream.v1.DiscoverConnectionProfileRequest"
423    }
424}
425
426/// Defines additional types related to [DiscoverConnectionProfileRequest].
427pub mod discover_connection_profile_request {
428    #[allow(unused_imports)]
429    use super::*;
430
431    /// The connection profile on which to run discover.
432    #[derive(Clone, Debug, PartialEq)]
433    #[non_exhaustive]
434    pub enum Target {
435        /// An ad-hoc connection profile configuration.
436        ConnectionProfile(std::boxed::Box<crate::model::ConnectionProfile>),
437        /// A reference to an existing connection profile.
438        ConnectionProfileName(std::string::String),
439    }
440
441    /// The depth of the retrieved hierarchy of data objects.
442    #[derive(Clone, Debug, PartialEq)]
443    #[non_exhaustive]
444    pub enum Hierarchy {
445        /// Whether to retrieve the full hierarchy of data objects (TRUE) or only the
446        /// current level (FALSE).
447        FullHierarchy(bool),
448        /// The number of hierarchy levels below the current level to be retrieved.
449        HierarchyDepth(i32),
450    }
451
452    /// The data object to populate with child data objects and metadata.
453    #[derive(Clone, Debug, PartialEq)]
454    #[non_exhaustive]
455    pub enum DataObject {
456        /// Oracle RDBMS to enrich with child data objects and metadata.
457        OracleRdbms(std::boxed::Box<crate::model::OracleRdbms>),
458        /// MySQL RDBMS to enrich with child data objects and metadata.
459        MysqlRdbms(std::boxed::Box<crate::model::MysqlRdbms>),
460        /// PostgreSQL RDBMS to enrich with child data objects and metadata.
461        PostgresqlRdbms(std::boxed::Box<crate::model::PostgresqlRdbms>),
462        /// SQLServer RDBMS to enrich with child data objects and metadata.
463        SqlServerRdbms(std::boxed::Box<crate::model::SqlServerRdbms>),
464        /// Salesforce organization to enrich with child data objects and metadata.
465        SalesforceOrg(std::boxed::Box<crate::model::SalesforceOrg>),
466        /// MongoDB cluster to enrich with child data objects and metadata.
467        MongodbCluster(std::boxed::Box<crate::model::MongodbCluster>),
468    }
469}
470
471/// Response from a discover request.
472#[derive(Clone, Default, PartialEq)]
473#[non_exhaustive]
474pub struct DiscoverConnectionProfileResponse {
475    /// The data object that has been enriched by the discover API call.
476    pub data_object:
477        std::option::Option<crate::model::discover_connection_profile_response::DataObject>,
478
479    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
480}
481
482impl DiscoverConnectionProfileResponse {
483    pub fn new() -> Self {
484        std::default::Default::default()
485    }
486
487    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object].
488    ///
489    /// Note that all the setters affecting `data_object` are mutually
490    /// exclusive.
491    pub fn set_data_object<
492        T: std::convert::Into<
493                std::option::Option<crate::model::discover_connection_profile_response::DataObject>,
494            >,
495    >(
496        mut self,
497        v: T,
498    ) -> Self {
499        self.data_object = v.into();
500        self
501    }
502
503    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
504    /// if it holds a `OracleRdbms`, `None` if the field is not set or
505    /// holds a different branch.
506    pub fn oracle_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
507        #[allow(unreachable_patterns)]
508        self.data_object.as_ref().and_then(|v| match v {
509            crate::model::discover_connection_profile_response::DataObject::OracleRdbms(v) => {
510                std::option::Option::Some(v)
511            }
512            _ => std::option::Option::None,
513        })
514    }
515
516    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
517    /// to hold a `OracleRdbms`.
518    ///
519    /// Note that all the setters affecting `data_object` are
520    /// mutually exclusive.
521    pub fn set_oracle_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>>(
522        mut self,
523        v: T,
524    ) -> Self {
525        self.data_object = std::option::Option::Some(
526            crate::model::discover_connection_profile_response::DataObject::OracleRdbms(v.into()),
527        );
528        self
529    }
530
531    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
532    /// if it holds a `MysqlRdbms`, `None` if the field is not set or
533    /// holds a different branch.
534    pub fn mysql_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
535        #[allow(unreachable_patterns)]
536        self.data_object.as_ref().and_then(|v| match v {
537            crate::model::discover_connection_profile_response::DataObject::MysqlRdbms(v) => {
538                std::option::Option::Some(v)
539            }
540            _ => std::option::Option::None,
541        })
542    }
543
544    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
545    /// to hold a `MysqlRdbms`.
546    ///
547    /// Note that all the setters affecting `data_object` are
548    /// mutually exclusive.
549    pub fn set_mysql_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>>(
550        mut self,
551        v: T,
552    ) -> Self {
553        self.data_object = std::option::Option::Some(
554            crate::model::discover_connection_profile_response::DataObject::MysqlRdbms(v.into()),
555        );
556        self
557    }
558
559    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
560    /// if it holds a `PostgresqlRdbms`, `None` if the field is not set or
561    /// holds a different branch.
562    pub fn postgresql_rdbms(
563        &self,
564    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
565        #[allow(unreachable_patterns)]
566        self.data_object.as_ref().and_then(|v| match v {
567            crate::model::discover_connection_profile_response::DataObject::PostgresqlRdbms(v) => {
568                std::option::Option::Some(v)
569            }
570            _ => std::option::Option::None,
571        })
572    }
573
574    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
575    /// to hold a `PostgresqlRdbms`.
576    ///
577    /// Note that all the setters affecting `data_object` are
578    /// mutually exclusive.
579    pub fn set_postgresql_rdbms<
580        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
581    >(
582        mut self,
583        v: T,
584    ) -> Self {
585        self.data_object = std::option::Option::Some(
586            crate::model::discover_connection_profile_response::DataObject::PostgresqlRdbms(
587                v.into(),
588            ),
589        );
590        self
591    }
592
593    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
594    /// if it holds a `SqlServerRdbms`, `None` if the field is not set or
595    /// holds a different branch.
596    pub fn sql_server_rdbms(
597        &self,
598    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
599        #[allow(unreachable_patterns)]
600        self.data_object.as_ref().and_then(|v| match v {
601            crate::model::discover_connection_profile_response::DataObject::SqlServerRdbms(v) => {
602                std::option::Option::Some(v)
603            }
604            _ => std::option::Option::None,
605        })
606    }
607
608    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
609    /// to hold a `SqlServerRdbms`.
610    ///
611    /// Note that all the setters affecting `data_object` are
612    /// mutually exclusive.
613    pub fn set_sql_server_rdbms<
614        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
615    >(
616        mut self,
617        v: T,
618    ) -> Self {
619        self.data_object = std::option::Option::Some(
620            crate::model::discover_connection_profile_response::DataObject::SqlServerRdbms(
621                v.into(),
622            ),
623        );
624        self
625    }
626
627    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
628    /// if it holds a `SalesforceOrg`, `None` if the field is not set or
629    /// holds a different branch.
630    pub fn salesforce_org(
631        &self,
632    ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceOrg>> {
633        #[allow(unreachable_patterns)]
634        self.data_object.as_ref().and_then(|v| match v {
635            crate::model::discover_connection_profile_response::DataObject::SalesforceOrg(v) => {
636                std::option::Option::Some(v)
637            }
638            _ => std::option::Option::None,
639        })
640    }
641
642    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
643    /// to hold a `SalesforceOrg`.
644    ///
645    /// Note that all the setters affecting `data_object` are
646    /// mutually exclusive.
647    pub fn set_salesforce_org<
648        T: std::convert::Into<std::boxed::Box<crate::model::SalesforceOrg>>,
649    >(
650        mut self,
651        v: T,
652    ) -> Self {
653        self.data_object = std::option::Option::Some(
654            crate::model::discover_connection_profile_response::DataObject::SalesforceOrg(v.into()),
655        );
656        self
657    }
658
659    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
660    /// if it holds a `MongodbCluster`, `None` if the field is not set or
661    /// holds a different branch.
662    pub fn mongodb_cluster(
663        &self,
664    ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbCluster>> {
665        #[allow(unreachable_patterns)]
666        self.data_object.as_ref().and_then(|v| match v {
667            crate::model::discover_connection_profile_response::DataObject::MongodbCluster(v) => {
668                std::option::Option::Some(v)
669            }
670            _ => std::option::Option::None,
671        })
672    }
673
674    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
675    /// to hold a `MongodbCluster`.
676    ///
677    /// Note that all the setters affecting `data_object` are
678    /// mutually exclusive.
679    pub fn set_mongodb_cluster<
680        T: std::convert::Into<std::boxed::Box<crate::model::MongodbCluster>>,
681    >(
682        mut self,
683        v: T,
684    ) -> Self {
685        self.data_object = std::option::Option::Some(
686            crate::model::discover_connection_profile_response::DataObject::MongodbCluster(
687                v.into(),
688            ),
689        );
690        self
691    }
692}
693
694impl wkt::message::Message for DiscoverConnectionProfileResponse {
695    fn typename() -> &'static str {
696        "type.googleapis.com/google.cloud.datastream.v1.DiscoverConnectionProfileResponse"
697    }
698}
699
700/// Defines additional types related to [DiscoverConnectionProfileResponse].
701pub mod discover_connection_profile_response {
702    #[allow(unused_imports)]
703    use super::*;
704
705    /// The data object that has been enriched by the discover API call.
706    #[derive(Clone, Debug, PartialEq)]
707    #[non_exhaustive]
708    pub enum DataObject {
709        /// Enriched Oracle RDBMS object.
710        OracleRdbms(std::boxed::Box<crate::model::OracleRdbms>),
711        /// Enriched MySQL RDBMS object.
712        MysqlRdbms(std::boxed::Box<crate::model::MysqlRdbms>),
713        /// Enriched PostgreSQL RDBMS object.
714        PostgresqlRdbms(std::boxed::Box<crate::model::PostgresqlRdbms>),
715        /// Enriched SQLServer RDBMS object.
716        SqlServerRdbms(std::boxed::Box<crate::model::SqlServerRdbms>),
717        /// Enriched Salesforce organization.
718        SalesforceOrg(std::boxed::Box<crate::model::SalesforceOrg>),
719        /// Enriched MongoDB cluster.
720        MongodbCluster(std::boxed::Box<crate::model::MongodbCluster>),
721    }
722}
723
724/// Request message for 'FetchStaticIps' request.
725#[derive(Clone, Default, PartialEq)]
726#[non_exhaustive]
727pub struct FetchStaticIpsRequest {
728    /// Required. The resource name for the location for which static IPs should be
729    /// returned. Must be in the format `projects/*/locations/*`.
730    pub name: std::string::String,
731
732    /// Maximum number of Ips to return, will likely not be specified.
733    pub page_size: i32,
734
735    /// A page token, received from a previous `ListStaticIps` call.
736    /// will likely not be specified.
737    pub page_token: std::string::String,
738
739    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
740}
741
742impl FetchStaticIpsRequest {
743    pub fn new() -> Self {
744        std::default::Default::default()
745    }
746
747    /// Sets the value of [name][crate::model::FetchStaticIpsRequest::name].
748    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
749        self.name = v.into();
750        self
751    }
752
753    /// Sets the value of [page_size][crate::model::FetchStaticIpsRequest::page_size].
754    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
755        self.page_size = v.into();
756        self
757    }
758
759    /// Sets the value of [page_token][crate::model::FetchStaticIpsRequest::page_token].
760    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
761        self.page_token = v.into();
762        self
763    }
764}
765
766impl wkt::message::Message for FetchStaticIpsRequest {
767    fn typename() -> &'static str {
768        "type.googleapis.com/google.cloud.datastream.v1.FetchStaticIpsRequest"
769    }
770}
771
772/// Response message for a 'FetchStaticIps' response.
773#[derive(Clone, Default, PartialEq)]
774#[non_exhaustive]
775pub struct FetchStaticIpsResponse {
776    /// list of static ips by account
777    pub static_ips: std::vec::Vec<std::string::String>,
778
779    /// A token that can be sent as `page_token` to retrieve the next page.
780    /// If this field is omitted, there are no subsequent pages.
781    pub next_page_token: std::string::String,
782
783    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
784}
785
786impl FetchStaticIpsResponse {
787    pub fn new() -> Self {
788        std::default::Default::default()
789    }
790
791    /// Sets the value of [static_ips][crate::model::FetchStaticIpsResponse::static_ips].
792    pub fn set_static_ips<T, V>(mut self, v: T) -> Self
793    where
794        T: std::iter::IntoIterator<Item = V>,
795        V: std::convert::Into<std::string::String>,
796    {
797        use std::iter::Iterator;
798        self.static_ips = v.into_iter().map(|i| i.into()).collect();
799        self
800    }
801
802    /// Sets the value of [next_page_token][crate::model::FetchStaticIpsResponse::next_page_token].
803    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
804        self.next_page_token = v.into();
805        self
806    }
807}
808
809impl wkt::message::Message for FetchStaticIpsResponse {
810    fn typename() -> &'static str {
811        "type.googleapis.com/google.cloud.datastream.v1.FetchStaticIpsResponse"
812    }
813}
814
815/// Request message for listing connection profiles.
816#[derive(Clone, Default, PartialEq)]
817#[non_exhaustive]
818pub struct ListConnectionProfilesRequest {
819    /// Required. The parent that owns the collection of connection profiles.
820    pub parent: std::string::String,
821
822    /// Maximum number of connection profiles to return.
823    /// If unspecified, at most 50 connection profiles will be returned.
824    /// The maximum value is 1000; values above 1000 will be coerced to 1000.
825    pub page_size: i32,
826
827    /// Page token received from a previous `ListConnectionProfiles` call.
828    /// Provide this to retrieve the subsequent page.
829    ///
830    /// When paginating, all other parameters provided to `ListConnectionProfiles`
831    /// must match the call that provided the page token.
832    pub page_token: std::string::String,
833
834    /// Filter request.
835    pub filter: std::string::String,
836
837    /// Order by fields for the result.
838    pub order_by: std::string::String,
839
840    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
841}
842
843impl ListConnectionProfilesRequest {
844    pub fn new() -> Self {
845        std::default::Default::default()
846    }
847
848    /// Sets the value of [parent][crate::model::ListConnectionProfilesRequest::parent].
849    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
850        self.parent = v.into();
851        self
852    }
853
854    /// Sets the value of [page_size][crate::model::ListConnectionProfilesRequest::page_size].
855    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
856        self.page_size = v.into();
857        self
858    }
859
860    /// Sets the value of [page_token][crate::model::ListConnectionProfilesRequest::page_token].
861    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
862        self.page_token = v.into();
863        self
864    }
865
866    /// Sets the value of [filter][crate::model::ListConnectionProfilesRequest::filter].
867    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
868        self.filter = v.into();
869        self
870    }
871
872    /// Sets the value of [order_by][crate::model::ListConnectionProfilesRequest::order_by].
873    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
874        self.order_by = v.into();
875        self
876    }
877}
878
879impl wkt::message::Message for ListConnectionProfilesRequest {
880    fn typename() -> &'static str {
881        "type.googleapis.com/google.cloud.datastream.v1.ListConnectionProfilesRequest"
882    }
883}
884
885/// Response message for listing connection profiles.
886#[derive(Clone, Default, PartialEq)]
887#[non_exhaustive]
888pub struct ListConnectionProfilesResponse {
889    /// List of connection profiles.
890    pub connection_profiles: std::vec::Vec<crate::model::ConnectionProfile>,
891
892    /// A token, which can be sent as `page_token` to retrieve the next page.
893    /// If this field is omitted, there are no subsequent pages.
894    pub next_page_token: std::string::String,
895
896    /// Locations that could not be reached.
897    pub unreachable: std::vec::Vec<std::string::String>,
898
899    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
900}
901
902impl ListConnectionProfilesResponse {
903    pub fn new() -> Self {
904        std::default::Default::default()
905    }
906
907    /// Sets the value of [connection_profiles][crate::model::ListConnectionProfilesResponse::connection_profiles].
908    pub fn set_connection_profiles<T, V>(mut self, v: T) -> Self
909    where
910        T: std::iter::IntoIterator<Item = V>,
911        V: std::convert::Into<crate::model::ConnectionProfile>,
912    {
913        use std::iter::Iterator;
914        self.connection_profiles = v.into_iter().map(|i| i.into()).collect();
915        self
916    }
917
918    /// Sets the value of [next_page_token][crate::model::ListConnectionProfilesResponse::next_page_token].
919    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
920        self.next_page_token = v.into();
921        self
922    }
923
924    /// Sets the value of [unreachable][crate::model::ListConnectionProfilesResponse::unreachable].
925    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
926    where
927        T: std::iter::IntoIterator<Item = V>,
928        V: std::convert::Into<std::string::String>,
929    {
930        use std::iter::Iterator;
931        self.unreachable = v.into_iter().map(|i| i.into()).collect();
932        self
933    }
934}
935
936impl wkt::message::Message for ListConnectionProfilesResponse {
937    fn typename() -> &'static str {
938        "type.googleapis.com/google.cloud.datastream.v1.ListConnectionProfilesResponse"
939    }
940}
941
942#[doc(hidden)]
943impl gax::paginator::internal::PageableResponse for ListConnectionProfilesResponse {
944    type PageItem = crate::model::ConnectionProfile;
945
946    fn items(self) -> std::vec::Vec<Self::PageItem> {
947        self.connection_profiles
948    }
949
950    fn next_page_token(&self) -> std::string::String {
951        use std::clone::Clone;
952        self.next_page_token.clone()
953    }
954}
955
956/// Request message for getting a connection profile.
957#[derive(Clone, Default, PartialEq)]
958#[non_exhaustive]
959pub struct GetConnectionProfileRequest {
960    /// Required. The name of the connection profile resource to get.
961    pub name: std::string::String,
962
963    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
964}
965
966impl GetConnectionProfileRequest {
967    pub fn new() -> Self {
968        std::default::Default::default()
969    }
970
971    /// Sets the value of [name][crate::model::GetConnectionProfileRequest::name].
972    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
973        self.name = v.into();
974        self
975    }
976}
977
978impl wkt::message::Message for GetConnectionProfileRequest {
979    fn typename() -> &'static str {
980        "type.googleapis.com/google.cloud.datastream.v1.GetConnectionProfileRequest"
981    }
982}
983
984/// Request message for creating a connection profile.
985#[derive(Clone, Default, PartialEq)]
986#[non_exhaustive]
987pub struct CreateConnectionProfileRequest {
988    /// Required. The parent that owns the collection of ConnectionProfiles.
989    pub parent: std::string::String,
990
991    /// Required. The connection profile identifier.
992    pub connection_profile_id: std::string::String,
993
994    /// Required. The connection profile resource to create.
995    pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
996
997    /// Optional. A request ID to identify requests. Specify a unique request ID
998    /// so that if you must retry your request, the server will know to ignore
999    /// the request if it has already been completed. The server will guarantee
1000    /// that for at least 60 minutes since the first request.
1001    ///
1002    /// For example, consider a situation where you make an initial request and the
1003    /// request times out. If you make the request again with the same request ID,
1004    /// the server can check if original operation with the same request ID was
1005    /// received, and if so, will ignore the second request. This prevents clients
1006    /// from accidentally creating duplicate commitments.
1007    ///
1008    /// The request ID must be a valid UUID with the exception that zero UUID is
1009    /// not supported (00000000-0000-0000-0000-000000000000).
1010    pub request_id: std::string::String,
1011
1012    /// Optional. Only validate the connection profile, but don't create any
1013    /// resources. The default is false.
1014    pub validate_only: bool,
1015
1016    /// Optional. Create the connection profile without validating it.
1017    pub force: bool,
1018
1019    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1020}
1021
1022impl CreateConnectionProfileRequest {
1023    pub fn new() -> Self {
1024        std::default::Default::default()
1025    }
1026
1027    /// Sets the value of [parent][crate::model::CreateConnectionProfileRequest::parent].
1028    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1029        self.parent = v.into();
1030        self
1031    }
1032
1033    /// Sets the value of [connection_profile_id][crate::model::CreateConnectionProfileRequest::connection_profile_id].
1034    pub fn set_connection_profile_id<T: std::convert::Into<std::string::String>>(
1035        mut self,
1036        v: T,
1037    ) -> Self {
1038        self.connection_profile_id = v.into();
1039        self
1040    }
1041
1042    /// Sets the value of [connection_profile][crate::model::CreateConnectionProfileRequest::connection_profile].
1043    pub fn set_connection_profile<T>(mut self, v: T) -> Self
1044    where
1045        T: std::convert::Into<crate::model::ConnectionProfile>,
1046    {
1047        self.connection_profile = std::option::Option::Some(v.into());
1048        self
1049    }
1050
1051    /// Sets or clears the value of [connection_profile][crate::model::CreateConnectionProfileRequest::connection_profile].
1052    pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
1053    where
1054        T: std::convert::Into<crate::model::ConnectionProfile>,
1055    {
1056        self.connection_profile = v.map(|x| x.into());
1057        self
1058    }
1059
1060    /// Sets the value of [request_id][crate::model::CreateConnectionProfileRequest::request_id].
1061    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1062        self.request_id = v.into();
1063        self
1064    }
1065
1066    /// Sets the value of [validate_only][crate::model::CreateConnectionProfileRequest::validate_only].
1067    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1068        self.validate_only = v.into();
1069        self
1070    }
1071
1072    /// Sets the value of [force][crate::model::CreateConnectionProfileRequest::force].
1073    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1074        self.force = v.into();
1075        self
1076    }
1077}
1078
1079impl wkt::message::Message for CreateConnectionProfileRequest {
1080    fn typename() -> &'static str {
1081        "type.googleapis.com/google.cloud.datastream.v1.CreateConnectionProfileRequest"
1082    }
1083}
1084
1085/// Connection profile update message.
1086#[derive(Clone, Default, PartialEq)]
1087#[non_exhaustive]
1088pub struct UpdateConnectionProfileRequest {
1089    /// Optional. Field mask is used to specify the fields to be overwritten in the
1090    /// ConnectionProfile resource by the update.
1091    /// The fields specified in the update_mask are relative to the resource, not
1092    /// the full request. A field will be overwritten if it is in the mask. If the
1093    /// user does not provide a mask then all fields will be overwritten.
1094    pub update_mask: std::option::Option<wkt::FieldMask>,
1095
1096    /// Required. The connection profile to update.
1097    pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
1098
1099    /// Optional. A request ID to identify requests. Specify a unique request ID
1100    /// so that if you must retry your request, the server will know to ignore
1101    /// the request if it has already been completed. The server will guarantee
1102    /// that for at least 60 minutes since the first request.
1103    ///
1104    /// For example, consider a situation where you make an initial request and the
1105    /// request times out. If you make the request again with the same request ID,
1106    /// the server can check if original operation with the same request ID was
1107    /// received, and if so, will ignore the second request. This prevents clients
1108    /// from accidentally creating duplicate commitments.
1109    ///
1110    /// The request ID must be a valid UUID with the exception that zero UUID is
1111    /// not supported (00000000-0000-0000-0000-000000000000).
1112    pub request_id: std::string::String,
1113
1114    /// Optional. Only validate the connection profile, but don't update any
1115    /// resources. The default is false.
1116    pub validate_only: bool,
1117
1118    /// Optional. Update the connection profile without validating it.
1119    pub force: bool,
1120
1121    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1122}
1123
1124impl UpdateConnectionProfileRequest {
1125    pub fn new() -> Self {
1126        std::default::Default::default()
1127    }
1128
1129    /// Sets the value of [update_mask][crate::model::UpdateConnectionProfileRequest::update_mask].
1130    pub fn set_update_mask<T>(mut self, v: T) -> Self
1131    where
1132        T: std::convert::Into<wkt::FieldMask>,
1133    {
1134        self.update_mask = std::option::Option::Some(v.into());
1135        self
1136    }
1137
1138    /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionProfileRequest::update_mask].
1139    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1140    where
1141        T: std::convert::Into<wkt::FieldMask>,
1142    {
1143        self.update_mask = v.map(|x| x.into());
1144        self
1145    }
1146
1147    /// Sets the value of [connection_profile][crate::model::UpdateConnectionProfileRequest::connection_profile].
1148    pub fn set_connection_profile<T>(mut self, v: T) -> Self
1149    where
1150        T: std::convert::Into<crate::model::ConnectionProfile>,
1151    {
1152        self.connection_profile = std::option::Option::Some(v.into());
1153        self
1154    }
1155
1156    /// Sets or clears the value of [connection_profile][crate::model::UpdateConnectionProfileRequest::connection_profile].
1157    pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
1158    where
1159        T: std::convert::Into<crate::model::ConnectionProfile>,
1160    {
1161        self.connection_profile = v.map(|x| x.into());
1162        self
1163    }
1164
1165    /// Sets the value of [request_id][crate::model::UpdateConnectionProfileRequest::request_id].
1166    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1167        self.request_id = v.into();
1168        self
1169    }
1170
1171    /// Sets the value of [validate_only][crate::model::UpdateConnectionProfileRequest::validate_only].
1172    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1173        self.validate_only = v.into();
1174        self
1175    }
1176
1177    /// Sets the value of [force][crate::model::UpdateConnectionProfileRequest::force].
1178    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1179        self.force = v.into();
1180        self
1181    }
1182}
1183
1184impl wkt::message::Message for UpdateConnectionProfileRequest {
1185    fn typename() -> &'static str {
1186        "type.googleapis.com/google.cloud.datastream.v1.UpdateConnectionProfileRequest"
1187    }
1188}
1189
1190/// Request message for deleting a connection profile.
1191#[derive(Clone, Default, PartialEq)]
1192#[non_exhaustive]
1193pub struct DeleteConnectionProfileRequest {
1194    /// Required. The name of the connection profile resource to delete.
1195    pub name: std::string::String,
1196
1197    /// Optional. A request ID to identify requests. Specify a unique request ID
1198    /// so that if you must retry your request, the server will know to ignore
1199    /// the request if it has already been completed. The server will guarantee
1200    /// that for at least 60 minutes after the first request.
1201    ///
1202    /// For example, consider a situation where you make an initial request and the
1203    /// request times out. If you make the request again with the same request ID,
1204    /// the server can check if original operation with the same request ID was
1205    /// received, and if so, will ignore the second request. This prevents clients
1206    /// from accidentally creating duplicate commitments.
1207    ///
1208    /// The request ID must be a valid UUID with the exception that zero UUID is
1209    /// not supported (00000000-0000-0000-0000-000000000000).
1210    pub request_id: std::string::String,
1211
1212    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1213}
1214
1215impl DeleteConnectionProfileRequest {
1216    pub fn new() -> Self {
1217        std::default::Default::default()
1218    }
1219
1220    /// Sets the value of [name][crate::model::DeleteConnectionProfileRequest::name].
1221    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1222        self.name = v.into();
1223        self
1224    }
1225
1226    /// Sets the value of [request_id][crate::model::DeleteConnectionProfileRequest::request_id].
1227    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1228        self.request_id = v.into();
1229        self
1230    }
1231}
1232
1233impl wkt::message::Message for DeleteConnectionProfileRequest {
1234    fn typename() -> &'static str {
1235        "type.googleapis.com/google.cloud.datastream.v1.DeleteConnectionProfileRequest"
1236    }
1237}
1238
1239/// Request message for listing streams.
1240#[derive(Clone, Default, PartialEq)]
1241#[non_exhaustive]
1242pub struct ListStreamsRequest {
1243    /// Required. The parent that owns the collection of streams.
1244    pub parent: std::string::String,
1245
1246    /// Maximum number of streams to return.
1247    /// If unspecified, at most 50 streams will  be returned. The maximum
1248    /// value is 1000; values above 1000 will be coerced to 1000.
1249    pub page_size: i32,
1250
1251    /// Page token received from a previous `ListStreams` call.
1252    /// Provide this to retrieve the subsequent page.
1253    ///
1254    /// When paginating, all other parameters provided to `ListStreams`
1255    /// must match the call that provided the page token.
1256    pub page_token: std::string::String,
1257
1258    /// Filter request.
1259    pub filter: std::string::String,
1260
1261    /// Order by fields for the result.
1262    pub order_by: std::string::String,
1263
1264    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1265}
1266
1267impl ListStreamsRequest {
1268    pub fn new() -> Self {
1269        std::default::Default::default()
1270    }
1271
1272    /// Sets the value of [parent][crate::model::ListStreamsRequest::parent].
1273    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1274        self.parent = v.into();
1275        self
1276    }
1277
1278    /// Sets the value of [page_size][crate::model::ListStreamsRequest::page_size].
1279    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1280        self.page_size = v.into();
1281        self
1282    }
1283
1284    /// Sets the value of [page_token][crate::model::ListStreamsRequest::page_token].
1285    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1286        self.page_token = v.into();
1287        self
1288    }
1289
1290    /// Sets the value of [filter][crate::model::ListStreamsRequest::filter].
1291    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1292        self.filter = v.into();
1293        self
1294    }
1295
1296    /// Sets the value of [order_by][crate::model::ListStreamsRequest::order_by].
1297    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1298        self.order_by = v.into();
1299        self
1300    }
1301}
1302
1303impl wkt::message::Message for ListStreamsRequest {
1304    fn typename() -> &'static str {
1305        "type.googleapis.com/google.cloud.datastream.v1.ListStreamsRequest"
1306    }
1307}
1308
1309/// Response message for listing streams.
1310#[derive(Clone, Default, PartialEq)]
1311#[non_exhaustive]
1312pub struct ListStreamsResponse {
1313    /// List of streams
1314    pub streams: std::vec::Vec<crate::model::Stream>,
1315
1316    /// A token, which can be sent as `page_token` to retrieve the next page.
1317    /// If this field is omitted, there are no subsequent pages.
1318    pub next_page_token: std::string::String,
1319
1320    /// Locations that could not be reached.
1321    pub unreachable: std::vec::Vec<std::string::String>,
1322
1323    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1324}
1325
1326impl ListStreamsResponse {
1327    pub fn new() -> Self {
1328        std::default::Default::default()
1329    }
1330
1331    /// Sets the value of [streams][crate::model::ListStreamsResponse::streams].
1332    pub fn set_streams<T, V>(mut self, v: T) -> Self
1333    where
1334        T: std::iter::IntoIterator<Item = V>,
1335        V: std::convert::Into<crate::model::Stream>,
1336    {
1337        use std::iter::Iterator;
1338        self.streams = v.into_iter().map(|i| i.into()).collect();
1339        self
1340    }
1341
1342    /// Sets the value of [next_page_token][crate::model::ListStreamsResponse::next_page_token].
1343    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1344        self.next_page_token = v.into();
1345        self
1346    }
1347
1348    /// Sets the value of [unreachable][crate::model::ListStreamsResponse::unreachable].
1349    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1350    where
1351        T: std::iter::IntoIterator<Item = V>,
1352        V: std::convert::Into<std::string::String>,
1353    {
1354        use std::iter::Iterator;
1355        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1356        self
1357    }
1358}
1359
1360impl wkt::message::Message for ListStreamsResponse {
1361    fn typename() -> &'static str {
1362        "type.googleapis.com/google.cloud.datastream.v1.ListStreamsResponse"
1363    }
1364}
1365
1366#[doc(hidden)]
1367impl gax::paginator::internal::PageableResponse for ListStreamsResponse {
1368    type PageItem = crate::model::Stream;
1369
1370    fn items(self) -> std::vec::Vec<Self::PageItem> {
1371        self.streams
1372    }
1373
1374    fn next_page_token(&self) -> std::string::String {
1375        use std::clone::Clone;
1376        self.next_page_token.clone()
1377    }
1378}
1379
1380/// Request message for getting a stream.
1381#[derive(Clone, Default, PartialEq)]
1382#[non_exhaustive]
1383pub struct GetStreamRequest {
1384    /// Required. The name of the stream resource to get.
1385    pub name: std::string::String,
1386
1387    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1388}
1389
1390impl GetStreamRequest {
1391    pub fn new() -> Self {
1392        std::default::Default::default()
1393    }
1394
1395    /// Sets the value of [name][crate::model::GetStreamRequest::name].
1396    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1397        self.name = v.into();
1398        self
1399    }
1400}
1401
1402impl wkt::message::Message for GetStreamRequest {
1403    fn typename() -> &'static str {
1404        "type.googleapis.com/google.cloud.datastream.v1.GetStreamRequest"
1405    }
1406}
1407
1408/// Request message for creating a stream.
1409#[derive(Clone, Default, PartialEq)]
1410#[non_exhaustive]
1411pub struct CreateStreamRequest {
1412    /// Required. The parent that owns the collection of streams.
1413    pub parent: std::string::String,
1414
1415    /// Required. The stream identifier.
1416    pub stream_id: std::string::String,
1417
1418    /// Required. The stream resource to create.
1419    pub stream: std::option::Option<crate::model::Stream>,
1420
1421    /// Optional. A request ID to identify requests. Specify a unique request ID
1422    /// so that if you must retry your request, the server will know to ignore
1423    /// the request if it has already been completed. The server will guarantee
1424    /// that for at least 60 minutes since the first request.
1425    ///
1426    /// For example, consider a situation where you make an initial request and the
1427    /// request times out. If you make the request again with the same request ID,
1428    /// the server can check if original operation with the same request ID was
1429    /// received, and if so, will ignore the second request. This prevents clients
1430    /// from accidentally creating duplicate commitments.
1431    ///
1432    /// The request ID must be a valid UUID with the exception that zero UUID is
1433    /// not supported (00000000-0000-0000-0000-000000000000).
1434    pub request_id: std::string::String,
1435
1436    /// Optional. Only validate the stream, but don't create any resources.
1437    /// The default is false.
1438    pub validate_only: bool,
1439
1440    /// Optional. Create the stream without validating it.
1441    pub force: bool,
1442
1443    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1444}
1445
1446impl CreateStreamRequest {
1447    pub fn new() -> Self {
1448        std::default::Default::default()
1449    }
1450
1451    /// Sets the value of [parent][crate::model::CreateStreamRequest::parent].
1452    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1453        self.parent = v.into();
1454        self
1455    }
1456
1457    /// Sets the value of [stream_id][crate::model::CreateStreamRequest::stream_id].
1458    pub fn set_stream_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1459        self.stream_id = v.into();
1460        self
1461    }
1462
1463    /// Sets the value of [stream][crate::model::CreateStreamRequest::stream].
1464    pub fn set_stream<T>(mut self, v: T) -> Self
1465    where
1466        T: std::convert::Into<crate::model::Stream>,
1467    {
1468        self.stream = std::option::Option::Some(v.into());
1469        self
1470    }
1471
1472    /// Sets or clears the value of [stream][crate::model::CreateStreamRequest::stream].
1473    pub fn set_or_clear_stream<T>(mut self, v: std::option::Option<T>) -> Self
1474    where
1475        T: std::convert::Into<crate::model::Stream>,
1476    {
1477        self.stream = v.map(|x| x.into());
1478        self
1479    }
1480
1481    /// Sets the value of [request_id][crate::model::CreateStreamRequest::request_id].
1482    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1483        self.request_id = v.into();
1484        self
1485    }
1486
1487    /// Sets the value of [validate_only][crate::model::CreateStreamRequest::validate_only].
1488    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1489        self.validate_only = v.into();
1490        self
1491    }
1492
1493    /// Sets the value of [force][crate::model::CreateStreamRequest::force].
1494    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1495        self.force = v.into();
1496        self
1497    }
1498}
1499
1500impl wkt::message::Message for CreateStreamRequest {
1501    fn typename() -> &'static str {
1502        "type.googleapis.com/google.cloud.datastream.v1.CreateStreamRequest"
1503    }
1504}
1505
1506/// Request message for updating a stream.
1507#[derive(Clone, Default, PartialEq)]
1508#[non_exhaustive]
1509pub struct UpdateStreamRequest {
1510    /// Optional. Field mask is used to specify the fields to be overwritten in the
1511    /// stream resource by the update.
1512    /// The fields specified in the update_mask are relative to the resource, not
1513    /// the full request. A field will be overwritten if it is in the mask. If the
1514    /// user does not provide a mask then all fields will be overwritten.
1515    pub update_mask: std::option::Option<wkt::FieldMask>,
1516
1517    /// Required. The stream resource to update.
1518    pub stream: std::option::Option<crate::model::Stream>,
1519
1520    /// Optional. A request ID to identify requests. Specify a unique request ID
1521    /// so that if you must retry your request, the server will know to ignore
1522    /// the request if it has already been completed. The server will guarantee
1523    /// that for at least 60 minutes since the first request.
1524    ///
1525    /// For example, consider a situation where you make an initial request and the
1526    /// request times out. If you make the request again with the same request ID,
1527    /// the server can check if original operation with the same request ID was
1528    /// received, and if so, will ignore the second request. This prevents clients
1529    /// from accidentally creating duplicate commitments.
1530    ///
1531    /// The request ID must be a valid UUID with the exception that zero UUID is
1532    /// not supported (00000000-0000-0000-0000-000000000000).
1533    pub request_id: std::string::String,
1534
1535    /// Optional. Only validate the stream with the changes, without actually
1536    /// updating it. The default is false.
1537    pub validate_only: bool,
1538
1539    /// Optional. Update the stream without validating it.
1540    pub force: bool,
1541
1542    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1543}
1544
1545impl UpdateStreamRequest {
1546    pub fn new() -> Self {
1547        std::default::Default::default()
1548    }
1549
1550    /// Sets the value of [update_mask][crate::model::UpdateStreamRequest::update_mask].
1551    pub fn set_update_mask<T>(mut self, v: T) -> Self
1552    where
1553        T: std::convert::Into<wkt::FieldMask>,
1554    {
1555        self.update_mask = std::option::Option::Some(v.into());
1556        self
1557    }
1558
1559    /// Sets or clears the value of [update_mask][crate::model::UpdateStreamRequest::update_mask].
1560    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1561    where
1562        T: std::convert::Into<wkt::FieldMask>,
1563    {
1564        self.update_mask = v.map(|x| x.into());
1565        self
1566    }
1567
1568    /// Sets the value of [stream][crate::model::UpdateStreamRequest::stream].
1569    pub fn set_stream<T>(mut self, v: T) -> Self
1570    where
1571        T: std::convert::Into<crate::model::Stream>,
1572    {
1573        self.stream = std::option::Option::Some(v.into());
1574        self
1575    }
1576
1577    /// Sets or clears the value of [stream][crate::model::UpdateStreamRequest::stream].
1578    pub fn set_or_clear_stream<T>(mut self, v: std::option::Option<T>) -> Self
1579    where
1580        T: std::convert::Into<crate::model::Stream>,
1581    {
1582        self.stream = v.map(|x| x.into());
1583        self
1584    }
1585
1586    /// Sets the value of [request_id][crate::model::UpdateStreamRequest::request_id].
1587    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1588        self.request_id = v.into();
1589        self
1590    }
1591
1592    /// Sets the value of [validate_only][crate::model::UpdateStreamRequest::validate_only].
1593    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1594        self.validate_only = v.into();
1595        self
1596    }
1597
1598    /// Sets the value of [force][crate::model::UpdateStreamRequest::force].
1599    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1600        self.force = v.into();
1601        self
1602    }
1603}
1604
1605impl wkt::message::Message for UpdateStreamRequest {
1606    fn typename() -> &'static str {
1607        "type.googleapis.com/google.cloud.datastream.v1.UpdateStreamRequest"
1608    }
1609}
1610
1611/// Request message for deleting a stream.
1612#[derive(Clone, Default, PartialEq)]
1613#[non_exhaustive]
1614pub struct DeleteStreamRequest {
1615    /// Required. The name of the stream resource to delete.
1616    pub name: std::string::String,
1617
1618    /// Optional. A request ID to identify requests. Specify a unique request ID
1619    /// so that if you must retry your request, the server will know to ignore
1620    /// the request if it has already been completed. The server will guarantee
1621    /// that for at least 60 minutes after the first request.
1622    ///
1623    /// For example, consider a situation where you make an initial request and the
1624    /// request times out. If you make the request again with the same request ID,
1625    /// the server can check if original operation with the same request ID was
1626    /// received, and if so, will ignore the second request. This prevents clients
1627    /// from accidentally creating duplicate commitments.
1628    ///
1629    /// The request ID must be a valid UUID with the exception that zero UUID is
1630    /// not supported (00000000-0000-0000-0000-000000000000).
1631    pub request_id: std::string::String,
1632
1633    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1634}
1635
1636impl DeleteStreamRequest {
1637    pub fn new() -> Self {
1638        std::default::Default::default()
1639    }
1640
1641    /// Sets the value of [name][crate::model::DeleteStreamRequest::name].
1642    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1643        self.name = v.into();
1644        self
1645    }
1646
1647    /// Sets the value of [request_id][crate::model::DeleteStreamRequest::request_id].
1648    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1649        self.request_id = v.into();
1650        self
1651    }
1652}
1653
1654impl wkt::message::Message for DeleteStreamRequest {
1655    fn typename() -> &'static str {
1656        "type.googleapis.com/google.cloud.datastream.v1.DeleteStreamRequest"
1657    }
1658}
1659
1660/// Request message for running a stream.
1661#[derive(Clone, Default, PartialEq)]
1662#[non_exhaustive]
1663pub struct RunStreamRequest {
1664    /// Required. Name of the stream resource to start, in the format:
1665    /// projects/{project_id}/locations/{location}/streams/{stream_name}
1666    pub name: std::string::String,
1667
1668    /// Optional. The CDC strategy of the stream. If not set, the system's default
1669    /// value will be used.
1670    pub cdc_strategy: std::option::Option<crate::model::CdcStrategy>,
1671
1672    /// Optional. Update the stream without validating it.
1673    pub force: bool,
1674
1675    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1676}
1677
1678impl RunStreamRequest {
1679    pub fn new() -> Self {
1680        std::default::Default::default()
1681    }
1682
1683    /// Sets the value of [name][crate::model::RunStreamRequest::name].
1684    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1685        self.name = v.into();
1686        self
1687    }
1688
1689    /// Sets the value of [cdc_strategy][crate::model::RunStreamRequest::cdc_strategy].
1690    pub fn set_cdc_strategy<T>(mut self, v: T) -> Self
1691    where
1692        T: std::convert::Into<crate::model::CdcStrategy>,
1693    {
1694        self.cdc_strategy = std::option::Option::Some(v.into());
1695        self
1696    }
1697
1698    /// Sets or clears the value of [cdc_strategy][crate::model::RunStreamRequest::cdc_strategy].
1699    pub fn set_or_clear_cdc_strategy<T>(mut self, v: std::option::Option<T>) -> Self
1700    where
1701        T: std::convert::Into<crate::model::CdcStrategy>,
1702    {
1703        self.cdc_strategy = v.map(|x| x.into());
1704        self
1705    }
1706
1707    /// Sets the value of [force][crate::model::RunStreamRequest::force].
1708    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1709        self.force = v.into();
1710        self
1711    }
1712}
1713
1714impl wkt::message::Message for RunStreamRequest {
1715    fn typename() -> &'static str {
1716        "type.googleapis.com/google.cloud.datastream.v1.RunStreamRequest"
1717    }
1718}
1719
1720/// Request for fetching a specific stream object.
1721#[derive(Clone, Default, PartialEq)]
1722#[non_exhaustive]
1723pub struct GetStreamObjectRequest {
1724    /// Required. The name of the stream object resource to get.
1725    pub name: std::string::String,
1726
1727    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1728}
1729
1730impl GetStreamObjectRequest {
1731    pub fn new() -> Self {
1732        std::default::Default::default()
1733    }
1734
1735    /// Sets the value of [name][crate::model::GetStreamObjectRequest::name].
1736    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1737        self.name = v.into();
1738        self
1739    }
1740}
1741
1742impl wkt::message::Message for GetStreamObjectRequest {
1743    fn typename() -> &'static str {
1744        "type.googleapis.com/google.cloud.datastream.v1.GetStreamObjectRequest"
1745    }
1746}
1747
1748/// Request for looking up a specific stream object by its source object
1749/// identifier.
1750#[derive(Clone, Default, PartialEq)]
1751#[non_exhaustive]
1752pub struct LookupStreamObjectRequest {
1753    /// Required. The parent stream that owns the collection of objects.
1754    pub parent: std::string::String,
1755
1756    /// Required. The source object identifier which maps to the stream object.
1757    pub source_object_identifier: std::option::Option<crate::model::SourceObjectIdentifier>,
1758
1759    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1760}
1761
1762impl LookupStreamObjectRequest {
1763    pub fn new() -> Self {
1764        std::default::Default::default()
1765    }
1766
1767    /// Sets the value of [parent][crate::model::LookupStreamObjectRequest::parent].
1768    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1769        self.parent = v.into();
1770        self
1771    }
1772
1773    /// Sets the value of [source_object_identifier][crate::model::LookupStreamObjectRequest::source_object_identifier].
1774    pub fn set_source_object_identifier<T>(mut self, v: T) -> Self
1775    where
1776        T: std::convert::Into<crate::model::SourceObjectIdentifier>,
1777    {
1778        self.source_object_identifier = std::option::Option::Some(v.into());
1779        self
1780    }
1781
1782    /// Sets or clears the value of [source_object_identifier][crate::model::LookupStreamObjectRequest::source_object_identifier].
1783    pub fn set_or_clear_source_object_identifier<T>(mut self, v: std::option::Option<T>) -> Self
1784    where
1785        T: std::convert::Into<crate::model::SourceObjectIdentifier>,
1786    {
1787        self.source_object_identifier = v.map(|x| x.into());
1788        self
1789    }
1790}
1791
1792impl wkt::message::Message for LookupStreamObjectRequest {
1793    fn typename() -> &'static str {
1794        "type.googleapis.com/google.cloud.datastream.v1.LookupStreamObjectRequest"
1795    }
1796}
1797
1798/// Request for manually initiating a backfill job for a specific stream object.
1799#[derive(Clone, Default, PartialEq)]
1800#[non_exhaustive]
1801pub struct StartBackfillJobRequest {
1802    /// Required. The name of the stream object resource to start a backfill job
1803    /// for.
1804    pub object: std::string::String,
1805
1806    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1807}
1808
1809impl StartBackfillJobRequest {
1810    pub fn new() -> Self {
1811        std::default::Default::default()
1812    }
1813
1814    /// Sets the value of [object][crate::model::StartBackfillJobRequest::object].
1815    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1816        self.object = v.into();
1817        self
1818    }
1819}
1820
1821impl wkt::message::Message for StartBackfillJobRequest {
1822    fn typename() -> &'static str {
1823        "type.googleapis.com/google.cloud.datastream.v1.StartBackfillJobRequest"
1824    }
1825}
1826
1827/// Response for manually initiating a backfill job for a specific stream object.
1828#[derive(Clone, Default, PartialEq)]
1829#[non_exhaustive]
1830pub struct StartBackfillJobResponse {
1831    /// The stream object resource a backfill job was started for.
1832    pub object: std::option::Option<crate::model::StreamObject>,
1833
1834    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1835}
1836
1837impl StartBackfillJobResponse {
1838    pub fn new() -> Self {
1839        std::default::Default::default()
1840    }
1841
1842    /// Sets the value of [object][crate::model::StartBackfillJobResponse::object].
1843    pub fn set_object<T>(mut self, v: T) -> Self
1844    where
1845        T: std::convert::Into<crate::model::StreamObject>,
1846    {
1847        self.object = std::option::Option::Some(v.into());
1848        self
1849    }
1850
1851    /// Sets or clears the value of [object][crate::model::StartBackfillJobResponse::object].
1852    pub fn set_or_clear_object<T>(mut self, v: std::option::Option<T>) -> Self
1853    where
1854        T: std::convert::Into<crate::model::StreamObject>,
1855    {
1856        self.object = v.map(|x| x.into());
1857        self
1858    }
1859}
1860
1861impl wkt::message::Message for StartBackfillJobResponse {
1862    fn typename() -> &'static str {
1863        "type.googleapis.com/google.cloud.datastream.v1.StartBackfillJobResponse"
1864    }
1865}
1866
1867/// Request for manually stopping a running backfill job for a specific stream
1868/// object.
1869#[derive(Clone, Default, PartialEq)]
1870#[non_exhaustive]
1871pub struct StopBackfillJobRequest {
1872    /// Required. The name of the stream object resource to stop the backfill job
1873    /// for.
1874    pub object: std::string::String,
1875
1876    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1877}
1878
1879impl StopBackfillJobRequest {
1880    pub fn new() -> Self {
1881        std::default::Default::default()
1882    }
1883
1884    /// Sets the value of [object][crate::model::StopBackfillJobRequest::object].
1885    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1886        self.object = v.into();
1887        self
1888    }
1889}
1890
1891impl wkt::message::Message for StopBackfillJobRequest {
1892    fn typename() -> &'static str {
1893        "type.googleapis.com/google.cloud.datastream.v1.StopBackfillJobRequest"
1894    }
1895}
1896
1897/// Response for manually stop a backfill job for a specific stream object.
1898#[derive(Clone, Default, PartialEq)]
1899#[non_exhaustive]
1900pub struct StopBackfillJobResponse {
1901    /// The stream object resource the backfill job was stopped for.
1902    pub object: std::option::Option<crate::model::StreamObject>,
1903
1904    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1905}
1906
1907impl StopBackfillJobResponse {
1908    pub fn new() -> Self {
1909        std::default::Default::default()
1910    }
1911
1912    /// Sets the value of [object][crate::model::StopBackfillJobResponse::object].
1913    pub fn set_object<T>(mut self, v: T) -> Self
1914    where
1915        T: std::convert::Into<crate::model::StreamObject>,
1916    {
1917        self.object = std::option::Option::Some(v.into());
1918        self
1919    }
1920
1921    /// Sets or clears the value of [object][crate::model::StopBackfillJobResponse::object].
1922    pub fn set_or_clear_object<T>(mut self, v: std::option::Option<T>) -> Self
1923    where
1924        T: std::convert::Into<crate::model::StreamObject>,
1925    {
1926        self.object = v.map(|x| x.into());
1927        self
1928    }
1929}
1930
1931impl wkt::message::Message for StopBackfillJobResponse {
1932    fn typename() -> &'static str {
1933        "type.googleapis.com/google.cloud.datastream.v1.StopBackfillJobResponse"
1934    }
1935}
1936
1937/// Request for listing all objects for a specific stream.
1938#[derive(Clone, Default, PartialEq)]
1939#[non_exhaustive]
1940pub struct ListStreamObjectsRequest {
1941    /// Required. The parent stream that owns the collection of objects.
1942    pub parent: std::string::String,
1943
1944    /// Maximum number of objects to return. Default is 50.
1945    /// The maximum value is 1000; values above 1000 will be coerced to 1000.
1946    pub page_size: i32,
1947
1948    /// Page token received from a previous `ListStreamObjectsRequest` call.
1949    /// Provide this to retrieve the subsequent page.
1950    ///
1951    /// When paginating, all other parameters provided to
1952    /// `ListStreamObjectsRequest` must match the call that provided the page
1953    /// token.
1954    pub page_token: std::string::String,
1955
1956    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1957}
1958
1959impl ListStreamObjectsRequest {
1960    pub fn new() -> Self {
1961        std::default::Default::default()
1962    }
1963
1964    /// Sets the value of [parent][crate::model::ListStreamObjectsRequest::parent].
1965    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1966        self.parent = v.into();
1967        self
1968    }
1969
1970    /// Sets the value of [page_size][crate::model::ListStreamObjectsRequest::page_size].
1971    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1972        self.page_size = v.into();
1973        self
1974    }
1975
1976    /// Sets the value of [page_token][crate::model::ListStreamObjectsRequest::page_token].
1977    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1978        self.page_token = v.into();
1979        self
1980    }
1981}
1982
1983impl wkt::message::Message for ListStreamObjectsRequest {
1984    fn typename() -> &'static str {
1985        "type.googleapis.com/google.cloud.datastream.v1.ListStreamObjectsRequest"
1986    }
1987}
1988
1989/// Response containing the objects for a stream.
1990#[derive(Clone, Default, PartialEq)]
1991#[non_exhaustive]
1992pub struct ListStreamObjectsResponse {
1993    /// List of stream objects.
1994    pub stream_objects: std::vec::Vec<crate::model::StreamObject>,
1995
1996    /// A token, which can be sent as `page_token` to retrieve the next page.
1997    pub next_page_token: std::string::String,
1998
1999    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2000}
2001
2002impl ListStreamObjectsResponse {
2003    pub fn new() -> Self {
2004        std::default::Default::default()
2005    }
2006
2007    /// Sets the value of [stream_objects][crate::model::ListStreamObjectsResponse::stream_objects].
2008    pub fn set_stream_objects<T, V>(mut self, v: T) -> Self
2009    where
2010        T: std::iter::IntoIterator<Item = V>,
2011        V: std::convert::Into<crate::model::StreamObject>,
2012    {
2013        use std::iter::Iterator;
2014        self.stream_objects = v.into_iter().map(|i| i.into()).collect();
2015        self
2016    }
2017
2018    /// Sets the value of [next_page_token][crate::model::ListStreamObjectsResponse::next_page_token].
2019    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2020        self.next_page_token = v.into();
2021        self
2022    }
2023}
2024
2025impl wkt::message::Message for ListStreamObjectsResponse {
2026    fn typename() -> &'static str {
2027        "type.googleapis.com/google.cloud.datastream.v1.ListStreamObjectsResponse"
2028    }
2029}
2030
2031#[doc(hidden)]
2032impl gax::paginator::internal::PageableResponse for ListStreamObjectsResponse {
2033    type PageItem = crate::model::StreamObject;
2034
2035    fn items(self) -> std::vec::Vec<Self::PageItem> {
2036        self.stream_objects
2037    }
2038
2039    fn next_page_token(&self) -> std::string::String {
2040        use std::clone::Clone;
2041        self.next_page_token.clone()
2042    }
2043}
2044
2045/// Represents the metadata of the long-running operation.
2046#[derive(Clone, Default, PartialEq)]
2047#[non_exhaustive]
2048pub struct OperationMetadata {
2049    /// Output only. The time the operation was created.
2050    pub create_time: std::option::Option<wkt::Timestamp>,
2051
2052    /// Output only. The time the operation finished running.
2053    pub end_time: std::option::Option<wkt::Timestamp>,
2054
2055    /// Output only. Server-defined resource path for the target of the operation.
2056    pub target: std::string::String,
2057
2058    /// Output only. Name of the verb executed by the operation.
2059    pub verb: std::string::String,
2060
2061    /// Output only. Human-readable status of the operation, if any.
2062    pub status_message: std::string::String,
2063
2064    /// Output only. Identifies whether the user has requested cancellation
2065    /// of the operation. Operations that have successfully been cancelled
2066    /// have
2067    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
2068    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
2069    /// corresponding to `Code.CANCELLED`.
2070    ///
2071    /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
2072    /// [google.rpc.Status.code]: rpc::model::Status::code
2073    pub requested_cancellation: bool,
2074
2075    /// Output only. API version used to start the operation.
2076    pub api_version: std::string::String,
2077
2078    /// Output only. Results of executed validations if there are any.
2079    pub validation_result: std::option::Option<crate::model::ValidationResult>,
2080
2081    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2082}
2083
2084impl OperationMetadata {
2085    pub fn new() -> Self {
2086        std::default::Default::default()
2087    }
2088
2089    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
2090    pub fn set_create_time<T>(mut self, v: T) -> Self
2091    where
2092        T: std::convert::Into<wkt::Timestamp>,
2093    {
2094        self.create_time = std::option::Option::Some(v.into());
2095        self
2096    }
2097
2098    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
2099    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2100    where
2101        T: std::convert::Into<wkt::Timestamp>,
2102    {
2103        self.create_time = v.map(|x| x.into());
2104        self
2105    }
2106
2107    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
2108    pub fn set_end_time<T>(mut self, v: T) -> Self
2109    where
2110        T: std::convert::Into<wkt::Timestamp>,
2111    {
2112        self.end_time = std::option::Option::Some(v.into());
2113        self
2114    }
2115
2116    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
2117    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2118    where
2119        T: std::convert::Into<wkt::Timestamp>,
2120    {
2121        self.end_time = v.map(|x| x.into());
2122        self
2123    }
2124
2125    /// Sets the value of [target][crate::model::OperationMetadata::target].
2126    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2127        self.target = v.into();
2128        self
2129    }
2130
2131    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
2132    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2133        self.verb = v.into();
2134        self
2135    }
2136
2137    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
2138    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2139        self.status_message = v.into();
2140        self
2141    }
2142
2143    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
2144    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2145        self.requested_cancellation = v.into();
2146        self
2147    }
2148
2149    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
2150    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2151        self.api_version = v.into();
2152        self
2153    }
2154
2155    /// Sets the value of [validation_result][crate::model::OperationMetadata::validation_result].
2156    pub fn set_validation_result<T>(mut self, v: T) -> Self
2157    where
2158        T: std::convert::Into<crate::model::ValidationResult>,
2159    {
2160        self.validation_result = std::option::Option::Some(v.into());
2161        self
2162    }
2163
2164    /// Sets or clears the value of [validation_result][crate::model::OperationMetadata::validation_result].
2165    pub fn set_or_clear_validation_result<T>(mut self, v: std::option::Option<T>) -> Self
2166    where
2167        T: std::convert::Into<crate::model::ValidationResult>,
2168    {
2169        self.validation_result = v.map(|x| x.into());
2170        self
2171    }
2172}
2173
2174impl wkt::message::Message for OperationMetadata {
2175    fn typename() -> &'static str {
2176        "type.googleapis.com/google.cloud.datastream.v1.OperationMetadata"
2177    }
2178}
2179
2180/// Request for creating a private connection.
2181#[derive(Clone, Default, PartialEq)]
2182#[non_exhaustive]
2183pub struct CreatePrivateConnectionRequest {
2184    /// Required. The parent that owns the collection of PrivateConnections.
2185    pub parent: std::string::String,
2186
2187    /// Required. The private connectivity identifier.
2188    pub private_connection_id: std::string::String,
2189
2190    /// Required. The Private Connectivity resource to create.
2191    pub private_connection: std::option::Option<crate::model::PrivateConnection>,
2192
2193    /// Optional. A request ID to identify requests. Specify a unique request ID
2194    /// so that if you must retry your request, the server will know to ignore
2195    /// the request if it has already been completed. The server will guarantee
2196    /// that for at least 60 minutes since the first request.
2197    ///
2198    /// For example, consider a situation where you make an initial request and the
2199    /// request times out. If you make the request again with the same request ID,
2200    /// the server can check if original operation with the same request ID was
2201    /// received, and if so, will ignore the second request. This prevents clients
2202    /// from accidentally creating duplicate commitments.
2203    ///
2204    /// The request ID must be a valid UUID with the exception that zero UUID is
2205    /// not supported (00000000-0000-0000-0000-000000000000).
2206    pub request_id: std::string::String,
2207
2208    /// Optional. If set to true, will skip validations.
2209    pub force: bool,
2210
2211    /// Optional. When supplied with PSC Interface config, will get/create the
2212    /// tenant project required for the customer to allow list and won't actually
2213    /// create the private connection.
2214    pub validate_only: bool,
2215
2216    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2217}
2218
2219impl CreatePrivateConnectionRequest {
2220    pub fn new() -> Self {
2221        std::default::Default::default()
2222    }
2223
2224    /// Sets the value of [parent][crate::model::CreatePrivateConnectionRequest::parent].
2225    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2226        self.parent = v.into();
2227        self
2228    }
2229
2230    /// Sets the value of [private_connection_id][crate::model::CreatePrivateConnectionRequest::private_connection_id].
2231    pub fn set_private_connection_id<T: std::convert::Into<std::string::String>>(
2232        mut self,
2233        v: T,
2234    ) -> Self {
2235        self.private_connection_id = v.into();
2236        self
2237    }
2238
2239    /// Sets the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
2240    pub fn set_private_connection<T>(mut self, v: T) -> Self
2241    where
2242        T: std::convert::Into<crate::model::PrivateConnection>,
2243    {
2244        self.private_connection = std::option::Option::Some(v.into());
2245        self
2246    }
2247
2248    /// Sets or clears the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
2249    pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
2250    where
2251        T: std::convert::Into<crate::model::PrivateConnection>,
2252    {
2253        self.private_connection = v.map(|x| x.into());
2254        self
2255    }
2256
2257    /// Sets the value of [request_id][crate::model::CreatePrivateConnectionRequest::request_id].
2258    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2259        self.request_id = v.into();
2260        self
2261    }
2262
2263    /// Sets the value of [force][crate::model::CreatePrivateConnectionRequest::force].
2264    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2265        self.force = v.into();
2266        self
2267    }
2268
2269    /// Sets the value of [validate_only][crate::model::CreatePrivateConnectionRequest::validate_only].
2270    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2271        self.validate_only = v.into();
2272        self
2273    }
2274}
2275
2276impl wkt::message::Message for CreatePrivateConnectionRequest {
2277    fn typename() -> &'static str {
2278        "type.googleapis.com/google.cloud.datastream.v1.CreatePrivateConnectionRequest"
2279    }
2280}
2281
2282/// Request for listing private connections.
2283#[derive(Clone, Default, PartialEq)]
2284#[non_exhaustive]
2285pub struct ListPrivateConnectionsRequest {
2286    /// Required. The parent that owns the collection of private connectivity
2287    /// configurations.
2288    pub parent: std::string::String,
2289
2290    /// Maximum number of private connectivity configurations to return.
2291    /// If unspecified, at most 50 private connectivity configurations that will be
2292    /// returned. The maximum value is 1000; values above 1000 will be coerced to
2293    /// 1000.
2294    pub page_size: i32,
2295
2296    /// Page token received from a previous `ListPrivateConnections` call.
2297    /// Provide this to retrieve the subsequent page.
2298    ///
2299    /// When paginating, all other parameters provided to
2300    /// `ListPrivateConnections` must match the call that provided the page
2301    /// token.
2302    pub page_token: std::string::String,
2303
2304    /// Filter request.
2305    pub filter: std::string::String,
2306
2307    /// Order by fields for the result.
2308    pub order_by: std::string::String,
2309
2310    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2311}
2312
2313impl ListPrivateConnectionsRequest {
2314    pub fn new() -> Self {
2315        std::default::Default::default()
2316    }
2317
2318    /// Sets the value of [parent][crate::model::ListPrivateConnectionsRequest::parent].
2319    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2320        self.parent = v.into();
2321        self
2322    }
2323
2324    /// Sets the value of [page_size][crate::model::ListPrivateConnectionsRequest::page_size].
2325    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2326        self.page_size = v.into();
2327        self
2328    }
2329
2330    /// Sets the value of [page_token][crate::model::ListPrivateConnectionsRequest::page_token].
2331    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2332        self.page_token = v.into();
2333        self
2334    }
2335
2336    /// Sets the value of [filter][crate::model::ListPrivateConnectionsRequest::filter].
2337    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2338        self.filter = v.into();
2339        self
2340    }
2341
2342    /// Sets the value of [order_by][crate::model::ListPrivateConnectionsRequest::order_by].
2343    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2344        self.order_by = v.into();
2345        self
2346    }
2347}
2348
2349impl wkt::message::Message for ListPrivateConnectionsRequest {
2350    fn typename() -> &'static str {
2351        "type.googleapis.com/google.cloud.datastream.v1.ListPrivateConnectionsRequest"
2352    }
2353}
2354
2355/// Response containing a list of private connection configurations.
2356#[derive(Clone, Default, PartialEq)]
2357#[non_exhaustive]
2358pub struct ListPrivateConnectionsResponse {
2359    /// List of private connectivity configurations.
2360    pub private_connections: std::vec::Vec<crate::model::PrivateConnection>,
2361
2362    /// A token, which can be sent as `page_token` to retrieve the next page.
2363    /// If this field is omitted, there are no subsequent pages.
2364    pub next_page_token: std::string::String,
2365
2366    /// Locations that could not be reached.
2367    pub unreachable: std::vec::Vec<std::string::String>,
2368
2369    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2370}
2371
2372impl ListPrivateConnectionsResponse {
2373    pub fn new() -> Self {
2374        std::default::Default::default()
2375    }
2376
2377    /// Sets the value of [private_connections][crate::model::ListPrivateConnectionsResponse::private_connections].
2378    pub fn set_private_connections<T, V>(mut self, v: T) -> Self
2379    where
2380        T: std::iter::IntoIterator<Item = V>,
2381        V: std::convert::Into<crate::model::PrivateConnection>,
2382    {
2383        use std::iter::Iterator;
2384        self.private_connections = v.into_iter().map(|i| i.into()).collect();
2385        self
2386    }
2387
2388    /// Sets the value of [next_page_token][crate::model::ListPrivateConnectionsResponse::next_page_token].
2389    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2390        self.next_page_token = v.into();
2391        self
2392    }
2393
2394    /// Sets the value of [unreachable][crate::model::ListPrivateConnectionsResponse::unreachable].
2395    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2396    where
2397        T: std::iter::IntoIterator<Item = V>,
2398        V: std::convert::Into<std::string::String>,
2399    {
2400        use std::iter::Iterator;
2401        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2402        self
2403    }
2404}
2405
2406impl wkt::message::Message for ListPrivateConnectionsResponse {
2407    fn typename() -> &'static str {
2408        "type.googleapis.com/google.cloud.datastream.v1.ListPrivateConnectionsResponse"
2409    }
2410}
2411
2412#[doc(hidden)]
2413impl gax::paginator::internal::PageableResponse for ListPrivateConnectionsResponse {
2414    type PageItem = crate::model::PrivateConnection;
2415
2416    fn items(self) -> std::vec::Vec<Self::PageItem> {
2417        self.private_connections
2418    }
2419
2420    fn next_page_token(&self) -> std::string::String {
2421        use std::clone::Clone;
2422        self.next_page_token.clone()
2423    }
2424}
2425
2426/// Request to delete a private connection.
2427#[derive(Clone, Default, PartialEq)]
2428#[non_exhaustive]
2429pub struct DeletePrivateConnectionRequest {
2430    /// Required. The name of the private connectivity configuration to delete.
2431    pub name: std::string::String,
2432
2433    /// Optional. A request ID to identify requests. Specify a unique request ID
2434    /// so that if you must retry your request, the server will know to ignore
2435    /// the request if it has already been completed. The server will guarantee
2436    /// that for at least 60 minutes after the first request.
2437    ///
2438    /// For example, consider a situation where you make an initial request and the
2439    /// request times out. If you make the request again with the same request ID,
2440    /// the server can check if original operation with the same request ID was
2441    /// received, and if so, will ignore the second request. This prevents clients
2442    /// from accidentally creating duplicate commitments.
2443    ///
2444    /// The request ID must be a valid UUID with the exception that zero UUID is
2445    /// not supported (00000000-0000-0000-0000-000000000000).
2446    pub request_id: std::string::String,
2447
2448    /// Optional. If set to true, any child routes that belong to this
2449    /// PrivateConnection will also be deleted.
2450    pub force: bool,
2451
2452    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2453}
2454
2455impl DeletePrivateConnectionRequest {
2456    pub fn new() -> Self {
2457        std::default::Default::default()
2458    }
2459
2460    /// Sets the value of [name][crate::model::DeletePrivateConnectionRequest::name].
2461    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2462        self.name = v.into();
2463        self
2464    }
2465
2466    /// Sets the value of [request_id][crate::model::DeletePrivateConnectionRequest::request_id].
2467    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2468        self.request_id = v.into();
2469        self
2470    }
2471
2472    /// Sets the value of [force][crate::model::DeletePrivateConnectionRequest::force].
2473    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2474        self.force = v.into();
2475        self
2476    }
2477}
2478
2479impl wkt::message::Message for DeletePrivateConnectionRequest {
2480    fn typename() -> &'static str {
2481        "type.googleapis.com/google.cloud.datastream.v1.DeletePrivateConnectionRequest"
2482    }
2483}
2484
2485/// Request to get a private connection configuration.
2486#[derive(Clone, Default, PartialEq)]
2487#[non_exhaustive]
2488pub struct GetPrivateConnectionRequest {
2489    /// Required. The name of the  private connectivity configuration to get.
2490    pub name: std::string::String,
2491
2492    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2493}
2494
2495impl GetPrivateConnectionRequest {
2496    pub fn new() -> Self {
2497        std::default::Default::default()
2498    }
2499
2500    /// Sets the value of [name][crate::model::GetPrivateConnectionRequest::name].
2501    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2502        self.name = v.into();
2503        self
2504    }
2505}
2506
2507impl wkt::message::Message for GetPrivateConnectionRequest {
2508    fn typename() -> &'static str {
2509        "type.googleapis.com/google.cloud.datastream.v1.GetPrivateConnectionRequest"
2510    }
2511}
2512
2513/// Route creation request.
2514#[derive(Clone, Default, PartialEq)]
2515#[non_exhaustive]
2516pub struct CreateRouteRequest {
2517    /// Required. The parent that owns the collection of Routes.
2518    pub parent: std::string::String,
2519
2520    /// Required. The Route identifier.
2521    pub route_id: std::string::String,
2522
2523    /// Required. The Route resource to create.
2524    pub route: std::option::Option<crate::model::Route>,
2525
2526    /// Optional. A request ID to identify requests. Specify a unique request ID
2527    /// so that if you must retry your request, the server will know to ignore
2528    /// the request if it has already been completed. The server will guarantee
2529    /// that for at least 60 minutes since the first request.
2530    ///
2531    /// For example, consider a situation where you make an initial request and the
2532    /// request times out. If you make the request again with the same request ID,
2533    /// the server can check if original operation with the same request ID was
2534    /// received, and if so, will ignore the second request. This prevents clients
2535    /// from accidentally creating duplicate commitments.
2536    ///
2537    /// The request ID must be a valid UUID with the exception that zero UUID is
2538    /// not supported (00000000-0000-0000-0000-000000000000).
2539    pub request_id: std::string::String,
2540
2541    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2542}
2543
2544impl CreateRouteRequest {
2545    pub fn new() -> Self {
2546        std::default::Default::default()
2547    }
2548
2549    /// Sets the value of [parent][crate::model::CreateRouteRequest::parent].
2550    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2551        self.parent = v.into();
2552        self
2553    }
2554
2555    /// Sets the value of [route_id][crate::model::CreateRouteRequest::route_id].
2556    pub fn set_route_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2557        self.route_id = v.into();
2558        self
2559    }
2560
2561    /// Sets the value of [route][crate::model::CreateRouteRequest::route].
2562    pub fn set_route<T>(mut self, v: T) -> Self
2563    where
2564        T: std::convert::Into<crate::model::Route>,
2565    {
2566        self.route = std::option::Option::Some(v.into());
2567        self
2568    }
2569
2570    /// Sets or clears the value of [route][crate::model::CreateRouteRequest::route].
2571    pub fn set_or_clear_route<T>(mut self, v: std::option::Option<T>) -> Self
2572    where
2573        T: std::convert::Into<crate::model::Route>,
2574    {
2575        self.route = v.map(|x| x.into());
2576        self
2577    }
2578
2579    /// Sets the value of [request_id][crate::model::CreateRouteRequest::request_id].
2580    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2581        self.request_id = v.into();
2582        self
2583    }
2584}
2585
2586impl wkt::message::Message for CreateRouteRequest {
2587    fn typename() -> &'static str {
2588        "type.googleapis.com/google.cloud.datastream.v1.CreateRouteRequest"
2589    }
2590}
2591
2592/// Route list request.
2593#[derive(Clone, Default, PartialEq)]
2594#[non_exhaustive]
2595pub struct ListRoutesRequest {
2596    /// Required. The parent that owns the collection of Routess.
2597    pub parent: std::string::String,
2598
2599    /// Maximum number of Routes to return. The service may return
2600    /// fewer than this value. If unspecified, at most 50 Routes
2601    /// will be returned. The maximum value is 1000; values above 1000 will be
2602    /// coerced to 1000.
2603    pub page_size: i32,
2604
2605    /// Page token received from a previous `ListRoutes` call.
2606    /// Provide this to retrieve the subsequent page.
2607    ///
2608    /// When paginating, all other parameters provided to
2609    /// `ListRoutes` must match the call that provided the page
2610    /// token.
2611    pub page_token: std::string::String,
2612
2613    /// Filter request.
2614    pub filter: std::string::String,
2615
2616    /// Order by fields for the result.
2617    pub order_by: std::string::String,
2618
2619    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2620}
2621
2622impl ListRoutesRequest {
2623    pub fn new() -> Self {
2624        std::default::Default::default()
2625    }
2626
2627    /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
2628    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2629        self.parent = v.into();
2630        self
2631    }
2632
2633    /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
2634    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2635        self.page_size = v.into();
2636        self
2637    }
2638
2639    /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
2640    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2641        self.page_token = v.into();
2642        self
2643    }
2644
2645    /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
2646    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2647        self.filter = v.into();
2648        self
2649    }
2650
2651    /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
2652    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2653        self.order_by = v.into();
2654        self
2655    }
2656}
2657
2658impl wkt::message::Message for ListRoutesRequest {
2659    fn typename() -> &'static str {
2660        "type.googleapis.com/google.cloud.datastream.v1.ListRoutesRequest"
2661    }
2662}
2663
2664/// Route list response.
2665#[derive(Clone, Default, PartialEq)]
2666#[non_exhaustive]
2667pub struct ListRoutesResponse {
2668    /// List of Routes.
2669    pub routes: std::vec::Vec<crate::model::Route>,
2670
2671    /// A token, which can be sent as `page_token` to retrieve the next page.
2672    /// If this field is omitted, there are no subsequent pages.
2673    pub next_page_token: std::string::String,
2674
2675    /// Locations that could not be reached.
2676    pub unreachable: std::vec::Vec<std::string::String>,
2677
2678    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2679}
2680
2681impl ListRoutesResponse {
2682    pub fn new() -> Self {
2683        std::default::Default::default()
2684    }
2685
2686    /// Sets the value of [routes][crate::model::ListRoutesResponse::routes].
2687    pub fn set_routes<T, V>(mut self, v: T) -> Self
2688    where
2689        T: std::iter::IntoIterator<Item = V>,
2690        V: std::convert::Into<crate::model::Route>,
2691    {
2692        use std::iter::Iterator;
2693        self.routes = v.into_iter().map(|i| i.into()).collect();
2694        self
2695    }
2696
2697    /// Sets the value of [next_page_token][crate::model::ListRoutesResponse::next_page_token].
2698    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2699        self.next_page_token = v.into();
2700        self
2701    }
2702
2703    /// Sets the value of [unreachable][crate::model::ListRoutesResponse::unreachable].
2704    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2705    where
2706        T: std::iter::IntoIterator<Item = V>,
2707        V: std::convert::Into<std::string::String>,
2708    {
2709        use std::iter::Iterator;
2710        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2711        self
2712    }
2713}
2714
2715impl wkt::message::Message for ListRoutesResponse {
2716    fn typename() -> &'static str {
2717        "type.googleapis.com/google.cloud.datastream.v1.ListRoutesResponse"
2718    }
2719}
2720
2721#[doc(hidden)]
2722impl gax::paginator::internal::PageableResponse for ListRoutesResponse {
2723    type PageItem = crate::model::Route;
2724
2725    fn items(self) -> std::vec::Vec<Self::PageItem> {
2726        self.routes
2727    }
2728
2729    fn next_page_token(&self) -> std::string::String {
2730        use std::clone::Clone;
2731        self.next_page_token.clone()
2732    }
2733}
2734
2735/// Route deletion request.
2736#[derive(Clone, Default, PartialEq)]
2737#[non_exhaustive]
2738pub struct DeleteRouteRequest {
2739    /// Required. The name of the Route resource to delete.
2740    pub name: std::string::String,
2741
2742    /// Optional. A request ID to identify requests. Specify a unique request ID
2743    /// so that if you must retry your request, the server will know to ignore
2744    /// the request if it has already been completed. The server will guarantee
2745    /// that for at least 60 minutes after the first request.
2746    ///
2747    /// For example, consider a situation where you make an initial request and the
2748    /// request times out. If you make the request again with the same request ID,
2749    /// the server can check if original operation with the same request ID was
2750    /// received, and if so, will ignore the second request. This prevents clients
2751    /// from accidentally creating duplicate commitments.
2752    ///
2753    /// The request ID must be a valid UUID with the exception that zero UUID is
2754    /// not supported (00000000-0000-0000-0000-000000000000).
2755    pub request_id: std::string::String,
2756
2757    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2758}
2759
2760impl DeleteRouteRequest {
2761    pub fn new() -> Self {
2762        std::default::Default::default()
2763    }
2764
2765    /// Sets the value of [name][crate::model::DeleteRouteRequest::name].
2766    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2767        self.name = v.into();
2768        self
2769    }
2770
2771    /// Sets the value of [request_id][crate::model::DeleteRouteRequest::request_id].
2772    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2773        self.request_id = v.into();
2774        self
2775    }
2776}
2777
2778impl wkt::message::Message for DeleteRouteRequest {
2779    fn typename() -> &'static str {
2780        "type.googleapis.com/google.cloud.datastream.v1.DeleteRouteRequest"
2781    }
2782}
2783
2784/// Route get request.
2785#[derive(Clone, Default, PartialEq)]
2786#[non_exhaustive]
2787pub struct GetRouteRequest {
2788    /// Required. The name of the Route resource to get.
2789    pub name: std::string::String,
2790
2791    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2792}
2793
2794impl GetRouteRequest {
2795    pub fn new() -> Self {
2796        std::default::Default::default()
2797    }
2798
2799    /// Sets the value of [name][crate::model::GetRouteRequest::name].
2800    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2801        self.name = v.into();
2802        self
2803    }
2804}
2805
2806impl wkt::message::Message for GetRouteRequest {
2807    fn typename() -> &'static str {
2808        "type.googleapis.com/google.cloud.datastream.v1.GetRouteRequest"
2809    }
2810}
2811
2812/// Oracle database profile.
2813#[derive(Clone, Default, PartialEq)]
2814#[non_exhaustive]
2815pub struct OracleProfile {
2816    /// Required. Hostname for the Oracle connection.
2817    pub hostname: std::string::String,
2818
2819    /// Port for the Oracle connection, default value is 1521.
2820    pub port: i32,
2821
2822    /// Required. Username for the Oracle connection.
2823    pub username: std::string::String,
2824
2825    /// Optional. Password for the Oracle connection. Mutually exclusive with the
2826    /// `secret_manager_stored_password` field.
2827    pub password: std::string::String,
2828
2829    /// Required. Database for the Oracle connection.
2830    pub database_service: std::string::String,
2831
2832    /// Connection string attributes
2833    pub connection_attributes: std::collections::HashMap<std::string::String, std::string::String>,
2834
2835    /// Optional. SSL configuration for the Oracle connection.
2836    pub oracle_ssl_config: std::option::Option<crate::model::OracleSslConfig>,
2837
2838    /// Optional. Configuration for Oracle ASM connection.
2839    pub oracle_asm_config: std::option::Option<crate::model::OracleAsmConfig>,
2840
2841    /// Optional. A reference to a Secret Manager resource name storing the Oracle
2842    /// connection password. Mutually exclusive with the `password` field.
2843    pub secret_manager_stored_password: std::string::String,
2844
2845    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2846}
2847
2848impl OracleProfile {
2849    pub fn new() -> Self {
2850        std::default::Default::default()
2851    }
2852
2853    /// Sets the value of [hostname][crate::model::OracleProfile::hostname].
2854    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2855        self.hostname = v.into();
2856        self
2857    }
2858
2859    /// Sets the value of [port][crate::model::OracleProfile::port].
2860    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2861        self.port = v.into();
2862        self
2863    }
2864
2865    /// Sets the value of [username][crate::model::OracleProfile::username].
2866    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2867        self.username = v.into();
2868        self
2869    }
2870
2871    /// Sets the value of [password][crate::model::OracleProfile::password].
2872    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2873        self.password = v.into();
2874        self
2875    }
2876
2877    /// Sets the value of [database_service][crate::model::OracleProfile::database_service].
2878    pub fn set_database_service<T: std::convert::Into<std::string::String>>(
2879        mut self,
2880        v: T,
2881    ) -> Self {
2882        self.database_service = v.into();
2883        self
2884    }
2885
2886    /// Sets the value of [connection_attributes][crate::model::OracleProfile::connection_attributes].
2887    pub fn set_connection_attributes<T, K, V>(mut self, v: T) -> Self
2888    where
2889        T: std::iter::IntoIterator<Item = (K, V)>,
2890        K: std::convert::Into<std::string::String>,
2891        V: std::convert::Into<std::string::String>,
2892    {
2893        use std::iter::Iterator;
2894        self.connection_attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2895        self
2896    }
2897
2898    /// Sets the value of [oracle_ssl_config][crate::model::OracleProfile::oracle_ssl_config].
2899    pub fn set_oracle_ssl_config<T>(mut self, v: T) -> Self
2900    where
2901        T: std::convert::Into<crate::model::OracleSslConfig>,
2902    {
2903        self.oracle_ssl_config = std::option::Option::Some(v.into());
2904        self
2905    }
2906
2907    /// Sets or clears the value of [oracle_ssl_config][crate::model::OracleProfile::oracle_ssl_config].
2908    pub fn set_or_clear_oracle_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
2909    where
2910        T: std::convert::Into<crate::model::OracleSslConfig>,
2911    {
2912        self.oracle_ssl_config = v.map(|x| x.into());
2913        self
2914    }
2915
2916    /// Sets the value of [oracle_asm_config][crate::model::OracleProfile::oracle_asm_config].
2917    pub fn set_oracle_asm_config<T>(mut self, v: T) -> Self
2918    where
2919        T: std::convert::Into<crate::model::OracleAsmConfig>,
2920    {
2921        self.oracle_asm_config = std::option::Option::Some(v.into());
2922        self
2923    }
2924
2925    /// Sets or clears the value of [oracle_asm_config][crate::model::OracleProfile::oracle_asm_config].
2926    pub fn set_or_clear_oracle_asm_config<T>(mut self, v: std::option::Option<T>) -> Self
2927    where
2928        T: std::convert::Into<crate::model::OracleAsmConfig>,
2929    {
2930        self.oracle_asm_config = v.map(|x| x.into());
2931        self
2932    }
2933
2934    /// Sets the value of [secret_manager_stored_password][crate::model::OracleProfile::secret_manager_stored_password].
2935    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
2936        mut self,
2937        v: T,
2938    ) -> Self {
2939        self.secret_manager_stored_password = v.into();
2940        self
2941    }
2942}
2943
2944impl wkt::message::Message for OracleProfile {
2945    fn typename() -> &'static str {
2946        "type.googleapis.com/google.cloud.datastream.v1.OracleProfile"
2947    }
2948}
2949
2950/// Configuration for Oracle Automatic Storage Management (ASM) connection.
2951#[derive(Clone, Default, PartialEq)]
2952#[non_exhaustive]
2953pub struct OracleAsmConfig {
2954    /// Required. Hostname for the Oracle ASM connection.
2955    pub hostname: std::string::String,
2956
2957    /// Required. Port for the Oracle ASM connection.
2958    pub port: i32,
2959
2960    /// Required. Username for the Oracle ASM connection.
2961    pub username: std::string::String,
2962
2963    /// Optional. Password for the Oracle ASM connection. Mutually exclusive with
2964    /// the `secret_manager_stored_password` field.
2965    pub password: std::string::String,
2966
2967    /// Required. ASM service name for the Oracle ASM connection.
2968    pub asm_service: std::string::String,
2969
2970    /// Optional. Connection string attributes
2971    pub connection_attributes: std::collections::HashMap<std::string::String, std::string::String>,
2972
2973    /// Optional. SSL configuration for the Oracle connection.
2974    pub oracle_ssl_config: std::option::Option<crate::model::OracleSslConfig>,
2975
2976    /// Optional. A reference to a Secret Manager resource name storing the Oracle
2977    /// ASM connection password. Mutually exclusive with the `password` field.
2978    pub secret_manager_stored_password: std::string::String,
2979
2980    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2981}
2982
2983impl OracleAsmConfig {
2984    pub fn new() -> Self {
2985        std::default::Default::default()
2986    }
2987
2988    /// Sets the value of [hostname][crate::model::OracleAsmConfig::hostname].
2989    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2990        self.hostname = v.into();
2991        self
2992    }
2993
2994    /// Sets the value of [port][crate::model::OracleAsmConfig::port].
2995    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2996        self.port = v.into();
2997        self
2998    }
2999
3000    /// Sets the value of [username][crate::model::OracleAsmConfig::username].
3001    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3002        self.username = v.into();
3003        self
3004    }
3005
3006    /// Sets the value of [password][crate::model::OracleAsmConfig::password].
3007    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3008        self.password = v.into();
3009        self
3010    }
3011
3012    /// Sets the value of [asm_service][crate::model::OracleAsmConfig::asm_service].
3013    pub fn set_asm_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3014        self.asm_service = v.into();
3015        self
3016    }
3017
3018    /// Sets the value of [connection_attributes][crate::model::OracleAsmConfig::connection_attributes].
3019    pub fn set_connection_attributes<T, K, V>(mut self, v: T) -> Self
3020    where
3021        T: std::iter::IntoIterator<Item = (K, V)>,
3022        K: std::convert::Into<std::string::String>,
3023        V: std::convert::Into<std::string::String>,
3024    {
3025        use std::iter::Iterator;
3026        self.connection_attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3027        self
3028    }
3029
3030    /// Sets the value of [oracle_ssl_config][crate::model::OracleAsmConfig::oracle_ssl_config].
3031    pub fn set_oracle_ssl_config<T>(mut self, v: T) -> Self
3032    where
3033        T: std::convert::Into<crate::model::OracleSslConfig>,
3034    {
3035        self.oracle_ssl_config = std::option::Option::Some(v.into());
3036        self
3037    }
3038
3039    /// Sets or clears the value of [oracle_ssl_config][crate::model::OracleAsmConfig::oracle_ssl_config].
3040    pub fn set_or_clear_oracle_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
3041    where
3042        T: std::convert::Into<crate::model::OracleSslConfig>,
3043    {
3044        self.oracle_ssl_config = v.map(|x| x.into());
3045        self
3046    }
3047
3048    /// Sets the value of [secret_manager_stored_password][crate::model::OracleAsmConfig::secret_manager_stored_password].
3049    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
3050        mut self,
3051        v: T,
3052    ) -> Self {
3053        self.secret_manager_stored_password = v.into();
3054        self
3055    }
3056}
3057
3058impl wkt::message::Message for OracleAsmConfig {
3059    fn typename() -> &'static str {
3060        "type.googleapis.com/google.cloud.datastream.v1.OracleAsmConfig"
3061    }
3062}
3063
3064/// MySQL database profile.
3065#[derive(Clone, Default, PartialEq)]
3066#[non_exhaustive]
3067pub struct MysqlProfile {
3068    /// Required. Hostname for the MySQL connection.
3069    pub hostname: std::string::String,
3070
3071    /// Port for the MySQL connection, default value is 3306.
3072    pub port: i32,
3073
3074    /// Required. Username for the MySQL connection.
3075    pub username: std::string::String,
3076
3077    /// Optional. Input only. Password for the MySQL connection. Mutually exclusive
3078    /// with the `secret_manager_stored_password` field.
3079    pub password: std::string::String,
3080
3081    /// SSL configuration for the MySQL connection.
3082    pub ssl_config: std::option::Option<crate::model::MysqlSslConfig>,
3083
3084    /// Optional. A reference to a Secret Manager resource name storing the MySQL
3085    /// connection password. Mutually exclusive with the `password` field.
3086    pub secret_manager_stored_password: std::string::String,
3087
3088    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3089}
3090
3091impl MysqlProfile {
3092    pub fn new() -> Self {
3093        std::default::Default::default()
3094    }
3095
3096    /// Sets the value of [hostname][crate::model::MysqlProfile::hostname].
3097    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3098        self.hostname = v.into();
3099        self
3100    }
3101
3102    /// Sets the value of [port][crate::model::MysqlProfile::port].
3103    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3104        self.port = v.into();
3105        self
3106    }
3107
3108    /// Sets the value of [username][crate::model::MysqlProfile::username].
3109    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3110        self.username = v.into();
3111        self
3112    }
3113
3114    /// Sets the value of [password][crate::model::MysqlProfile::password].
3115    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3116        self.password = v.into();
3117        self
3118    }
3119
3120    /// Sets the value of [ssl_config][crate::model::MysqlProfile::ssl_config].
3121    pub fn set_ssl_config<T>(mut self, v: T) -> Self
3122    where
3123        T: std::convert::Into<crate::model::MysqlSslConfig>,
3124    {
3125        self.ssl_config = std::option::Option::Some(v.into());
3126        self
3127    }
3128
3129    /// Sets or clears the value of [ssl_config][crate::model::MysqlProfile::ssl_config].
3130    pub fn set_or_clear_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
3131    where
3132        T: std::convert::Into<crate::model::MysqlSslConfig>,
3133    {
3134        self.ssl_config = v.map(|x| x.into());
3135        self
3136    }
3137
3138    /// Sets the value of [secret_manager_stored_password][crate::model::MysqlProfile::secret_manager_stored_password].
3139    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
3140        mut self,
3141        v: T,
3142    ) -> Self {
3143        self.secret_manager_stored_password = v.into();
3144        self
3145    }
3146}
3147
3148impl wkt::message::Message for MysqlProfile {
3149    fn typename() -> &'static str {
3150        "type.googleapis.com/google.cloud.datastream.v1.MysqlProfile"
3151    }
3152}
3153
3154/// PostgreSQL database profile.
3155#[derive(Clone, Default, PartialEq)]
3156#[non_exhaustive]
3157pub struct PostgresqlProfile {
3158    /// Required. Hostname for the PostgreSQL connection.
3159    pub hostname: std::string::String,
3160
3161    /// Port for the PostgreSQL connection, default value is 5432.
3162    pub port: i32,
3163
3164    /// Required. Username for the PostgreSQL connection.
3165    pub username: std::string::String,
3166
3167    /// Optional. Password for the PostgreSQL connection. Mutually exclusive with
3168    /// the `secret_manager_stored_password` field.
3169    pub password: std::string::String,
3170
3171    /// Required. Database for the PostgreSQL connection.
3172    pub database: std::string::String,
3173
3174    /// Optional. A reference to a Secret Manager resource name storing the
3175    /// PostgreSQL connection password. Mutually exclusive with the `password`
3176    /// field.
3177    pub secret_manager_stored_password: std::string::String,
3178
3179    /// Optional. SSL configuration for the PostgreSQL connection.
3180    /// In case PostgresqlSslConfig is not set, the connection will use the default
3181    /// SSL mode, which is `prefer` (i.e. this mode will only use encryption if
3182    /// enabled from database side, otherwise will use unencrypted communication)
3183    pub ssl_config: std::option::Option<crate::model::PostgresqlSslConfig>,
3184
3185    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3186}
3187
3188impl PostgresqlProfile {
3189    pub fn new() -> Self {
3190        std::default::Default::default()
3191    }
3192
3193    /// Sets the value of [hostname][crate::model::PostgresqlProfile::hostname].
3194    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3195        self.hostname = v.into();
3196        self
3197    }
3198
3199    /// Sets the value of [port][crate::model::PostgresqlProfile::port].
3200    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3201        self.port = v.into();
3202        self
3203    }
3204
3205    /// Sets the value of [username][crate::model::PostgresqlProfile::username].
3206    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3207        self.username = v.into();
3208        self
3209    }
3210
3211    /// Sets the value of [password][crate::model::PostgresqlProfile::password].
3212    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3213        self.password = v.into();
3214        self
3215    }
3216
3217    /// Sets the value of [database][crate::model::PostgresqlProfile::database].
3218    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3219        self.database = v.into();
3220        self
3221    }
3222
3223    /// Sets the value of [secret_manager_stored_password][crate::model::PostgresqlProfile::secret_manager_stored_password].
3224    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
3225        mut self,
3226        v: T,
3227    ) -> Self {
3228        self.secret_manager_stored_password = v.into();
3229        self
3230    }
3231
3232    /// Sets the value of [ssl_config][crate::model::PostgresqlProfile::ssl_config].
3233    pub fn set_ssl_config<T>(mut self, v: T) -> Self
3234    where
3235        T: std::convert::Into<crate::model::PostgresqlSslConfig>,
3236    {
3237        self.ssl_config = std::option::Option::Some(v.into());
3238        self
3239    }
3240
3241    /// Sets or clears the value of [ssl_config][crate::model::PostgresqlProfile::ssl_config].
3242    pub fn set_or_clear_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
3243    where
3244        T: std::convert::Into<crate::model::PostgresqlSslConfig>,
3245    {
3246        self.ssl_config = v.map(|x| x.into());
3247        self
3248    }
3249}
3250
3251impl wkt::message::Message for PostgresqlProfile {
3252    fn typename() -> &'static str {
3253        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlProfile"
3254    }
3255}
3256
3257/// SQLServer database profile.
3258#[derive(Clone, Default, PartialEq)]
3259#[non_exhaustive]
3260pub struct SqlServerProfile {
3261    /// Required. Hostname for the SQLServer connection.
3262    pub hostname: std::string::String,
3263
3264    /// Port for the SQLServer connection, default value is 1433.
3265    pub port: i32,
3266
3267    /// Required. Username for the SQLServer connection.
3268    pub username: std::string::String,
3269
3270    /// Optional. Password for the SQLServer connection. Mutually exclusive with
3271    /// the `secret_manager_stored_password` field.
3272    pub password: std::string::String,
3273
3274    /// Required. Database for the SQLServer connection.
3275    pub database: std::string::String,
3276
3277    /// Optional. A reference to a Secret Manager resource name storing the
3278    /// SQLServer connection password. Mutually exclusive with the `password`
3279    /// field.
3280    pub secret_manager_stored_password: std::string::String,
3281
3282    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3283}
3284
3285impl SqlServerProfile {
3286    pub fn new() -> Self {
3287        std::default::Default::default()
3288    }
3289
3290    /// Sets the value of [hostname][crate::model::SqlServerProfile::hostname].
3291    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3292        self.hostname = v.into();
3293        self
3294    }
3295
3296    /// Sets the value of [port][crate::model::SqlServerProfile::port].
3297    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3298        self.port = v.into();
3299        self
3300    }
3301
3302    /// Sets the value of [username][crate::model::SqlServerProfile::username].
3303    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3304        self.username = v.into();
3305        self
3306    }
3307
3308    /// Sets the value of [password][crate::model::SqlServerProfile::password].
3309    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3310        self.password = v.into();
3311        self
3312    }
3313
3314    /// Sets the value of [database][crate::model::SqlServerProfile::database].
3315    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3316        self.database = v.into();
3317        self
3318    }
3319
3320    /// Sets the value of [secret_manager_stored_password][crate::model::SqlServerProfile::secret_manager_stored_password].
3321    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
3322        mut self,
3323        v: T,
3324    ) -> Self {
3325        self.secret_manager_stored_password = v.into();
3326        self
3327    }
3328}
3329
3330impl wkt::message::Message for SqlServerProfile {
3331    fn typename() -> &'static str {
3332        "type.googleapis.com/google.cloud.datastream.v1.SqlServerProfile"
3333    }
3334}
3335
3336/// Salesforce profile
3337#[derive(Clone, Default, PartialEq)]
3338#[non_exhaustive]
3339pub struct SalesforceProfile {
3340    /// Required. Domain endpoint for the Salesforce connection.
3341    pub domain: std::string::String,
3342
3343    /// Credentials for Salesforce connection.
3344    pub credentials: std::option::Option<crate::model::salesforce_profile::Credentials>,
3345
3346    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3347}
3348
3349impl SalesforceProfile {
3350    pub fn new() -> Self {
3351        std::default::Default::default()
3352    }
3353
3354    /// Sets the value of [domain][crate::model::SalesforceProfile::domain].
3355    pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3356        self.domain = v.into();
3357        self
3358    }
3359
3360    /// Sets the value of [credentials][crate::model::SalesforceProfile::credentials].
3361    ///
3362    /// Note that all the setters affecting `credentials` are mutually
3363    /// exclusive.
3364    pub fn set_credentials<
3365        T: std::convert::Into<std::option::Option<crate::model::salesforce_profile::Credentials>>,
3366    >(
3367        mut self,
3368        v: T,
3369    ) -> Self {
3370        self.credentials = v.into();
3371        self
3372    }
3373
3374    /// The value of [credentials][crate::model::SalesforceProfile::credentials]
3375    /// if it holds a `UserCredentials`, `None` if the field is not set or
3376    /// holds a different branch.
3377    pub fn user_credentials(
3378        &self,
3379    ) -> std::option::Option<&std::boxed::Box<crate::model::salesforce_profile::UserCredentials>>
3380    {
3381        #[allow(unreachable_patterns)]
3382        self.credentials.as_ref().and_then(|v| match v {
3383            crate::model::salesforce_profile::Credentials::UserCredentials(v) => {
3384                std::option::Option::Some(v)
3385            }
3386            _ => std::option::Option::None,
3387        })
3388    }
3389
3390    /// Sets the value of [credentials][crate::model::SalesforceProfile::credentials]
3391    /// to hold a `UserCredentials`.
3392    ///
3393    /// Note that all the setters affecting `credentials` are
3394    /// mutually exclusive.
3395    pub fn set_user_credentials<
3396        T: std::convert::Into<std::boxed::Box<crate::model::salesforce_profile::UserCredentials>>,
3397    >(
3398        mut self,
3399        v: T,
3400    ) -> Self {
3401        self.credentials = std::option::Option::Some(
3402            crate::model::salesforce_profile::Credentials::UserCredentials(v.into()),
3403        );
3404        self
3405    }
3406
3407    /// The value of [credentials][crate::model::SalesforceProfile::credentials]
3408    /// if it holds a `Oauth2ClientCredentials`, `None` if the field is not set or
3409    /// holds a different branch.
3410    pub fn oauth2_client_credentials(
3411        &self,
3412    ) -> std::option::Option<
3413        &std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>,
3414    > {
3415        #[allow(unreachable_patterns)]
3416        self.credentials.as_ref().and_then(|v| match v {
3417            crate::model::salesforce_profile::Credentials::Oauth2ClientCredentials(v) => {
3418                std::option::Option::Some(v)
3419            }
3420            _ => std::option::Option::None,
3421        })
3422    }
3423
3424    /// Sets the value of [credentials][crate::model::SalesforceProfile::credentials]
3425    /// to hold a `Oauth2ClientCredentials`.
3426    ///
3427    /// Note that all the setters affecting `credentials` are
3428    /// mutually exclusive.
3429    pub fn set_oauth2_client_credentials<
3430        T: std::convert::Into<
3431                std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>,
3432            >,
3433    >(
3434        mut self,
3435        v: T,
3436    ) -> Self {
3437        self.credentials = std::option::Option::Some(
3438            crate::model::salesforce_profile::Credentials::Oauth2ClientCredentials(v.into()),
3439        );
3440        self
3441    }
3442}
3443
3444impl wkt::message::Message for SalesforceProfile {
3445    fn typename() -> &'static str {
3446        "type.googleapis.com/google.cloud.datastream.v1.SalesforceProfile"
3447    }
3448}
3449
3450/// Defines additional types related to [SalesforceProfile].
3451pub mod salesforce_profile {
3452    #[allow(unused_imports)]
3453    use super::*;
3454
3455    /// Username-password credentials.
3456    #[derive(Clone, Default, PartialEq)]
3457    #[non_exhaustive]
3458    pub struct UserCredentials {
3459        /// Required. Username for the Salesforce connection.
3460        pub username: std::string::String,
3461
3462        /// Optional. Password for the Salesforce connection.
3463        /// Mutually exclusive with the `secret_manager_stored_password` field.
3464        pub password: std::string::String,
3465
3466        /// Optional. Security token for the Salesforce connection.
3467        /// Mutually exclusive with the `secret_manager_stored_security_token` field.
3468        pub security_token: std::string::String,
3469
3470        /// Optional. A reference to a Secret Manager resource name storing the
3471        /// Salesforce connection's password. Mutually exclusive with the `password`
3472        /// field.
3473        pub secret_manager_stored_password: std::string::String,
3474
3475        /// Optional. A reference to a Secret Manager resource name storing the
3476        /// Salesforce connection's security token. Mutually exclusive with the
3477        /// `security_token` field.
3478        pub secret_manager_stored_security_token: std::string::String,
3479
3480        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3481    }
3482
3483    impl UserCredentials {
3484        pub fn new() -> Self {
3485            std::default::Default::default()
3486        }
3487
3488        /// Sets the value of [username][crate::model::salesforce_profile::UserCredentials::username].
3489        pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3490            self.username = v.into();
3491            self
3492        }
3493
3494        /// Sets the value of [password][crate::model::salesforce_profile::UserCredentials::password].
3495        pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3496            self.password = v.into();
3497            self
3498        }
3499
3500        /// Sets the value of [security_token][crate::model::salesforce_profile::UserCredentials::security_token].
3501        pub fn set_security_token<T: std::convert::Into<std::string::String>>(
3502            mut self,
3503            v: T,
3504        ) -> Self {
3505            self.security_token = v.into();
3506            self
3507        }
3508
3509        /// Sets the value of [secret_manager_stored_password][crate::model::salesforce_profile::UserCredentials::secret_manager_stored_password].
3510        pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
3511            mut self,
3512            v: T,
3513        ) -> Self {
3514            self.secret_manager_stored_password = v.into();
3515            self
3516        }
3517
3518        /// Sets the value of [secret_manager_stored_security_token][crate::model::salesforce_profile::UserCredentials::secret_manager_stored_security_token].
3519        pub fn set_secret_manager_stored_security_token<
3520            T: std::convert::Into<std::string::String>,
3521        >(
3522            mut self,
3523            v: T,
3524        ) -> Self {
3525            self.secret_manager_stored_security_token = v.into();
3526            self
3527        }
3528    }
3529
3530    impl wkt::message::Message for UserCredentials {
3531        fn typename() -> &'static str {
3532            "type.googleapis.com/google.cloud.datastream.v1.SalesforceProfile.UserCredentials"
3533        }
3534    }
3535
3536    /// OAuth2 Client Credentials.
3537    #[derive(Clone, Default, PartialEq)]
3538    #[non_exhaustive]
3539    pub struct Oauth2ClientCredentials {
3540        /// Required. Client ID for Salesforce OAuth2 Client Credentials.
3541        pub client_id: std::string::String,
3542
3543        /// Optional. Client secret for Salesforce OAuth2 Client Credentials.
3544        /// Mutually exclusive with the `secret_manager_stored_client_secret` field.
3545        pub client_secret: std::string::String,
3546
3547        /// Optional. A reference to a Secret Manager resource name storing the
3548        /// Salesforce OAuth2 client_secret. Mutually exclusive with the
3549        /// `client_secret` field.
3550        pub secret_manager_stored_client_secret: std::string::String,
3551
3552        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3553    }
3554
3555    impl Oauth2ClientCredentials {
3556        pub fn new() -> Self {
3557            std::default::Default::default()
3558        }
3559
3560        /// Sets the value of [client_id][crate::model::salesforce_profile::Oauth2ClientCredentials::client_id].
3561        pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3562            self.client_id = v.into();
3563            self
3564        }
3565
3566        /// Sets the value of [client_secret][crate::model::salesforce_profile::Oauth2ClientCredentials::client_secret].
3567        pub fn set_client_secret<T: std::convert::Into<std::string::String>>(
3568            mut self,
3569            v: T,
3570        ) -> Self {
3571            self.client_secret = v.into();
3572            self
3573        }
3574
3575        /// Sets the value of [secret_manager_stored_client_secret][crate::model::salesforce_profile::Oauth2ClientCredentials::secret_manager_stored_client_secret].
3576        pub fn set_secret_manager_stored_client_secret<
3577            T: std::convert::Into<std::string::String>,
3578        >(
3579            mut self,
3580            v: T,
3581        ) -> Self {
3582            self.secret_manager_stored_client_secret = v.into();
3583            self
3584        }
3585    }
3586
3587    impl wkt::message::Message for Oauth2ClientCredentials {
3588        fn typename() -> &'static str {
3589            "type.googleapis.com/google.cloud.datastream.v1.SalesforceProfile.Oauth2ClientCredentials"
3590        }
3591    }
3592
3593    /// Credentials for Salesforce connection.
3594    #[derive(Clone, Debug, PartialEq)]
3595    #[non_exhaustive]
3596    pub enum Credentials {
3597        /// User-password authentication.
3598        UserCredentials(std::boxed::Box<crate::model::salesforce_profile::UserCredentials>),
3599        /// Connected app authentication.
3600        Oauth2ClientCredentials(
3601            std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>,
3602        ),
3603    }
3604}
3605
3606/// MongoDB profile.
3607#[derive(Clone, Default, PartialEq)]
3608#[non_exhaustive]
3609pub struct MongodbProfile {
3610    /// Required. List of host addresses for a MongoDB cluster.
3611    /// For SRV connection format, this list must contain exactly one DNS host
3612    /// without a port. For Standard connection format, this list must contain all
3613    /// the required hosts in the cluster with their respective ports.
3614    pub host_addresses: std::vec::Vec<crate::model::HostAddress>,
3615
3616    /// Optional. Name of the replica set. Only needed for self hosted replica set
3617    /// type MongoDB cluster. For SRV connection format, this field must be empty.
3618    /// For Standard connection format, this field must be specified.
3619    pub replica_set: std::string::String,
3620
3621    /// Required. Username for the MongoDB connection.
3622    pub username: std::string::String,
3623
3624    /// Optional. Password for the MongoDB connection. Mutually exclusive with the
3625    /// `secret_manager_stored_password` field.
3626    pub password: std::string::String,
3627
3628    /// Optional. A reference to a Secret Manager resource name storing the
3629    /// SQLServer connection password. Mutually exclusive with the `password`
3630    /// field.
3631    pub secret_manager_stored_password: std::string::String,
3632
3633    /// Optional. SSL configuration for the MongoDB connection.
3634    pub ssl_config: std::option::Option<crate::model::MongodbSslConfig>,
3635
3636    /// MongoDB connection format.
3637    /// Must specify either srv_connection_format or standard_connection_format.
3638    pub mongodb_connection_format:
3639        std::option::Option<crate::model::mongodb_profile::MongodbConnectionFormat>,
3640
3641    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3642}
3643
3644impl MongodbProfile {
3645    pub fn new() -> Self {
3646        std::default::Default::default()
3647    }
3648
3649    /// Sets the value of [host_addresses][crate::model::MongodbProfile::host_addresses].
3650    pub fn set_host_addresses<T, V>(mut self, v: T) -> Self
3651    where
3652        T: std::iter::IntoIterator<Item = V>,
3653        V: std::convert::Into<crate::model::HostAddress>,
3654    {
3655        use std::iter::Iterator;
3656        self.host_addresses = v.into_iter().map(|i| i.into()).collect();
3657        self
3658    }
3659
3660    /// Sets the value of [replica_set][crate::model::MongodbProfile::replica_set].
3661    pub fn set_replica_set<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3662        self.replica_set = v.into();
3663        self
3664    }
3665
3666    /// Sets the value of [username][crate::model::MongodbProfile::username].
3667    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3668        self.username = v.into();
3669        self
3670    }
3671
3672    /// Sets the value of [password][crate::model::MongodbProfile::password].
3673    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3674        self.password = v.into();
3675        self
3676    }
3677
3678    /// Sets the value of [secret_manager_stored_password][crate::model::MongodbProfile::secret_manager_stored_password].
3679    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
3680        mut self,
3681        v: T,
3682    ) -> Self {
3683        self.secret_manager_stored_password = v.into();
3684        self
3685    }
3686
3687    /// Sets the value of [ssl_config][crate::model::MongodbProfile::ssl_config].
3688    pub fn set_ssl_config<T>(mut self, v: T) -> Self
3689    where
3690        T: std::convert::Into<crate::model::MongodbSslConfig>,
3691    {
3692        self.ssl_config = std::option::Option::Some(v.into());
3693        self
3694    }
3695
3696    /// Sets or clears the value of [ssl_config][crate::model::MongodbProfile::ssl_config].
3697    pub fn set_or_clear_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
3698    where
3699        T: std::convert::Into<crate::model::MongodbSslConfig>,
3700    {
3701        self.ssl_config = v.map(|x| x.into());
3702        self
3703    }
3704
3705    /// Sets the value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format].
3706    ///
3707    /// Note that all the setters affecting `mongodb_connection_format` are mutually
3708    /// exclusive.
3709    pub fn set_mongodb_connection_format<
3710        T: std::convert::Into<
3711                std::option::Option<crate::model::mongodb_profile::MongodbConnectionFormat>,
3712            >,
3713    >(
3714        mut self,
3715        v: T,
3716    ) -> Self {
3717        self.mongodb_connection_format = v.into();
3718        self
3719    }
3720
3721    /// The value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
3722    /// if it holds a `SrvConnectionFormat`, `None` if the field is not set or
3723    /// holds a different branch.
3724    pub fn srv_connection_format(
3725        &self,
3726    ) -> std::option::Option<&std::boxed::Box<crate::model::SrvConnectionFormat>> {
3727        #[allow(unreachable_patterns)]
3728        self.mongodb_connection_format
3729            .as_ref()
3730            .and_then(|v| match v {
3731                crate::model::mongodb_profile::MongodbConnectionFormat::SrvConnectionFormat(v) => {
3732                    std::option::Option::Some(v)
3733                }
3734                _ => std::option::Option::None,
3735            })
3736    }
3737
3738    /// Sets the value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
3739    /// to hold a `SrvConnectionFormat`.
3740    ///
3741    /// Note that all the setters affecting `mongodb_connection_format` are
3742    /// mutually exclusive.
3743    pub fn set_srv_connection_format<
3744        T: std::convert::Into<std::boxed::Box<crate::model::SrvConnectionFormat>>,
3745    >(
3746        mut self,
3747        v: T,
3748    ) -> Self {
3749        self.mongodb_connection_format = std::option::Option::Some(
3750            crate::model::mongodb_profile::MongodbConnectionFormat::SrvConnectionFormat(v.into()),
3751        );
3752        self
3753    }
3754
3755    /// The value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
3756    /// if it holds a `StandardConnectionFormat`, `None` if the field is not set or
3757    /// holds a different branch.
3758    pub fn standard_connection_format(
3759        &self,
3760    ) -> std::option::Option<&std::boxed::Box<crate::model::StandardConnectionFormat>> {
3761        #[allow(unreachable_patterns)]
3762        self.mongodb_connection_format.as_ref().and_then(|v| match v {
3763            crate::model::mongodb_profile::MongodbConnectionFormat::StandardConnectionFormat(v) => std::option::Option::Some(v),
3764            _ => std::option::Option::None,
3765        })
3766    }
3767
3768    /// Sets the value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
3769    /// to hold a `StandardConnectionFormat`.
3770    ///
3771    /// Note that all the setters affecting `mongodb_connection_format` are
3772    /// mutually exclusive.
3773    pub fn set_standard_connection_format<
3774        T: std::convert::Into<std::boxed::Box<crate::model::StandardConnectionFormat>>,
3775    >(
3776        mut self,
3777        v: T,
3778    ) -> Self {
3779        self.mongodb_connection_format = std::option::Option::Some(
3780            crate::model::mongodb_profile::MongodbConnectionFormat::StandardConnectionFormat(
3781                v.into(),
3782            ),
3783        );
3784        self
3785    }
3786}
3787
3788impl wkt::message::Message for MongodbProfile {
3789    fn typename() -> &'static str {
3790        "type.googleapis.com/google.cloud.datastream.v1.MongodbProfile"
3791    }
3792}
3793
3794/// Defines additional types related to [MongodbProfile].
3795pub mod mongodb_profile {
3796    #[allow(unused_imports)]
3797    use super::*;
3798
3799    /// MongoDB connection format.
3800    /// Must specify either srv_connection_format or standard_connection_format.
3801    #[derive(Clone, Debug, PartialEq)]
3802    #[non_exhaustive]
3803    pub enum MongodbConnectionFormat {
3804        /// Srv connection format.
3805        SrvConnectionFormat(std::boxed::Box<crate::model::SrvConnectionFormat>),
3806        /// Standard connection format.
3807        StandardConnectionFormat(std::boxed::Box<crate::model::StandardConnectionFormat>),
3808    }
3809}
3810
3811/// A HostAddress represents a transport end point, which is the combination
3812/// of an IP address or hostname and a port number.
3813#[derive(Clone, Default, PartialEq)]
3814#[non_exhaustive]
3815pub struct HostAddress {
3816    /// Required. Hostname for the connection.
3817    pub hostname: std::string::String,
3818
3819    /// Optional. Port for the connection.
3820    pub port: i32,
3821
3822    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3823}
3824
3825impl HostAddress {
3826    pub fn new() -> Self {
3827        std::default::Default::default()
3828    }
3829
3830    /// Sets the value of [hostname][crate::model::HostAddress::hostname].
3831    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3832        self.hostname = v.into();
3833        self
3834    }
3835
3836    /// Sets the value of [port][crate::model::HostAddress::port].
3837    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3838        self.port = v.into();
3839        self
3840    }
3841}
3842
3843impl wkt::message::Message for HostAddress {
3844    fn typename() -> &'static str {
3845        "type.googleapis.com/google.cloud.datastream.v1.HostAddress"
3846    }
3847}
3848
3849/// Srv connection format.
3850#[derive(Clone, Default, PartialEq)]
3851#[non_exhaustive]
3852pub struct SrvConnectionFormat {
3853    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3854}
3855
3856impl SrvConnectionFormat {
3857    pub fn new() -> Self {
3858        std::default::Default::default()
3859    }
3860}
3861
3862impl wkt::message::Message for SrvConnectionFormat {
3863    fn typename() -> &'static str {
3864        "type.googleapis.com/google.cloud.datastream.v1.SrvConnectionFormat"
3865    }
3866}
3867
3868/// Standard connection format.
3869#[derive(Clone, Default, PartialEq)]
3870#[non_exhaustive]
3871pub struct StandardConnectionFormat {
3872    /// Optional. Specifies whether the client connects directly to the host[:port]
3873    /// in the connection URI.
3874    pub direct_connection: bool,
3875
3876    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3877}
3878
3879impl StandardConnectionFormat {
3880    pub fn new() -> Self {
3881        std::default::Default::default()
3882    }
3883
3884    /// Sets the value of [direct_connection][crate::model::StandardConnectionFormat::direct_connection].
3885    pub fn set_direct_connection<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3886        self.direct_connection = v.into();
3887        self
3888    }
3889}
3890
3891impl wkt::message::Message for StandardConnectionFormat {
3892    fn typename() -> &'static str {
3893        "type.googleapis.com/google.cloud.datastream.v1.StandardConnectionFormat"
3894    }
3895}
3896
3897/// Cloud Storage bucket profile.
3898#[derive(Clone, Default, PartialEq)]
3899#[non_exhaustive]
3900pub struct GcsProfile {
3901    /// Required. The Cloud Storage bucket name.
3902    pub bucket: std::string::String,
3903
3904    /// The root path inside the Cloud Storage bucket.
3905    pub root_path: std::string::String,
3906
3907    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3908}
3909
3910impl GcsProfile {
3911    pub fn new() -> Self {
3912        std::default::Default::default()
3913    }
3914
3915    /// Sets the value of [bucket][crate::model::GcsProfile::bucket].
3916    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3917        self.bucket = v.into();
3918        self
3919    }
3920
3921    /// Sets the value of [root_path][crate::model::GcsProfile::root_path].
3922    pub fn set_root_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3923        self.root_path = v.into();
3924        self
3925    }
3926}
3927
3928impl wkt::message::Message for GcsProfile {
3929    fn typename() -> &'static str {
3930        "type.googleapis.com/google.cloud.datastream.v1.GcsProfile"
3931    }
3932}
3933
3934/// BigQuery warehouse profile.
3935#[derive(Clone, Default, PartialEq)]
3936#[non_exhaustive]
3937pub struct BigQueryProfile {
3938    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3939}
3940
3941impl BigQueryProfile {
3942    pub fn new() -> Self {
3943        std::default::Default::default()
3944    }
3945}
3946
3947impl wkt::message::Message for BigQueryProfile {
3948    fn typename() -> &'static str {
3949        "type.googleapis.com/google.cloud.datastream.v1.BigQueryProfile"
3950    }
3951}
3952
3953/// Static IP address connectivity. Used when the source database is configured
3954/// to allow incoming connections from the Datastream public IP addresses
3955/// for the region specified in the connection profile.
3956#[derive(Clone, Default, PartialEq)]
3957#[non_exhaustive]
3958pub struct StaticServiceIpConnectivity {
3959    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3960}
3961
3962impl StaticServiceIpConnectivity {
3963    pub fn new() -> Self {
3964        std::default::Default::default()
3965    }
3966}
3967
3968impl wkt::message::Message for StaticServiceIpConnectivity {
3969    fn typename() -> &'static str {
3970        "type.googleapis.com/google.cloud.datastream.v1.StaticServiceIpConnectivity"
3971    }
3972}
3973
3974/// Forward SSH Tunnel connectivity.
3975#[derive(Clone, Default, PartialEq)]
3976#[non_exhaustive]
3977pub struct ForwardSshTunnelConnectivity {
3978    /// Required. Hostname for the SSH tunnel.
3979    pub hostname: std::string::String,
3980
3981    /// Required. Username for the SSH tunnel.
3982    pub username: std::string::String,
3983
3984    /// Port for the SSH tunnel, default value is 22.
3985    pub port: i32,
3986
3987    pub authentication_method:
3988        std::option::Option<crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod>,
3989
3990    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3991}
3992
3993impl ForwardSshTunnelConnectivity {
3994    pub fn new() -> Self {
3995        std::default::Default::default()
3996    }
3997
3998    /// Sets the value of [hostname][crate::model::ForwardSshTunnelConnectivity::hostname].
3999    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4000        self.hostname = v.into();
4001        self
4002    }
4003
4004    /// Sets the value of [username][crate::model::ForwardSshTunnelConnectivity::username].
4005    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4006        self.username = v.into();
4007        self
4008    }
4009
4010    /// Sets the value of [port][crate::model::ForwardSshTunnelConnectivity::port].
4011    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4012        self.port = v.into();
4013        self
4014    }
4015
4016    /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method].
4017    ///
4018    /// Note that all the setters affecting `authentication_method` are mutually
4019    /// exclusive.
4020    pub fn set_authentication_method<
4021        T: std::convert::Into<
4022                std::option::Option<
4023                    crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod,
4024                >,
4025            >,
4026    >(
4027        mut self,
4028        v: T,
4029    ) -> Self {
4030        self.authentication_method = v.into();
4031        self
4032    }
4033
4034    /// The value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
4035    /// if it holds a `Password`, `None` if the field is not set or
4036    /// holds a different branch.
4037    pub fn password(&self) -> std::option::Option<&std::string::String> {
4038        #[allow(unreachable_patterns)]
4039        self.authentication_method.as_ref().and_then(|v| match v {
4040            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::Password(v) => {
4041                std::option::Option::Some(v)
4042            }
4043            _ => std::option::Option::None,
4044        })
4045    }
4046
4047    /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
4048    /// to hold a `Password`.
4049    ///
4050    /// Note that all the setters affecting `authentication_method` are
4051    /// mutually exclusive.
4052    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4053        self.authentication_method = std::option::Option::Some(
4054            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::Password(v.into()),
4055        );
4056        self
4057    }
4058
4059    /// The value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
4060    /// if it holds a `PrivateKey`, `None` if the field is not set or
4061    /// holds a different branch.
4062    pub fn private_key(&self) -> std::option::Option<&std::string::String> {
4063        #[allow(unreachable_patterns)]
4064        self.authentication_method.as_ref().and_then(|v| match v {
4065            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::PrivateKey(v) => {
4066                std::option::Option::Some(v)
4067            }
4068            _ => std::option::Option::None,
4069        })
4070    }
4071
4072    /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
4073    /// to hold a `PrivateKey`.
4074    ///
4075    /// Note that all the setters affecting `authentication_method` are
4076    /// mutually exclusive.
4077    pub fn set_private_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4078        self.authentication_method = std::option::Option::Some(
4079            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::PrivateKey(
4080                v.into(),
4081            ),
4082        );
4083        self
4084    }
4085}
4086
4087impl wkt::message::Message for ForwardSshTunnelConnectivity {
4088    fn typename() -> &'static str {
4089        "type.googleapis.com/google.cloud.datastream.v1.ForwardSshTunnelConnectivity"
4090    }
4091}
4092
4093/// Defines additional types related to [ForwardSshTunnelConnectivity].
4094pub mod forward_ssh_tunnel_connectivity {
4095    #[allow(unused_imports)]
4096    use super::*;
4097
4098    #[derive(Clone, Debug, PartialEq)]
4099    #[non_exhaustive]
4100    pub enum AuthenticationMethod {
4101        /// Input only. SSH password.
4102        Password(std::string::String),
4103        /// Input only. SSH private key.
4104        PrivateKey(std::string::String),
4105    }
4106}
4107
4108/// The VPC Peering configuration is used to create VPC peering between
4109/// Datastream and the consumer's VPC.
4110#[derive(Clone, Default, PartialEq)]
4111#[non_exhaustive]
4112pub struct VpcPeeringConfig {
4113    /// Required. Fully qualified name of the VPC that Datastream will peer to.
4114    /// Format: `projects/{project}/global/{networks}/{name}`
4115    pub vpc: std::string::String,
4116
4117    /// Required. A free subnet for peering. (CIDR of /29)
4118    pub subnet: std::string::String,
4119
4120    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4121}
4122
4123impl VpcPeeringConfig {
4124    pub fn new() -> Self {
4125        std::default::Default::default()
4126    }
4127
4128    /// Sets the value of [vpc][crate::model::VpcPeeringConfig::vpc].
4129    pub fn set_vpc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4130        self.vpc = v.into();
4131        self
4132    }
4133
4134    /// Sets the value of [subnet][crate::model::VpcPeeringConfig::subnet].
4135    pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4136        self.subnet = v.into();
4137        self
4138    }
4139}
4140
4141impl wkt::message::Message for VpcPeeringConfig {
4142    fn typename() -> &'static str {
4143        "type.googleapis.com/google.cloud.datastream.v1.VpcPeeringConfig"
4144    }
4145}
4146
4147/// The PSC Interface configuration is used to create PSC Interface between
4148/// Datastream and the consumer's PSC.
4149#[derive(Clone, Default, PartialEq)]
4150#[non_exhaustive]
4151pub struct PscInterfaceConfig {
4152    /// Required. Fully qualified name of the Network Attachment that Datastream
4153    /// will connect to. Format:
4154    /// `projects/{project}/regions/{region}/networkAttachments/{name}`
4155    pub network_attachment: std::string::String,
4156
4157    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4158}
4159
4160impl PscInterfaceConfig {
4161    pub fn new() -> Self {
4162        std::default::Default::default()
4163    }
4164
4165    /// Sets the value of [network_attachment][crate::model::PscInterfaceConfig::network_attachment].
4166    pub fn set_network_attachment<T: std::convert::Into<std::string::String>>(
4167        mut self,
4168        v: T,
4169    ) -> Self {
4170        self.network_attachment = v.into();
4171        self
4172    }
4173}
4174
4175impl wkt::message::Message for PscInterfaceConfig {
4176    fn typename() -> &'static str {
4177        "type.googleapis.com/google.cloud.datastream.v1.PscInterfaceConfig"
4178    }
4179}
4180
4181/// The PrivateConnection resource is used to establish private connectivity
4182/// between Datastream and a customer's network.
4183#[derive(Clone, Default, PartialEq)]
4184#[non_exhaustive]
4185pub struct PrivateConnection {
4186    /// Output only. Identifier. The resource's name.
4187    pub name: std::string::String,
4188
4189    /// Output only. The create time of the resource.
4190    pub create_time: std::option::Option<wkt::Timestamp>,
4191
4192    /// Output only. The update time of the resource.
4193    pub update_time: std::option::Option<wkt::Timestamp>,
4194
4195    /// Labels.
4196    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4197
4198    /// Required. Display name.
4199    pub display_name: std::string::String,
4200
4201    /// Output only. The state of the Private Connection.
4202    pub state: crate::model::private_connection::State,
4203
4204    /// Output only. In case of error, the details of the error in a user-friendly
4205    /// format.
4206    pub error: std::option::Option<crate::model::Error>,
4207
4208    /// Output only. Reserved for future use.
4209    pub satisfies_pzs: std::option::Option<bool>,
4210
4211    /// Output only. Reserved for future use.
4212    pub satisfies_pzi: std::option::Option<bool>,
4213
4214    /// VPC Peering Config.
4215    pub vpc_peering_config: std::option::Option<crate::model::VpcPeeringConfig>,
4216
4217    /// PSC Interface Config.
4218    pub psc_interface_config: std::option::Option<crate::model::PscInterfaceConfig>,
4219
4220    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4221}
4222
4223impl PrivateConnection {
4224    pub fn new() -> Self {
4225        std::default::Default::default()
4226    }
4227
4228    /// Sets the value of [name][crate::model::PrivateConnection::name].
4229    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4230        self.name = v.into();
4231        self
4232    }
4233
4234    /// Sets the value of [create_time][crate::model::PrivateConnection::create_time].
4235    pub fn set_create_time<T>(mut self, v: T) -> Self
4236    where
4237        T: std::convert::Into<wkt::Timestamp>,
4238    {
4239        self.create_time = std::option::Option::Some(v.into());
4240        self
4241    }
4242
4243    /// Sets or clears the value of [create_time][crate::model::PrivateConnection::create_time].
4244    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4245    where
4246        T: std::convert::Into<wkt::Timestamp>,
4247    {
4248        self.create_time = v.map(|x| x.into());
4249        self
4250    }
4251
4252    /// Sets the value of [update_time][crate::model::PrivateConnection::update_time].
4253    pub fn set_update_time<T>(mut self, v: T) -> Self
4254    where
4255        T: std::convert::Into<wkt::Timestamp>,
4256    {
4257        self.update_time = std::option::Option::Some(v.into());
4258        self
4259    }
4260
4261    /// Sets or clears the value of [update_time][crate::model::PrivateConnection::update_time].
4262    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4263    where
4264        T: std::convert::Into<wkt::Timestamp>,
4265    {
4266        self.update_time = v.map(|x| x.into());
4267        self
4268    }
4269
4270    /// Sets the value of [labels][crate::model::PrivateConnection::labels].
4271    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4272    where
4273        T: std::iter::IntoIterator<Item = (K, V)>,
4274        K: std::convert::Into<std::string::String>,
4275        V: std::convert::Into<std::string::String>,
4276    {
4277        use std::iter::Iterator;
4278        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4279        self
4280    }
4281
4282    /// Sets the value of [display_name][crate::model::PrivateConnection::display_name].
4283    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4284        self.display_name = v.into();
4285        self
4286    }
4287
4288    /// Sets the value of [state][crate::model::PrivateConnection::state].
4289    pub fn set_state<T: std::convert::Into<crate::model::private_connection::State>>(
4290        mut self,
4291        v: T,
4292    ) -> Self {
4293        self.state = v.into();
4294        self
4295    }
4296
4297    /// Sets the value of [error][crate::model::PrivateConnection::error].
4298    pub fn set_error<T>(mut self, v: T) -> Self
4299    where
4300        T: std::convert::Into<crate::model::Error>,
4301    {
4302        self.error = std::option::Option::Some(v.into());
4303        self
4304    }
4305
4306    /// Sets or clears the value of [error][crate::model::PrivateConnection::error].
4307    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
4308    where
4309        T: std::convert::Into<crate::model::Error>,
4310    {
4311        self.error = v.map(|x| x.into());
4312        self
4313    }
4314
4315    /// Sets the value of [satisfies_pzs][crate::model::PrivateConnection::satisfies_pzs].
4316    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
4317    where
4318        T: std::convert::Into<bool>,
4319    {
4320        self.satisfies_pzs = std::option::Option::Some(v.into());
4321        self
4322    }
4323
4324    /// Sets or clears the value of [satisfies_pzs][crate::model::PrivateConnection::satisfies_pzs].
4325    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
4326    where
4327        T: std::convert::Into<bool>,
4328    {
4329        self.satisfies_pzs = v.map(|x| x.into());
4330        self
4331    }
4332
4333    /// Sets the value of [satisfies_pzi][crate::model::PrivateConnection::satisfies_pzi].
4334    pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
4335    where
4336        T: std::convert::Into<bool>,
4337    {
4338        self.satisfies_pzi = std::option::Option::Some(v.into());
4339        self
4340    }
4341
4342    /// Sets or clears the value of [satisfies_pzi][crate::model::PrivateConnection::satisfies_pzi].
4343    pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
4344    where
4345        T: std::convert::Into<bool>,
4346    {
4347        self.satisfies_pzi = v.map(|x| x.into());
4348        self
4349    }
4350
4351    /// Sets the value of [vpc_peering_config][crate::model::PrivateConnection::vpc_peering_config].
4352    pub fn set_vpc_peering_config<T>(mut self, v: T) -> Self
4353    where
4354        T: std::convert::Into<crate::model::VpcPeeringConfig>,
4355    {
4356        self.vpc_peering_config = std::option::Option::Some(v.into());
4357        self
4358    }
4359
4360    /// Sets or clears the value of [vpc_peering_config][crate::model::PrivateConnection::vpc_peering_config].
4361    pub fn set_or_clear_vpc_peering_config<T>(mut self, v: std::option::Option<T>) -> Self
4362    where
4363        T: std::convert::Into<crate::model::VpcPeeringConfig>,
4364    {
4365        self.vpc_peering_config = v.map(|x| x.into());
4366        self
4367    }
4368
4369    /// Sets the value of [psc_interface_config][crate::model::PrivateConnection::psc_interface_config].
4370    pub fn set_psc_interface_config<T>(mut self, v: T) -> Self
4371    where
4372        T: std::convert::Into<crate::model::PscInterfaceConfig>,
4373    {
4374        self.psc_interface_config = std::option::Option::Some(v.into());
4375        self
4376    }
4377
4378    /// Sets or clears the value of [psc_interface_config][crate::model::PrivateConnection::psc_interface_config].
4379    pub fn set_or_clear_psc_interface_config<T>(mut self, v: std::option::Option<T>) -> Self
4380    where
4381        T: std::convert::Into<crate::model::PscInterfaceConfig>,
4382    {
4383        self.psc_interface_config = v.map(|x| x.into());
4384        self
4385    }
4386}
4387
4388impl wkt::message::Message for PrivateConnection {
4389    fn typename() -> &'static str {
4390        "type.googleapis.com/google.cloud.datastream.v1.PrivateConnection"
4391    }
4392}
4393
4394/// Defines additional types related to [PrivateConnection].
4395pub mod private_connection {
4396    #[allow(unused_imports)]
4397    use super::*;
4398
4399    /// Private Connection state.
4400    ///
4401    /// # Working with unknown values
4402    ///
4403    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4404    /// additional enum variants at any time. Adding new variants is not considered
4405    /// a breaking change. Applications should write their code in anticipation of:
4406    ///
4407    /// - New values appearing in future releases of the client library, **and**
4408    /// - New values received dynamically, without application changes.
4409    ///
4410    /// Please consult the [Working with enums] section in the user guide for some
4411    /// guidelines.
4412    ///
4413    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4414    #[derive(Clone, Debug, PartialEq)]
4415    #[non_exhaustive]
4416    pub enum State {
4417        /// Unspecified state.
4418        Unspecified,
4419        /// The private connection is in creation state - creating resources.
4420        Creating,
4421        /// The private connection has been created with all of its resources.
4422        Created,
4423        /// The private connection creation has failed.
4424        Failed,
4425        /// The private connection is being deleted.
4426        Deleting,
4427        /// Delete request has failed, resource is in invalid state.
4428        FailedToDelete,
4429        /// If set, the enum was initialized with an unknown value.
4430        ///
4431        /// Applications can examine the value using [State::value] or
4432        /// [State::name].
4433        UnknownValue(state::UnknownValue),
4434    }
4435
4436    #[doc(hidden)]
4437    pub mod state {
4438        #[allow(unused_imports)]
4439        use super::*;
4440        #[derive(Clone, Debug, PartialEq)]
4441        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4442    }
4443
4444    impl State {
4445        /// Gets the enum value.
4446        ///
4447        /// Returns `None` if the enum contains an unknown value deserialized from
4448        /// the string representation of enums.
4449        pub fn value(&self) -> std::option::Option<i32> {
4450            match self {
4451                Self::Unspecified => std::option::Option::Some(0),
4452                Self::Creating => std::option::Option::Some(1),
4453                Self::Created => std::option::Option::Some(2),
4454                Self::Failed => std::option::Option::Some(3),
4455                Self::Deleting => std::option::Option::Some(4),
4456                Self::FailedToDelete => std::option::Option::Some(5),
4457                Self::UnknownValue(u) => u.0.value(),
4458            }
4459        }
4460
4461        /// Gets the enum value as a string.
4462        ///
4463        /// Returns `None` if the enum contains an unknown value deserialized from
4464        /// the integer representation of enums.
4465        pub fn name(&self) -> std::option::Option<&str> {
4466            match self {
4467                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
4468                Self::Creating => std::option::Option::Some("CREATING"),
4469                Self::Created => std::option::Option::Some("CREATED"),
4470                Self::Failed => std::option::Option::Some("FAILED"),
4471                Self::Deleting => std::option::Option::Some("DELETING"),
4472                Self::FailedToDelete => std::option::Option::Some("FAILED_TO_DELETE"),
4473                Self::UnknownValue(u) => u.0.name(),
4474            }
4475        }
4476    }
4477
4478    impl std::default::Default for State {
4479        fn default() -> Self {
4480            use std::convert::From;
4481            Self::from(0)
4482        }
4483    }
4484
4485    impl std::fmt::Display for State {
4486        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4487            wkt::internal::display_enum(f, self.name(), self.value())
4488        }
4489    }
4490
4491    impl std::convert::From<i32> for State {
4492        fn from(value: i32) -> Self {
4493            match value {
4494                0 => Self::Unspecified,
4495                1 => Self::Creating,
4496                2 => Self::Created,
4497                3 => Self::Failed,
4498                4 => Self::Deleting,
4499                5 => Self::FailedToDelete,
4500                _ => Self::UnknownValue(state::UnknownValue(
4501                    wkt::internal::UnknownEnumValue::Integer(value),
4502                )),
4503            }
4504        }
4505    }
4506
4507    impl std::convert::From<&str> for State {
4508        fn from(value: &str) -> Self {
4509            use std::string::ToString;
4510            match value {
4511                "STATE_UNSPECIFIED" => Self::Unspecified,
4512                "CREATING" => Self::Creating,
4513                "CREATED" => Self::Created,
4514                "FAILED" => Self::Failed,
4515                "DELETING" => Self::Deleting,
4516                "FAILED_TO_DELETE" => Self::FailedToDelete,
4517                _ => Self::UnknownValue(state::UnknownValue(
4518                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4519                )),
4520            }
4521        }
4522    }
4523
4524    impl serde::ser::Serialize for State {
4525        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4526        where
4527            S: serde::Serializer,
4528        {
4529            match self {
4530                Self::Unspecified => serializer.serialize_i32(0),
4531                Self::Creating => serializer.serialize_i32(1),
4532                Self::Created => serializer.serialize_i32(2),
4533                Self::Failed => serializer.serialize_i32(3),
4534                Self::Deleting => serializer.serialize_i32(4),
4535                Self::FailedToDelete => serializer.serialize_i32(5),
4536                Self::UnknownValue(u) => u.0.serialize(serializer),
4537            }
4538        }
4539    }
4540
4541    impl<'de> serde::de::Deserialize<'de> for State {
4542        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4543        where
4544            D: serde::Deserializer<'de>,
4545        {
4546            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
4547                ".google.cloud.datastream.v1.PrivateConnection.State",
4548            ))
4549        }
4550    }
4551}
4552
4553/// Private Connectivity
4554#[derive(Clone, Default, PartialEq)]
4555#[non_exhaustive]
4556pub struct PrivateConnectivity {
4557    /// Required. A reference to a private connection resource.
4558    /// Format: `projects/{project}/locations/{location}/privateConnections/{name}`
4559    pub private_connection: std::string::String,
4560
4561    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4562}
4563
4564impl PrivateConnectivity {
4565    pub fn new() -> Self {
4566        std::default::Default::default()
4567    }
4568
4569    /// Sets the value of [private_connection][crate::model::PrivateConnectivity::private_connection].
4570    pub fn set_private_connection<T: std::convert::Into<std::string::String>>(
4571        mut self,
4572        v: T,
4573    ) -> Self {
4574        self.private_connection = v.into();
4575        self
4576    }
4577}
4578
4579impl wkt::message::Message for PrivateConnectivity {
4580    fn typename() -> &'static str {
4581        "type.googleapis.com/google.cloud.datastream.v1.PrivateConnectivity"
4582    }
4583}
4584
4585/// The route resource is the child of the private connection resource,
4586/// used for defining a route for a private connection.
4587#[derive(Clone, Default, PartialEq)]
4588#[non_exhaustive]
4589pub struct Route {
4590    /// Output only. Identifier. The resource's name.
4591    pub name: std::string::String,
4592
4593    /// Output only. The create time of the resource.
4594    pub create_time: std::option::Option<wkt::Timestamp>,
4595
4596    /// Output only. The update time of the resource.
4597    pub update_time: std::option::Option<wkt::Timestamp>,
4598
4599    /// Labels.
4600    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4601
4602    /// Required. Display name.
4603    pub display_name: std::string::String,
4604
4605    /// Required. Destination address for connection
4606    pub destination_address: std::string::String,
4607
4608    /// Destination port for connection
4609    pub destination_port: i32,
4610
4611    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4612}
4613
4614impl Route {
4615    pub fn new() -> Self {
4616        std::default::Default::default()
4617    }
4618
4619    /// Sets the value of [name][crate::model::Route::name].
4620    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4621        self.name = v.into();
4622        self
4623    }
4624
4625    /// Sets the value of [create_time][crate::model::Route::create_time].
4626    pub fn set_create_time<T>(mut self, v: T) -> Self
4627    where
4628        T: std::convert::Into<wkt::Timestamp>,
4629    {
4630        self.create_time = std::option::Option::Some(v.into());
4631        self
4632    }
4633
4634    /// Sets or clears the value of [create_time][crate::model::Route::create_time].
4635    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4636    where
4637        T: std::convert::Into<wkt::Timestamp>,
4638    {
4639        self.create_time = v.map(|x| x.into());
4640        self
4641    }
4642
4643    /// Sets the value of [update_time][crate::model::Route::update_time].
4644    pub fn set_update_time<T>(mut self, v: T) -> Self
4645    where
4646        T: std::convert::Into<wkt::Timestamp>,
4647    {
4648        self.update_time = std::option::Option::Some(v.into());
4649        self
4650    }
4651
4652    /// Sets or clears the value of [update_time][crate::model::Route::update_time].
4653    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4654    where
4655        T: std::convert::Into<wkt::Timestamp>,
4656    {
4657        self.update_time = v.map(|x| x.into());
4658        self
4659    }
4660
4661    /// Sets the value of [labels][crate::model::Route::labels].
4662    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4663    where
4664        T: std::iter::IntoIterator<Item = (K, V)>,
4665        K: std::convert::Into<std::string::String>,
4666        V: std::convert::Into<std::string::String>,
4667    {
4668        use std::iter::Iterator;
4669        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4670        self
4671    }
4672
4673    /// Sets the value of [display_name][crate::model::Route::display_name].
4674    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4675        self.display_name = v.into();
4676        self
4677    }
4678
4679    /// Sets the value of [destination_address][crate::model::Route::destination_address].
4680    pub fn set_destination_address<T: std::convert::Into<std::string::String>>(
4681        mut self,
4682        v: T,
4683    ) -> Self {
4684        self.destination_address = v.into();
4685        self
4686    }
4687
4688    /// Sets the value of [destination_port][crate::model::Route::destination_port].
4689    pub fn set_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4690        self.destination_port = v.into();
4691        self
4692    }
4693}
4694
4695impl wkt::message::Message for Route {
4696    fn typename() -> &'static str {
4697        "type.googleapis.com/google.cloud.datastream.v1.Route"
4698    }
4699}
4700
4701/// MongoDB SSL configuration information.
4702#[derive(Clone, Default, PartialEq)]
4703#[non_exhaustive]
4704pub struct MongodbSslConfig {
4705    /// Optional. Input only. PEM-encoded private key associated with the Client
4706    /// Certificate. If this field is used then the 'client_certificate' and the
4707    /// 'ca_certificate' fields are mandatory.
4708    pub client_key: std::string::String,
4709
4710    /// Output only. Indicates whether the client_key field is set.
4711    pub client_key_set: bool,
4712
4713    /// Optional. Input only. PEM-encoded certificate that will be used by the
4714    /// replica to authenticate against the source database server. If this field
4715    /// is used then the 'client_key' and the 'ca_certificate' fields are
4716    /// mandatory.
4717    pub client_certificate: std::string::String,
4718
4719    /// Output only. Indicates whether the client_certificate field is set.
4720    pub client_certificate_set: bool,
4721
4722    /// Optional. Input only. PEM-encoded certificate of the CA that signed the
4723    /// source database server's certificate.
4724    pub ca_certificate: std::string::String,
4725
4726    /// Output only. Indicates whether the ca_certificate field is set.
4727    pub ca_certificate_set: bool,
4728
4729    /// Optional. Input only. A reference to a Secret Manager resource name storing
4730    /// the PEM-encoded private key associated with the Client Certificate. If this
4731    /// field is used then the 'client_certificate' and the 'ca_certificate' fields
4732    /// are mandatory. Mutually exclusive with the `client_key` field.
4733    pub secret_manager_stored_client_key: std::string::String,
4734
4735    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4736}
4737
4738impl MongodbSslConfig {
4739    pub fn new() -> Self {
4740        std::default::Default::default()
4741    }
4742
4743    /// Sets the value of [client_key][crate::model::MongodbSslConfig::client_key].
4744    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4745        self.client_key = v.into();
4746        self
4747    }
4748
4749    /// Sets the value of [client_key_set][crate::model::MongodbSslConfig::client_key_set].
4750    pub fn set_client_key_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4751        self.client_key_set = v.into();
4752        self
4753    }
4754
4755    /// Sets the value of [client_certificate][crate::model::MongodbSslConfig::client_certificate].
4756    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
4757        mut self,
4758        v: T,
4759    ) -> Self {
4760        self.client_certificate = v.into();
4761        self
4762    }
4763
4764    /// Sets the value of [client_certificate_set][crate::model::MongodbSslConfig::client_certificate_set].
4765    pub fn set_client_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4766        self.client_certificate_set = v.into();
4767        self
4768    }
4769
4770    /// Sets the value of [ca_certificate][crate::model::MongodbSslConfig::ca_certificate].
4771    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4772        self.ca_certificate = v.into();
4773        self
4774    }
4775
4776    /// Sets the value of [ca_certificate_set][crate::model::MongodbSslConfig::ca_certificate_set].
4777    pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4778        self.ca_certificate_set = v.into();
4779        self
4780    }
4781
4782    /// Sets the value of [secret_manager_stored_client_key][crate::model::MongodbSslConfig::secret_manager_stored_client_key].
4783    pub fn set_secret_manager_stored_client_key<T: std::convert::Into<std::string::String>>(
4784        mut self,
4785        v: T,
4786    ) -> Self {
4787        self.secret_manager_stored_client_key = v.into();
4788        self
4789    }
4790}
4791
4792impl wkt::message::Message for MongodbSslConfig {
4793    fn typename() -> &'static str {
4794        "type.googleapis.com/google.cloud.datastream.v1.MongodbSslConfig"
4795    }
4796}
4797
4798/// MySQL SSL configuration information.
4799#[derive(Clone, Default, PartialEq)]
4800#[non_exhaustive]
4801pub struct MysqlSslConfig {
4802    /// Optional. Input only. PEM-encoded private key associated with the Client
4803    /// Certificate. If this field is used then the 'client_certificate' and the
4804    /// 'ca_certificate' fields are mandatory.
4805    pub client_key: std::string::String,
4806
4807    /// Output only. Indicates whether the client_key field is set.
4808    pub client_key_set: bool,
4809
4810    /// Optional. Input only. PEM-encoded certificate that will be used by the
4811    /// replica to authenticate against the source database server. If this field
4812    /// is used then the 'client_key' and the 'ca_certificate' fields are
4813    /// mandatory.
4814    pub client_certificate: std::string::String,
4815
4816    /// Output only. Indicates whether the client_certificate field is set.
4817    pub client_certificate_set: bool,
4818
4819    /// Input only. PEM-encoded certificate of the CA that signed the source
4820    /// database server's certificate.
4821    pub ca_certificate: std::string::String,
4822
4823    /// Output only. Indicates whether the ca_certificate field is set.
4824    pub ca_certificate_set: bool,
4825
4826    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4827}
4828
4829impl MysqlSslConfig {
4830    pub fn new() -> Self {
4831        std::default::Default::default()
4832    }
4833
4834    /// Sets the value of [client_key][crate::model::MysqlSslConfig::client_key].
4835    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4836        self.client_key = v.into();
4837        self
4838    }
4839
4840    /// Sets the value of [client_key_set][crate::model::MysqlSslConfig::client_key_set].
4841    pub fn set_client_key_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4842        self.client_key_set = v.into();
4843        self
4844    }
4845
4846    /// Sets the value of [client_certificate][crate::model::MysqlSslConfig::client_certificate].
4847    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
4848        mut self,
4849        v: T,
4850    ) -> Self {
4851        self.client_certificate = v.into();
4852        self
4853    }
4854
4855    /// Sets the value of [client_certificate_set][crate::model::MysqlSslConfig::client_certificate_set].
4856    pub fn set_client_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4857        self.client_certificate_set = v.into();
4858        self
4859    }
4860
4861    /// Sets the value of [ca_certificate][crate::model::MysqlSslConfig::ca_certificate].
4862    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4863        self.ca_certificate = v.into();
4864        self
4865    }
4866
4867    /// Sets the value of [ca_certificate_set][crate::model::MysqlSslConfig::ca_certificate_set].
4868    pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4869        self.ca_certificate_set = v.into();
4870        self
4871    }
4872}
4873
4874impl wkt::message::Message for MysqlSslConfig {
4875    fn typename() -> &'static str {
4876        "type.googleapis.com/google.cloud.datastream.v1.MysqlSslConfig"
4877    }
4878}
4879
4880/// Oracle SSL configuration information.
4881#[derive(Clone, Default, PartialEq)]
4882#[non_exhaustive]
4883pub struct OracleSslConfig {
4884    /// Input only. PEM-encoded certificate of the CA that signed the source
4885    /// database server's certificate.
4886    pub ca_certificate: std::string::String,
4887
4888    /// Output only. Indicates whether the ca_certificate field has been set for
4889    /// this Connection-Profile.
4890    pub ca_certificate_set: bool,
4891
4892    /// Optional. The distinguished name (DN) mentioned in the server
4893    /// certificate. This corresponds to SSL_SERVER_CERT_DN sqlnet parameter.
4894    /// Refer
4895    /// <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>
4896    /// If this field is not provided, the DN matching is not enforced.
4897    pub server_certificate_distinguished_name: std::string::String,
4898
4899    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4900}
4901
4902impl OracleSslConfig {
4903    pub fn new() -> Self {
4904        std::default::Default::default()
4905    }
4906
4907    /// Sets the value of [ca_certificate][crate::model::OracleSslConfig::ca_certificate].
4908    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4909        self.ca_certificate = v.into();
4910        self
4911    }
4912
4913    /// Sets the value of [ca_certificate_set][crate::model::OracleSslConfig::ca_certificate_set].
4914    pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4915        self.ca_certificate_set = v.into();
4916        self
4917    }
4918
4919    /// Sets the value of [server_certificate_distinguished_name][crate::model::OracleSslConfig::server_certificate_distinguished_name].
4920    pub fn set_server_certificate_distinguished_name<T: std::convert::Into<std::string::String>>(
4921        mut self,
4922        v: T,
4923    ) -> Self {
4924        self.server_certificate_distinguished_name = v.into();
4925        self
4926    }
4927}
4928
4929impl wkt::message::Message for OracleSslConfig {
4930    fn typename() -> &'static str {
4931        "type.googleapis.com/google.cloud.datastream.v1.OracleSslConfig"
4932    }
4933}
4934
4935/// PostgreSQL SSL configuration information.
4936#[derive(Clone, Default, PartialEq)]
4937#[non_exhaustive]
4938pub struct PostgresqlSslConfig {
4939    /// The encryption settings available for PostgreSQL connection profiles.
4940    /// This captures various SSL mode supported by PostgreSQL, which includes
4941    /// TLS encryption with server verification, TLS encryption with both server
4942    /// and client verification and no TLS encryption.
4943    pub encryption_setting:
4944        std::option::Option<crate::model::postgresql_ssl_config::EncryptionSetting>,
4945
4946    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4947}
4948
4949impl PostgresqlSslConfig {
4950    pub fn new() -> Self {
4951        std::default::Default::default()
4952    }
4953
4954    /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting].
4955    ///
4956    /// Note that all the setters affecting `encryption_setting` are mutually
4957    /// exclusive.
4958    pub fn set_encryption_setting<
4959        T: std::convert::Into<
4960                std::option::Option<crate::model::postgresql_ssl_config::EncryptionSetting>,
4961            >,
4962    >(
4963        mut self,
4964        v: T,
4965    ) -> Self {
4966        self.encryption_setting = v.into();
4967        self
4968    }
4969
4970    /// The value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
4971    /// if it holds a `ServerVerification`, `None` if the field is not set or
4972    /// holds a different branch.
4973    pub fn server_verification(
4974        &self,
4975    ) -> std::option::Option<
4976        &std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
4977    > {
4978        #[allow(unreachable_patterns)]
4979        self.encryption_setting.as_ref().and_then(|v| match v {
4980            crate::model::postgresql_ssl_config::EncryptionSetting::ServerVerification(v) => {
4981                std::option::Option::Some(v)
4982            }
4983            _ => std::option::Option::None,
4984        })
4985    }
4986
4987    /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
4988    /// to hold a `ServerVerification`.
4989    ///
4990    /// Note that all the setters affecting `encryption_setting` are
4991    /// mutually exclusive.
4992    pub fn set_server_verification<
4993        T: std::convert::Into<
4994                std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
4995            >,
4996    >(
4997        mut self,
4998        v: T,
4999    ) -> Self {
5000        self.encryption_setting = std::option::Option::Some(
5001            crate::model::postgresql_ssl_config::EncryptionSetting::ServerVerification(v.into()),
5002        );
5003        self
5004    }
5005
5006    /// The value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
5007    /// if it holds a `ServerAndClientVerification`, `None` if the field is not set or
5008    /// holds a different branch.
5009    pub fn server_and_client_verification(
5010        &self,
5011    ) -> std::option::Option<
5012        &std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
5013    > {
5014        #[allow(unreachable_patterns)]
5015        self.encryption_setting.as_ref().and_then(|v| match v {
5016            crate::model::postgresql_ssl_config::EncryptionSetting::ServerAndClientVerification(
5017                v,
5018            ) => std::option::Option::Some(v),
5019            _ => std::option::Option::None,
5020        })
5021    }
5022
5023    /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
5024    /// to hold a `ServerAndClientVerification`.
5025    ///
5026    /// Note that all the setters affecting `encryption_setting` are
5027    /// mutually exclusive.
5028    pub fn set_server_and_client_verification<
5029        T: std::convert::Into<
5030                std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
5031            >,
5032    >(
5033        mut self,
5034        v: T,
5035    ) -> Self {
5036        self.encryption_setting = std::option::Option::Some(
5037            crate::model::postgresql_ssl_config::EncryptionSetting::ServerAndClientVerification(
5038                v.into(),
5039            ),
5040        );
5041        self
5042    }
5043}
5044
5045impl wkt::message::Message for PostgresqlSslConfig {
5046    fn typename() -> &'static str {
5047        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig"
5048    }
5049}
5050
5051/// Defines additional types related to [PostgresqlSslConfig].
5052pub mod postgresql_ssl_config {
5053    #[allow(unused_imports)]
5054    use super::*;
5055
5056    /// Message represents the option where Datastream will enforce the encryption
5057    /// and authenticate the server identity. ca_certificate must be set if user
5058    /// selects this option.
5059    #[derive(Clone, Default, PartialEq)]
5060    #[non_exhaustive]
5061    pub struct ServerVerification {
5062        /// Required. Input only. PEM-encoded server root CA certificate.
5063        pub ca_certificate: std::string::String,
5064
5065        /// Optional. The hostname mentioned in the Subject or SAN extension of the
5066        /// server certificate. If this field is not provided, the hostname in the
5067        /// server certificate is not validated.
5068        pub server_certificate_hostname: std::string::String,
5069
5070        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5071    }
5072
5073    impl ServerVerification {
5074        pub fn new() -> Self {
5075            std::default::Default::default()
5076        }
5077
5078        /// Sets the value of [ca_certificate][crate::model::postgresql_ssl_config::ServerVerification::ca_certificate].
5079        pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(
5080            mut self,
5081            v: T,
5082        ) -> Self {
5083            self.ca_certificate = v.into();
5084            self
5085        }
5086
5087        /// Sets the value of [server_certificate_hostname][crate::model::postgresql_ssl_config::ServerVerification::server_certificate_hostname].
5088        pub fn set_server_certificate_hostname<T: std::convert::Into<std::string::String>>(
5089            mut self,
5090            v: T,
5091        ) -> Self {
5092            self.server_certificate_hostname = v.into();
5093            self
5094        }
5095    }
5096
5097    impl wkt::message::Message for ServerVerification {
5098        fn typename() -> &'static str {
5099            "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig.ServerVerification"
5100        }
5101    }
5102
5103    /// Message represents the option where Datastream will enforce the encryption
5104    /// and authenticate the server identity as well as the client identity.
5105    /// ca_certificate, client_certificate and client_key must be set if user
5106    /// selects this option.
5107    #[derive(Clone, Default, PartialEq)]
5108    #[non_exhaustive]
5109    pub struct ServerAndClientVerification {
5110        /// Required. Input only. PEM-encoded certificate used by the source database
5111        /// to authenticate the client identity (i.e., the Datastream's identity).
5112        /// This certificate is signed by either a root certificate trusted by the
5113        /// server or one or more intermediate certificates (which is stored with the
5114        /// leaf certificate) to link the this certificate to the trusted root
5115        /// certificate.
5116        pub client_certificate: std::string::String,
5117
5118        /// Optional. Input only. PEM-encoded private key associated with the client
5119        /// certificate. This value will be used during the SSL/TLS handshake,
5120        /// allowing the PostgreSQL server to authenticate the client's identity,
5121        /// i.e. identity of the Datastream.
5122        pub client_key: std::string::String,
5123
5124        /// Required. Input only. PEM-encoded server root CA certificate.
5125        pub ca_certificate: std::string::String,
5126
5127        /// Optional. The hostname mentioned in the Subject or SAN extension of the
5128        /// server certificate. If this field is not provided, the hostname in the
5129        /// server certificate is not validated.
5130        pub server_certificate_hostname: std::string::String,
5131
5132        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5133    }
5134
5135    impl ServerAndClientVerification {
5136        pub fn new() -> Self {
5137            std::default::Default::default()
5138        }
5139
5140        /// Sets the value of [client_certificate][crate::model::postgresql_ssl_config::ServerAndClientVerification::client_certificate].
5141        pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
5142            mut self,
5143            v: T,
5144        ) -> Self {
5145            self.client_certificate = v.into();
5146            self
5147        }
5148
5149        /// Sets the value of [client_key][crate::model::postgresql_ssl_config::ServerAndClientVerification::client_key].
5150        pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5151            self.client_key = v.into();
5152            self
5153        }
5154
5155        /// Sets the value of [ca_certificate][crate::model::postgresql_ssl_config::ServerAndClientVerification::ca_certificate].
5156        pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(
5157            mut self,
5158            v: T,
5159        ) -> Self {
5160            self.ca_certificate = v.into();
5161            self
5162        }
5163
5164        /// Sets the value of [server_certificate_hostname][crate::model::postgresql_ssl_config::ServerAndClientVerification::server_certificate_hostname].
5165        pub fn set_server_certificate_hostname<T: std::convert::Into<std::string::String>>(
5166            mut self,
5167            v: T,
5168        ) -> Self {
5169            self.server_certificate_hostname = v.into();
5170            self
5171        }
5172    }
5173
5174    impl wkt::message::Message for ServerAndClientVerification {
5175        fn typename() -> &'static str {
5176            "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig.ServerAndClientVerification"
5177        }
5178    }
5179
5180    /// The encryption settings available for PostgreSQL connection profiles.
5181    /// This captures various SSL mode supported by PostgreSQL, which includes
5182    /// TLS encryption with server verification, TLS encryption with both server
5183    /// and client verification and no TLS encryption.
5184    #[derive(Clone, Debug, PartialEq)]
5185    #[non_exhaustive]
5186    pub enum EncryptionSetting {
5187        ///  If this field is set, the communication will be encrypted with TLS
5188        /// encryption and the server identity will be authenticated.
5189        ServerVerification(
5190            std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
5191        ),
5192        /// If this field is set, the communication will be encrypted with TLS
5193        /// encryption and both the server identity and the client identity will be
5194        /// authenticated.
5195        ServerAndClientVerification(
5196            std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
5197        ),
5198    }
5199}
5200
5201/// A set of reusable connection configurations to be used as a source or
5202/// destination for a stream.
5203#[derive(Clone, Default, PartialEq)]
5204#[non_exhaustive]
5205pub struct ConnectionProfile {
5206    /// Output only. Identifier. The resource's name.
5207    pub name: std::string::String,
5208
5209    /// Output only. The create time of the resource.
5210    pub create_time: std::option::Option<wkt::Timestamp>,
5211
5212    /// Output only. The update time of the resource.
5213    pub update_time: std::option::Option<wkt::Timestamp>,
5214
5215    /// Labels.
5216    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5217
5218    /// Required. Display name.
5219    pub display_name: std::string::String,
5220
5221    /// Output only. Reserved for future use.
5222    pub satisfies_pzs: std::option::Option<bool>,
5223
5224    /// Output only. Reserved for future use.
5225    pub satisfies_pzi: std::option::Option<bool>,
5226
5227    /// Connection configuration for the ConnectionProfile.
5228    pub profile: std::option::Option<crate::model::connection_profile::Profile>,
5229
5230    /// Connectivity options used to establish a connection to the profile.
5231    pub connectivity: std::option::Option<crate::model::connection_profile::Connectivity>,
5232
5233    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5234}
5235
5236impl ConnectionProfile {
5237    pub fn new() -> Self {
5238        std::default::Default::default()
5239    }
5240
5241    /// Sets the value of [name][crate::model::ConnectionProfile::name].
5242    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5243        self.name = v.into();
5244        self
5245    }
5246
5247    /// Sets the value of [create_time][crate::model::ConnectionProfile::create_time].
5248    pub fn set_create_time<T>(mut self, v: T) -> Self
5249    where
5250        T: std::convert::Into<wkt::Timestamp>,
5251    {
5252        self.create_time = std::option::Option::Some(v.into());
5253        self
5254    }
5255
5256    /// Sets or clears the value of [create_time][crate::model::ConnectionProfile::create_time].
5257    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5258    where
5259        T: std::convert::Into<wkt::Timestamp>,
5260    {
5261        self.create_time = v.map(|x| x.into());
5262        self
5263    }
5264
5265    /// Sets the value of [update_time][crate::model::ConnectionProfile::update_time].
5266    pub fn set_update_time<T>(mut self, v: T) -> Self
5267    where
5268        T: std::convert::Into<wkt::Timestamp>,
5269    {
5270        self.update_time = std::option::Option::Some(v.into());
5271        self
5272    }
5273
5274    /// Sets or clears the value of [update_time][crate::model::ConnectionProfile::update_time].
5275    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5276    where
5277        T: std::convert::Into<wkt::Timestamp>,
5278    {
5279        self.update_time = v.map(|x| x.into());
5280        self
5281    }
5282
5283    /// Sets the value of [labels][crate::model::ConnectionProfile::labels].
5284    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5285    where
5286        T: std::iter::IntoIterator<Item = (K, V)>,
5287        K: std::convert::Into<std::string::String>,
5288        V: std::convert::Into<std::string::String>,
5289    {
5290        use std::iter::Iterator;
5291        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5292        self
5293    }
5294
5295    /// Sets the value of [display_name][crate::model::ConnectionProfile::display_name].
5296    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5297        self.display_name = v.into();
5298        self
5299    }
5300
5301    /// Sets the value of [satisfies_pzs][crate::model::ConnectionProfile::satisfies_pzs].
5302    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
5303    where
5304        T: std::convert::Into<bool>,
5305    {
5306        self.satisfies_pzs = std::option::Option::Some(v.into());
5307        self
5308    }
5309
5310    /// Sets or clears the value of [satisfies_pzs][crate::model::ConnectionProfile::satisfies_pzs].
5311    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
5312    where
5313        T: std::convert::Into<bool>,
5314    {
5315        self.satisfies_pzs = v.map(|x| x.into());
5316        self
5317    }
5318
5319    /// Sets the value of [satisfies_pzi][crate::model::ConnectionProfile::satisfies_pzi].
5320    pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
5321    where
5322        T: std::convert::Into<bool>,
5323    {
5324        self.satisfies_pzi = std::option::Option::Some(v.into());
5325        self
5326    }
5327
5328    /// Sets or clears the value of [satisfies_pzi][crate::model::ConnectionProfile::satisfies_pzi].
5329    pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
5330    where
5331        T: std::convert::Into<bool>,
5332    {
5333        self.satisfies_pzi = v.map(|x| x.into());
5334        self
5335    }
5336
5337    /// Sets the value of [profile][crate::model::ConnectionProfile::profile].
5338    ///
5339    /// Note that all the setters affecting `profile` are mutually
5340    /// exclusive.
5341    pub fn set_profile<
5342        T: std::convert::Into<std::option::Option<crate::model::connection_profile::Profile>>,
5343    >(
5344        mut self,
5345        v: T,
5346    ) -> Self {
5347        self.profile = v.into();
5348        self
5349    }
5350
5351    /// The value of [profile][crate::model::ConnectionProfile::profile]
5352    /// if it holds a `OracleProfile`, `None` if the field is not set or
5353    /// holds a different branch.
5354    pub fn oracle_profile(
5355        &self,
5356    ) -> std::option::Option<&std::boxed::Box<crate::model::OracleProfile>> {
5357        #[allow(unreachable_patterns)]
5358        self.profile.as_ref().and_then(|v| match v {
5359            crate::model::connection_profile::Profile::OracleProfile(v) => {
5360                std::option::Option::Some(v)
5361            }
5362            _ => std::option::Option::None,
5363        })
5364    }
5365
5366    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
5367    /// to hold a `OracleProfile`.
5368    ///
5369    /// Note that all the setters affecting `profile` are
5370    /// mutually exclusive.
5371    pub fn set_oracle_profile<
5372        T: std::convert::Into<std::boxed::Box<crate::model::OracleProfile>>,
5373    >(
5374        mut self,
5375        v: T,
5376    ) -> Self {
5377        self.profile = std::option::Option::Some(
5378            crate::model::connection_profile::Profile::OracleProfile(v.into()),
5379        );
5380        self
5381    }
5382
5383    /// The value of [profile][crate::model::ConnectionProfile::profile]
5384    /// if it holds a `GcsProfile`, `None` if the field is not set or
5385    /// holds a different branch.
5386    pub fn gcs_profile(&self) -> std::option::Option<&std::boxed::Box<crate::model::GcsProfile>> {
5387        #[allow(unreachable_patterns)]
5388        self.profile.as_ref().and_then(|v| match v {
5389            crate::model::connection_profile::Profile::GcsProfile(v) => {
5390                std::option::Option::Some(v)
5391            }
5392            _ => std::option::Option::None,
5393        })
5394    }
5395
5396    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
5397    /// to hold a `GcsProfile`.
5398    ///
5399    /// Note that all the setters affecting `profile` are
5400    /// mutually exclusive.
5401    pub fn set_gcs_profile<T: std::convert::Into<std::boxed::Box<crate::model::GcsProfile>>>(
5402        mut self,
5403        v: T,
5404    ) -> Self {
5405        self.profile = std::option::Option::Some(
5406            crate::model::connection_profile::Profile::GcsProfile(v.into()),
5407        );
5408        self
5409    }
5410
5411    /// The value of [profile][crate::model::ConnectionProfile::profile]
5412    /// if it holds a `MysqlProfile`, `None` if the field is not set or
5413    /// holds a different branch.
5414    pub fn mysql_profile(
5415        &self,
5416    ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlProfile>> {
5417        #[allow(unreachable_patterns)]
5418        self.profile.as_ref().and_then(|v| match v {
5419            crate::model::connection_profile::Profile::MysqlProfile(v) => {
5420                std::option::Option::Some(v)
5421            }
5422            _ => std::option::Option::None,
5423        })
5424    }
5425
5426    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
5427    /// to hold a `MysqlProfile`.
5428    ///
5429    /// Note that all the setters affecting `profile` are
5430    /// mutually exclusive.
5431    pub fn set_mysql_profile<T: std::convert::Into<std::boxed::Box<crate::model::MysqlProfile>>>(
5432        mut self,
5433        v: T,
5434    ) -> Self {
5435        self.profile = std::option::Option::Some(
5436            crate::model::connection_profile::Profile::MysqlProfile(v.into()),
5437        );
5438        self
5439    }
5440
5441    /// The value of [profile][crate::model::ConnectionProfile::profile]
5442    /// if it holds a `BigqueryProfile`, `None` if the field is not set or
5443    /// holds a different branch.
5444    pub fn bigquery_profile(
5445        &self,
5446    ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryProfile>> {
5447        #[allow(unreachable_patterns)]
5448        self.profile.as_ref().and_then(|v| match v {
5449            crate::model::connection_profile::Profile::BigqueryProfile(v) => {
5450                std::option::Option::Some(v)
5451            }
5452            _ => std::option::Option::None,
5453        })
5454    }
5455
5456    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
5457    /// to hold a `BigqueryProfile`.
5458    ///
5459    /// Note that all the setters affecting `profile` are
5460    /// mutually exclusive.
5461    pub fn set_bigquery_profile<
5462        T: std::convert::Into<std::boxed::Box<crate::model::BigQueryProfile>>,
5463    >(
5464        mut self,
5465        v: T,
5466    ) -> Self {
5467        self.profile = std::option::Option::Some(
5468            crate::model::connection_profile::Profile::BigqueryProfile(v.into()),
5469        );
5470        self
5471    }
5472
5473    /// The value of [profile][crate::model::ConnectionProfile::profile]
5474    /// if it holds a `PostgresqlProfile`, `None` if the field is not set or
5475    /// holds a different branch.
5476    pub fn postgresql_profile(
5477        &self,
5478    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlProfile>> {
5479        #[allow(unreachable_patterns)]
5480        self.profile.as_ref().and_then(|v| match v {
5481            crate::model::connection_profile::Profile::PostgresqlProfile(v) => {
5482                std::option::Option::Some(v)
5483            }
5484            _ => std::option::Option::None,
5485        })
5486    }
5487
5488    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
5489    /// to hold a `PostgresqlProfile`.
5490    ///
5491    /// Note that all the setters affecting `profile` are
5492    /// mutually exclusive.
5493    pub fn set_postgresql_profile<
5494        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlProfile>>,
5495    >(
5496        mut self,
5497        v: T,
5498    ) -> Self {
5499        self.profile = std::option::Option::Some(
5500            crate::model::connection_profile::Profile::PostgresqlProfile(v.into()),
5501        );
5502        self
5503    }
5504
5505    /// The value of [profile][crate::model::ConnectionProfile::profile]
5506    /// if it holds a `SqlServerProfile`, `None` if the field is not set or
5507    /// holds a different branch.
5508    pub fn sql_server_profile(
5509        &self,
5510    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerProfile>> {
5511        #[allow(unreachable_patterns)]
5512        self.profile.as_ref().and_then(|v| match v {
5513            crate::model::connection_profile::Profile::SqlServerProfile(v) => {
5514                std::option::Option::Some(v)
5515            }
5516            _ => std::option::Option::None,
5517        })
5518    }
5519
5520    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
5521    /// to hold a `SqlServerProfile`.
5522    ///
5523    /// Note that all the setters affecting `profile` are
5524    /// mutually exclusive.
5525    pub fn set_sql_server_profile<
5526        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerProfile>>,
5527    >(
5528        mut self,
5529        v: T,
5530    ) -> Self {
5531        self.profile = std::option::Option::Some(
5532            crate::model::connection_profile::Profile::SqlServerProfile(v.into()),
5533        );
5534        self
5535    }
5536
5537    /// The value of [profile][crate::model::ConnectionProfile::profile]
5538    /// if it holds a `SalesforceProfile`, `None` if the field is not set or
5539    /// holds a different branch.
5540    pub fn salesforce_profile(
5541        &self,
5542    ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceProfile>> {
5543        #[allow(unreachable_patterns)]
5544        self.profile.as_ref().and_then(|v| match v {
5545            crate::model::connection_profile::Profile::SalesforceProfile(v) => {
5546                std::option::Option::Some(v)
5547            }
5548            _ => std::option::Option::None,
5549        })
5550    }
5551
5552    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
5553    /// to hold a `SalesforceProfile`.
5554    ///
5555    /// Note that all the setters affecting `profile` are
5556    /// mutually exclusive.
5557    pub fn set_salesforce_profile<
5558        T: std::convert::Into<std::boxed::Box<crate::model::SalesforceProfile>>,
5559    >(
5560        mut self,
5561        v: T,
5562    ) -> Self {
5563        self.profile = std::option::Option::Some(
5564            crate::model::connection_profile::Profile::SalesforceProfile(v.into()),
5565        );
5566        self
5567    }
5568
5569    /// The value of [profile][crate::model::ConnectionProfile::profile]
5570    /// if it holds a `MongodbProfile`, `None` if the field is not set or
5571    /// holds a different branch.
5572    pub fn mongodb_profile(
5573        &self,
5574    ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbProfile>> {
5575        #[allow(unreachable_patterns)]
5576        self.profile.as_ref().and_then(|v| match v {
5577            crate::model::connection_profile::Profile::MongodbProfile(v) => {
5578                std::option::Option::Some(v)
5579            }
5580            _ => std::option::Option::None,
5581        })
5582    }
5583
5584    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
5585    /// to hold a `MongodbProfile`.
5586    ///
5587    /// Note that all the setters affecting `profile` are
5588    /// mutually exclusive.
5589    pub fn set_mongodb_profile<
5590        T: std::convert::Into<std::boxed::Box<crate::model::MongodbProfile>>,
5591    >(
5592        mut self,
5593        v: T,
5594    ) -> Self {
5595        self.profile = std::option::Option::Some(
5596            crate::model::connection_profile::Profile::MongodbProfile(v.into()),
5597        );
5598        self
5599    }
5600
5601    /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity].
5602    ///
5603    /// Note that all the setters affecting `connectivity` are mutually
5604    /// exclusive.
5605    pub fn set_connectivity<
5606        T: std::convert::Into<std::option::Option<crate::model::connection_profile::Connectivity>>,
5607    >(
5608        mut self,
5609        v: T,
5610    ) -> Self {
5611        self.connectivity = v.into();
5612        self
5613    }
5614
5615    /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
5616    /// if it holds a `StaticServiceIpConnectivity`, `None` if the field is not set or
5617    /// holds a different branch.
5618    pub fn static_service_ip_connectivity(
5619        &self,
5620    ) -> std::option::Option<&std::boxed::Box<crate::model::StaticServiceIpConnectivity>> {
5621        #[allow(unreachable_patterns)]
5622        self.connectivity.as_ref().and_then(|v| match v {
5623            crate::model::connection_profile::Connectivity::StaticServiceIpConnectivity(v) => {
5624                std::option::Option::Some(v)
5625            }
5626            _ => std::option::Option::None,
5627        })
5628    }
5629
5630    /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
5631    /// to hold a `StaticServiceIpConnectivity`.
5632    ///
5633    /// Note that all the setters affecting `connectivity` are
5634    /// mutually exclusive.
5635    pub fn set_static_service_ip_connectivity<
5636        T: std::convert::Into<std::boxed::Box<crate::model::StaticServiceIpConnectivity>>,
5637    >(
5638        mut self,
5639        v: T,
5640    ) -> Self {
5641        self.connectivity = std::option::Option::Some(
5642            crate::model::connection_profile::Connectivity::StaticServiceIpConnectivity(v.into()),
5643        );
5644        self
5645    }
5646
5647    /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
5648    /// if it holds a `ForwardSshConnectivity`, `None` if the field is not set or
5649    /// holds a different branch.
5650    pub fn forward_ssh_connectivity(
5651        &self,
5652    ) -> std::option::Option<&std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>> {
5653        #[allow(unreachable_patterns)]
5654        self.connectivity.as_ref().and_then(|v| match v {
5655            crate::model::connection_profile::Connectivity::ForwardSshConnectivity(v) => {
5656                std::option::Option::Some(v)
5657            }
5658            _ => std::option::Option::None,
5659        })
5660    }
5661
5662    /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
5663    /// to hold a `ForwardSshConnectivity`.
5664    ///
5665    /// Note that all the setters affecting `connectivity` are
5666    /// mutually exclusive.
5667    pub fn set_forward_ssh_connectivity<
5668        T: std::convert::Into<std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>>,
5669    >(
5670        mut self,
5671        v: T,
5672    ) -> Self {
5673        self.connectivity = std::option::Option::Some(
5674            crate::model::connection_profile::Connectivity::ForwardSshConnectivity(v.into()),
5675        );
5676        self
5677    }
5678
5679    /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
5680    /// if it holds a `PrivateConnectivity`, `None` if the field is not set or
5681    /// holds a different branch.
5682    pub fn private_connectivity(
5683        &self,
5684    ) -> std::option::Option<&std::boxed::Box<crate::model::PrivateConnectivity>> {
5685        #[allow(unreachable_patterns)]
5686        self.connectivity.as_ref().and_then(|v| match v {
5687            crate::model::connection_profile::Connectivity::PrivateConnectivity(v) => {
5688                std::option::Option::Some(v)
5689            }
5690            _ => std::option::Option::None,
5691        })
5692    }
5693
5694    /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
5695    /// to hold a `PrivateConnectivity`.
5696    ///
5697    /// Note that all the setters affecting `connectivity` are
5698    /// mutually exclusive.
5699    pub fn set_private_connectivity<
5700        T: std::convert::Into<std::boxed::Box<crate::model::PrivateConnectivity>>,
5701    >(
5702        mut self,
5703        v: T,
5704    ) -> Self {
5705        self.connectivity = std::option::Option::Some(
5706            crate::model::connection_profile::Connectivity::PrivateConnectivity(v.into()),
5707        );
5708        self
5709    }
5710}
5711
5712impl wkt::message::Message for ConnectionProfile {
5713    fn typename() -> &'static str {
5714        "type.googleapis.com/google.cloud.datastream.v1.ConnectionProfile"
5715    }
5716}
5717
5718/// Defines additional types related to [ConnectionProfile].
5719pub mod connection_profile {
5720    #[allow(unused_imports)]
5721    use super::*;
5722
5723    /// Connection configuration for the ConnectionProfile.
5724    #[derive(Clone, Debug, PartialEq)]
5725    #[non_exhaustive]
5726    pub enum Profile {
5727        /// Oracle ConnectionProfile configuration.
5728        OracleProfile(std::boxed::Box<crate::model::OracleProfile>),
5729        /// Cloud Storage ConnectionProfile configuration.
5730        GcsProfile(std::boxed::Box<crate::model::GcsProfile>),
5731        /// MySQL ConnectionProfile configuration.
5732        MysqlProfile(std::boxed::Box<crate::model::MysqlProfile>),
5733        /// BigQuery Connection Profile configuration.
5734        BigqueryProfile(std::boxed::Box<crate::model::BigQueryProfile>),
5735        /// PostgreSQL Connection Profile configuration.
5736        PostgresqlProfile(std::boxed::Box<crate::model::PostgresqlProfile>),
5737        /// SQLServer Connection Profile configuration.
5738        SqlServerProfile(std::boxed::Box<crate::model::SqlServerProfile>),
5739        /// Salesforce Connection Profile configuration.
5740        SalesforceProfile(std::boxed::Box<crate::model::SalesforceProfile>),
5741        /// MongoDB Connection Profile configuration.
5742        MongodbProfile(std::boxed::Box<crate::model::MongodbProfile>),
5743    }
5744
5745    /// Connectivity options used to establish a connection to the profile.
5746    #[derive(Clone, Debug, PartialEq)]
5747    #[non_exhaustive]
5748    pub enum Connectivity {
5749        /// Static Service IP connectivity.
5750        StaticServiceIpConnectivity(std::boxed::Box<crate::model::StaticServiceIpConnectivity>),
5751        /// Forward SSH tunnel connectivity.
5752        ForwardSshConnectivity(std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>),
5753        /// Private connectivity.
5754        PrivateConnectivity(std::boxed::Box<crate::model::PrivateConnectivity>),
5755    }
5756}
5757
5758/// Oracle Column.
5759#[derive(Clone, Default, PartialEq)]
5760#[non_exhaustive]
5761pub struct OracleColumn {
5762    /// Column name.
5763    pub column: std::string::String,
5764
5765    /// The Oracle data type.
5766    pub data_type: std::string::String,
5767
5768    /// Column length.
5769    pub length: i32,
5770
5771    /// Column precision.
5772    pub precision: i32,
5773
5774    /// Column scale.
5775    pub scale: i32,
5776
5777    /// Column encoding.
5778    pub encoding: std::string::String,
5779
5780    /// Whether or not the column represents a primary key.
5781    pub primary_key: bool,
5782
5783    /// Whether or not the column can accept a null value.
5784    pub nullable: bool,
5785
5786    /// The ordinal position of the column in the table.
5787    pub ordinal_position: i32,
5788
5789    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5790}
5791
5792impl OracleColumn {
5793    pub fn new() -> Self {
5794        std::default::Default::default()
5795    }
5796
5797    /// Sets the value of [column][crate::model::OracleColumn::column].
5798    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5799        self.column = v.into();
5800        self
5801    }
5802
5803    /// Sets the value of [data_type][crate::model::OracleColumn::data_type].
5804    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5805        self.data_type = v.into();
5806        self
5807    }
5808
5809    /// Sets the value of [length][crate::model::OracleColumn::length].
5810    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5811        self.length = v.into();
5812        self
5813    }
5814
5815    /// Sets the value of [precision][crate::model::OracleColumn::precision].
5816    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5817        self.precision = v.into();
5818        self
5819    }
5820
5821    /// Sets the value of [scale][crate::model::OracleColumn::scale].
5822    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5823        self.scale = v.into();
5824        self
5825    }
5826
5827    /// Sets the value of [encoding][crate::model::OracleColumn::encoding].
5828    pub fn set_encoding<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5829        self.encoding = v.into();
5830        self
5831    }
5832
5833    /// Sets the value of [primary_key][crate::model::OracleColumn::primary_key].
5834    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5835        self.primary_key = v.into();
5836        self
5837    }
5838
5839    /// Sets the value of [nullable][crate::model::OracleColumn::nullable].
5840    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5841        self.nullable = v.into();
5842        self
5843    }
5844
5845    /// Sets the value of [ordinal_position][crate::model::OracleColumn::ordinal_position].
5846    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5847        self.ordinal_position = v.into();
5848        self
5849    }
5850}
5851
5852impl wkt::message::Message for OracleColumn {
5853    fn typename() -> &'static str {
5854        "type.googleapis.com/google.cloud.datastream.v1.OracleColumn"
5855    }
5856}
5857
5858/// Oracle table.
5859#[derive(Clone, Default, PartialEq)]
5860#[non_exhaustive]
5861pub struct OracleTable {
5862    /// Table name.
5863    pub table: std::string::String,
5864
5865    /// Oracle columns in the schema.
5866    /// When unspecified as part of include/exclude objects, includes/excludes
5867    /// everything.
5868    pub oracle_columns: std::vec::Vec<crate::model::OracleColumn>,
5869
5870    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5871}
5872
5873impl OracleTable {
5874    pub fn new() -> Self {
5875        std::default::Default::default()
5876    }
5877
5878    /// Sets the value of [table][crate::model::OracleTable::table].
5879    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5880        self.table = v.into();
5881        self
5882    }
5883
5884    /// Sets the value of [oracle_columns][crate::model::OracleTable::oracle_columns].
5885    pub fn set_oracle_columns<T, V>(mut self, v: T) -> Self
5886    where
5887        T: std::iter::IntoIterator<Item = V>,
5888        V: std::convert::Into<crate::model::OracleColumn>,
5889    {
5890        use std::iter::Iterator;
5891        self.oracle_columns = v.into_iter().map(|i| i.into()).collect();
5892        self
5893    }
5894}
5895
5896impl wkt::message::Message for OracleTable {
5897    fn typename() -> &'static str {
5898        "type.googleapis.com/google.cloud.datastream.v1.OracleTable"
5899    }
5900}
5901
5902/// Oracle schema.
5903#[derive(Clone, Default, PartialEq)]
5904#[non_exhaustive]
5905pub struct OracleSchema {
5906    /// Schema name.
5907    pub schema: std::string::String,
5908
5909    /// Tables in the schema.
5910    pub oracle_tables: std::vec::Vec<crate::model::OracleTable>,
5911
5912    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5913}
5914
5915impl OracleSchema {
5916    pub fn new() -> Self {
5917        std::default::Default::default()
5918    }
5919
5920    /// Sets the value of [schema][crate::model::OracleSchema::schema].
5921    pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5922        self.schema = v.into();
5923        self
5924    }
5925
5926    /// Sets the value of [oracle_tables][crate::model::OracleSchema::oracle_tables].
5927    pub fn set_oracle_tables<T, V>(mut self, v: T) -> Self
5928    where
5929        T: std::iter::IntoIterator<Item = V>,
5930        V: std::convert::Into<crate::model::OracleTable>,
5931    {
5932        use std::iter::Iterator;
5933        self.oracle_tables = v.into_iter().map(|i| i.into()).collect();
5934        self
5935    }
5936}
5937
5938impl wkt::message::Message for OracleSchema {
5939    fn typename() -> &'static str {
5940        "type.googleapis.com/google.cloud.datastream.v1.OracleSchema"
5941    }
5942}
5943
5944/// Oracle database structure.
5945#[derive(Clone, Default, PartialEq)]
5946#[non_exhaustive]
5947pub struct OracleRdbms {
5948    /// Oracle schemas/databases in the database server.
5949    pub oracle_schemas: std::vec::Vec<crate::model::OracleSchema>,
5950
5951    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5952}
5953
5954impl OracleRdbms {
5955    pub fn new() -> Self {
5956        std::default::Default::default()
5957    }
5958
5959    /// Sets the value of [oracle_schemas][crate::model::OracleRdbms::oracle_schemas].
5960    pub fn set_oracle_schemas<T, V>(mut self, v: T) -> Self
5961    where
5962        T: std::iter::IntoIterator<Item = V>,
5963        V: std::convert::Into<crate::model::OracleSchema>,
5964    {
5965        use std::iter::Iterator;
5966        self.oracle_schemas = v.into_iter().map(|i| i.into()).collect();
5967        self
5968    }
5969}
5970
5971impl wkt::message::Message for OracleRdbms {
5972    fn typename() -> &'static str {
5973        "type.googleapis.com/google.cloud.datastream.v1.OracleRdbms"
5974    }
5975}
5976
5977/// Oracle data source configuration
5978#[derive(Clone, Default, PartialEq)]
5979#[non_exhaustive]
5980pub struct OracleSourceConfig {
5981    /// Oracle objects to include in the stream.
5982    pub include_objects: std::option::Option<crate::model::OracleRdbms>,
5983
5984    /// Oracle objects to exclude from the stream.
5985    pub exclude_objects: std::option::Option<crate::model::OracleRdbms>,
5986
5987    /// Maximum number of concurrent CDC tasks. The number should be non-negative.
5988    /// If not set (or set to 0), the system's default value is used.
5989    pub max_concurrent_cdc_tasks: i32,
5990
5991    /// Maximum number of concurrent backfill tasks. The number should be
5992    /// non-negative. If not set (or set to 0), the system's default value is used.
5993    pub max_concurrent_backfill_tasks: i32,
5994
5995    /// The configuration for handle Oracle large objects.
5996    pub large_objects_handling:
5997        std::option::Option<crate::model::oracle_source_config::LargeObjectsHandling>,
5998
5999    /// Configuration to select the CDC method.
6000    pub cdc_method: std::option::Option<crate::model::oracle_source_config::CdcMethod>,
6001
6002    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6003}
6004
6005impl OracleSourceConfig {
6006    pub fn new() -> Self {
6007        std::default::Default::default()
6008    }
6009
6010    /// Sets the value of [include_objects][crate::model::OracleSourceConfig::include_objects].
6011    pub fn set_include_objects<T>(mut self, v: T) -> Self
6012    where
6013        T: std::convert::Into<crate::model::OracleRdbms>,
6014    {
6015        self.include_objects = std::option::Option::Some(v.into());
6016        self
6017    }
6018
6019    /// Sets or clears the value of [include_objects][crate::model::OracleSourceConfig::include_objects].
6020    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
6021    where
6022        T: std::convert::Into<crate::model::OracleRdbms>,
6023    {
6024        self.include_objects = v.map(|x| x.into());
6025        self
6026    }
6027
6028    /// Sets the value of [exclude_objects][crate::model::OracleSourceConfig::exclude_objects].
6029    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
6030    where
6031        T: std::convert::Into<crate::model::OracleRdbms>,
6032    {
6033        self.exclude_objects = std::option::Option::Some(v.into());
6034        self
6035    }
6036
6037    /// Sets or clears the value of [exclude_objects][crate::model::OracleSourceConfig::exclude_objects].
6038    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
6039    where
6040        T: std::convert::Into<crate::model::OracleRdbms>,
6041    {
6042        self.exclude_objects = v.map(|x| x.into());
6043        self
6044    }
6045
6046    /// Sets the value of [max_concurrent_cdc_tasks][crate::model::OracleSourceConfig::max_concurrent_cdc_tasks].
6047    pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6048        self.max_concurrent_cdc_tasks = v.into();
6049        self
6050    }
6051
6052    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::OracleSourceConfig::max_concurrent_backfill_tasks].
6053    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6054        self.max_concurrent_backfill_tasks = v.into();
6055        self
6056    }
6057
6058    /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling].
6059    ///
6060    /// Note that all the setters affecting `large_objects_handling` are mutually
6061    /// exclusive.
6062    pub fn set_large_objects_handling<
6063        T: std::convert::Into<
6064                std::option::Option<crate::model::oracle_source_config::LargeObjectsHandling>,
6065            >,
6066    >(
6067        mut self,
6068        v: T,
6069    ) -> Self {
6070        self.large_objects_handling = v.into();
6071        self
6072    }
6073
6074    /// The value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
6075    /// if it holds a `DropLargeObjects`, `None` if the field is not set or
6076    /// holds a different branch.
6077    pub fn drop_large_objects(
6078        &self,
6079    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>>
6080    {
6081        #[allow(unreachable_patterns)]
6082        self.large_objects_handling.as_ref().and_then(|v| match v {
6083            crate::model::oracle_source_config::LargeObjectsHandling::DropLargeObjects(v) => {
6084                std::option::Option::Some(v)
6085            }
6086            _ => std::option::Option::None,
6087        })
6088    }
6089
6090    /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
6091    /// to hold a `DropLargeObjects`.
6092    ///
6093    /// Note that all the setters affecting `large_objects_handling` are
6094    /// mutually exclusive.
6095    pub fn set_drop_large_objects<
6096        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>>,
6097    >(
6098        mut self,
6099        v: T,
6100    ) -> Self {
6101        self.large_objects_handling = std::option::Option::Some(
6102            crate::model::oracle_source_config::LargeObjectsHandling::DropLargeObjects(v.into()),
6103        );
6104        self
6105    }
6106
6107    /// The value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
6108    /// if it holds a `StreamLargeObjects`, `None` if the field is not set or
6109    /// holds a different branch.
6110    pub fn stream_large_objects(
6111        &self,
6112    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>>
6113    {
6114        #[allow(unreachable_patterns)]
6115        self.large_objects_handling.as_ref().and_then(|v| match v {
6116            crate::model::oracle_source_config::LargeObjectsHandling::StreamLargeObjects(v) => {
6117                std::option::Option::Some(v)
6118            }
6119            _ => std::option::Option::None,
6120        })
6121    }
6122
6123    /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
6124    /// to hold a `StreamLargeObjects`.
6125    ///
6126    /// Note that all the setters affecting `large_objects_handling` are
6127    /// mutually exclusive.
6128    pub fn set_stream_large_objects<
6129        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>>,
6130    >(
6131        mut self,
6132        v: T,
6133    ) -> Self {
6134        self.large_objects_handling = std::option::Option::Some(
6135            crate::model::oracle_source_config::LargeObjectsHandling::StreamLargeObjects(v.into()),
6136        );
6137        self
6138    }
6139
6140    /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method].
6141    ///
6142    /// Note that all the setters affecting `cdc_method` are mutually
6143    /// exclusive.
6144    pub fn set_cdc_method<
6145        T: std::convert::Into<std::option::Option<crate::model::oracle_source_config::CdcMethod>>,
6146    >(
6147        mut self,
6148        v: T,
6149    ) -> Self {
6150        self.cdc_method = v.into();
6151        self
6152    }
6153
6154    /// The value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
6155    /// if it holds a `LogMiner`, `None` if the field is not set or
6156    /// holds a different branch.
6157    pub fn log_miner(
6158        &self,
6159    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::LogMiner>> {
6160        #[allow(unreachable_patterns)]
6161        self.cdc_method.as_ref().and_then(|v| match v {
6162            crate::model::oracle_source_config::CdcMethod::LogMiner(v) => {
6163                std::option::Option::Some(v)
6164            }
6165            _ => std::option::Option::None,
6166        })
6167    }
6168
6169    /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
6170    /// to hold a `LogMiner`.
6171    ///
6172    /// Note that all the setters affecting `cdc_method` are
6173    /// mutually exclusive.
6174    pub fn set_log_miner<
6175        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::LogMiner>>,
6176    >(
6177        mut self,
6178        v: T,
6179    ) -> Self {
6180        self.cdc_method = std::option::Option::Some(
6181            crate::model::oracle_source_config::CdcMethod::LogMiner(v.into()),
6182        );
6183        self
6184    }
6185
6186    /// The value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
6187    /// if it holds a `BinaryLogParser`, `None` if the field is not set or
6188    /// holds a different branch.
6189    pub fn binary_log_parser(
6190        &self,
6191    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>>
6192    {
6193        #[allow(unreachable_patterns)]
6194        self.cdc_method.as_ref().and_then(|v| match v {
6195            crate::model::oracle_source_config::CdcMethod::BinaryLogParser(v) => {
6196                std::option::Option::Some(v)
6197            }
6198            _ => std::option::Option::None,
6199        })
6200    }
6201
6202    /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
6203    /// to hold a `BinaryLogParser`.
6204    ///
6205    /// Note that all the setters affecting `cdc_method` are
6206    /// mutually exclusive.
6207    pub fn set_binary_log_parser<
6208        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>>,
6209    >(
6210        mut self,
6211        v: T,
6212    ) -> Self {
6213        self.cdc_method = std::option::Option::Some(
6214            crate::model::oracle_source_config::CdcMethod::BinaryLogParser(v.into()),
6215        );
6216        self
6217    }
6218}
6219
6220impl wkt::message::Message for OracleSourceConfig {
6221    fn typename() -> &'static str {
6222        "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig"
6223    }
6224}
6225
6226/// Defines additional types related to [OracleSourceConfig].
6227pub mod oracle_source_config {
6228    #[allow(unused_imports)]
6229    use super::*;
6230
6231    /// Configuration to drop large object values.
6232    #[derive(Clone, Default, PartialEq)]
6233    #[non_exhaustive]
6234    pub struct DropLargeObjects {
6235        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6236    }
6237
6238    impl DropLargeObjects {
6239        pub fn new() -> Self {
6240            std::default::Default::default()
6241        }
6242    }
6243
6244    impl wkt::message::Message for DropLargeObjects {
6245        fn typename() -> &'static str {
6246            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.DropLargeObjects"
6247        }
6248    }
6249
6250    /// Configuration to stream large object values.
6251    #[derive(Clone, Default, PartialEq)]
6252    #[non_exhaustive]
6253    pub struct StreamLargeObjects {
6254        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6255    }
6256
6257    impl StreamLargeObjects {
6258        pub fn new() -> Self {
6259            std::default::Default::default()
6260        }
6261    }
6262
6263    impl wkt::message::Message for StreamLargeObjects {
6264        fn typename() -> &'static str {
6265            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.StreamLargeObjects"
6266        }
6267    }
6268
6269    /// Configuration to use LogMiner CDC method.
6270    #[derive(Clone, Default, PartialEq)]
6271    #[non_exhaustive]
6272    pub struct LogMiner {
6273        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6274    }
6275
6276    impl LogMiner {
6277        pub fn new() -> Self {
6278            std::default::Default::default()
6279        }
6280    }
6281
6282    impl wkt::message::Message for LogMiner {
6283        fn typename() -> &'static str {
6284            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.LogMiner"
6285        }
6286    }
6287
6288    /// Configuration to use Binary Log Parser CDC technique.
6289    #[derive(Clone, Default, PartialEq)]
6290    #[non_exhaustive]
6291    pub struct BinaryLogParser {
6292        /// Configuration to specify how the log file should be accessed.
6293        pub log_file_access: std::option::Option<
6294            crate::model::oracle_source_config::binary_log_parser::LogFileAccess,
6295        >,
6296
6297        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6298    }
6299
6300    impl BinaryLogParser {
6301        pub fn new() -> Self {
6302            std::default::Default::default()
6303        }
6304
6305        /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access].
6306        ///
6307        /// Note that all the setters affecting `log_file_access` are mutually
6308        /// exclusive.
6309        pub fn set_log_file_access<
6310            T: std::convert::Into<
6311                    std::option::Option<
6312                        crate::model::oracle_source_config::binary_log_parser::LogFileAccess,
6313                    >,
6314                >,
6315        >(
6316            mut self,
6317            v: T,
6318        ) -> Self {
6319            self.log_file_access = v.into();
6320            self
6321        }
6322
6323        /// The value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
6324        /// if it holds a `OracleAsmLogFileAccess`, `None` if the field is not set or
6325        /// holds a different branch.
6326        pub fn oracle_asm_log_file_access(
6327            &self,
6328        ) -> std::option::Option<
6329            &std::boxed::Box<
6330                crate::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess,
6331            >,
6332        > {
6333            #[allow(unreachable_patterns)]
6334            self.log_file_access.as_ref().and_then(|v| match v {
6335                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::OracleAsmLogFileAccess(v) => std::option::Option::Some(v),
6336                _ => std::option::Option::None,
6337            })
6338        }
6339
6340        /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
6341        /// to hold a `OracleAsmLogFileAccess`.
6342        ///
6343        /// Note that all the setters affecting `log_file_access` are
6344        /// mutually exclusive.
6345        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{
6346            self.log_file_access = std::option::Option::Some(
6347                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::OracleAsmLogFileAccess(
6348                    v.into()
6349                )
6350            );
6351            self
6352        }
6353
6354        /// The value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
6355        /// if it holds a `LogFileDirectories`, `None` if the field is not set or
6356        /// holds a different branch.
6357        pub fn log_file_directories(
6358            &self,
6359        ) -> std::option::Option<
6360            &std::boxed::Box<
6361                crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
6362            >,
6363        > {
6364            #[allow(unreachable_patterns)]
6365            self.log_file_access.as_ref().and_then(|v| match v {
6366                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::LogFileDirectories(v) => std::option::Option::Some(v),
6367                _ => std::option::Option::None,
6368            })
6369        }
6370
6371        /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
6372        /// to hold a `LogFileDirectories`.
6373        ///
6374        /// Note that all the setters affecting `log_file_access` are
6375        /// mutually exclusive.
6376        pub fn set_log_file_directories<
6377            T: std::convert::Into<
6378                    std::boxed::Box<
6379                        crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
6380                    >,
6381                >,
6382        >(
6383            mut self,
6384            v: T,
6385        ) -> Self {
6386            self.log_file_access = std::option::Option::Some(
6387                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::LogFileDirectories(
6388                    v.into()
6389                )
6390            );
6391            self
6392        }
6393    }
6394
6395    impl wkt::message::Message for BinaryLogParser {
6396        fn typename() -> &'static str {
6397            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser"
6398        }
6399    }
6400
6401    /// Defines additional types related to [BinaryLogParser].
6402    pub mod binary_log_parser {
6403        #[allow(unused_imports)]
6404        use super::*;
6405
6406        /// Configuration to use Oracle ASM to access the log files.
6407        #[derive(Clone, Default, PartialEq)]
6408        #[non_exhaustive]
6409        pub struct OracleAsmLogFileAccess {
6410            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6411        }
6412
6413        impl OracleAsmLogFileAccess {
6414            pub fn new() -> Self {
6415                std::default::Default::default()
6416            }
6417        }
6418
6419        impl wkt::message::Message for OracleAsmLogFileAccess {
6420            fn typename() -> &'static str {
6421                "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser.OracleAsmLogFileAccess"
6422            }
6423        }
6424
6425        /// Configuration to specify the Oracle directories to access the log files.
6426        #[derive(Clone, Default, PartialEq)]
6427        #[non_exhaustive]
6428        pub struct LogFileDirectories {
6429            /// Required. Oracle directory for online logs.
6430            pub online_log_directory: std::string::String,
6431
6432            /// Required. Oracle directory for archived logs.
6433            pub archived_log_directory: std::string::String,
6434
6435            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6436        }
6437
6438        impl LogFileDirectories {
6439            pub fn new() -> Self {
6440                std::default::Default::default()
6441            }
6442
6443            /// Sets the value of [online_log_directory][crate::model::oracle_source_config::binary_log_parser::LogFileDirectories::online_log_directory].
6444            pub fn set_online_log_directory<T: std::convert::Into<std::string::String>>(
6445                mut self,
6446                v: T,
6447            ) -> Self {
6448                self.online_log_directory = v.into();
6449                self
6450            }
6451
6452            /// Sets the value of [archived_log_directory][crate::model::oracle_source_config::binary_log_parser::LogFileDirectories::archived_log_directory].
6453            pub fn set_archived_log_directory<T: std::convert::Into<std::string::String>>(
6454                mut self,
6455                v: T,
6456            ) -> Self {
6457                self.archived_log_directory = v.into();
6458                self
6459            }
6460        }
6461
6462        impl wkt::message::Message for LogFileDirectories {
6463            fn typename() -> &'static str {
6464                "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser.LogFileDirectories"
6465            }
6466        }
6467
6468        /// Configuration to specify how the log file should be accessed.
6469        #[derive(Clone, Debug, PartialEq)]
6470        #[non_exhaustive]
6471        pub enum LogFileAccess {
6472            /// Use Oracle ASM.
6473            OracleAsmLogFileAccess(
6474                std::boxed::Box<
6475                    crate::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess,
6476                >,
6477            ),
6478            /// Use Oracle directories.
6479            LogFileDirectories(
6480                std::boxed::Box<
6481                    crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
6482                >,
6483            ),
6484        }
6485    }
6486
6487    /// The configuration for handle Oracle large objects.
6488    #[derive(Clone, Debug, PartialEq)]
6489    #[non_exhaustive]
6490    pub enum LargeObjectsHandling {
6491        /// Drop large object values.
6492        DropLargeObjects(std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>),
6493        /// Stream large object values.
6494        StreamLargeObjects(std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>),
6495    }
6496
6497    /// Configuration to select the CDC method.
6498    #[derive(Clone, Debug, PartialEq)]
6499    #[non_exhaustive]
6500    pub enum CdcMethod {
6501        /// Use LogMiner.
6502        LogMiner(std::boxed::Box<crate::model::oracle_source_config::LogMiner>),
6503        /// Use Binary Log Parser.
6504        BinaryLogParser(std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>),
6505    }
6506}
6507
6508/// PostgreSQL Column.
6509#[derive(Clone, Default, PartialEq)]
6510#[non_exhaustive]
6511pub struct PostgresqlColumn {
6512    /// Column name.
6513    pub column: std::string::String,
6514
6515    /// The PostgreSQL data type.
6516    pub data_type: std::string::String,
6517
6518    /// Column length.
6519    pub length: i32,
6520
6521    /// Column precision.
6522    pub precision: i32,
6523
6524    /// Column scale.
6525    pub scale: i32,
6526
6527    /// Whether or not the column represents a primary key.
6528    pub primary_key: bool,
6529
6530    /// Whether or not the column can accept a null value.
6531    pub nullable: bool,
6532
6533    /// The ordinal position of the column in the table.
6534    pub ordinal_position: i32,
6535
6536    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6537}
6538
6539impl PostgresqlColumn {
6540    pub fn new() -> Self {
6541        std::default::Default::default()
6542    }
6543
6544    /// Sets the value of [column][crate::model::PostgresqlColumn::column].
6545    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6546        self.column = v.into();
6547        self
6548    }
6549
6550    /// Sets the value of [data_type][crate::model::PostgresqlColumn::data_type].
6551    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6552        self.data_type = v.into();
6553        self
6554    }
6555
6556    /// Sets the value of [length][crate::model::PostgresqlColumn::length].
6557    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6558        self.length = v.into();
6559        self
6560    }
6561
6562    /// Sets the value of [precision][crate::model::PostgresqlColumn::precision].
6563    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6564        self.precision = v.into();
6565        self
6566    }
6567
6568    /// Sets the value of [scale][crate::model::PostgresqlColumn::scale].
6569    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6570        self.scale = v.into();
6571        self
6572    }
6573
6574    /// Sets the value of [primary_key][crate::model::PostgresqlColumn::primary_key].
6575    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6576        self.primary_key = v.into();
6577        self
6578    }
6579
6580    /// Sets the value of [nullable][crate::model::PostgresqlColumn::nullable].
6581    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6582        self.nullable = v.into();
6583        self
6584    }
6585
6586    /// Sets the value of [ordinal_position][crate::model::PostgresqlColumn::ordinal_position].
6587    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6588        self.ordinal_position = v.into();
6589        self
6590    }
6591}
6592
6593impl wkt::message::Message for PostgresqlColumn {
6594    fn typename() -> &'static str {
6595        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlColumn"
6596    }
6597}
6598
6599/// PostgreSQL table.
6600#[derive(Clone, Default, PartialEq)]
6601#[non_exhaustive]
6602pub struct PostgresqlTable {
6603    /// Table name.
6604    pub table: std::string::String,
6605
6606    /// PostgreSQL columns in the schema.
6607    /// When unspecified as part of include/exclude objects,
6608    /// includes/excludes everything.
6609    pub postgresql_columns: std::vec::Vec<crate::model::PostgresqlColumn>,
6610
6611    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6612}
6613
6614impl PostgresqlTable {
6615    pub fn new() -> Self {
6616        std::default::Default::default()
6617    }
6618
6619    /// Sets the value of [table][crate::model::PostgresqlTable::table].
6620    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6621        self.table = v.into();
6622        self
6623    }
6624
6625    /// Sets the value of [postgresql_columns][crate::model::PostgresqlTable::postgresql_columns].
6626    pub fn set_postgresql_columns<T, V>(mut self, v: T) -> Self
6627    where
6628        T: std::iter::IntoIterator<Item = V>,
6629        V: std::convert::Into<crate::model::PostgresqlColumn>,
6630    {
6631        use std::iter::Iterator;
6632        self.postgresql_columns = v.into_iter().map(|i| i.into()).collect();
6633        self
6634    }
6635}
6636
6637impl wkt::message::Message for PostgresqlTable {
6638    fn typename() -> &'static str {
6639        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlTable"
6640    }
6641}
6642
6643/// PostgreSQL schema.
6644#[derive(Clone, Default, PartialEq)]
6645#[non_exhaustive]
6646pub struct PostgresqlSchema {
6647    /// Schema name.
6648    pub schema: std::string::String,
6649
6650    /// Tables in the schema.
6651    pub postgresql_tables: std::vec::Vec<crate::model::PostgresqlTable>,
6652
6653    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6654}
6655
6656impl PostgresqlSchema {
6657    pub fn new() -> Self {
6658        std::default::Default::default()
6659    }
6660
6661    /// Sets the value of [schema][crate::model::PostgresqlSchema::schema].
6662    pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6663        self.schema = v.into();
6664        self
6665    }
6666
6667    /// Sets the value of [postgresql_tables][crate::model::PostgresqlSchema::postgresql_tables].
6668    pub fn set_postgresql_tables<T, V>(mut self, v: T) -> Self
6669    where
6670        T: std::iter::IntoIterator<Item = V>,
6671        V: std::convert::Into<crate::model::PostgresqlTable>,
6672    {
6673        use std::iter::Iterator;
6674        self.postgresql_tables = v.into_iter().map(|i| i.into()).collect();
6675        self
6676    }
6677}
6678
6679impl wkt::message::Message for PostgresqlSchema {
6680    fn typename() -> &'static str {
6681        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSchema"
6682    }
6683}
6684
6685/// PostgreSQL database structure.
6686#[derive(Clone, Default, PartialEq)]
6687#[non_exhaustive]
6688pub struct PostgresqlRdbms {
6689    /// PostgreSQL schemas in the database server.
6690    pub postgresql_schemas: std::vec::Vec<crate::model::PostgresqlSchema>,
6691
6692    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6693}
6694
6695impl PostgresqlRdbms {
6696    pub fn new() -> Self {
6697        std::default::Default::default()
6698    }
6699
6700    /// Sets the value of [postgresql_schemas][crate::model::PostgresqlRdbms::postgresql_schemas].
6701    pub fn set_postgresql_schemas<T, V>(mut self, v: T) -> Self
6702    where
6703        T: std::iter::IntoIterator<Item = V>,
6704        V: std::convert::Into<crate::model::PostgresqlSchema>,
6705    {
6706        use std::iter::Iterator;
6707        self.postgresql_schemas = v.into_iter().map(|i| i.into()).collect();
6708        self
6709    }
6710}
6711
6712impl wkt::message::Message for PostgresqlRdbms {
6713    fn typename() -> &'static str {
6714        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlRdbms"
6715    }
6716}
6717
6718/// PostgreSQL data source configuration
6719#[derive(Clone, Default, PartialEq)]
6720#[non_exhaustive]
6721pub struct PostgresqlSourceConfig {
6722    /// PostgreSQL objects to include in the stream.
6723    pub include_objects: std::option::Option<crate::model::PostgresqlRdbms>,
6724
6725    /// PostgreSQL objects to exclude from the stream.
6726    pub exclude_objects: std::option::Option<crate::model::PostgresqlRdbms>,
6727
6728    /// Required. Immutable. The name of the logical replication slot that's
6729    /// configured with the pgoutput plugin.
6730    pub replication_slot: std::string::String,
6731
6732    /// Required. The name of the publication that includes the set of all tables
6733    /// that are defined in the stream's include_objects.
6734    pub publication: std::string::String,
6735
6736    /// Maximum number of concurrent backfill tasks. The number should be non
6737    /// negative. If not set (or set to 0), the system's default value will be
6738    /// used.
6739    pub max_concurrent_backfill_tasks: i32,
6740
6741    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6742}
6743
6744impl PostgresqlSourceConfig {
6745    pub fn new() -> Self {
6746        std::default::Default::default()
6747    }
6748
6749    /// Sets the value of [include_objects][crate::model::PostgresqlSourceConfig::include_objects].
6750    pub fn set_include_objects<T>(mut self, v: T) -> Self
6751    where
6752        T: std::convert::Into<crate::model::PostgresqlRdbms>,
6753    {
6754        self.include_objects = std::option::Option::Some(v.into());
6755        self
6756    }
6757
6758    /// Sets or clears the value of [include_objects][crate::model::PostgresqlSourceConfig::include_objects].
6759    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
6760    where
6761        T: std::convert::Into<crate::model::PostgresqlRdbms>,
6762    {
6763        self.include_objects = v.map(|x| x.into());
6764        self
6765    }
6766
6767    /// Sets the value of [exclude_objects][crate::model::PostgresqlSourceConfig::exclude_objects].
6768    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
6769    where
6770        T: std::convert::Into<crate::model::PostgresqlRdbms>,
6771    {
6772        self.exclude_objects = std::option::Option::Some(v.into());
6773        self
6774    }
6775
6776    /// Sets or clears the value of [exclude_objects][crate::model::PostgresqlSourceConfig::exclude_objects].
6777    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
6778    where
6779        T: std::convert::Into<crate::model::PostgresqlRdbms>,
6780    {
6781        self.exclude_objects = v.map(|x| x.into());
6782        self
6783    }
6784
6785    /// Sets the value of [replication_slot][crate::model::PostgresqlSourceConfig::replication_slot].
6786    pub fn set_replication_slot<T: std::convert::Into<std::string::String>>(
6787        mut self,
6788        v: T,
6789    ) -> Self {
6790        self.replication_slot = v.into();
6791        self
6792    }
6793
6794    /// Sets the value of [publication][crate::model::PostgresqlSourceConfig::publication].
6795    pub fn set_publication<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6796        self.publication = v.into();
6797        self
6798    }
6799
6800    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::PostgresqlSourceConfig::max_concurrent_backfill_tasks].
6801    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6802        self.max_concurrent_backfill_tasks = v.into();
6803        self
6804    }
6805}
6806
6807impl wkt::message::Message for PostgresqlSourceConfig {
6808    fn typename() -> &'static str {
6809        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSourceConfig"
6810    }
6811}
6812
6813/// SQLServer Column.
6814#[derive(Clone, Default, PartialEq)]
6815#[non_exhaustive]
6816pub struct SqlServerColumn {
6817    /// Column name.
6818    pub column: std::string::String,
6819
6820    /// The SQLServer data type.
6821    pub data_type: std::string::String,
6822
6823    /// Column length.
6824    pub length: i32,
6825
6826    /// Column precision.
6827    pub precision: i32,
6828
6829    /// Column scale.
6830    pub scale: i32,
6831
6832    /// Whether or not the column represents a primary key.
6833    pub primary_key: bool,
6834
6835    /// Whether or not the column can accept a null value.
6836    pub nullable: bool,
6837
6838    /// The ordinal position of the column in the table.
6839    pub ordinal_position: i32,
6840
6841    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6842}
6843
6844impl SqlServerColumn {
6845    pub fn new() -> Self {
6846        std::default::Default::default()
6847    }
6848
6849    /// Sets the value of [column][crate::model::SqlServerColumn::column].
6850    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6851        self.column = v.into();
6852        self
6853    }
6854
6855    /// Sets the value of [data_type][crate::model::SqlServerColumn::data_type].
6856    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6857        self.data_type = v.into();
6858        self
6859    }
6860
6861    /// Sets the value of [length][crate::model::SqlServerColumn::length].
6862    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6863        self.length = v.into();
6864        self
6865    }
6866
6867    /// Sets the value of [precision][crate::model::SqlServerColumn::precision].
6868    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6869        self.precision = v.into();
6870        self
6871    }
6872
6873    /// Sets the value of [scale][crate::model::SqlServerColumn::scale].
6874    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6875        self.scale = v.into();
6876        self
6877    }
6878
6879    /// Sets the value of [primary_key][crate::model::SqlServerColumn::primary_key].
6880    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6881        self.primary_key = v.into();
6882        self
6883    }
6884
6885    /// Sets the value of [nullable][crate::model::SqlServerColumn::nullable].
6886    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6887        self.nullable = v.into();
6888        self
6889    }
6890
6891    /// Sets the value of [ordinal_position][crate::model::SqlServerColumn::ordinal_position].
6892    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6893        self.ordinal_position = v.into();
6894        self
6895    }
6896}
6897
6898impl wkt::message::Message for SqlServerColumn {
6899    fn typename() -> &'static str {
6900        "type.googleapis.com/google.cloud.datastream.v1.SqlServerColumn"
6901    }
6902}
6903
6904/// SQLServer table.
6905#[derive(Clone, Default, PartialEq)]
6906#[non_exhaustive]
6907pub struct SqlServerTable {
6908    /// Table name.
6909    pub table: std::string::String,
6910
6911    /// SQLServer columns in the schema.
6912    /// When unspecified as part of include/exclude objects,
6913    /// includes/excludes everything.
6914    pub columns: std::vec::Vec<crate::model::SqlServerColumn>,
6915
6916    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6917}
6918
6919impl SqlServerTable {
6920    pub fn new() -> Self {
6921        std::default::Default::default()
6922    }
6923
6924    /// Sets the value of [table][crate::model::SqlServerTable::table].
6925    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6926        self.table = v.into();
6927        self
6928    }
6929
6930    /// Sets the value of [columns][crate::model::SqlServerTable::columns].
6931    pub fn set_columns<T, V>(mut self, v: T) -> Self
6932    where
6933        T: std::iter::IntoIterator<Item = V>,
6934        V: std::convert::Into<crate::model::SqlServerColumn>,
6935    {
6936        use std::iter::Iterator;
6937        self.columns = v.into_iter().map(|i| i.into()).collect();
6938        self
6939    }
6940}
6941
6942impl wkt::message::Message for SqlServerTable {
6943    fn typename() -> &'static str {
6944        "type.googleapis.com/google.cloud.datastream.v1.SqlServerTable"
6945    }
6946}
6947
6948/// SQLServer schema.
6949#[derive(Clone, Default, PartialEq)]
6950#[non_exhaustive]
6951pub struct SqlServerSchema {
6952    /// Schema name.
6953    pub schema: std::string::String,
6954
6955    /// Tables in the schema.
6956    pub tables: std::vec::Vec<crate::model::SqlServerTable>,
6957
6958    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6959}
6960
6961impl SqlServerSchema {
6962    pub fn new() -> Self {
6963        std::default::Default::default()
6964    }
6965
6966    /// Sets the value of [schema][crate::model::SqlServerSchema::schema].
6967    pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6968        self.schema = v.into();
6969        self
6970    }
6971
6972    /// Sets the value of [tables][crate::model::SqlServerSchema::tables].
6973    pub fn set_tables<T, V>(mut self, v: T) -> Self
6974    where
6975        T: std::iter::IntoIterator<Item = V>,
6976        V: std::convert::Into<crate::model::SqlServerTable>,
6977    {
6978        use std::iter::Iterator;
6979        self.tables = v.into_iter().map(|i| i.into()).collect();
6980        self
6981    }
6982}
6983
6984impl wkt::message::Message for SqlServerSchema {
6985    fn typename() -> &'static str {
6986        "type.googleapis.com/google.cloud.datastream.v1.SqlServerSchema"
6987    }
6988}
6989
6990/// SQLServer database structure.
6991#[derive(Clone, Default, PartialEq)]
6992#[non_exhaustive]
6993pub struct SqlServerRdbms {
6994    /// SQLServer schemas in the database server.
6995    pub schemas: std::vec::Vec<crate::model::SqlServerSchema>,
6996
6997    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6998}
6999
7000impl SqlServerRdbms {
7001    pub fn new() -> Self {
7002        std::default::Default::default()
7003    }
7004
7005    /// Sets the value of [schemas][crate::model::SqlServerRdbms::schemas].
7006    pub fn set_schemas<T, V>(mut self, v: T) -> Self
7007    where
7008        T: std::iter::IntoIterator<Item = V>,
7009        V: std::convert::Into<crate::model::SqlServerSchema>,
7010    {
7011        use std::iter::Iterator;
7012        self.schemas = v.into_iter().map(|i| i.into()).collect();
7013        self
7014    }
7015}
7016
7017impl wkt::message::Message for SqlServerRdbms {
7018    fn typename() -> &'static str {
7019        "type.googleapis.com/google.cloud.datastream.v1.SqlServerRdbms"
7020    }
7021}
7022
7023/// SQLServer data source configuration
7024#[derive(Clone, Default, PartialEq)]
7025#[non_exhaustive]
7026pub struct SqlServerSourceConfig {
7027    /// SQLServer objects to include in the stream.
7028    pub include_objects: std::option::Option<crate::model::SqlServerRdbms>,
7029
7030    /// SQLServer objects to exclude from the stream.
7031    pub exclude_objects: std::option::Option<crate::model::SqlServerRdbms>,
7032
7033    /// Max concurrent CDC tasks.
7034    pub max_concurrent_cdc_tasks: i32,
7035
7036    /// Max concurrent backfill tasks.
7037    pub max_concurrent_backfill_tasks: i32,
7038
7039    /// Configuration to select the CDC read method for the stream.
7040    pub cdc_method: std::option::Option<crate::model::sql_server_source_config::CdcMethod>,
7041
7042    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7043}
7044
7045impl SqlServerSourceConfig {
7046    pub fn new() -> Self {
7047        std::default::Default::default()
7048    }
7049
7050    /// Sets the value of [include_objects][crate::model::SqlServerSourceConfig::include_objects].
7051    pub fn set_include_objects<T>(mut self, v: T) -> Self
7052    where
7053        T: std::convert::Into<crate::model::SqlServerRdbms>,
7054    {
7055        self.include_objects = std::option::Option::Some(v.into());
7056        self
7057    }
7058
7059    /// Sets or clears the value of [include_objects][crate::model::SqlServerSourceConfig::include_objects].
7060    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
7061    where
7062        T: std::convert::Into<crate::model::SqlServerRdbms>,
7063    {
7064        self.include_objects = v.map(|x| x.into());
7065        self
7066    }
7067
7068    /// Sets the value of [exclude_objects][crate::model::SqlServerSourceConfig::exclude_objects].
7069    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
7070    where
7071        T: std::convert::Into<crate::model::SqlServerRdbms>,
7072    {
7073        self.exclude_objects = std::option::Option::Some(v.into());
7074        self
7075    }
7076
7077    /// Sets or clears the value of [exclude_objects][crate::model::SqlServerSourceConfig::exclude_objects].
7078    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
7079    where
7080        T: std::convert::Into<crate::model::SqlServerRdbms>,
7081    {
7082        self.exclude_objects = v.map(|x| x.into());
7083        self
7084    }
7085
7086    /// Sets the value of [max_concurrent_cdc_tasks][crate::model::SqlServerSourceConfig::max_concurrent_cdc_tasks].
7087    pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7088        self.max_concurrent_cdc_tasks = v.into();
7089        self
7090    }
7091
7092    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::SqlServerSourceConfig::max_concurrent_backfill_tasks].
7093    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7094        self.max_concurrent_backfill_tasks = v.into();
7095        self
7096    }
7097
7098    /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method].
7099    ///
7100    /// Note that all the setters affecting `cdc_method` are mutually
7101    /// exclusive.
7102    pub fn set_cdc_method<
7103        T: std::convert::Into<std::option::Option<crate::model::sql_server_source_config::CdcMethod>>,
7104    >(
7105        mut self,
7106        v: T,
7107    ) -> Self {
7108        self.cdc_method = v.into();
7109        self
7110    }
7111
7112    /// The value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
7113    /// if it holds a `TransactionLogs`, `None` if the field is not set or
7114    /// holds a different branch.
7115    pub fn transaction_logs(
7116        &self,
7117    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerTransactionLogs>> {
7118        #[allow(unreachable_patterns)]
7119        self.cdc_method.as_ref().and_then(|v| match v {
7120            crate::model::sql_server_source_config::CdcMethod::TransactionLogs(v) => {
7121                std::option::Option::Some(v)
7122            }
7123            _ => std::option::Option::None,
7124        })
7125    }
7126
7127    /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
7128    /// to hold a `TransactionLogs`.
7129    ///
7130    /// Note that all the setters affecting `cdc_method` are
7131    /// mutually exclusive.
7132    pub fn set_transaction_logs<
7133        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerTransactionLogs>>,
7134    >(
7135        mut self,
7136        v: T,
7137    ) -> Self {
7138        self.cdc_method = std::option::Option::Some(
7139            crate::model::sql_server_source_config::CdcMethod::TransactionLogs(v.into()),
7140        );
7141        self
7142    }
7143
7144    /// The value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
7145    /// if it holds a `ChangeTables`, `None` if the field is not set or
7146    /// holds a different branch.
7147    pub fn change_tables(
7148        &self,
7149    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerChangeTables>> {
7150        #[allow(unreachable_patterns)]
7151        self.cdc_method.as_ref().and_then(|v| match v {
7152            crate::model::sql_server_source_config::CdcMethod::ChangeTables(v) => {
7153                std::option::Option::Some(v)
7154            }
7155            _ => std::option::Option::None,
7156        })
7157    }
7158
7159    /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
7160    /// to hold a `ChangeTables`.
7161    ///
7162    /// Note that all the setters affecting `cdc_method` are
7163    /// mutually exclusive.
7164    pub fn set_change_tables<
7165        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerChangeTables>>,
7166    >(
7167        mut self,
7168        v: T,
7169    ) -> Self {
7170        self.cdc_method = std::option::Option::Some(
7171            crate::model::sql_server_source_config::CdcMethod::ChangeTables(v.into()),
7172        );
7173        self
7174    }
7175}
7176
7177impl wkt::message::Message for SqlServerSourceConfig {
7178    fn typename() -> &'static str {
7179        "type.googleapis.com/google.cloud.datastream.v1.SqlServerSourceConfig"
7180    }
7181}
7182
7183/// Defines additional types related to [SqlServerSourceConfig].
7184pub mod sql_server_source_config {
7185    #[allow(unused_imports)]
7186    use super::*;
7187
7188    /// Configuration to select the CDC read method for the stream.
7189    #[derive(Clone, Debug, PartialEq)]
7190    #[non_exhaustive]
7191    pub enum CdcMethod {
7192        /// CDC reader reads from transaction logs.
7193        TransactionLogs(std::boxed::Box<crate::model::SqlServerTransactionLogs>),
7194        /// CDC reader reads from change tables.
7195        ChangeTables(std::boxed::Box<crate::model::SqlServerChangeTables>),
7196    }
7197}
7198
7199/// Configuration to use Transaction Logs CDC read method.
7200#[derive(Clone, Default, PartialEq)]
7201#[non_exhaustive]
7202pub struct SqlServerTransactionLogs {
7203    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7204}
7205
7206impl SqlServerTransactionLogs {
7207    pub fn new() -> Self {
7208        std::default::Default::default()
7209    }
7210}
7211
7212impl wkt::message::Message for SqlServerTransactionLogs {
7213    fn typename() -> &'static str {
7214        "type.googleapis.com/google.cloud.datastream.v1.SqlServerTransactionLogs"
7215    }
7216}
7217
7218/// Configuration to use Change Tables CDC read method.
7219#[derive(Clone, Default, PartialEq)]
7220#[non_exhaustive]
7221pub struct SqlServerChangeTables {
7222    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7223}
7224
7225impl SqlServerChangeTables {
7226    pub fn new() -> Self {
7227        std::default::Default::default()
7228    }
7229}
7230
7231impl wkt::message::Message for SqlServerChangeTables {
7232    fn typename() -> &'static str {
7233        "type.googleapis.com/google.cloud.datastream.v1.SqlServerChangeTables"
7234    }
7235}
7236
7237/// MySQL Column.
7238#[derive(Clone, Default, PartialEq)]
7239#[non_exhaustive]
7240pub struct MysqlColumn {
7241    /// Column name.
7242    pub column: std::string::String,
7243
7244    /// The MySQL data type. Full data types list can be found here:
7245    /// <https://dev.mysql.com/doc/refman/8.0/en/data-types.html>
7246    pub data_type: std::string::String,
7247
7248    /// Column length.
7249    pub length: i32,
7250
7251    /// Column collation.
7252    pub collation: std::string::String,
7253
7254    /// Whether or not the column represents a primary key.
7255    pub primary_key: bool,
7256
7257    /// Whether or not the column can accept a null value.
7258    pub nullable: bool,
7259
7260    /// The ordinal position of the column in the table.
7261    pub ordinal_position: i32,
7262
7263    /// Column precision.
7264    pub precision: i32,
7265
7266    /// Column scale.
7267    pub scale: i32,
7268
7269    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7270}
7271
7272impl MysqlColumn {
7273    pub fn new() -> Self {
7274        std::default::Default::default()
7275    }
7276
7277    /// Sets the value of [column][crate::model::MysqlColumn::column].
7278    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7279        self.column = v.into();
7280        self
7281    }
7282
7283    /// Sets the value of [data_type][crate::model::MysqlColumn::data_type].
7284    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7285        self.data_type = v.into();
7286        self
7287    }
7288
7289    /// Sets the value of [length][crate::model::MysqlColumn::length].
7290    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7291        self.length = v.into();
7292        self
7293    }
7294
7295    /// Sets the value of [collation][crate::model::MysqlColumn::collation].
7296    pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7297        self.collation = v.into();
7298        self
7299    }
7300
7301    /// Sets the value of [primary_key][crate::model::MysqlColumn::primary_key].
7302    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7303        self.primary_key = v.into();
7304        self
7305    }
7306
7307    /// Sets the value of [nullable][crate::model::MysqlColumn::nullable].
7308    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7309        self.nullable = v.into();
7310        self
7311    }
7312
7313    /// Sets the value of [ordinal_position][crate::model::MysqlColumn::ordinal_position].
7314    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7315        self.ordinal_position = v.into();
7316        self
7317    }
7318
7319    /// Sets the value of [precision][crate::model::MysqlColumn::precision].
7320    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7321        self.precision = v.into();
7322        self
7323    }
7324
7325    /// Sets the value of [scale][crate::model::MysqlColumn::scale].
7326    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7327        self.scale = v.into();
7328        self
7329    }
7330}
7331
7332impl wkt::message::Message for MysqlColumn {
7333    fn typename() -> &'static str {
7334        "type.googleapis.com/google.cloud.datastream.v1.MysqlColumn"
7335    }
7336}
7337
7338/// MySQL table.
7339#[derive(Clone, Default, PartialEq)]
7340#[non_exhaustive]
7341pub struct MysqlTable {
7342    /// Table name.
7343    pub table: std::string::String,
7344
7345    /// MySQL columns in the database.
7346    /// When unspecified as part of include/exclude objects, includes/excludes
7347    /// everything.
7348    pub mysql_columns: std::vec::Vec<crate::model::MysqlColumn>,
7349
7350    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7351}
7352
7353impl MysqlTable {
7354    pub fn new() -> Self {
7355        std::default::Default::default()
7356    }
7357
7358    /// Sets the value of [table][crate::model::MysqlTable::table].
7359    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7360        self.table = v.into();
7361        self
7362    }
7363
7364    /// Sets the value of [mysql_columns][crate::model::MysqlTable::mysql_columns].
7365    pub fn set_mysql_columns<T, V>(mut self, v: T) -> Self
7366    where
7367        T: std::iter::IntoIterator<Item = V>,
7368        V: std::convert::Into<crate::model::MysqlColumn>,
7369    {
7370        use std::iter::Iterator;
7371        self.mysql_columns = v.into_iter().map(|i| i.into()).collect();
7372        self
7373    }
7374}
7375
7376impl wkt::message::Message for MysqlTable {
7377    fn typename() -> &'static str {
7378        "type.googleapis.com/google.cloud.datastream.v1.MysqlTable"
7379    }
7380}
7381
7382/// MySQL database.
7383#[derive(Clone, Default, PartialEq)]
7384#[non_exhaustive]
7385pub struct MysqlDatabase {
7386    /// Database name.
7387    pub database: std::string::String,
7388
7389    /// Tables in the database.
7390    pub mysql_tables: std::vec::Vec<crate::model::MysqlTable>,
7391
7392    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7393}
7394
7395impl MysqlDatabase {
7396    pub fn new() -> Self {
7397        std::default::Default::default()
7398    }
7399
7400    /// Sets the value of [database][crate::model::MysqlDatabase::database].
7401    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7402        self.database = v.into();
7403        self
7404    }
7405
7406    /// Sets the value of [mysql_tables][crate::model::MysqlDatabase::mysql_tables].
7407    pub fn set_mysql_tables<T, V>(mut self, v: T) -> Self
7408    where
7409        T: std::iter::IntoIterator<Item = V>,
7410        V: std::convert::Into<crate::model::MysqlTable>,
7411    {
7412        use std::iter::Iterator;
7413        self.mysql_tables = v.into_iter().map(|i| i.into()).collect();
7414        self
7415    }
7416}
7417
7418impl wkt::message::Message for MysqlDatabase {
7419    fn typename() -> &'static str {
7420        "type.googleapis.com/google.cloud.datastream.v1.MysqlDatabase"
7421    }
7422}
7423
7424/// MySQL database structure
7425#[derive(Clone, Default, PartialEq)]
7426#[non_exhaustive]
7427pub struct MysqlRdbms {
7428    /// Mysql databases on the server
7429    pub mysql_databases: std::vec::Vec<crate::model::MysqlDatabase>,
7430
7431    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7432}
7433
7434impl MysqlRdbms {
7435    pub fn new() -> Self {
7436        std::default::Default::default()
7437    }
7438
7439    /// Sets the value of [mysql_databases][crate::model::MysqlRdbms::mysql_databases].
7440    pub fn set_mysql_databases<T, V>(mut self, v: T) -> Self
7441    where
7442        T: std::iter::IntoIterator<Item = V>,
7443        V: std::convert::Into<crate::model::MysqlDatabase>,
7444    {
7445        use std::iter::Iterator;
7446        self.mysql_databases = v.into_iter().map(|i| i.into()).collect();
7447        self
7448    }
7449}
7450
7451impl wkt::message::Message for MysqlRdbms {
7452    fn typename() -> &'static str {
7453        "type.googleapis.com/google.cloud.datastream.v1.MysqlRdbms"
7454    }
7455}
7456
7457/// MySQL source configuration
7458#[derive(Clone, Default, PartialEq)]
7459#[non_exhaustive]
7460pub struct MysqlSourceConfig {
7461    /// MySQL objects to retrieve from the source.
7462    pub include_objects: std::option::Option<crate::model::MysqlRdbms>,
7463
7464    /// MySQL objects to exclude from the stream.
7465    pub exclude_objects: std::option::Option<crate::model::MysqlRdbms>,
7466
7467    /// Maximum number of concurrent CDC tasks. The number should be non negative.
7468    /// If not set (or set to 0), the system's default value will be used.
7469    pub max_concurrent_cdc_tasks: i32,
7470
7471    /// Maximum number of concurrent backfill tasks. The number should be non
7472    /// negative. If not set (or set to 0), the system's default value will be
7473    /// used.
7474    pub max_concurrent_backfill_tasks: i32,
7475
7476    /// The CDC method to use for the stream.
7477    pub cdc_method: std::option::Option<crate::model::mysql_source_config::CdcMethod>,
7478
7479    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7480}
7481
7482impl MysqlSourceConfig {
7483    pub fn new() -> Self {
7484        std::default::Default::default()
7485    }
7486
7487    /// Sets the value of [include_objects][crate::model::MysqlSourceConfig::include_objects].
7488    pub fn set_include_objects<T>(mut self, v: T) -> Self
7489    where
7490        T: std::convert::Into<crate::model::MysqlRdbms>,
7491    {
7492        self.include_objects = std::option::Option::Some(v.into());
7493        self
7494    }
7495
7496    /// Sets or clears the value of [include_objects][crate::model::MysqlSourceConfig::include_objects].
7497    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
7498    where
7499        T: std::convert::Into<crate::model::MysqlRdbms>,
7500    {
7501        self.include_objects = v.map(|x| x.into());
7502        self
7503    }
7504
7505    /// Sets the value of [exclude_objects][crate::model::MysqlSourceConfig::exclude_objects].
7506    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
7507    where
7508        T: std::convert::Into<crate::model::MysqlRdbms>,
7509    {
7510        self.exclude_objects = std::option::Option::Some(v.into());
7511        self
7512    }
7513
7514    /// Sets or clears the value of [exclude_objects][crate::model::MysqlSourceConfig::exclude_objects].
7515    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
7516    where
7517        T: std::convert::Into<crate::model::MysqlRdbms>,
7518    {
7519        self.exclude_objects = v.map(|x| x.into());
7520        self
7521    }
7522
7523    /// Sets the value of [max_concurrent_cdc_tasks][crate::model::MysqlSourceConfig::max_concurrent_cdc_tasks].
7524    pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7525        self.max_concurrent_cdc_tasks = v.into();
7526        self
7527    }
7528
7529    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::MysqlSourceConfig::max_concurrent_backfill_tasks].
7530    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7531        self.max_concurrent_backfill_tasks = v.into();
7532        self
7533    }
7534
7535    /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method].
7536    ///
7537    /// Note that all the setters affecting `cdc_method` are mutually
7538    /// exclusive.
7539    pub fn set_cdc_method<
7540        T: std::convert::Into<std::option::Option<crate::model::mysql_source_config::CdcMethod>>,
7541    >(
7542        mut self,
7543        v: T,
7544    ) -> Self {
7545        self.cdc_method = v.into();
7546        self
7547    }
7548
7549    /// The value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
7550    /// if it holds a `BinaryLogPosition`, `None` if the field is not set or
7551    /// holds a different branch.
7552    pub fn binary_log_position(
7553        &self,
7554    ) -> std::option::Option<&std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>>
7555    {
7556        #[allow(unreachable_patterns)]
7557        self.cdc_method.as_ref().and_then(|v| match v {
7558            crate::model::mysql_source_config::CdcMethod::BinaryLogPosition(v) => {
7559                std::option::Option::Some(v)
7560            }
7561            _ => std::option::Option::None,
7562        })
7563    }
7564
7565    /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
7566    /// to hold a `BinaryLogPosition`.
7567    ///
7568    /// Note that all the setters affecting `cdc_method` are
7569    /// mutually exclusive.
7570    pub fn set_binary_log_position<
7571        T: std::convert::Into<std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>>,
7572    >(
7573        mut self,
7574        v: T,
7575    ) -> Self {
7576        self.cdc_method = std::option::Option::Some(
7577            crate::model::mysql_source_config::CdcMethod::BinaryLogPosition(v.into()),
7578        );
7579        self
7580    }
7581
7582    /// The value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
7583    /// if it holds a `Gtid`, `None` if the field is not set or
7584    /// holds a different branch.
7585    pub fn gtid(
7586        &self,
7587    ) -> std::option::Option<&std::boxed::Box<crate::model::mysql_source_config::Gtid>> {
7588        #[allow(unreachable_patterns)]
7589        self.cdc_method.as_ref().and_then(|v| match v {
7590            crate::model::mysql_source_config::CdcMethod::Gtid(v) => std::option::Option::Some(v),
7591            _ => std::option::Option::None,
7592        })
7593    }
7594
7595    /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
7596    /// to hold a `Gtid`.
7597    ///
7598    /// Note that all the setters affecting `cdc_method` are
7599    /// mutually exclusive.
7600    pub fn set_gtid<
7601        T: std::convert::Into<std::boxed::Box<crate::model::mysql_source_config::Gtid>>,
7602    >(
7603        mut self,
7604        v: T,
7605    ) -> Self {
7606        self.cdc_method =
7607            std::option::Option::Some(crate::model::mysql_source_config::CdcMethod::Gtid(v.into()));
7608        self
7609    }
7610}
7611
7612impl wkt::message::Message for MysqlSourceConfig {
7613    fn typename() -> &'static str {
7614        "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig"
7615    }
7616}
7617
7618/// Defines additional types related to [MysqlSourceConfig].
7619pub mod mysql_source_config {
7620    #[allow(unused_imports)]
7621    use super::*;
7622
7623    /// Use Binary log position based replication.
7624    #[derive(Clone, Default, PartialEq)]
7625    #[non_exhaustive]
7626    pub struct BinaryLogPosition {
7627        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7628    }
7629
7630    impl BinaryLogPosition {
7631        pub fn new() -> Self {
7632            std::default::Default::default()
7633        }
7634    }
7635
7636    impl wkt::message::Message for BinaryLogPosition {
7637        fn typename() -> &'static str {
7638            "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig.BinaryLogPosition"
7639        }
7640    }
7641
7642    /// Use GTID based replication.
7643    #[derive(Clone, Default, PartialEq)]
7644    #[non_exhaustive]
7645    pub struct Gtid {
7646        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7647    }
7648
7649    impl Gtid {
7650        pub fn new() -> Self {
7651            std::default::Default::default()
7652        }
7653    }
7654
7655    impl wkt::message::Message for Gtid {
7656        fn typename() -> &'static str {
7657            "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig.Gtid"
7658        }
7659    }
7660
7661    /// The CDC method to use for the stream.
7662    #[derive(Clone, Debug, PartialEq)]
7663    #[non_exhaustive]
7664    pub enum CdcMethod {
7665        /// Use Binary log position based replication.
7666        BinaryLogPosition(std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>),
7667        /// Use GTID based replication.
7668        Gtid(std::boxed::Box<crate::model::mysql_source_config::Gtid>),
7669    }
7670}
7671
7672/// Salesforce source configuration
7673#[derive(Clone, Default, PartialEq)]
7674#[non_exhaustive]
7675pub struct SalesforceSourceConfig {
7676    /// Salesforce objects to retrieve from the source.
7677    pub include_objects: std::option::Option<crate::model::SalesforceOrg>,
7678
7679    /// Salesforce objects to exclude from the stream.
7680    pub exclude_objects: std::option::Option<crate::model::SalesforceOrg>,
7681
7682    /// Required. Salesforce objects polling interval. The interval at which new
7683    /// changes will be polled for each object. The duration must be between 5
7684    /// minutes and 24 hours.
7685    pub polling_interval: std::option::Option<wkt::Duration>,
7686
7687    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7688}
7689
7690impl SalesforceSourceConfig {
7691    pub fn new() -> Self {
7692        std::default::Default::default()
7693    }
7694
7695    /// Sets the value of [include_objects][crate::model::SalesforceSourceConfig::include_objects].
7696    pub fn set_include_objects<T>(mut self, v: T) -> Self
7697    where
7698        T: std::convert::Into<crate::model::SalesforceOrg>,
7699    {
7700        self.include_objects = std::option::Option::Some(v.into());
7701        self
7702    }
7703
7704    /// Sets or clears the value of [include_objects][crate::model::SalesforceSourceConfig::include_objects].
7705    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
7706    where
7707        T: std::convert::Into<crate::model::SalesforceOrg>,
7708    {
7709        self.include_objects = v.map(|x| x.into());
7710        self
7711    }
7712
7713    /// Sets the value of [exclude_objects][crate::model::SalesforceSourceConfig::exclude_objects].
7714    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
7715    where
7716        T: std::convert::Into<crate::model::SalesforceOrg>,
7717    {
7718        self.exclude_objects = std::option::Option::Some(v.into());
7719        self
7720    }
7721
7722    /// Sets or clears the value of [exclude_objects][crate::model::SalesforceSourceConfig::exclude_objects].
7723    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
7724    where
7725        T: std::convert::Into<crate::model::SalesforceOrg>,
7726    {
7727        self.exclude_objects = v.map(|x| x.into());
7728        self
7729    }
7730
7731    /// Sets the value of [polling_interval][crate::model::SalesforceSourceConfig::polling_interval].
7732    pub fn set_polling_interval<T>(mut self, v: T) -> Self
7733    where
7734        T: std::convert::Into<wkt::Duration>,
7735    {
7736        self.polling_interval = std::option::Option::Some(v.into());
7737        self
7738    }
7739
7740    /// Sets or clears the value of [polling_interval][crate::model::SalesforceSourceConfig::polling_interval].
7741    pub fn set_or_clear_polling_interval<T>(mut self, v: std::option::Option<T>) -> Self
7742    where
7743        T: std::convert::Into<wkt::Duration>,
7744    {
7745        self.polling_interval = v.map(|x| x.into());
7746        self
7747    }
7748}
7749
7750impl wkt::message::Message for SalesforceSourceConfig {
7751    fn typename() -> &'static str {
7752        "type.googleapis.com/google.cloud.datastream.v1.SalesforceSourceConfig"
7753    }
7754}
7755
7756/// Salesforce organization structure.
7757#[derive(Clone, Default, PartialEq)]
7758#[non_exhaustive]
7759pub struct SalesforceOrg {
7760    /// Salesforce objects in the database server.
7761    pub objects: std::vec::Vec<crate::model::SalesforceObject>,
7762
7763    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7764}
7765
7766impl SalesforceOrg {
7767    pub fn new() -> Self {
7768        std::default::Default::default()
7769    }
7770
7771    /// Sets the value of [objects][crate::model::SalesforceOrg::objects].
7772    pub fn set_objects<T, V>(mut self, v: T) -> Self
7773    where
7774        T: std::iter::IntoIterator<Item = V>,
7775        V: std::convert::Into<crate::model::SalesforceObject>,
7776    {
7777        use std::iter::Iterator;
7778        self.objects = v.into_iter().map(|i| i.into()).collect();
7779        self
7780    }
7781}
7782
7783impl wkt::message::Message for SalesforceOrg {
7784    fn typename() -> &'static str {
7785        "type.googleapis.com/google.cloud.datastream.v1.SalesforceOrg"
7786    }
7787}
7788
7789/// Salesforce object.
7790#[derive(Clone, Default, PartialEq)]
7791#[non_exhaustive]
7792pub struct SalesforceObject {
7793    /// Object name.
7794    pub object_name: std::string::String,
7795
7796    /// Salesforce fields.
7797    /// When unspecified as part of include objects,
7798    /// includes everything, when unspecified as part of exclude objects,
7799    /// excludes nothing.
7800    pub fields: std::vec::Vec<crate::model::SalesforceField>,
7801
7802    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7803}
7804
7805impl SalesforceObject {
7806    pub fn new() -> Self {
7807        std::default::Default::default()
7808    }
7809
7810    /// Sets the value of [object_name][crate::model::SalesforceObject::object_name].
7811    pub fn set_object_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7812        self.object_name = v.into();
7813        self
7814    }
7815
7816    /// Sets the value of [fields][crate::model::SalesforceObject::fields].
7817    pub fn set_fields<T, V>(mut self, v: T) -> Self
7818    where
7819        T: std::iter::IntoIterator<Item = V>,
7820        V: std::convert::Into<crate::model::SalesforceField>,
7821    {
7822        use std::iter::Iterator;
7823        self.fields = v.into_iter().map(|i| i.into()).collect();
7824        self
7825    }
7826}
7827
7828impl wkt::message::Message for SalesforceObject {
7829    fn typename() -> &'static str {
7830        "type.googleapis.com/google.cloud.datastream.v1.SalesforceObject"
7831    }
7832}
7833
7834/// Salesforce field.
7835#[derive(Clone, Default, PartialEq)]
7836#[non_exhaustive]
7837pub struct SalesforceField {
7838    /// Field name.
7839    pub name: std::string::String,
7840
7841    /// The data type.
7842    pub data_type: std::string::String,
7843
7844    /// Indicates whether the field can accept nil values.
7845    pub nillable: bool,
7846
7847    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7848}
7849
7850impl SalesforceField {
7851    pub fn new() -> Self {
7852        std::default::Default::default()
7853    }
7854
7855    /// Sets the value of [name][crate::model::SalesforceField::name].
7856    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7857        self.name = v.into();
7858        self
7859    }
7860
7861    /// Sets the value of [data_type][crate::model::SalesforceField::data_type].
7862    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7863        self.data_type = v.into();
7864        self
7865    }
7866
7867    /// Sets the value of [nillable][crate::model::SalesforceField::nillable].
7868    pub fn set_nillable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7869        self.nillable = v.into();
7870        self
7871    }
7872}
7873
7874impl wkt::message::Message for SalesforceField {
7875    fn typename() -> &'static str {
7876        "type.googleapis.com/google.cloud.datastream.v1.SalesforceField"
7877    }
7878}
7879
7880/// MongoDB source configuration.
7881#[derive(Clone, Default, PartialEq)]
7882#[non_exhaustive]
7883pub struct MongodbSourceConfig {
7884    /// MongoDB collections to include in the stream.
7885    pub include_objects: std::option::Option<crate::model::MongodbCluster>,
7886
7887    /// MongoDB collections to exclude from the stream.
7888    pub exclude_objects: std::option::Option<crate::model::MongodbCluster>,
7889
7890    /// Optional. Maximum number of concurrent backfill tasks. The number should be
7891    /// non-negative and less than or equal to 50. If not set (or set to 0), the
7892    /// system's default value is used
7893    pub max_concurrent_backfill_tasks: i32,
7894
7895    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7896}
7897
7898impl MongodbSourceConfig {
7899    pub fn new() -> Self {
7900        std::default::Default::default()
7901    }
7902
7903    /// Sets the value of [include_objects][crate::model::MongodbSourceConfig::include_objects].
7904    pub fn set_include_objects<T>(mut self, v: T) -> Self
7905    where
7906        T: std::convert::Into<crate::model::MongodbCluster>,
7907    {
7908        self.include_objects = std::option::Option::Some(v.into());
7909        self
7910    }
7911
7912    /// Sets or clears the value of [include_objects][crate::model::MongodbSourceConfig::include_objects].
7913    pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
7914    where
7915        T: std::convert::Into<crate::model::MongodbCluster>,
7916    {
7917        self.include_objects = v.map(|x| x.into());
7918        self
7919    }
7920
7921    /// Sets the value of [exclude_objects][crate::model::MongodbSourceConfig::exclude_objects].
7922    pub fn set_exclude_objects<T>(mut self, v: T) -> Self
7923    where
7924        T: std::convert::Into<crate::model::MongodbCluster>,
7925    {
7926        self.exclude_objects = std::option::Option::Some(v.into());
7927        self
7928    }
7929
7930    /// Sets or clears the value of [exclude_objects][crate::model::MongodbSourceConfig::exclude_objects].
7931    pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
7932    where
7933        T: std::convert::Into<crate::model::MongodbCluster>,
7934    {
7935        self.exclude_objects = v.map(|x| x.into());
7936        self
7937    }
7938
7939    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::MongodbSourceConfig::max_concurrent_backfill_tasks].
7940    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7941        self.max_concurrent_backfill_tasks = v.into();
7942        self
7943    }
7944}
7945
7946impl wkt::message::Message for MongodbSourceConfig {
7947    fn typename() -> &'static str {
7948        "type.googleapis.com/google.cloud.datastream.v1.MongodbSourceConfig"
7949    }
7950}
7951
7952/// MongoDB Cluster structure.
7953#[derive(Clone, Default, PartialEq)]
7954#[non_exhaustive]
7955pub struct MongodbCluster {
7956    /// MongoDB databases in the cluster.
7957    pub databases: std::vec::Vec<crate::model::MongodbDatabase>,
7958
7959    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7960}
7961
7962impl MongodbCluster {
7963    pub fn new() -> Self {
7964        std::default::Default::default()
7965    }
7966
7967    /// Sets the value of [databases][crate::model::MongodbCluster::databases].
7968    pub fn set_databases<T, V>(mut self, v: T) -> Self
7969    where
7970        T: std::iter::IntoIterator<Item = V>,
7971        V: std::convert::Into<crate::model::MongodbDatabase>,
7972    {
7973        use std::iter::Iterator;
7974        self.databases = v.into_iter().map(|i| i.into()).collect();
7975        self
7976    }
7977}
7978
7979impl wkt::message::Message for MongodbCluster {
7980    fn typename() -> &'static str {
7981        "type.googleapis.com/google.cloud.datastream.v1.MongodbCluster"
7982    }
7983}
7984
7985/// MongoDB Database.
7986#[derive(Clone, Default, PartialEq)]
7987#[non_exhaustive]
7988pub struct MongodbDatabase {
7989    /// Database name.
7990    pub database: std::string::String,
7991
7992    /// Collections in the database.
7993    pub collections: std::vec::Vec<crate::model::MongodbCollection>,
7994
7995    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7996}
7997
7998impl MongodbDatabase {
7999    pub fn new() -> Self {
8000        std::default::Default::default()
8001    }
8002
8003    /// Sets the value of [database][crate::model::MongodbDatabase::database].
8004    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8005        self.database = v.into();
8006        self
8007    }
8008
8009    /// Sets the value of [collections][crate::model::MongodbDatabase::collections].
8010    pub fn set_collections<T, V>(mut self, v: T) -> Self
8011    where
8012        T: std::iter::IntoIterator<Item = V>,
8013        V: std::convert::Into<crate::model::MongodbCollection>,
8014    {
8015        use std::iter::Iterator;
8016        self.collections = v.into_iter().map(|i| i.into()).collect();
8017        self
8018    }
8019}
8020
8021impl wkt::message::Message for MongodbDatabase {
8022    fn typename() -> &'static str {
8023        "type.googleapis.com/google.cloud.datastream.v1.MongodbDatabase"
8024    }
8025}
8026
8027/// MongoDB Collection.
8028#[derive(Clone, Default, PartialEq)]
8029#[non_exhaustive]
8030pub struct MongodbCollection {
8031    /// Collection name.
8032    pub collection: std::string::String,
8033
8034    /// Fields in the collection.
8035    pub fields: std::vec::Vec<crate::model::MongodbField>,
8036
8037    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8038}
8039
8040impl MongodbCollection {
8041    pub fn new() -> Self {
8042        std::default::Default::default()
8043    }
8044
8045    /// Sets the value of [collection][crate::model::MongodbCollection::collection].
8046    pub fn set_collection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8047        self.collection = v.into();
8048        self
8049    }
8050
8051    /// Sets the value of [fields][crate::model::MongodbCollection::fields].
8052    pub fn set_fields<T, V>(mut self, v: T) -> Self
8053    where
8054        T: std::iter::IntoIterator<Item = V>,
8055        V: std::convert::Into<crate::model::MongodbField>,
8056    {
8057        use std::iter::Iterator;
8058        self.fields = v.into_iter().map(|i| i.into()).collect();
8059        self
8060    }
8061}
8062
8063impl wkt::message::Message for MongodbCollection {
8064    fn typename() -> &'static str {
8065        "type.googleapis.com/google.cloud.datastream.v1.MongodbCollection"
8066    }
8067}
8068
8069/// MongoDB Field.
8070#[derive(Clone, Default, PartialEq)]
8071#[non_exhaustive]
8072pub struct MongodbField {
8073    /// Field name.
8074    pub field: std::string::String,
8075
8076    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8077}
8078
8079impl MongodbField {
8080    pub fn new() -> Self {
8081        std::default::Default::default()
8082    }
8083
8084    /// Sets the value of [field][crate::model::MongodbField::field].
8085    pub fn set_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8086        self.field = v.into();
8087        self
8088    }
8089}
8090
8091impl wkt::message::Message for MongodbField {
8092    fn typename() -> &'static str {
8093        "type.googleapis.com/google.cloud.datastream.v1.MongodbField"
8094    }
8095}
8096
8097/// The configuration of the stream source.
8098#[derive(Clone, Default, PartialEq)]
8099#[non_exhaustive]
8100pub struct SourceConfig {
8101    /// Required. Source connection profile resource.
8102    /// Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
8103    pub source_connection_profile: std::string::String,
8104
8105    /// Stream configuration that is specific to the data source type.
8106    pub source_stream_config: std::option::Option<crate::model::source_config::SourceStreamConfig>,
8107
8108    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8109}
8110
8111impl SourceConfig {
8112    pub fn new() -> Self {
8113        std::default::Default::default()
8114    }
8115
8116    /// Sets the value of [source_connection_profile][crate::model::SourceConfig::source_connection_profile].
8117    pub fn set_source_connection_profile<T: std::convert::Into<std::string::String>>(
8118        mut self,
8119        v: T,
8120    ) -> Self {
8121        self.source_connection_profile = v.into();
8122        self
8123    }
8124
8125    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config].
8126    ///
8127    /// Note that all the setters affecting `source_stream_config` are mutually
8128    /// exclusive.
8129    pub fn set_source_stream_config<
8130        T: std::convert::Into<std::option::Option<crate::model::source_config::SourceStreamConfig>>,
8131    >(
8132        mut self,
8133        v: T,
8134    ) -> Self {
8135        self.source_stream_config = v.into();
8136        self
8137    }
8138
8139    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
8140    /// if it holds a `OracleSourceConfig`, `None` if the field is not set or
8141    /// holds a different branch.
8142    pub fn oracle_source_config(
8143        &self,
8144    ) -> std::option::Option<&std::boxed::Box<crate::model::OracleSourceConfig>> {
8145        #[allow(unreachable_patterns)]
8146        self.source_stream_config.as_ref().and_then(|v| match v {
8147            crate::model::source_config::SourceStreamConfig::OracleSourceConfig(v) => {
8148                std::option::Option::Some(v)
8149            }
8150            _ => std::option::Option::None,
8151        })
8152    }
8153
8154    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
8155    /// to hold a `OracleSourceConfig`.
8156    ///
8157    /// Note that all the setters affecting `source_stream_config` are
8158    /// mutually exclusive.
8159    pub fn set_oracle_source_config<
8160        T: std::convert::Into<std::boxed::Box<crate::model::OracleSourceConfig>>,
8161    >(
8162        mut self,
8163        v: T,
8164    ) -> Self {
8165        self.source_stream_config = std::option::Option::Some(
8166            crate::model::source_config::SourceStreamConfig::OracleSourceConfig(v.into()),
8167        );
8168        self
8169    }
8170
8171    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
8172    /// if it holds a `MysqlSourceConfig`, `None` if the field is not set or
8173    /// holds a different branch.
8174    pub fn mysql_source_config(
8175        &self,
8176    ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlSourceConfig>> {
8177        #[allow(unreachable_patterns)]
8178        self.source_stream_config.as_ref().and_then(|v| match v {
8179            crate::model::source_config::SourceStreamConfig::MysqlSourceConfig(v) => {
8180                std::option::Option::Some(v)
8181            }
8182            _ => std::option::Option::None,
8183        })
8184    }
8185
8186    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
8187    /// to hold a `MysqlSourceConfig`.
8188    ///
8189    /// Note that all the setters affecting `source_stream_config` are
8190    /// mutually exclusive.
8191    pub fn set_mysql_source_config<
8192        T: std::convert::Into<std::boxed::Box<crate::model::MysqlSourceConfig>>,
8193    >(
8194        mut self,
8195        v: T,
8196    ) -> Self {
8197        self.source_stream_config = std::option::Option::Some(
8198            crate::model::source_config::SourceStreamConfig::MysqlSourceConfig(v.into()),
8199        );
8200        self
8201    }
8202
8203    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
8204    /// if it holds a `PostgresqlSourceConfig`, `None` if the field is not set or
8205    /// holds a different branch.
8206    pub fn postgresql_source_config(
8207        &self,
8208    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlSourceConfig>> {
8209        #[allow(unreachable_patterns)]
8210        self.source_stream_config.as_ref().and_then(|v| match v {
8211            crate::model::source_config::SourceStreamConfig::PostgresqlSourceConfig(v) => {
8212                std::option::Option::Some(v)
8213            }
8214            _ => std::option::Option::None,
8215        })
8216    }
8217
8218    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
8219    /// to hold a `PostgresqlSourceConfig`.
8220    ///
8221    /// Note that all the setters affecting `source_stream_config` are
8222    /// mutually exclusive.
8223    pub fn set_postgresql_source_config<
8224        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlSourceConfig>>,
8225    >(
8226        mut self,
8227        v: T,
8228    ) -> Self {
8229        self.source_stream_config = std::option::Option::Some(
8230            crate::model::source_config::SourceStreamConfig::PostgresqlSourceConfig(v.into()),
8231        );
8232        self
8233    }
8234
8235    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
8236    /// if it holds a `SqlServerSourceConfig`, `None` if the field is not set or
8237    /// holds a different branch.
8238    pub fn sql_server_source_config(
8239        &self,
8240    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerSourceConfig>> {
8241        #[allow(unreachable_patterns)]
8242        self.source_stream_config.as_ref().and_then(|v| match v {
8243            crate::model::source_config::SourceStreamConfig::SqlServerSourceConfig(v) => {
8244                std::option::Option::Some(v)
8245            }
8246            _ => std::option::Option::None,
8247        })
8248    }
8249
8250    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
8251    /// to hold a `SqlServerSourceConfig`.
8252    ///
8253    /// Note that all the setters affecting `source_stream_config` are
8254    /// mutually exclusive.
8255    pub fn set_sql_server_source_config<
8256        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerSourceConfig>>,
8257    >(
8258        mut self,
8259        v: T,
8260    ) -> Self {
8261        self.source_stream_config = std::option::Option::Some(
8262            crate::model::source_config::SourceStreamConfig::SqlServerSourceConfig(v.into()),
8263        );
8264        self
8265    }
8266
8267    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
8268    /// if it holds a `SalesforceSourceConfig`, `None` if the field is not set or
8269    /// holds a different branch.
8270    pub fn salesforce_source_config(
8271        &self,
8272    ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceSourceConfig>> {
8273        #[allow(unreachable_patterns)]
8274        self.source_stream_config.as_ref().and_then(|v| match v {
8275            crate::model::source_config::SourceStreamConfig::SalesforceSourceConfig(v) => {
8276                std::option::Option::Some(v)
8277            }
8278            _ => std::option::Option::None,
8279        })
8280    }
8281
8282    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
8283    /// to hold a `SalesforceSourceConfig`.
8284    ///
8285    /// Note that all the setters affecting `source_stream_config` are
8286    /// mutually exclusive.
8287    pub fn set_salesforce_source_config<
8288        T: std::convert::Into<std::boxed::Box<crate::model::SalesforceSourceConfig>>,
8289    >(
8290        mut self,
8291        v: T,
8292    ) -> Self {
8293        self.source_stream_config = std::option::Option::Some(
8294            crate::model::source_config::SourceStreamConfig::SalesforceSourceConfig(v.into()),
8295        );
8296        self
8297    }
8298
8299    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
8300    /// if it holds a `MongodbSourceConfig`, `None` if the field is not set or
8301    /// holds a different branch.
8302    pub fn mongodb_source_config(
8303        &self,
8304    ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbSourceConfig>> {
8305        #[allow(unreachable_patterns)]
8306        self.source_stream_config.as_ref().and_then(|v| match v {
8307            crate::model::source_config::SourceStreamConfig::MongodbSourceConfig(v) => {
8308                std::option::Option::Some(v)
8309            }
8310            _ => std::option::Option::None,
8311        })
8312    }
8313
8314    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
8315    /// to hold a `MongodbSourceConfig`.
8316    ///
8317    /// Note that all the setters affecting `source_stream_config` are
8318    /// mutually exclusive.
8319    pub fn set_mongodb_source_config<
8320        T: std::convert::Into<std::boxed::Box<crate::model::MongodbSourceConfig>>,
8321    >(
8322        mut self,
8323        v: T,
8324    ) -> Self {
8325        self.source_stream_config = std::option::Option::Some(
8326            crate::model::source_config::SourceStreamConfig::MongodbSourceConfig(v.into()),
8327        );
8328        self
8329    }
8330}
8331
8332impl wkt::message::Message for SourceConfig {
8333    fn typename() -> &'static str {
8334        "type.googleapis.com/google.cloud.datastream.v1.SourceConfig"
8335    }
8336}
8337
8338/// Defines additional types related to [SourceConfig].
8339pub mod source_config {
8340    #[allow(unused_imports)]
8341    use super::*;
8342
8343    /// Stream configuration that is specific to the data source type.
8344    #[derive(Clone, Debug, PartialEq)]
8345    #[non_exhaustive]
8346    pub enum SourceStreamConfig {
8347        /// Oracle data source configuration.
8348        OracleSourceConfig(std::boxed::Box<crate::model::OracleSourceConfig>),
8349        /// MySQL data source configuration.
8350        MysqlSourceConfig(std::boxed::Box<crate::model::MysqlSourceConfig>),
8351        /// PostgreSQL data source configuration.
8352        PostgresqlSourceConfig(std::boxed::Box<crate::model::PostgresqlSourceConfig>),
8353        /// SQLServer data source configuration.
8354        SqlServerSourceConfig(std::boxed::Box<crate::model::SqlServerSourceConfig>),
8355        /// Salesforce data source configuration.
8356        SalesforceSourceConfig(std::boxed::Box<crate::model::SalesforceSourceConfig>),
8357        /// MongoDB data source configuration.
8358        MongodbSourceConfig(std::boxed::Box<crate::model::MongodbSourceConfig>),
8359    }
8360}
8361
8362/// AVRO file format configuration.
8363#[derive(Clone, Default, PartialEq)]
8364#[non_exhaustive]
8365pub struct AvroFileFormat {
8366    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8367}
8368
8369impl AvroFileFormat {
8370    pub fn new() -> Self {
8371        std::default::Default::default()
8372    }
8373}
8374
8375impl wkt::message::Message for AvroFileFormat {
8376    fn typename() -> &'static str {
8377        "type.googleapis.com/google.cloud.datastream.v1.AvroFileFormat"
8378    }
8379}
8380
8381/// JSON file format configuration.
8382#[derive(Clone, Default, PartialEq)]
8383#[non_exhaustive]
8384pub struct JsonFileFormat {
8385    /// The schema file format along JSON data files.
8386    pub schema_file_format: crate::model::json_file_format::SchemaFileFormat,
8387
8388    /// Compression of the loaded JSON file.
8389    pub compression: crate::model::json_file_format::JsonCompression,
8390
8391    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8392}
8393
8394impl JsonFileFormat {
8395    pub fn new() -> Self {
8396        std::default::Default::default()
8397    }
8398
8399    /// Sets the value of [schema_file_format][crate::model::JsonFileFormat::schema_file_format].
8400    pub fn set_schema_file_format<
8401        T: std::convert::Into<crate::model::json_file_format::SchemaFileFormat>,
8402    >(
8403        mut self,
8404        v: T,
8405    ) -> Self {
8406        self.schema_file_format = v.into();
8407        self
8408    }
8409
8410    /// Sets the value of [compression][crate::model::JsonFileFormat::compression].
8411    pub fn set_compression<
8412        T: std::convert::Into<crate::model::json_file_format::JsonCompression>,
8413    >(
8414        mut self,
8415        v: T,
8416    ) -> Self {
8417        self.compression = v.into();
8418        self
8419    }
8420}
8421
8422impl wkt::message::Message for JsonFileFormat {
8423    fn typename() -> &'static str {
8424        "type.googleapis.com/google.cloud.datastream.v1.JsonFileFormat"
8425    }
8426}
8427
8428/// Defines additional types related to [JsonFileFormat].
8429pub mod json_file_format {
8430    #[allow(unused_imports)]
8431    use super::*;
8432
8433    /// Schema file format.
8434    ///
8435    /// # Working with unknown values
8436    ///
8437    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8438    /// additional enum variants at any time. Adding new variants is not considered
8439    /// a breaking change. Applications should write their code in anticipation of:
8440    ///
8441    /// - New values appearing in future releases of the client library, **and**
8442    /// - New values received dynamically, without application changes.
8443    ///
8444    /// Please consult the [Working with enums] section in the user guide for some
8445    /// guidelines.
8446    ///
8447    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8448    #[derive(Clone, Debug, PartialEq)]
8449    #[non_exhaustive]
8450    pub enum SchemaFileFormat {
8451        /// Unspecified schema file format.
8452        Unspecified,
8453        /// Do not attach schema file.
8454        NoSchemaFile,
8455        /// Avro schema format.
8456        AvroSchemaFile,
8457        /// If set, the enum was initialized with an unknown value.
8458        ///
8459        /// Applications can examine the value using [SchemaFileFormat::value] or
8460        /// [SchemaFileFormat::name].
8461        UnknownValue(schema_file_format::UnknownValue),
8462    }
8463
8464    #[doc(hidden)]
8465    pub mod schema_file_format {
8466        #[allow(unused_imports)]
8467        use super::*;
8468        #[derive(Clone, Debug, PartialEq)]
8469        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8470    }
8471
8472    impl SchemaFileFormat {
8473        /// Gets the enum value.
8474        ///
8475        /// Returns `None` if the enum contains an unknown value deserialized from
8476        /// the string representation of enums.
8477        pub fn value(&self) -> std::option::Option<i32> {
8478            match self {
8479                Self::Unspecified => std::option::Option::Some(0),
8480                Self::NoSchemaFile => std::option::Option::Some(1),
8481                Self::AvroSchemaFile => std::option::Option::Some(2),
8482                Self::UnknownValue(u) => u.0.value(),
8483            }
8484        }
8485
8486        /// Gets the enum value as a string.
8487        ///
8488        /// Returns `None` if the enum contains an unknown value deserialized from
8489        /// the integer representation of enums.
8490        pub fn name(&self) -> std::option::Option<&str> {
8491            match self {
8492                Self::Unspecified => std::option::Option::Some("SCHEMA_FILE_FORMAT_UNSPECIFIED"),
8493                Self::NoSchemaFile => std::option::Option::Some("NO_SCHEMA_FILE"),
8494                Self::AvroSchemaFile => std::option::Option::Some("AVRO_SCHEMA_FILE"),
8495                Self::UnknownValue(u) => u.0.name(),
8496            }
8497        }
8498    }
8499
8500    impl std::default::Default for SchemaFileFormat {
8501        fn default() -> Self {
8502            use std::convert::From;
8503            Self::from(0)
8504        }
8505    }
8506
8507    impl std::fmt::Display for SchemaFileFormat {
8508        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8509            wkt::internal::display_enum(f, self.name(), self.value())
8510        }
8511    }
8512
8513    impl std::convert::From<i32> for SchemaFileFormat {
8514        fn from(value: i32) -> Self {
8515            match value {
8516                0 => Self::Unspecified,
8517                1 => Self::NoSchemaFile,
8518                2 => Self::AvroSchemaFile,
8519                _ => Self::UnknownValue(schema_file_format::UnknownValue(
8520                    wkt::internal::UnknownEnumValue::Integer(value),
8521                )),
8522            }
8523        }
8524    }
8525
8526    impl std::convert::From<&str> for SchemaFileFormat {
8527        fn from(value: &str) -> Self {
8528            use std::string::ToString;
8529            match value {
8530                "SCHEMA_FILE_FORMAT_UNSPECIFIED" => Self::Unspecified,
8531                "NO_SCHEMA_FILE" => Self::NoSchemaFile,
8532                "AVRO_SCHEMA_FILE" => Self::AvroSchemaFile,
8533                _ => Self::UnknownValue(schema_file_format::UnknownValue(
8534                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8535                )),
8536            }
8537        }
8538    }
8539
8540    impl serde::ser::Serialize for SchemaFileFormat {
8541        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8542        where
8543            S: serde::Serializer,
8544        {
8545            match self {
8546                Self::Unspecified => serializer.serialize_i32(0),
8547                Self::NoSchemaFile => serializer.serialize_i32(1),
8548                Self::AvroSchemaFile => serializer.serialize_i32(2),
8549                Self::UnknownValue(u) => u.0.serialize(serializer),
8550            }
8551        }
8552    }
8553
8554    impl<'de> serde::de::Deserialize<'de> for SchemaFileFormat {
8555        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8556        where
8557            D: serde::Deserializer<'de>,
8558        {
8559            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SchemaFileFormat>::new(
8560                ".google.cloud.datastream.v1.JsonFileFormat.SchemaFileFormat",
8561            ))
8562        }
8563    }
8564
8565    /// Json file compression.
8566    ///
8567    /// # Working with unknown values
8568    ///
8569    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8570    /// additional enum variants at any time. Adding new variants is not considered
8571    /// a breaking change. Applications should write their code in anticipation of:
8572    ///
8573    /// - New values appearing in future releases of the client library, **and**
8574    /// - New values received dynamically, without application changes.
8575    ///
8576    /// Please consult the [Working with enums] section in the user guide for some
8577    /// guidelines.
8578    ///
8579    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8580    #[derive(Clone, Debug, PartialEq)]
8581    #[non_exhaustive]
8582    pub enum JsonCompression {
8583        /// Unspecified json file compression.
8584        Unspecified,
8585        /// Do not compress JSON file.
8586        NoCompression,
8587        /// Gzip compression.
8588        Gzip,
8589        /// If set, the enum was initialized with an unknown value.
8590        ///
8591        /// Applications can examine the value using [JsonCompression::value] or
8592        /// [JsonCompression::name].
8593        UnknownValue(json_compression::UnknownValue),
8594    }
8595
8596    #[doc(hidden)]
8597    pub mod json_compression {
8598        #[allow(unused_imports)]
8599        use super::*;
8600        #[derive(Clone, Debug, PartialEq)]
8601        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8602    }
8603
8604    impl JsonCompression {
8605        /// Gets the enum value.
8606        ///
8607        /// Returns `None` if the enum contains an unknown value deserialized from
8608        /// the string representation of enums.
8609        pub fn value(&self) -> std::option::Option<i32> {
8610            match self {
8611                Self::Unspecified => std::option::Option::Some(0),
8612                Self::NoCompression => std::option::Option::Some(1),
8613                Self::Gzip => std::option::Option::Some(2),
8614                Self::UnknownValue(u) => u.0.value(),
8615            }
8616        }
8617
8618        /// Gets the enum value as a string.
8619        ///
8620        /// Returns `None` if the enum contains an unknown value deserialized from
8621        /// the integer representation of enums.
8622        pub fn name(&self) -> std::option::Option<&str> {
8623            match self {
8624                Self::Unspecified => std::option::Option::Some("JSON_COMPRESSION_UNSPECIFIED"),
8625                Self::NoCompression => std::option::Option::Some("NO_COMPRESSION"),
8626                Self::Gzip => std::option::Option::Some("GZIP"),
8627                Self::UnknownValue(u) => u.0.name(),
8628            }
8629        }
8630    }
8631
8632    impl std::default::Default for JsonCompression {
8633        fn default() -> Self {
8634            use std::convert::From;
8635            Self::from(0)
8636        }
8637    }
8638
8639    impl std::fmt::Display for JsonCompression {
8640        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8641            wkt::internal::display_enum(f, self.name(), self.value())
8642        }
8643    }
8644
8645    impl std::convert::From<i32> for JsonCompression {
8646        fn from(value: i32) -> Self {
8647            match value {
8648                0 => Self::Unspecified,
8649                1 => Self::NoCompression,
8650                2 => Self::Gzip,
8651                _ => Self::UnknownValue(json_compression::UnknownValue(
8652                    wkt::internal::UnknownEnumValue::Integer(value),
8653                )),
8654            }
8655        }
8656    }
8657
8658    impl std::convert::From<&str> for JsonCompression {
8659        fn from(value: &str) -> Self {
8660            use std::string::ToString;
8661            match value {
8662                "JSON_COMPRESSION_UNSPECIFIED" => Self::Unspecified,
8663                "NO_COMPRESSION" => Self::NoCompression,
8664                "GZIP" => Self::Gzip,
8665                _ => Self::UnknownValue(json_compression::UnknownValue(
8666                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8667                )),
8668            }
8669        }
8670    }
8671
8672    impl serde::ser::Serialize for JsonCompression {
8673        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8674        where
8675            S: serde::Serializer,
8676        {
8677            match self {
8678                Self::Unspecified => serializer.serialize_i32(0),
8679                Self::NoCompression => serializer.serialize_i32(1),
8680                Self::Gzip => serializer.serialize_i32(2),
8681                Self::UnknownValue(u) => u.0.serialize(serializer),
8682            }
8683        }
8684    }
8685
8686    impl<'de> serde::de::Deserialize<'de> for JsonCompression {
8687        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8688        where
8689            D: serde::Deserializer<'de>,
8690        {
8691            deserializer.deserialize_any(wkt::internal::EnumVisitor::<JsonCompression>::new(
8692                ".google.cloud.datastream.v1.JsonFileFormat.JsonCompression",
8693            ))
8694        }
8695    }
8696}
8697
8698/// Google Cloud Storage destination configuration
8699#[derive(Clone, Default, PartialEq)]
8700#[non_exhaustive]
8701pub struct GcsDestinationConfig {
8702    /// Path inside the Cloud Storage bucket to write data to.
8703    pub path: std::string::String,
8704
8705    /// The maximum file size to be saved in the bucket.
8706    pub file_rotation_mb: i32,
8707
8708    /// The maximum duration for which new events are added before a file is
8709    /// closed and a new file is created. Values within the range of 15-60 seconds
8710    /// are allowed.
8711    pub file_rotation_interval: std::option::Option<wkt::Duration>,
8712
8713    /// File Format that the data should be written in.
8714    pub file_format: std::option::Option<crate::model::gcs_destination_config::FileFormat>,
8715
8716    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8717}
8718
8719impl GcsDestinationConfig {
8720    pub fn new() -> Self {
8721        std::default::Default::default()
8722    }
8723
8724    /// Sets the value of [path][crate::model::GcsDestinationConfig::path].
8725    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8726        self.path = v.into();
8727        self
8728    }
8729
8730    /// Sets the value of [file_rotation_mb][crate::model::GcsDestinationConfig::file_rotation_mb].
8731    pub fn set_file_rotation_mb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8732        self.file_rotation_mb = v.into();
8733        self
8734    }
8735
8736    /// Sets the value of [file_rotation_interval][crate::model::GcsDestinationConfig::file_rotation_interval].
8737    pub fn set_file_rotation_interval<T>(mut self, v: T) -> Self
8738    where
8739        T: std::convert::Into<wkt::Duration>,
8740    {
8741        self.file_rotation_interval = std::option::Option::Some(v.into());
8742        self
8743    }
8744
8745    /// Sets or clears the value of [file_rotation_interval][crate::model::GcsDestinationConfig::file_rotation_interval].
8746    pub fn set_or_clear_file_rotation_interval<T>(mut self, v: std::option::Option<T>) -> Self
8747    where
8748        T: std::convert::Into<wkt::Duration>,
8749    {
8750        self.file_rotation_interval = v.map(|x| x.into());
8751        self
8752    }
8753
8754    /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format].
8755    ///
8756    /// Note that all the setters affecting `file_format` are mutually
8757    /// exclusive.
8758    pub fn set_file_format<
8759        T: std::convert::Into<std::option::Option<crate::model::gcs_destination_config::FileFormat>>,
8760    >(
8761        mut self,
8762        v: T,
8763    ) -> Self {
8764        self.file_format = v.into();
8765        self
8766    }
8767
8768    /// The value of [file_format][crate::model::GcsDestinationConfig::file_format]
8769    /// if it holds a `AvroFileFormat`, `None` if the field is not set or
8770    /// holds a different branch.
8771    pub fn avro_file_format(
8772        &self,
8773    ) -> std::option::Option<&std::boxed::Box<crate::model::AvroFileFormat>> {
8774        #[allow(unreachable_patterns)]
8775        self.file_format.as_ref().and_then(|v| match v {
8776            crate::model::gcs_destination_config::FileFormat::AvroFileFormat(v) => {
8777                std::option::Option::Some(v)
8778            }
8779            _ => std::option::Option::None,
8780        })
8781    }
8782
8783    /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format]
8784    /// to hold a `AvroFileFormat`.
8785    ///
8786    /// Note that all the setters affecting `file_format` are
8787    /// mutually exclusive.
8788    pub fn set_avro_file_format<
8789        T: std::convert::Into<std::boxed::Box<crate::model::AvroFileFormat>>,
8790    >(
8791        mut self,
8792        v: T,
8793    ) -> Self {
8794        self.file_format = std::option::Option::Some(
8795            crate::model::gcs_destination_config::FileFormat::AvroFileFormat(v.into()),
8796        );
8797        self
8798    }
8799
8800    /// The value of [file_format][crate::model::GcsDestinationConfig::file_format]
8801    /// if it holds a `JsonFileFormat`, `None` if the field is not set or
8802    /// holds a different branch.
8803    pub fn json_file_format(
8804        &self,
8805    ) -> std::option::Option<&std::boxed::Box<crate::model::JsonFileFormat>> {
8806        #[allow(unreachable_patterns)]
8807        self.file_format.as_ref().and_then(|v| match v {
8808            crate::model::gcs_destination_config::FileFormat::JsonFileFormat(v) => {
8809                std::option::Option::Some(v)
8810            }
8811            _ => std::option::Option::None,
8812        })
8813    }
8814
8815    /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format]
8816    /// to hold a `JsonFileFormat`.
8817    ///
8818    /// Note that all the setters affecting `file_format` are
8819    /// mutually exclusive.
8820    pub fn set_json_file_format<
8821        T: std::convert::Into<std::boxed::Box<crate::model::JsonFileFormat>>,
8822    >(
8823        mut self,
8824        v: T,
8825    ) -> Self {
8826        self.file_format = std::option::Option::Some(
8827            crate::model::gcs_destination_config::FileFormat::JsonFileFormat(v.into()),
8828        );
8829        self
8830    }
8831}
8832
8833impl wkt::message::Message for GcsDestinationConfig {
8834    fn typename() -> &'static str {
8835        "type.googleapis.com/google.cloud.datastream.v1.GcsDestinationConfig"
8836    }
8837}
8838
8839/// Defines additional types related to [GcsDestinationConfig].
8840pub mod gcs_destination_config {
8841    #[allow(unused_imports)]
8842    use super::*;
8843
8844    /// File Format that the data should be written in.
8845    #[derive(Clone, Debug, PartialEq)]
8846    #[non_exhaustive]
8847    pub enum FileFormat {
8848        /// AVRO file format configuration.
8849        AvroFileFormat(std::boxed::Box<crate::model::AvroFileFormat>),
8850        /// JSON file format configuration.
8851        JsonFileFormat(std::boxed::Box<crate::model::JsonFileFormat>),
8852    }
8853}
8854
8855/// BigQuery destination configuration
8856#[derive(Clone, Default, PartialEq)]
8857#[non_exhaustive]
8858pub struct BigQueryDestinationConfig {
8859    /// The guaranteed data freshness (in seconds) when querying tables created by
8860    /// the stream. Editing this field will only affect new tables created in the
8861    /// future, but existing tables will not be impacted. Lower values mean that
8862    /// queries will return fresher data, but may result in higher cost.
8863    pub data_freshness: std::option::Option<wkt::Duration>,
8864
8865    /// Optional. Big Lake Managed Tables (BLMT) configuration.
8866    pub blmt_config: std::option::Option<crate::model::big_query_destination_config::BlmtConfig>,
8867
8868    /// Target dataset(s) configuration.
8869    pub dataset_config:
8870        std::option::Option<crate::model::big_query_destination_config::DatasetConfig>,
8871
8872    pub write_mode: std::option::Option<crate::model::big_query_destination_config::WriteMode>,
8873
8874    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8875}
8876
8877impl BigQueryDestinationConfig {
8878    pub fn new() -> Self {
8879        std::default::Default::default()
8880    }
8881
8882    /// Sets the value of [data_freshness][crate::model::BigQueryDestinationConfig::data_freshness].
8883    pub fn set_data_freshness<T>(mut self, v: T) -> Self
8884    where
8885        T: std::convert::Into<wkt::Duration>,
8886    {
8887        self.data_freshness = std::option::Option::Some(v.into());
8888        self
8889    }
8890
8891    /// Sets or clears the value of [data_freshness][crate::model::BigQueryDestinationConfig::data_freshness].
8892    pub fn set_or_clear_data_freshness<T>(mut self, v: std::option::Option<T>) -> Self
8893    where
8894        T: std::convert::Into<wkt::Duration>,
8895    {
8896        self.data_freshness = v.map(|x| x.into());
8897        self
8898    }
8899
8900    /// Sets the value of [blmt_config][crate::model::BigQueryDestinationConfig::blmt_config].
8901    pub fn set_blmt_config<T>(mut self, v: T) -> Self
8902    where
8903        T: std::convert::Into<crate::model::big_query_destination_config::BlmtConfig>,
8904    {
8905        self.blmt_config = std::option::Option::Some(v.into());
8906        self
8907    }
8908
8909    /// Sets or clears the value of [blmt_config][crate::model::BigQueryDestinationConfig::blmt_config].
8910    pub fn set_or_clear_blmt_config<T>(mut self, v: std::option::Option<T>) -> Self
8911    where
8912        T: std::convert::Into<crate::model::big_query_destination_config::BlmtConfig>,
8913    {
8914        self.blmt_config = v.map(|x| x.into());
8915        self
8916    }
8917
8918    /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config].
8919    ///
8920    /// Note that all the setters affecting `dataset_config` are mutually
8921    /// exclusive.
8922    pub fn set_dataset_config<
8923        T: std::convert::Into<
8924                std::option::Option<crate::model::big_query_destination_config::DatasetConfig>,
8925            >,
8926    >(
8927        mut self,
8928        v: T,
8929    ) -> Self {
8930        self.dataset_config = v.into();
8931        self
8932    }
8933
8934    /// The value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
8935    /// if it holds a `SingleTargetDataset`, `None` if the field is not set or
8936    /// holds a different branch.
8937    pub fn single_target_dataset(
8938        &self,
8939    ) -> std::option::Option<
8940        &std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
8941    > {
8942        #[allow(unreachable_patterns)]
8943        self.dataset_config.as_ref().and_then(|v| match v {
8944            crate::model::big_query_destination_config::DatasetConfig::SingleTargetDataset(v) => {
8945                std::option::Option::Some(v)
8946            }
8947            _ => std::option::Option::None,
8948        })
8949    }
8950
8951    /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
8952    /// to hold a `SingleTargetDataset`.
8953    ///
8954    /// Note that all the setters affecting `dataset_config` are
8955    /// mutually exclusive.
8956    pub fn set_single_target_dataset<
8957        T: std::convert::Into<
8958                std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
8959            >,
8960    >(
8961        mut self,
8962        v: T,
8963    ) -> Self {
8964        self.dataset_config = std::option::Option::Some(
8965            crate::model::big_query_destination_config::DatasetConfig::SingleTargetDataset(
8966                v.into(),
8967            ),
8968        );
8969        self
8970    }
8971
8972    /// The value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
8973    /// if it holds a `SourceHierarchyDatasets`, `None` if the field is not set or
8974    /// holds a different branch.
8975    pub fn source_hierarchy_datasets(
8976        &self,
8977    ) -> std::option::Option<
8978        &std::boxed::Box<crate::model::big_query_destination_config::SourceHierarchyDatasets>,
8979    > {
8980        #[allow(unreachable_patterns)]
8981        self.dataset_config.as_ref().and_then(|v| match v {
8982            crate::model::big_query_destination_config::DatasetConfig::SourceHierarchyDatasets(
8983                v,
8984            ) => std::option::Option::Some(v),
8985            _ => std::option::Option::None,
8986        })
8987    }
8988
8989    /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
8990    /// to hold a `SourceHierarchyDatasets`.
8991    ///
8992    /// Note that all the setters affecting `dataset_config` are
8993    /// mutually exclusive.
8994    pub fn set_source_hierarchy_datasets<
8995        T: std::convert::Into<
8996                std::boxed::Box<
8997                    crate::model::big_query_destination_config::SourceHierarchyDatasets,
8998                >,
8999            >,
9000    >(
9001        mut self,
9002        v: T,
9003    ) -> Self {
9004        self.dataset_config = std::option::Option::Some(
9005            crate::model::big_query_destination_config::DatasetConfig::SourceHierarchyDatasets(
9006                v.into(),
9007            ),
9008        );
9009        self
9010    }
9011
9012    /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode].
9013    ///
9014    /// Note that all the setters affecting `write_mode` are mutually
9015    /// exclusive.
9016    pub fn set_write_mode<
9017        T: std::convert::Into<
9018                std::option::Option<crate::model::big_query_destination_config::WriteMode>,
9019            >,
9020    >(
9021        mut self,
9022        v: T,
9023    ) -> Self {
9024        self.write_mode = v.into();
9025        self
9026    }
9027
9028    /// The value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
9029    /// if it holds a `Merge`, `None` if the field is not set or
9030    /// holds a different branch.
9031    pub fn merge(
9032        &self,
9033    ) -> std::option::Option<&std::boxed::Box<crate::model::big_query_destination_config::Merge>>
9034    {
9035        #[allow(unreachable_patterns)]
9036        self.write_mode.as_ref().and_then(|v| match v {
9037            crate::model::big_query_destination_config::WriteMode::Merge(v) => {
9038                std::option::Option::Some(v)
9039            }
9040            _ => std::option::Option::None,
9041        })
9042    }
9043
9044    /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
9045    /// to hold a `Merge`.
9046    ///
9047    /// Note that all the setters affecting `write_mode` are
9048    /// mutually exclusive.
9049    pub fn set_merge<
9050        T: std::convert::Into<std::boxed::Box<crate::model::big_query_destination_config::Merge>>,
9051    >(
9052        mut self,
9053        v: T,
9054    ) -> Self {
9055        self.write_mode = std::option::Option::Some(
9056            crate::model::big_query_destination_config::WriteMode::Merge(v.into()),
9057        );
9058        self
9059    }
9060
9061    /// The value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
9062    /// if it holds a `AppendOnly`, `None` if the field is not set or
9063    /// holds a different branch.
9064    pub fn append_only(
9065        &self,
9066    ) -> std::option::Option<&std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>>
9067    {
9068        #[allow(unreachable_patterns)]
9069        self.write_mode.as_ref().and_then(|v| match v {
9070            crate::model::big_query_destination_config::WriteMode::AppendOnly(v) => {
9071                std::option::Option::Some(v)
9072            }
9073            _ => std::option::Option::None,
9074        })
9075    }
9076
9077    /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
9078    /// to hold a `AppendOnly`.
9079    ///
9080    /// Note that all the setters affecting `write_mode` are
9081    /// mutually exclusive.
9082    pub fn set_append_only<
9083        T: std::convert::Into<std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>>,
9084    >(
9085        mut self,
9086        v: T,
9087    ) -> Self {
9088        self.write_mode = std::option::Option::Some(
9089            crate::model::big_query_destination_config::WriteMode::AppendOnly(v.into()),
9090        );
9091        self
9092    }
9093}
9094
9095impl wkt::message::Message for BigQueryDestinationConfig {
9096    fn typename() -> &'static str {
9097        "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig"
9098    }
9099}
9100
9101/// Defines additional types related to [BigQueryDestinationConfig].
9102pub mod big_query_destination_config {
9103    #[allow(unused_imports)]
9104    use super::*;
9105
9106    /// A single target dataset to which all data will be streamed.
9107    #[derive(Clone, Default, PartialEq)]
9108    #[non_exhaustive]
9109    pub struct SingleTargetDataset {
9110        /// The dataset ID of the target dataset.
9111        /// DatasetIds allowed characters:
9112        /// <https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets#datasetreference>.
9113        pub dataset_id: std::string::String,
9114
9115        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9116    }
9117
9118    impl SingleTargetDataset {
9119        pub fn new() -> Self {
9120            std::default::Default::default()
9121        }
9122
9123        /// Sets the value of [dataset_id][crate::model::big_query_destination_config::SingleTargetDataset::dataset_id].
9124        pub fn set_dataset_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9125            self.dataset_id = v.into();
9126            self
9127        }
9128    }
9129
9130    impl wkt::message::Message for SingleTargetDataset {
9131        fn typename() -> &'static str {
9132            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SingleTargetDataset"
9133        }
9134    }
9135
9136    /// Destination datasets are created so that hierarchy of the destination data
9137    /// objects matches the source hierarchy.
9138    #[derive(Clone, Default, PartialEq)]
9139    #[non_exhaustive]
9140    pub struct SourceHierarchyDatasets {
9141        /// The dataset template to use for dynamic dataset creation.
9142        pub dataset_template: std::option::Option<
9143            crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate,
9144        >,
9145
9146        /// Optional. The project id of the BigQuery dataset. If not specified, the
9147        /// project will be inferred from the stream resource.
9148        pub project_id: std::option::Option<std::string::String>,
9149
9150        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9151    }
9152
9153    impl SourceHierarchyDatasets {
9154        pub fn new() -> Self {
9155            std::default::Default::default()
9156        }
9157
9158        /// Sets the value of [dataset_template][crate::model::big_query_destination_config::SourceHierarchyDatasets::dataset_template].
9159        pub fn set_dataset_template<T>(mut self, v: T) -> Self
9160        where T: std::convert::Into<crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate>
9161        {
9162            self.dataset_template = std::option::Option::Some(v.into());
9163            self
9164        }
9165
9166        /// Sets or clears the value of [dataset_template][crate::model::big_query_destination_config::SourceHierarchyDatasets::dataset_template].
9167        pub fn set_or_clear_dataset_template<T>(mut self, v: std::option::Option<T>) -> Self
9168        where T: std::convert::Into<crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate>
9169        {
9170            self.dataset_template = v.map(|x| x.into());
9171            self
9172        }
9173
9174        /// Sets the value of [project_id][crate::model::big_query_destination_config::SourceHierarchyDatasets::project_id].
9175        pub fn set_project_id<T>(mut self, v: T) -> Self
9176        where
9177            T: std::convert::Into<std::string::String>,
9178        {
9179            self.project_id = std::option::Option::Some(v.into());
9180            self
9181        }
9182
9183        /// Sets or clears the value of [project_id][crate::model::big_query_destination_config::SourceHierarchyDatasets::project_id].
9184        pub fn set_or_clear_project_id<T>(mut self, v: std::option::Option<T>) -> Self
9185        where
9186            T: std::convert::Into<std::string::String>,
9187        {
9188            self.project_id = v.map(|x| x.into());
9189            self
9190        }
9191    }
9192
9193    impl wkt::message::Message for SourceHierarchyDatasets {
9194        fn typename() -> &'static str {
9195            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SourceHierarchyDatasets"
9196        }
9197    }
9198
9199    /// Defines additional types related to [SourceHierarchyDatasets].
9200    pub mod source_hierarchy_datasets {
9201        #[allow(unused_imports)]
9202        use super::*;
9203
9204        /// Dataset template used for dynamic dataset creation.
9205        #[derive(Clone, Default, PartialEq)]
9206        #[non_exhaustive]
9207        pub struct DatasetTemplate {
9208            /// Required. The geographic location where the dataset should reside. See
9209            /// <https://cloud.google.com/bigquery/docs/locations> for supported
9210            /// locations.
9211            pub location: std::string::String,
9212
9213            /// If supplied, every created dataset will have its name prefixed by the
9214            /// provided value. The prefix and name will be separated by an underscore.
9215            /// i.e. \<prefix\>_<dataset_name>.
9216            pub dataset_id_prefix: std::string::String,
9217
9218            /// Describes the Cloud KMS encryption key that will be used to
9219            /// protect destination BigQuery table. The BigQuery Service Account
9220            /// associated with your project requires access to this encryption key.
9221            /// i.e.
9222            /// projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{cryptoKey}.
9223            /// See <https://cloud.google.com/bigquery/docs/customer-managed-encryption>
9224            /// for more information.
9225            pub kms_key_name: std::string::String,
9226
9227            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9228        }
9229
9230        impl DatasetTemplate {
9231            pub fn new() -> Self {
9232                std::default::Default::default()
9233            }
9234
9235            /// Sets the value of [location][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::location].
9236            pub fn set_location<T: std::convert::Into<std::string::String>>(
9237                mut self,
9238                v: T,
9239            ) -> Self {
9240                self.location = v.into();
9241                self
9242            }
9243
9244            /// Sets the value of [dataset_id_prefix][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::dataset_id_prefix].
9245            pub fn set_dataset_id_prefix<T: std::convert::Into<std::string::String>>(
9246                mut self,
9247                v: T,
9248            ) -> Self {
9249                self.dataset_id_prefix = v.into();
9250                self
9251            }
9252
9253            /// Sets the value of [kms_key_name][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::kms_key_name].
9254            pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(
9255                mut self,
9256                v: T,
9257            ) -> Self {
9258                self.kms_key_name = v.into();
9259                self
9260            }
9261        }
9262
9263        impl wkt::message::Message for DatasetTemplate {
9264            fn typename() -> &'static str {
9265                "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SourceHierarchyDatasets.DatasetTemplate"
9266            }
9267        }
9268    }
9269
9270    /// The configuration for BLMT.
9271    #[derive(Clone, Default, PartialEq)]
9272    #[non_exhaustive]
9273    pub struct BlmtConfig {
9274        /// Required. The Cloud Storage bucket name.
9275        pub bucket: std::string::String,
9276
9277        /// The root path inside the Cloud Storage bucket.
9278        pub root_path: std::string::String,
9279
9280        /// Required. The bigquery connection.
9281        /// Format: `{project}.{location}.{name}`
9282        pub connection_name: std::string::String,
9283
9284        /// Required. The file format.
9285        pub file_format: crate::model::big_query_destination_config::blmt_config::FileFormat,
9286
9287        /// Required. The table format.
9288        pub table_format: crate::model::big_query_destination_config::blmt_config::TableFormat,
9289
9290        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9291    }
9292
9293    impl BlmtConfig {
9294        pub fn new() -> Self {
9295            std::default::Default::default()
9296        }
9297
9298        /// Sets the value of [bucket][crate::model::big_query_destination_config::BlmtConfig::bucket].
9299        pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9300            self.bucket = v.into();
9301            self
9302        }
9303
9304        /// Sets the value of [root_path][crate::model::big_query_destination_config::BlmtConfig::root_path].
9305        pub fn set_root_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9306            self.root_path = v.into();
9307            self
9308        }
9309
9310        /// Sets the value of [connection_name][crate::model::big_query_destination_config::BlmtConfig::connection_name].
9311        pub fn set_connection_name<T: std::convert::Into<std::string::String>>(
9312            mut self,
9313            v: T,
9314        ) -> Self {
9315            self.connection_name = v.into();
9316            self
9317        }
9318
9319        /// Sets the value of [file_format][crate::model::big_query_destination_config::BlmtConfig::file_format].
9320        pub fn set_file_format<
9321            T: std::convert::Into<crate::model::big_query_destination_config::blmt_config::FileFormat>,
9322        >(
9323            mut self,
9324            v: T,
9325        ) -> Self {
9326            self.file_format = v.into();
9327            self
9328        }
9329
9330        /// Sets the value of [table_format][crate::model::big_query_destination_config::BlmtConfig::table_format].
9331        pub fn set_table_format<
9332            T: std::convert::Into<
9333                    crate::model::big_query_destination_config::blmt_config::TableFormat,
9334                >,
9335        >(
9336            mut self,
9337            v: T,
9338        ) -> Self {
9339            self.table_format = v.into();
9340            self
9341        }
9342    }
9343
9344    impl wkt::message::Message for BlmtConfig {
9345        fn typename() -> &'static str {
9346            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig"
9347        }
9348    }
9349
9350    /// Defines additional types related to [BlmtConfig].
9351    pub mod blmt_config {
9352        #[allow(unused_imports)]
9353        use super::*;
9354
9355        /// Supported file formats for BigLake managed tables.
9356        ///
9357        /// # Working with unknown values
9358        ///
9359        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9360        /// additional enum variants at any time. Adding new variants is not considered
9361        /// a breaking change. Applications should write their code in anticipation of:
9362        ///
9363        /// - New values appearing in future releases of the client library, **and**
9364        /// - New values received dynamically, without application changes.
9365        ///
9366        /// Please consult the [Working with enums] section in the user guide for some
9367        /// guidelines.
9368        ///
9369        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9370        #[derive(Clone, Debug, PartialEq)]
9371        #[non_exhaustive]
9372        pub enum FileFormat {
9373            /// Default value.
9374            Unspecified,
9375            /// Parquet file format.
9376            Parquet,
9377            /// If set, the enum was initialized with an unknown value.
9378            ///
9379            /// Applications can examine the value using [FileFormat::value] or
9380            /// [FileFormat::name].
9381            UnknownValue(file_format::UnknownValue),
9382        }
9383
9384        #[doc(hidden)]
9385        pub mod file_format {
9386            #[allow(unused_imports)]
9387            use super::*;
9388            #[derive(Clone, Debug, PartialEq)]
9389            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9390        }
9391
9392        impl FileFormat {
9393            /// Gets the enum value.
9394            ///
9395            /// Returns `None` if the enum contains an unknown value deserialized from
9396            /// the string representation of enums.
9397            pub fn value(&self) -> std::option::Option<i32> {
9398                match self {
9399                    Self::Unspecified => std::option::Option::Some(0),
9400                    Self::Parquet => std::option::Option::Some(1),
9401                    Self::UnknownValue(u) => u.0.value(),
9402                }
9403            }
9404
9405            /// Gets the enum value as a string.
9406            ///
9407            /// Returns `None` if the enum contains an unknown value deserialized from
9408            /// the integer representation of enums.
9409            pub fn name(&self) -> std::option::Option<&str> {
9410                match self {
9411                    Self::Unspecified => std::option::Option::Some("FILE_FORMAT_UNSPECIFIED"),
9412                    Self::Parquet => std::option::Option::Some("PARQUET"),
9413                    Self::UnknownValue(u) => u.0.name(),
9414                }
9415            }
9416        }
9417
9418        impl std::default::Default for FileFormat {
9419            fn default() -> Self {
9420                use std::convert::From;
9421                Self::from(0)
9422            }
9423        }
9424
9425        impl std::fmt::Display for FileFormat {
9426            fn fmt(
9427                &self,
9428                f: &mut std::fmt::Formatter<'_>,
9429            ) -> std::result::Result<(), std::fmt::Error> {
9430                wkt::internal::display_enum(f, self.name(), self.value())
9431            }
9432        }
9433
9434        impl std::convert::From<i32> for FileFormat {
9435            fn from(value: i32) -> Self {
9436                match value {
9437                    0 => Self::Unspecified,
9438                    1 => Self::Parquet,
9439                    _ => Self::UnknownValue(file_format::UnknownValue(
9440                        wkt::internal::UnknownEnumValue::Integer(value),
9441                    )),
9442                }
9443            }
9444        }
9445
9446        impl std::convert::From<&str> for FileFormat {
9447            fn from(value: &str) -> Self {
9448                use std::string::ToString;
9449                match value {
9450                    "FILE_FORMAT_UNSPECIFIED" => Self::Unspecified,
9451                    "PARQUET" => Self::Parquet,
9452                    _ => Self::UnknownValue(file_format::UnknownValue(
9453                        wkt::internal::UnknownEnumValue::String(value.to_string()),
9454                    )),
9455                }
9456            }
9457        }
9458
9459        impl serde::ser::Serialize for FileFormat {
9460            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9461            where
9462                S: serde::Serializer,
9463            {
9464                match self {
9465                    Self::Unspecified => serializer.serialize_i32(0),
9466                    Self::Parquet => serializer.serialize_i32(1),
9467                    Self::UnknownValue(u) => u.0.serialize(serializer),
9468                }
9469            }
9470        }
9471
9472        impl<'de> serde::de::Deserialize<'de> for FileFormat {
9473            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9474            where
9475                D: serde::Deserializer<'de>,
9476            {
9477                deserializer.deserialize_any(wkt::internal::EnumVisitor::<FileFormat>::new(
9478                    ".google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig.FileFormat",
9479                ))
9480            }
9481        }
9482
9483        /// Supported table formats for BigLake managed tables.
9484        ///
9485        /// # Working with unknown values
9486        ///
9487        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9488        /// additional enum variants at any time. Adding new variants is not considered
9489        /// a breaking change. Applications should write their code in anticipation of:
9490        ///
9491        /// - New values appearing in future releases of the client library, **and**
9492        /// - New values received dynamically, without application changes.
9493        ///
9494        /// Please consult the [Working with enums] section in the user guide for some
9495        /// guidelines.
9496        ///
9497        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9498        #[derive(Clone, Debug, PartialEq)]
9499        #[non_exhaustive]
9500        pub enum TableFormat {
9501            /// Default value.
9502            Unspecified,
9503            /// Iceberg table format.
9504            Iceberg,
9505            /// If set, the enum was initialized with an unknown value.
9506            ///
9507            /// Applications can examine the value using [TableFormat::value] or
9508            /// [TableFormat::name].
9509            UnknownValue(table_format::UnknownValue),
9510        }
9511
9512        #[doc(hidden)]
9513        pub mod table_format {
9514            #[allow(unused_imports)]
9515            use super::*;
9516            #[derive(Clone, Debug, PartialEq)]
9517            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9518        }
9519
9520        impl TableFormat {
9521            /// Gets the enum value.
9522            ///
9523            /// Returns `None` if the enum contains an unknown value deserialized from
9524            /// the string representation of enums.
9525            pub fn value(&self) -> std::option::Option<i32> {
9526                match self {
9527                    Self::Unspecified => std::option::Option::Some(0),
9528                    Self::Iceberg => std::option::Option::Some(1),
9529                    Self::UnknownValue(u) => u.0.value(),
9530                }
9531            }
9532
9533            /// Gets the enum value as a string.
9534            ///
9535            /// Returns `None` if the enum contains an unknown value deserialized from
9536            /// the integer representation of enums.
9537            pub fn name(&self) -> std::option::Option<&str> {
9538                match self {
9539                    Self::Unspecified => std::option::Option::Some("TABLE_FORMAT_UNSPECIFIED"),
9540                    Self::Iceberg => std::option::Option::Some("ICEBERG"),
9541                    Self::UnknownValue(u) => u.0.name(),
9542                }
9543            }
9544        }
9545
9546        impl std::default::Default for TableFormat {
9547            fn default() -> Self {
9548                use std::convert::From;
9549                Self::from(0)
9550            }
9551        }
9552
9553        impl std::fmt::Display for TableFormat {
9554            fn fmt(
9555                &self,
9556                f: &mut std::fmt::Formatter<'_>,
9557            ) -> std::result::Result<(), std::fmt::Error> {
9558                wkt::internal::display_enum(f, self.name(), self.value())
9559            }
9560        }
9561
9562        impl std::convert::From<i32> for TableFormat {
9563            fn from(value: i32) -> Self {
9564                match value {
9565                    0 => Self::Unspecified,
9566                    1 => Self::Iceberg,
9567                    _ => Self::UnknownValue(table_format::UnknownValue(
9568                        wkt::internal::UnknownEnumValue::Integer(value),
9569                    )),
9570                }
9571            }
9572        }
9573
9574        impl std::convert::From<&str> for TableFormat {
9575            fn from(value: &str) -> Self {
9576                use std::string::ToString;
9577                match value {
9578                    "TABLE_FORMAT_UNSPECIFIED" => Self::Unspecified,
9579                    "ICEBERG" => Self::Iceberg,
9580                    _ => Self::UnknownValue(table_format::UnknownValue(
9581                        wkt::internal::UnknownEnumValue::String(value.to_string()),
9582                    )),
9583                }
9584            }
9585        }
9586
9587        impl serde::ser::Serialize for TableFormat {
9588            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9589            where
9590                S: serde::Serializer,
9591            {
9592                match self {
9593                    Self::Unspecified => serializer.serialize_i32(0),
9594                    Self::Iceberg => serializer.serialize_i32(1),
9595                    Self::UnknownValue(u) => u.0.serialize(serializer),
9596                }
9597            }
9598        }
9599
9600        impl<'de> serde::de::Deserialize<'de> for TableFormat {
9601            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9602            where
9603                D: serde::Deserializer<'de>,
9604            {
9605                deserializer.deserialize_any(wkt::internal::EnumVisitor::<TableFormat>::new(
9606                    ".google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig.TableFormat",
9607                ))
9608            }
9609        }
9610    }
9611
9612    /// AppendOnly mode defines that all changes to a table will be written to the
9613    /// destination table.
9614    #[derive(Clone, Default, PartialEq)]
9615    #[non_exhaustive]
9616    pub struct AppendOnly {
9617        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9618    }
9619
9620    impl AppendOnly {
9621        pub fn new() -> Self {
9622            std::default::Default::default()
9623        }
9624    }
9625
9626    impl wkt::message::Message for AppendOnly {
9627        fn typename() -> &'static str {
9628            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.AppendOnly"
9629        }
9630    }
9631
9632    /// Merge mode defines that all changes to a table will be merged at the
9633    /// destination table.
9634    #[derive(Clone, Default, PartialEq)]
9635    #[non_exhaustive]
9636    pub struct Merge {
9637        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9638    }
9639
9640    impl Merge {
9641        pub fn new() -> Self {
9642            std::default::Default::default()
9643        }
9644    }
9645
9646    impl wkt::message::Message for Merge {
9647        fn typename() -> &'static str {
9648            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.Merge"
9649        }
9650    }
9651
9652    /// Target dataset(s) configuration.
9653    #[derive(Clone, Debug, PartialEq)]
9654    #[non_exhaustive]
9655    pub enum DatasetConfig {
9656        /// Single destination dataset.
9657        SingleTargetDataset(
9658            std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
9659        ),
9660        /// Source hierarchy datasets.
9661        SourceHierarchyDatasets(
9662            std::boxed::Box<crate::model::big_query_destination_config::SourceHierarchyDatasets>,
9663        ),
9664    }
9665
9666    #[derive(Clone, Debug, PartialEq)]
9667    #[non_exhaustive]
9668    pub enum WriteMode {
9669        /// The standard mode
9670        Merge(std::boxed::Box<crate::model::big_query_destination_config::Merge>),
9671        /// Append only mode
9672        AppendOnly(std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>),
9673    }
9674}
9675
9676/// The configuration of the stream destination.
9677#[derive(Clone, Default, PartialEq)]
9678#[non_exhaustive]
9679pub struct DestinationConfig {
9680    /// Required. Destination connection profile resource.
9681    /// Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
9682    pub destination_connection_profile: std::string::String,
9683
9684    /// Stream configuration that is specific to the data destination type.
9685    pub destination_stream_config:
9686        std::option::Option<crate::model::destination_config::DestinationStreamConfig>,
9687
9688    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9689}
9690
9691impl DestinationConfig {
9692    pub fn new() -> Self {
9693        std::default::Default::default()
9694    }
9695
9696    /// Sets the value of [destination_connection_profile][crate::model::DestinationConfig::destination_connection_profile].
9697    pub fn set_destination_connection_profile<T: std::convert::Into<std::string::String>>(
9698        mut self,
9699        v: T,
9700    ) -> Self {
9701        self.destination_connection_profile = v.into();
9702        self
9703    }
9704
9705    /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config].
9706    ///
9707    /// Note that all the setters affecting `destination_stream_config` are mutually
9708    /// exclusive.
9709    pub fn set_destination_stream_config<
9710        T: std::convert::Into<
9711                std::option::Option<crate::model::destination_config::DestinationStreamConfig>,
9712            >,
9713    >(
9714        mut self,
9715        v: T,
9716    ) -> Self {
9717        self.destination_stream_config = v.into();
9718        self
9719    }
9720
9721    /// The value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
9722    /// if it holds a `GcsDestinationConfig`, `None` if the field is not set or
9723    /// holds a different branch.
9724    pub fn gcs_destination_config(
9725        &self,
9726    ) -> std::option::Option<&std::boxed::Box<crate::model::GcsDestinationConfig>> {
9727        #[allow(unreachable_patterns)]
9728        self.destination_stream_config
9729            .as_ref()
9730            .and_then(|v| match v {
9731                crate::model::destination_config::DestinationStreamConfig::GcsDestinationConfig(
9732                    v,
9733                ) => std::option::Option::Some(v),
9734                _ => std::option::Option::None,
9735            })
9736    }
9737
9738    /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
9739    /// to hold a `GcsDestinationConfig`.
9740    ///
9741    /// Note that all the setters affecting `destination_stream_config` are
9742    /// mutually exclusive.
9743    pub fn set_gcs_destination_config<
9744        T: std::convert::Into<std::boxed::Box<crate::model::GcsDestinationConfig>>,
9745    >(
9746        mut self,
9747        v: T,
9748    ) -> Self {
9749        self.destination_stream_config = std::option::Option::Some(
9750            crate::model::destination_config::DestinationStreamConfig::GcsDestinationConfig(
9751                v.into(),
9752            ),
9753        );
9754        self
9755    }
9756
9757    /// The value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
9758    /// if it holds a `BigqueryDestinationConfig`, `None` if the field is not set or
9759    /// holds a different branch.
9760    pub fn bigquery_destination_config(
9761        &self,
9762    ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryDestinationConfig>> {
9763        #[allow(unreachable_patterns)]
9764        self.destination_stream_config.as_ref().and_then(|v| match v {
9765            crate::model::destination_config::DestinationStreamConfig::BigqueryDestinationConfig(v) => std::option::Option::Some(v),
9766            _ => std::option::Option::None,
9767        })
9768    }
9769
9770    /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
9771    /// to hold a `BigqueryDestinationConfig`.
9772    ///
9773    /// Note that all the setters affecting `destination_stream_config` are
9774    /// mutually exclusive.
9775    pub fn set_bigquery_destination_config<
9776        T: std::convert::Into<std::boxed::Box<crate::model::BigQueryDestinationConfig>>,
9777    >(
9778        mut self,
9779        v: T,
9780    ) -> Self {
9781        self.destination_stream_config = std::option::Option::Some(
9782            crate::model::destination_config::DestinationStreamConfig::BigqueryDestinationConfig(
9783                v.into(),
9784            ),
9785        );
9786        self
9787    }
9788}
9789
9790impl wkt::message::Message for DestinationConfig {
9791    fn typename() -> &'static str {
9792        "type.googleapis.com/google.cloud.datastream.v1.DestinationConfig"
9793    }
9794}
9795
9796/// Defines additional types related to [DestinationConfig].
9797pub mod destination_config {
9798    #[allow(unused_imports)]
9799    use super::*;
9800
9801    /// Stream configuration that is specific to the data destination type.
9802    #[derive(Clone, Debug, PartialEq)]
9803    #[non_exhaustive]
9804    pub enum DestinationStreamConfig {
9805        /// A configuration for how data should be loaded to Cloud Storage.
9806        GcsDestinationConfig(std::boxed::Box<crate::model::GcsDestinationConfig>),
9807        /// BigQuery destination configuration.
9808        BigqueryDestinationConfig(std::boxed::Box<crate::model::BigQueryDestinationConfig>),
9809    }
9810}
9811
9812/// A resource representing streaming data from a source to a destination.
9813#[derive(Clone, Default, PartialEq)]
9814#[non_exhaustive]
9815pub struct Stream {
9816    /// Output only. Identifier. The stream's name.
9817    pub name: std::string::String,
9818
9819    /// Output only. The creation time of the stream.
9820    pub create_time: std::option::Option<wkt::Timestamp>,
9821
9822    /// Output only. The last update time of the stream.
9823    pub update_time: std::option::Option<wkt::Timestamp>,
9824
9825    /// Labels.
9826    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9827
9828    /// Required. Display name.
9829    pub display_name: std::string::String,
9830
9831    /// Required. Source connection profile configuration.
9832    pub source_config: std::option::Option<crate::model::SourceConfig>,
9833
9834    /// Required. Destination connection profile configuration.
9835    pub destination_config: std::option::Option<crate::model::DestinationConfig>,
9836
9837    /// The state of the stream.
9838    pub state: crate::model::stream::State,
9839
9840    /// Output only. Errors on the Stream.
9841    pub errors: std::vec::Vec<crate::model::Error>,
9842
9843    /// Immutable. A reference to a KMS encryption key.
9844    /// If provided, it will be used to encrypt the data.
9845    /// If left blank, data will be encrypted using an internal Stream-specific
9846    /// encryption key provisioned through KMS.
9847    pub customer_managed_encryption_key: std::option::Option<std::string::String>,
9848
9849    /// Output only. If the stream was recovered, the time of the last recovery.
9850    /// Note: This field is currently experimental.
9851    pub last_recovery_time: std::option::Option<wkt::Timestamp>,
9852
9853    /// Output only. Reserved for future use.
9854    pub satisfies_pzs: std::option::Option<bool>,
9855
9856    /// Output only. Reserved for future use.
9857    pub satisfies_pzi: std::option::Option<bool>,
9858
9859    /// Stream backfill strategy.
9860    pub backfill_strategy: std::option::Option<crate::model::stream::BackfillStrategy>,
9861
9862    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9863}
9864
9865impl Stream {
9866    pub fn new() -> Self {
9867        std::default::Default::default()
9868    }
9869
9870    /// Sets the value of [name][crate::model::Stream::name].
9871    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9872        self.name = v.into();
9873        self
9874    }
9875
9876    /// Sets the value of [create_time][crate::model::Stream::create_time].
9877    pub fn set_create_time<T>(mut self, v: T) -> Self
9878    where
9879        T: std::convert::Into<wkt::Timestamp>,
9880    {
9881        self.create_time = std::option::Option::Some(v.into());
9882        self
9883    }
9884
9885    /// Sets or clears the value of [create_time][crate::model::Stream::create_time].
9886    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9887    where
9888        T: std::convert::Into<wkt::Timestamp>,
9889    {
9890        self.create_time = v.map(|x| x.into());
9891        self
9892    }
9893
9894    /// Sets the value of [update_time][crate::model::Stream::update_time].
9895    pub fn set_update_time<T>(mut self, v: T) -> Self
9896    where
9897        T: std::convert::Into<wkt::Timestamp>,
9898    {
9899        self.update_time = std::option::Option::Some(v.into());
9900        self
9901    }
9902
9903    /// Sets or clears the value of [update_time][crate::model::Stream::update_time].
9904    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9905    where
9906        T: std::convert::Into<wkt::Timestamp>,
9907    {
9908        self.update_time = v.map(|x| x.into());
9909        self
9910    }
9911
9912    /// Sets the value of [labels][crate::model::Stream::labels].
9913    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9914    where
9915        T: std::iter::IntoIterator<Item = (K, V)>,
9916        K: std::convert::Into<std::string::String>,
9917        V: std::convert::Into<std::string::String>,
9918    {
9919        use std::iter::Iterator;
9920        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9921        self
9922    }
9923
9924    /// Sets the value of [display_name][crate::model::Stream::display_name].
9925    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9926        self.display_name = v.into();
9927        self
9928    }
9929
9930    /// Sets the value of [source_config][crate::model::Stream::source_config].
9931    pub fn set_source_config<T>(mut self, v: T) -> Self
9932    where
9933        T: std::convert::Into<crate::model::SourceConfig>,
9934    {
9935        self.source_config = std::option::Option::Some(v.into());
9936        self
9937    }
9938
9939    /// Sets or clears the value of [source_config][crate::model::Stream::source_config].
9940    pub fn set_or_clear_source_config<T>(mut self, v: std::option::Option<T>) -> Self
9941    where
9942        T: std::convert::Into<crate::model::SourceConfig>,
9943    {
9944        self.source_config = v.map(|x| x.into());
9945        self
9946    }
9947
9948    /// Sets the value of [destination_config][crate::model::Stream::destination_config].
9949    pub fn set_destination_config<T>(mut self, v: T) -> Self
9950    where
9951        T: std::convert::Into<crate::model::DestinationConfig>,
9952    {
9953        self.destination_config = std::option::Option::Some(v.into());
9954        self
9955    }
9956
9957    /// Sets or clears the value of [destination_config][crate::model::Stream::destination_config].
9958    pub fn set_or_clear_destination_config<T>(mut self, v: std::option::Option<T>) -> Self
9959    where
9960        T: std::convert::Into<crate::model::DestinationConfig>,
9961    {
9962        self.destination_config = v.map(|x| x.into());
9963        self
9964    }
9965
9966    /// Sets the value of [state][crate::model::Stream::state].
9967    pub fn set_state<T: std::convert::Into<crate::model::stream::State>>(mut self, v: T) -> Self {
9968        self.state = v.into();
9969        self
9970    }
9971
9972    /// Sets the value of [errors][crate::model::Stream::errors].
9973    pub fn set_errors<T, V>(mut self, v: T) -> Self
9974    where
9975        T: std::iter::IntoIterator<Item = V>,
9976        V: std::convert::Into<crate::model::Error>,
9977    {
9978        use std::iter::Iterator;
9979        self.errors = v.into_iter().map(|i| i.into()).collect();
9980        self
9981    }
9982
9983    /// Sets the value of [customer_managed_encryption_key][crate::model::Stream::customer_managed_encryption_key].
9984    pub fn set_customer_managed_encryption_key<T>(mut self, v: T) -> Self
9985    where
9986        T: std::convert::Into<std::string::String>,
9987    {
9988        self.customer_managed_encryption_key = std::option::Option::Some(v.into());
9989        self
9990    }
9991
9992    /// Sets or clears the value of [customer_managed_encryption_key][crate::model::Stream::customer_managed_encryption_key].
9993    pub fn set_or_clear_customer_managed_encryption_key<T>(
9994        mut self,
9995        v: std::option::Option<T>,
9996    ) -> Self
9997    where
9998        T: std::convert::Into<std::string::String>,
9999    {
10000        self.customer_managed_encryption_key = v.map(|x| x.into());
10001        self
10002    }
10003
10004    /// Sets the value of [last_recovery_time][crate::model::Stream::last_recovery_time].
10005    pub fn set_last_recovery_time<T>(mut self, v: T) -> Self
10006    where
10007        T: std::convert::Into<wkt::Timestamp>,
10008    {
10009        self.last_recovery_time = std::option::Option::Some(v.into());
10010        self
10011    }
10012
10013    /// Sets or clears the value of [last_recovery_time][crate::model::Stream::last_recovery_time].
10014    pub fn set_or_clear_last_recovery_time<T>(mut self, v: std::option::Option<T>) -> Self
10015    where
10016        T: std::convert::Into<wkt::Timestamp>,
10017    {
10018        self.last_recovery_time = v.map(|x| x.into());
10019        self
10020    }
10021
10022    /// Sets the value of [satisfies_pzs][crate::model::Stream::satisfies_pzs].
10023    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
10024    where
10025        T: std::convert::Into<bool>,
10026    {
10027        self.satisfies_pzs = std::option::Option::Some(v.into());
10028        self
10029    }
10030
10031    /// Sets or clears the value of [satisfies_pzs][crate::model::Stream::satisfies_pzs].
10032    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
10033    where
10034        T: std::convert::Into<bool>,
10035    {
10036        self.satisfies_pzs = v.map(|x| x.into());
10037        self
10038    }
10039
10040    /// Sets the value of [satisfies_pzi][crate::model::Stream::satisfies_pzi].
10041    pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
10042    where
10043        T: std::convert::Into<bool>,
10044    {
10045        self.satisfies_pzi = std::option::Option::Some(v.into());
10046        self
10047    }
10048
10049    /// Sets or clears the value of [satisfies_pzi][crate::model::Stream::satisfies_pzi].
10050    pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
10051    where
10052        T: std::convert::Into<bool>,
10053    {
10054        self.satisfies_pzi = v.map(|x| x.into());
10055        self
10056    }
10057
10058    /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy].
10059    ///
10060    /// Note that all the setters affecting `backfill_strategy` are mutually
10061    /// exclusive.
10062    pub fn set_backfill_strategy<
10063        T: std::convert::Into<std::option::Option<crate::model::stream::BackfillStrategy>>,
10064    >(
10065        mut self,
10066        v: T,
10067    ) -> Self {
10068        self.backfill_strategy = v.into();
10069        self
10070    }
10071
10072    /// The value of [backfill_strategy][crate::model::Stream::backfill_strategy]
10073    /// if it holds a `BackfillAll`, `None` if the field is not set or
10074    /// holds a different branch.
10075    pub fn backfill_all(
10076        &self,
10077    ) -> std::option::Option<&std::boxed::Box<crate::model::stream::BackfillAllStrategy>> {
10078        #[allow(unreachable_patterns)]
10079        self.backfill_strategy.as_ref().and_then(|v| match v {
10080            crate::model::stream::BackfillStrategy::BackfillAll(v) => std::option::Option::Some(v),
10081            _ => std::option::Option::None,
10082        })
10083    }
10084
10085    /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy]
10086    /// to hold a `BackfillAll`.
10087    ///
10088    /// Note that all the setters affecting `backfill_strategy` are
10089    /// mutually exclusive.
10090    pub fn set_backfill_all<
10091        T: std::convert::Into<std::boxed::Box<crate::model::stream::BackfillAllStrategy>>,
10092    >(
10093        mut self,
10094        v: T,
10095    ) -> Self {
10096        self.backfill_strategy = std::option::Option::Some(
10097            crate::model::stream::BackfillStrategy::BackfillAll(v.into()),
10098        );
10099        self
10100    }
10101
10102    /// The value of [backfill_strategy][crate::model::Stream::backfill_strategy]
10103    /// if it holds a `BackfillNone`, `None` if the field is not set or
10104    /// holds a different branch.
10105    pub fn backfill_none(
10106        &self,
10107    ) -> std::option::Option<&std::boxed::Box<crate::model::stream::BackfillNoneStrategy>> {
10108        #[allow(unreachable_patterns)]
10109        self.backfill_strategy.as_ref().and_then(|v| match v {
10110            crate::model::stream::BackfillStrategy::BackfillNone(v) => std::option::Option::Some(v),
10111            _ => std::option::Option::None,
10112        })
10113    }
10114
10115    /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy]
10116    /// to hold a `BackfillNone`.
10117    ///
10118    /// Note that all the setters affecting `backfill_strategy` are
10119    /// mutually exclusive.
10120    pub fn set_backfill_none<
10121        T: std::convert::Into<std::boxed::Box<crate::model::stream::BackfillNoneStrategy>>,
10122    >(
10123        mut self,
10124        v: T,
10125    ) -> Self {
10126        self.backfill_strategy = std::option::Option::Some(
10127            crate::model::stream::BackfillStrategy::BackfillNone(v.into()),
10128        );
10129        self
10130    }
10131}
10132
10133impl wkt::message::Message for Stream {
10134    fn typename() -> &'static str {
10135        "type.googleapis.com/google.cloud.datastream.v1.Stream"
10136    }
10137}
10138
10139/// Defines additional types related to [Stream].
10140pub mod stream {
10141    #[allow(unused_imports)]
10142    use super::*;
10143
10144    /// Backfill strategy to automatically backfill the Stream's objects.
10145    /// Specific objects can be excluded.
10146    #[derive(Clone, Default, PartialEq)]
10147    #[non_exhaustive]
10148    pub struct BackfillAllStrategy {
10149        /// List of objects to exclude.
10150        pub excluded_objects:
10151            std::option::Option<crate::model::stream::backfill_all_strategy::ExcludedObjects>,
10152
10153        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10154    }
10155
10156    impl BackfillAllStrategy {
10157        pub fn new() -> Self {
10158            std::default::Default::default()
10159        }
10160
10161        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects].
10162        ///
10163        /// Note that all the setters affecting `excluded_objects` are mutually
10164        /// exclusive.
10165        pub fn set_excluded_objects<
10166            T: std::convert::Into<
10167                    std::option::Option<
10168                        crate::model::stream::backfill_all_strategy::ExcludedObjects,
10169                    >,
10170                >,
10171        >(
10172            mut self,
10173            v: T,
10174        ) -> Self {
10175            self.excluded_objects = v.into();
10176            self
10177        }
10178
10179        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
10180        /// if it holds a `OracleExcludedObjects`, `None` if the field is not set or
10181        /// holds a different branch.
10182        pub fn oracle_excluded_objects(
10183            &self,
10184        ) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
10185            #[allow(unreachable_patterns)]
10186            self.excluded_objects.as_ref().and_then(|v| match v {
10187                crate::model::stream::backfill_all_strategy::ExcludedObjects::OracleExcludedObjects(v) => std::option::Option::Some(v),
10188                _ => std::option::Option::None,
10189            })
10190        }
10191
10192        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
10193        /// to hold a `OracleExcludedObjects`.
10194        ///
10195        /// Note that all the setters affecting `excluded_objects` are
10196        /// mutually exclusive.
10197        pub fn set_oracle_excluded_objects<
10198            T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>,
10199        >(
10200            mut self,
10201            v: T,
10202        ) -> Self {
10203            self.excluded_objects = std::option::Option::Some(
10204                crate::model::stream::backfill_all_strategy::ExcludedObjects::OracleExcludedObjects(
10205                    v.into(),
10206                ),
10207            );
10208            self
10209        }
10210
10211        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
10212        /// if it holds a `MysqlExcludedObjects`, `None` if the field is not set or
10213        /// holds a different branch.
10214        pub fn mysql_excluded_objects(
10215            &self,
10216        ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
10217            #[allow(unreachable_patterns)]
10218            self.excluded_objects.as_ref().and_then(|v| match v {
10219                crate::model::stream::backfill_all_strategy::ExcludedObjects::MysqlExcludedObjects(v) => std::option::Option::Some(v),
10220                _ => std::option::Option::None,
10221            })
10222        }
10223
10224        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
10225        /// to hold a `MysqlExcludedObjects`.
10226        ///
10227        /// Note that all the setters affecting `excluded_objects` are
10228        /// mutually exclusive.
10229        pub fn set_mysql_excluded_objects<
10230            T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>,
10231        >(
10232            mut self,
10233            v: T,
10234        ) -> Self {
10235            self.excluded_objects = std::option::Option::Some(
10236                crate::model::stream::backfill_all_strategy::ExcludedObjects::MysqlExcludedObjects(
10237                    v.into(),
10238                ),
10239            );
10240            self
10241        }
10242
10243        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
10244        /// if it holds a `PostgresqlExcludedObjects`, `None` if the field is not set or
10245        /// holds a different branch.
10246        pub fn postgresql_excluded_objects(
10247            &self,
10248        ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
10249            #[allow(unreachable_patterns)]
10250            self.excluded_objects.as_ref().and_then(|v| match v {
10251                crate::model::stream::backfill_all_strategy::ExcludedObjects::PostgresqlExcludedObjects(v) => std::option::Option::Some(v),
10252                _ => std::option::Option::None,
10253            })
10254        }
10255
10256        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
10257        /// to hold a `PostgresqlExcludedObjects`.
10258        ///
10259        /// Note that all the setters affecting `excluded_objects` are
10260        /// mutually exclusive.
10261        pub fn set_postgresql_excluded_objects<
10262            T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
10263        >(
10264            mut self,
10265            v: T,
10266        ) -> Self {
10267            self.excluded_objects = std::option::Option::Some(
10268                crate::model::stream::backfill_all_strategy::ExcludedObjects::PostgresqlExcludedObjects(
10269                    v.into()
10270                )
10271            );
10272            self
10273        }
10274
10275        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
10276        /// if it holds a `SqlServerExcludedObjects`, `None` if the field is not set or
10277        /// holds a different branch.
10278        pub fn sql_server_excluded_objects(
10279            &self,
10280        ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
10281            #[allow(unreachable_patterns)]
10282            self.excluded_objects.as_ref().and_then(|v| match v {
10283                crate::model::stream::backfill_all_strategy::ExcludedObjects::SqlServerExcludedObjects(v) => std::option::Option::Some(v),
10284                _ => std::option::Option::None,
10285            })
10286        }
10287
10288        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
10289        /// to hold a `SqlServerExcludedObjects`.
10290        ///
10291        /// Note that all the setters affecting `excluded_objects` are
10292        /// mutually exclusive.
10293        pub fn set_sql_server_excluded_objects<
10294            T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
10295        >(
10296            mut self,
10297            v: T,
10298        ) -> Self {
10299            self.excluded_objects = std::option::Option::Some(
10300                crate::model::stream::backfill_all_strategy::ExcludedObjects::SqlServerExcludedObjects(
10301                    v.into()
10302                )
10303            );
10304            self
10305        }
10306
10307        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
10308        /// if it holds a `SalesforceExcludedObjects`, `None` if the field is not set or
10309        /// holds a different branch.
10310        pub fn salesforce_excluded_objects(
10311            &self,
10312        ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceOrg>> {
10313            #[allow(unreachable_patterns)]
10314            self.excluded_objects.as_ref().and_then(|v| match v {
10315                crate::model::stream::backfill_all_strategy::ExcludedObjects::SalesforceExcludedObjects(v) => std::option::Option::Some(v),
10316                _ => std::option::Option::None,
10317            })
10318        }
10319
10320        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
10321        /// to hold a `SalesforceExcludedObjects`.
10322        ///
10323        /// Note that all the setters affecting `excluded_objects` are
10324        /// mutually exclusive.
10325        pub fn set_salesforce_excluded_objects<
10326            T: std::convert::Into<std::boxed::Box<crate::model::SalesforceOrg>>,
10327        >(
10328            mut self,
10329            v: T,
10330        ) -> Self {
10331            self.excluded_objects = std::option::Option::Some(
10332                crate::model::stream::backfill_all_strategy::ExcludedObjects::SalesforceExcludedObjects(
10333                    v.into()
10334                )
10335            );
10336            self
10337        }
10338
10339        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
10340        /// if it holds a `MongodbExcludedObjects`, `None` if the field is not set or
10341        /// holds a different branch.
10342        pub fn mongodb_excluded_objects(
10343            &self,
10344        ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbCluster>> {
10345            #[allow(unreachable_patterns)]
10346            self.excluded_objects.as_ref().and_then(|v| match v {
10347                crate::model::stream::backfill_all_strategy::ExcludedObjects::MongodbExcludedObjects(v) => std::option::Option::Some(v),
10348                _ => std::option::Option::None,
10349            })
10350        }
10351
10352        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
10353        /// to hold a `MongodbExcludedObjects`.
10354        ///
10355        /// Note that all the setters affecting `excluded_objects` are
10356        /// mutually exclusive.
10357        pub fn set_mongodb_excluded_objects<
10358            T: std::convert::Into<std::boxed::Box<crate::model::MongodbCluster>>,
10359        >(
10360            mut self,
10361            v: T,
10362        ) -> Self {
10363            self.excluded_objects = std::option::Option::Some(
10364                crate::model::stream::backfill_all_strategy::ExcludedObjects::MongodbExcludedObjects(
10365                    v.into()
10366                )
10367            );
10368            self
10369        }
10370    }
10371
10372    impl wkt::message::Message for BackfillAllStrategy {
10373        fn typename() -> &'static str {
10374            "type.googleapis.com/google.cloud.datastream.v1.Stream.BackfillAllStrategy"
10375        }
10376    }
10377
10378    /// Defines additional types related to [BackfillAllStrategy].
10379    pub mod backfill_all_strategy {
10380        #[allow(unused_imports)]
10381        use super::*;
10382
10383        /// List of objects to exclude.
10384        #[derive(Clone, Debug, PartialEq)]
10385        #[non_exhaustive]
10386        pub enum ExcludedObjects {
10387            /// Oracle data source objects to avoid backfilling.
10388            OracleExcludedObjects(std::boxed::Box<crate::model::OracleRdbms>),
10389            /// MySQL data source objects to avoid backfilling.
10390            MysqlExcludedObjects(std::boxed::Box<crate::model::MysqlRdbms>),
10391            /// PostgreSQL data source objects to avoid backfilling.
10392            PostgresqlExcludedObjects(std::boxed::Box<crate::model::PostgresqlRdbms>),
10393            /// SQLServer data source objects to avoid backfilling
10394            SqlServerExcludedObjects(std::boxed::Box<crate::model::SqlServerRdbms>),
10395            /// Salesforce data source objects to avoid backfilling
10396            SalesforceExcludedObjects(std::boxed::Box<crate::model::SalesforceOrg>),
10397            /// MongoDB data source objects to avoid backfilling
10398            MongodbExcludedObjects(std::boxed::Box<crate::model::MongodbCluster>),
10399        }
10400    }
10401
10402    /// Backfill strategy to disable automatic backfill for the Stream's objects.
10403    #[derive(Clone, Default, PartialEq)]
10404    #[non_exhaustive]
10405    pub struct BackfillNoneStrategy {
10406        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10407    }
10408
10409    impl BackfillNoneStrategy {
10410        pub fn new() -> Self {
10411            std::default::Default::default()
10412        }
10413    }
10414
10415    impl wkt::message::Message for BackfillNoneStrategy {
10416        fn typename() -> &'static str {
10417            "type.googleapis.com/google.cloud.datastream.v1.Stream.BackfillNoneStrategy"
10418        }
10419    }
10420
10421    /// Stream state.
10422    ///
10423    /// # Working with unknown values
10424    ///
10425    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10426    /// additional enum variants at any time. Adding new variants is not considered
10427    /// a breaking change. Applications should write their code in anticipation of:
10428    ///
10429    /// - New values appearing in future releases of the client library, **and**
10430    /// - New values received dynamically, without application changes.
10431    ///
10432    /// Please consult the [Working with enums] section in the user guide for some
10433    /// guidelines.
10434    ///
10435    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10436    #[derive(Clone, Debug, PartialEq)]
10437    #[non_exhaustive]
10438    pub enum State {
10439        /// Unspecified stream state.
10440        Unspecified,
10441        /// The stream has been created but has not yet started streaming data.
10442        NotStarted,
10443        /// The stream is running.
10444        Running,
10445        /// The stream is paused.
10446        Paused,
10447        /// The stream is in maintenance mode.
10448        ///
10449        /// Updates are rejected on the resource in this state.
10450        Maintenance,
10451        /// The stream is experiencing an error that is preventing data from being
10452        /// streamed.
10453        Failed,
10454        /// The stream has experienced a terminal failure.
10455        FailedPermanently,
10456        /// The stream is starting, but not yet running.
10457        Starting,
10458        /// The Stream is no longer reading new events, but still writing events in
10459        /// the buffer.
10460        Draining,
10461        /// If set, the enum was initialized with an unknown value.
10462        ///
10463        /// Applications can examine the value using [State::value] or
10464        /// [State::name].
10465        UnknownValue(state::UnknownValue),
10466    }
10467
10468    #[doc(hidden)]
10469    pub mod state {
10470        #[allow(unused_imports)]
10471        use super::*;
10472        #[derive(Clone, Debug, PartialEq)]
10473        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10474    }
10475
10476    impl State {
10477        /// Gets the enum value.
10478        ///
10479        /// Returns `None` if the enum contains an unknown value deserialized from
10480        /// the string representation of enums.
10481        pub fn value(&self) -> std::option::Option<i32> {
10482            match self {
10483                Self::Unspecified => std::option::Option::Some(0),
10484                Self::NotStarted => std::option::Option::Some(1),
10485                Self::Running => std::option::Option::Some(2),
10486                Self::Paused => std::option::Option::Some(3),
10487                Self::Maintenance => std::option::Option::Some(4),
10488                Self::Failed => std::option::Option::Some(5),
10489                Self::FailedPermanently => std::option::Option::Some(6),
10490                Self::Starting => std::option::Option::Some(7),
10491                Self::Draining => std::option::Option::Some(8),
10492                Self::UnknownValue(u) => u.0.value(),
10493            }
10494        }
10495
10496        /// Gets the enum value as a string.
10497        ///
10498        /// Returns `None` if the enum contains an unknown value deserialized from
10499        /// the integer representation of enums.
10500        pub fn name(&self) -> std::option::Option<&str> {
10501            match self {
10502                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10503                Self::NotStarted => std::option::Option::Some("NOT_STARTED"),
10504                Self::Running => std::option::Option::Some("RUNNING"),
10505                Self::Paused => std::option::Option::Some("PAUSED"),
10506                Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
10507                Self::Failed => std::option::Option::Some("FAILED"),
10508                Self::FailedPermanently => std::option::Option::Some("FAILED_PERMANENTLY"),
10509                Self::Starting => std::option::Option::Some("STARTING"),
10510                Self::Draining => std::option::Option::Some("DRAINING"),
10511                Self::UnknownValue(u) => u.0.name(),
10512            }
10513        }
10514    }
10515
10516    impl std::default::Default for State {
10517        fn default() -> Self {
10518            use std::convert::From;
10519            Self::from(0)
10520        }
10521    }
10522
10523    impl std::fmt::Display for State {
10524        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10525            wkt::internal::display_enum(f, self.name(), self.value())
10526        }
10527    }
10528
10529    impl std::convert::From<i32> for State {
10530        fn from(value: i32) -> Self {
10531            match value {
10532                0 => Self::Unspecified,
10533                1 => Self::NotStarted,
10534                2 => Self::Running,
10535                3 => Self::Paused,
10536                4 => Self::Maintenance,
10537                5 => Self::Failed,
10538                6 => Self::FailedPermanently,
10539                7 => Self::Starting,
10540                8 => Self::Draining,
10541                _ => Self::UnknownValue(state::UnknownValue(
10542                    wkt::internal::UnknownEnumValue::Integer(value),
10543                )),
10544            }
10545        }
10546    }
10547
10548    impl std::convert::From<&str> for State {
10549        fn from(value: &str) -> Self {
10550            use std::string::ToString;
10551            match value {
10552                "STATE_UNSPECIFIED" => Self::Unspecified,
10553                "NOT_STARTED" => Self::NotStarted,
10554                "RUNNING" => Self::Running,
10555                "PAUSED" => Self::Paused,
10556                "MAINTENANCE" => Self::Maintenance,
10557                "FAILED" => Self::Failed,
10558                "FAILED_PERMANENTLY" => Self::FailedPermanently,
10559                "STARTING" => Self::Starting,
10560                "DRAINING" => Self::Draining,
10561                _ => Self::UnknownValue(state::UnknownValue(
10562                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10563                )),
10564            }
10565        }
10566    }
10567
10568    impl serde::ser::Serialize for State {
10569        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10570        where
10571            S: serde::Serializer,
10572        {
10573            match self {
10574                Self::Unspecified => serializer.serialize_i32(0),
10575                Self::NotStarted => serializer.serialize_i32(1),
10576                Self::Running => serializer.serialize_i32(2),
10577                Self::Paused => serializer.serialize_i32(3),
10578                Self::Maintenance => serializer.serialize_i32(4),
10579                Self::Failed => serializer.serialize_i32(5),
10580                Self::FailedPermanently => serializer.serialize_i32(6),
10581                Self::Starting => serializer.serialize_i32(7),
10582                Self::Draining => serializer.serialize_i32(8),
10583                Self::UnknownValue(u) => u.0.serialize(serializer),
10584            }
10585        }
10586    }
10587
10588    impl<'de> serde::de::Deserialize<'de> for State {
10589        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10590        where
10591            D: serde::Deserializer<'de>,
10592        {
10593            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10594                ".google.cloud.datastream.v1.Stream.State",
10595            ))
10596        }
10597    }
10598
10599    /// Stream backfill strategy.
10600    #[derive(Clone, Debug, PartialEq)]
10601    #[non_exhaustive]
10602    pub enum BackfillStrategy {
10603        /// Automatically backfill objects included in the stream source
10604        /// configuration. Specific objects can be excluded.
10605        BackfillAll(std::boxed::Box<crate::model::stream::BackfillAllStrategy>),
10606        /// Do not automatically backfill any objects.
10607        BackfillNone(std::boxed::Box<crate::model::stream::BackfillNoneStrategy>),
10608    }
10609}
10610
10611/// A specific stream object (e.g a specific DB table).
10612#[derive(Clone, Default, PartialEq)]
10613#[non_exhaustive]
10614pub struct StreamObject {
10615    /// Output only. Identifier. The object resource's name.
10616    pub name: std::string::String,
10617
10618    /// Output only. The creation time of the object.
10619    pub create_time: std::option::Option<wkt::Timestamp>,
10620
10621    /// Output only. The last update time of the object.
10622    pub update_time: std::option::Option<wkt::Timestamp>,
10623
10624    /// Required. Display name.
10625    pub display_name: std::string::String,
10626
10627    /// Output only. Active errors on the object.
10628    pub errors: std::vec::Vec<crate::model::Error>,
10629
10630    /// The latest backfill job that was initiated for the stream object.
10631    pub backfill_job: std::option::Option<crate::model::BackfillJob>,
10632
10633    /// The object identifier in the data source.
10634    pub source_object: std::option::Option<crate::model::SourceObjectIdentifier>,
10635
10636    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10637}
10638
10639impl StreamObject {
10640    pub fn new() -> Self {
10641        std::default::Default::default()
10642    }
10643
10644    /// Sets the value of [name][crate::model::StreamObject::name].
10645    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10646        self.name = v.into();
10647        self
10648    }
10649
10650    /// Sets the value of [create_time][crate::model::StreamObject::create_time].
10651    pub fn set_create_time<T>(mut self, v: T) -> Self
10652    where
10653        T: std::convert::Into<wkt::Timestamp>,
10654    {
10655        self.create_time = std::option::Option::Some(v.into());
10656        self
10657    }
10658
10659    /// Sets or clears the value of [create_time][crate::model::StreamObject::create_time].
10660    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10661    where
10662        T: std::convert::Into<wkt::Timestamp>,
10663    {
10664        self.create_time = v.map(|x| x.into());
10665        self
10666    }
10667
10668    /// Sets the value of [update_time][crate::model::StreamObject::update_time].
10669    pub fn set_update_time<T>(mut self, v: T) -> Self
10670    where
10671        T: std::convert::Into<wkt::Timestamp>,
10672    {
10673        self.update_time = std::option::Option::Some(v.into());
10674        self
10675    }
10676
10677    /// Sets or clears the value of [update_time][crate::model::StreamObject::update_time].
10678    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10679    where
10680        T: std::convert::Into<wkt::Timestamp>,
10681    {
10682        self.update_time = v.map(|x| x.into());
10683        self
10684    }
10685
10686    /// Sets the value of [display_name][crate::model::StreamObject::display_name].
10687    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10688        self.display_name = v.into();
10689        self
10690    }
10691
10692    /// Sets the value of [errors][crate::model::StreamObject::errors].
10693    pub fn set_errors<T, V>(mut self, v: T) -> Self
10694    where
10695        T: std::iter::IntoIterator<Item = V>,
10696        V: std::convert::Into<crate::model::Error>,
10697    {
10698        use std::iter::Iterator;
10699        self.errors = v.into_iter().map(|i| i.into()).collect();
10700        self
10701    }
10702
10703    /// Sets the value of [backfill_job][crate::model::StreamObject::backfill_job].
10704    pub fn set_backfill_job<T>(mut self, v: T) -> Self
10705    where
10706        T: std::convert::Into<crate::model::BackfillJob>,
10707    {
10708        self.backfill_job = std::option::Option::Some(v.into());
10709        self
10710    }
10711
10712    /// Sets or clears the value of [backfill_job][crate::model::StreamObject::backfill_job].
10713    pub fn set_or_clear_backfill_job<T>(mut self, v: std::option::Option<T>) -> Self
10714    where
10715        T: std::convert::Into<crate::model::BackfillJob>,
10716    {
10717        self.backfill_job = v.map(|x| x.into());
10718        self
10719    }
10720
10721    /// Sets the value of [source_object][crate::model::StreamObject::source_object].
10722    pub fn set_source_object<T>(mut self, v: T) -> Self
10723    where
10724        T: std::convert::Into<crate::model::SourceObjectIdentifier>,
10725    {
10726        self.source_object = std::option::Option::Some(v.into());
10727        self
10728    }
10729
10730    /// Sets or clears the value of [source_object][crate::model::StreamObject::source_object].
10731    pub fn set_or_clear_source_object<T>(mut self, v: std::option::Option<T>) -> Self
10732    where
10733        T: std::convert::Into<crate::model::SourceObjectIdentifier>,
10734    {
10735        self.source_object = v.map(|x| x.into());
10736        self
10737    }
10738}
10739
10740impl wkt::message::Message for StreamObject {
10741    fn typename() -> &'static str {
10742        "type.googleapis.com/google.cloud.datastream.v1.StreamObject"
10743    }
10744}
10745
10746/// Represents an identifier of an object in the data source.
10747#[derive(Clone, Default, PartialEq)]
10748#[non_exhaustive]
10749pub struct SourceObjectIdentifier {
10750    /// The identifier for an object in the data source.
10751    pub source_identifier:
10752        std::option::Option<crate::model::source_object_identifier::SourceIdentifier>,
10753
10754    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10755}
10756
10757impl SourceObjectIdentifier {
10758    pub fn new() -> Self {
10759        std::default::Default::default()
10760    }
10761
10762    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier].
10763    ///
10764    /// Note that all the setters affecting `source_identifier` are mutually
10765    /// exclusive.
10766    pub fn set_source_identifier<
10767        T: std::convert::Into<
10768                std::option::Option<crate::model::source_object_identifier::SourceIdentifier>,
10769            >,
10770    >(
10771        mut self,
10772        v: T,
10773    ) -> Self {
10774        self.source_identifier = v.into();
10775        self
10776    }
10777
10778    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
10779    /// if it holds a `OracleIdentifier`, `None` if the field is not set or
10780    /// holds a different branch.
10781    pub fn oracle_identifier(
10782        &self,
10783    ) -> std::option::Option<
10784        &std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
10785    > {
10786        #[allow(unreachable_patterns)]
10787        self.source_identifier.as_ref().and_then(|v| match v {
10788            crate::model::source_object_identifier::SourceIdentifier::OracleIdentifier(v) => {
10789                std::option::Option::Some(v)
10790            }
10791            _ => std::option::Option::None,
10792        })
10793    }
10794
10795    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
10796    /// to hold a `OracleIdentifier`.
10797    ///
10798    /// Note that all the setters affecting `source_identifier` are
10799    /// mutually exclusive.
10800    pub fn set_oracle_identifier<
10801        T: std::convert::Into<
10802                std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
10803            >,
10804    >(
10805        mut self,
10806        v: T,
10807    ) -> Self {
10808        self.source_identifier = std::option::Option::Some(
10809            crate::model::source_object_identifier::SourceIdentifier::OracleIdentifier(v.into()),
10810        );
10811        self
10812    }
10813
10814    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
10815    /// if it holds a `MysqlIdentifier`, `None` if the field is not set or
10816    /// holds a different branch.
10817    pub fn mysql_identifier(
10818        &self,
10819    ) -> std::option::Option<
10820        &std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
10821    > {
10822        #[allow(unreachable_patterns)]
10823        self.source_identifier.as_ref().and_then(|v| match v {
10824            crate::model::source_object_identifier::SourceIdentifier::MysqlIdentifier(v) => {
10825                std::option::Option::Some(v)
10826            }
10827            _ => std::option::Option::None,
10828        })
10829    }
10830
10831    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
10832    /// to hold a `MysqlIdentifier`.
10833    ///
10834    /// Note that all the setters affecting `source_identifier` are
10835    /// mutually exclusive.
10836    pub fn set_mysql_identifier<
10837        T: std::convert::Into<
10838                std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
10839            >,
10840    >(
10841        mut self,
10842        v: T,
10843    ) -> Self {
10844        self.source_identifier = std::option::Option::Some(
10845            crate::model::source_object_identifier::SourceIdentifier::MysqlIdentifier(v.into()),
10846        );
10847        self
10848    }
10849
10850    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
10851    /// if it holds a `PostgresqlIdentifier`, `None` if the field is not set or
10852    /// holds a different branch.
10853    pub fn postgresql_identifier(
10854        &self,
10855    ) -> std::option::Option<
10856        &std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
10857    > {
10858        #[allow(unreachable_patterns)]
10859        self.source_identifier.as_ref().and_then(|v| match v {
10860            crate::model::source_object_identifier::SourceIdentifier::PostgresqlIdentifier(v) => {
10861                std::option::Option::Some(v)
10862            }
10863            _ => std::option::Option::None,
10864        })
10865    }
10866
10867    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
10868    /// to hold a `PostgresqlIdentifier`.
10869    ///
10870    /// Note that all the setters affecting `source_identifier` are
10871    /// mutually exclusive.
10872    pub fn set_postgresql_identifier<
10873        T: std::convert::Into<
10874                std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
10875            >,
10876    >(
10877        mut self,
10878        v: T,
10879    ) -> Self {
10880        self.source_identifier = std::option::Option::Some(
10881            crate::model::source_object_identifier::SourceIdentifier::PostgresqlIdentifier(
10882                v.into(),
10883            ),
10884        );
10885        self
10886    }
10887
10888    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
10889    /// if it holds a `SqlServerIdentifier`, `None` if the field is not set or
10890    /// holds a different branch.
10891    pub fn sql_server_identifier(
10892        &self,
10893    ) -> std::option::Option<
10894        &std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
10895    > {
10896        #[allow(unreachable_patterns)]
10897        self.source_identifier.as_ref().and_then(|v| match v {
10898            crate::model::source_object_identifier::SourceIdentifier::SqlServerIdentifier(v) => {
10899                std::option::Option::Some(v)
10900            }
10901            _ => std::option::Option::None,
10902        })
10903    }
10904
10905    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
10906    /// to hold a `SqlServerIdentifier`.
10907    ///
10908    /// Note that all the setters affecting `source_identifier` are
10909    /// mutually exclusive.
10910    pub fn set_sql_server_identifier<
10911        T: std::convert::Into<
10912                std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
10913            >,
10914    >(
10915        mut self,
10916        v: T,
10917    ) -> Self {
10918        self.source_identifier = std::option::Option::Some(
10919            crate::model::source_object_identifier::SourceIdentifier::SqlServerIdentifier(v.into()),
10920        );
10921        self
10922    }
10923
10924    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
10925    /// if it holds a `SalesforceIdentifier`, `None` if the field is not set or
10926    /// holds a different branch.
10927    pub fn salesforce_identifier(
10928        &self,
10929    ) -> std::option::Option<
10930        &std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>,
10931    > {
10932        #[allow(unreachable_patterns)]
10933        self.source_identifier.as_ref().and_then(|v| match v {
10934            crate::model::source_object_identifier::SourceIdentifier::SalesforceIdentifier(v) => {
10935                std::option::Option::Some(v)
10936            }
10937            _ => std::option::Option::None,
10938        })
10939    }
10940
10941    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
10942    /// to hold a `SalesforceIdentifier`.
10943    ///
10944    /// Note that all the setters affecting `source_identifier` are
10945    /// mutually exclusive.
10946    pub fn set_salesforce_identifier<
10947        T: std::convert::Into<
10948                std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>,
10949            >,
10950    >(
10951        mut self,
10952        v: T,
10953    ) -> Self {
10954        self.source_identifier = std::option::Option::Some(
10955            crate::model::source_object_identifier::SourceIdentifier::SalesforceIdentifier(
10956                v.into(),
10957            ),
10958        );
10959        self
10960    }
10961
10962    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
10963    /// if it holds a `MongodbIdentifier`, `None` if the field is not set or
10964    /// holds a different branch.
10965    pub fn mongodb_identifier(
10966        &self,
10967    ) -> std::option::Option<
10968        &std::boxed::Box<crate::model::source_object_identifier::MongodbObjectIdentifier>,
10969    > {
10970        #[allow(unreachable_patterns)]
10971        self.source_identifier.as_ref().and_then(|v| match v {
10972            crate::model::source_object_identifier::SourceIdentifier::MongodbIdentifier(v) => {
10973                std::option::Option::Some(v)
10974            }
10975            _ => std::option::Option::None,
10976        })
10977    }
10978
10979    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
10980    /// to hold a `MongodbIdentifier`.
10981    ///
10982    /// Note that all the setters affecting `source_identifier` are
10983    /// mutually exclusive.
10984    pub fn set_mongodb_identifier<
10985        T: std::convert::Into<
10986                std::boxed::Box<crate::model::source_object_identifier::MongodbObjectIdentifier>,
10987            >,
10988    >(
10989        mut self,
10990        v: T,
10991    ) -> Self {
10992        self.source_identifier = std::option::Option::Some(
10993            crate::model::source_object_identifier::SourceIdentifier::MongodbIdentifier(v.into()),
10994        );
10995        self
10996    }
10997}
10998
10999impl wkt::message::Message for SourceObjectIdentifier {
11000    fn typename() -> &'static str {
11001        "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier"
11002    }
11003}
11004
11005/// Defines additional types related to [SourceObjectIdentifier].
11006pub mod source_object_identifier {
11007    #[allow(unused_imports)]
11008    use super::*;
11009
11010    /// Oracle data source object identifier.
11011    #[derive(Clone, Default, PartialEq)]
11012    #[non_exhaustive]
11013    pub struct OracleObjectIdentifier {
11014        /// Required. The schema name.
11015        pub schema: std::string::String,
11016
11017        /// Required. The table name.
11018        pub table: std::string::String,
11019
11020        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11021    }
11022
11023    impl OracleObjectIdentifier {
11024        pub fn new() -> Self {
11025            std::default::Default::default()
11026        }
11027
11028        /// Sets the value of [schema][crate::model::source_object_identifier::OracleObjectIdentifier::schema].
11029        pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11030            self.schema = v.into();
11031            self
11032        }
11033
11034        /// Sets the value of [table][crate::model::source_object_identifier::OracleObjectIdentifier::table].
11035        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11036            self.table = v.into();
11037            self
11038        }
11039    }
11040
11041    impl wkt::message::Message for OracleObjectIdentifier {
11042        fn typename() -> &'static str {
11043            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.OracleObjectIdentifier"
11044        }
11045    }
11046
11047    /// PostgreSQL data source object identifier.
11048    #[derive(Clone, Default, PartialEq)]
11049    #[non_exhaustive]
11050    pub struct PostgresqlObjectIdentifier {
11051        /// Required. The schema name.
11052        pub schema: std::string::String,
11053
11054        /// Required. The table name.
11055        pub table: std::string::String,
11056
11057        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11058    }
11059
11060    impl PostgresqlObjectIdentifier {
11061        pub fn new() -> Self {
11062            std::default::Default::default()
11063        }
11064
11065        /// Sets the value of [schema][crate::model::source_object_identifier::PostgresqlObjectIdentifier::schema].
11066        pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11067            self.schema = v.into();
11068            self
11069        }
11070
11071        /// Sets the value of [table][crate::model::source_object_identifier::PostgresqlObjectIdentifier::table].
11072        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11073            self.table = v.into();
11074            self
11075        }
11076    }
11077
11078    impl wkt::message::Message for PostgresqlObjectIdentifier {
11079        fn typename() -> &'static str {
11080            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.PostgresqlObjectIdentifier"
11081        }
11082    }
11083
11084    /// Mysql data source object identifier.
11085    #[derive(Clone, Default, PartialEq)]
11086    #[non_exhaustive]
11087    pub struct MysqlObjectIdentifier {
11088        /// Required. The database name.
11089        pub database: std::string::String,
11090
11091        /// Required. The table name.
11092        pub table: std::string::String,
11093
11094        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11095    }
11096
11097    impl MysqlObjectIdentifier {
11098        pub fn new() -> Self {
11099            std::default::Default::default()
11100        }
11101
11102        /// Sets the value of [database][crate::model::source_object_identifier::MysqlObjectIdentifier::database].
11103        pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11104            self.database = v.into();
11105            self
11106        }
11107
11108        /// Sets the value of [table][crate::model::source_object_identifier::MysqlObjectIdentifier::table].
11109        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11110            self.table = v.into();
11111            self
11112        }
11113    }
11114
11115    impl wkt::message::Message for MysqlObjectIdentifier {
11116        fn typename() -> &'static str {
11117            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.MysqlObjectIdentifier"
11118        }
11119    }
11120
11121    /// SQLServer data source object identifier.
11122    #[derive(Clone, Default, PartialEq)]
11123    #[non_exhaustive]
11124    pub struct SqlServerObjectIdentifier {
11125        /// Required. The schema name.
11126        pub schema: std::string::String,
11127
11128        /// Required. The table name.
11129        pub table: std::string::String,
11130
11131        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11132    }
11133
11134    impl SqlServerObjectIdentifier {
11135        pub fn new() -> Self {
11136            std::default::Default::default()
11137        }
11138
11139        /// Sets the value of [schema][crate::model::source_object_identifier::SqlServerObjectIdentifier::schema].
11140        pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11141            self.schema = v.into();
11142            self
11143        }
11144
11145        /// Sets the value of [table][crate::model::source_object_identifier::SqlServerObjectIdentifier::table].
11146        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11147            self.table = v.into();
11148            self
11149        }
11150    }
11151
11152    impl wkt::message::Message for SqlServerObjectIdentifier {
11153        fn typename() -> &'static str {
11154            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.SqlServerObjectIdentifier"
11155        }
11156    }
11157
11158    /// Salesforce data source object identifier.
11159    #[derive(Clone, Default, PartialEq)]
11160    #[non_exhaustive]
11161    pub struct SalesforceObjectIdentifier {
11162        /// Required. The object name.
11163        pub object_name: std::string::String,
11164
11165        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11166    }
11167
11168    impl SalesforceObjectIdentifier {
11169        pub fn new() -> Self {
11170            std::default::Default::default()
11171        }
11172
11173        /// Sets the value of [object_name][crate::model::source_object_identifier::SalesforceObjectIdentifier::object_name].
11174        pub fn set_object_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11175            self.object_name = v.into();
11176            self
11177        }
11178    }
11179
11180    impl wkt::message::Message for SalesforceObjectIdentifier {
11181        fn typename() -> &'static str {
11182            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.SalesforceObjectIdentifier"
11183        }
11184    }
11185
11186    /// MongoDB data source object identifier.
11187    #[derive(Clone, Default, PartialEq)]
11188    #[non_exhaustive]
11189    pub struct MongodbObjectIdentifier {
11190        /// Required. The database name.
11191        pub database: std::string::String,
11192
11193        /// Required. The collection name.
11194        pub collection: std::string::String,
11195
11196        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11197    }
11198
11199    impl MongodbObjectIdentifier {
11200        pub fn new() -> Self {
11201            std::default::Default::default()
11202        }
11203
11204        /// Sets the value of [database][crate::model::source_object_identifier::MongodbObjectIdentifier::database].
11205        pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11206            self.database = v.into();
11207            self
11208        }
11209
11210        /// Sets the value of [collection][crate::model::source_object_identifier::MongodbObjectIdentifier::collection].
11211        pub fn set_collection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11212            self.collection = v.into();
11213            self
11214        }
11215    }
11216
11217    impl wkt::message::Message for MongodbObjectIdentifier {
11218        fn typename() -> &'static str {
11219            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.MongodbObjectIdentifier"
11220        }
11221    }
11222
11223    /// The identifier for an object in the data source.
11224    #[derive(Clone, Debug, PartialEq)]
11225    #[non_exhaustive]
11226    pub enum SourceIdentifier {
11227        /// Oracle data source object identifier.
11228        OracleIdentifier(
11229            std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
11230        ),
11231        /// Mysql data source object identifier.
11232        MysqlIdentifier(
11233            std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
11234        ),
11235        /// PostgreSQL data source object identifier.
11236        PostgresqlIdentifier(
11237            std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
11238        ),
11239        /// SQLServer data source object identifier.
11240        SqlServerIdentifier(
11241            std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
11242        ),
11243        /// Salesforce data source object identifier.
11244        SalesforceIdentifier(
11245            std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>,
11246        ),
11247        /// MongoDB data source object identifier.
11248        MongodbIdentifier(
11249            std::boxed::Box<crate::model::source_object_identifier::MongodbObjectIdentifier>,
11250        ),
11251    }
11252}
11253
11254/// Represents a backfill job on a specific stream object.
11255#[derive(Clone, Default, PartialEq)]
11256#[non_exhaustive]
11257pub struct BackfillJob {
11258    /// Output only. Backfill job state.
11259    pub state: crate::model::backfill_job::State,
11260
11261    /// Backfill job's triggering reason.
11262    pub trigger: crate::model::backfill_job::Trigger,
11263
11264    /// Output only. Backfill job's start time.
11265    pub last_start_time: std::option::Option<wkt::Timestamp>,
11266
11267    /// Output only. Backfill job's end time.
11268    pub last_end_time: std::option::Option<wkt::Timestamp>,
11269
11270    /// Output only. Errors which caused the backfill job to fail.
11271    pub errors: std::vec::Vec<crate::model::Error>,
11272
11273    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11274}
11275
11276impl BackfillJob {
11277    pub fn new() -> Self {
11278        std::default::Default::default()
11279    }
11280
11281    /// Sets the value of [state][crate::model::BackfillJob::state].
11282    pub fn set_state<T: std::convert::Into<crate::model::backfill_job::State>>(
11283        mut self,
11284        v: T,
11285    ) -> Self {
11286        self.state = v.into();
11287        self
11288    }
11289
11290    /// Sets the value of [trigger][crate::model::BackfillJob::trigger].
11291    pub fn set_trigger<T: std::convert::Into<crate::model::backfill_job::Trigger>>(
11292        mut self,
11293        v: T,
11294    ) -> Self {
11295        self.trigger = v.into();
11296        self
11297    }
11298
11299    /// Sets the value of [last_start_time][crate::model::BackfillJob::last_start_time].
11300    pub fn set_last_start_time<T>(mut self, v: T) -> Self
11301    where
11302        T: std::convert::Into<wkt::Timestamp>,
11303    {
11304        self.last_start_time = std::option::Option::Some(v.into());
11305        self
11306    }
11307
11308    /// Sets or clears the value of [last_start_time][crate::model::BackfillJob::last_start_time].
11309    pub fn set_or_clear_last_start_time<T>(mut self, v: std::option::Option<T>) -> Self
11310    where
11311        T: std::convert::Into<wkt::Timestamp>,
11312    {
11313        self.last_start_time = v.map(|x| x.into());
11314        self
11315    }
11316
11317    /// Sets the value of [last_end_time][crate::model::BackfillJob::last_end_time].
11318    pub fn set_last_end_time<T>(mut self, v: T) -> Self
11319    where
11320        T: std::convert::Into<wkt::Timestamp>,
11321    {
11322        self.last_end_time = std::option::Option::Some(v.into());
11323        self
11324    }
11325
11326    /// Sets or clears the value of [last_end_time][crate::model::BackfillJob::last_end_time].
11327    pub fn set_or_clear_last_end_time<T>(mut self, v: std::option::Option<T>) -> Self
11328    where
11329        T: std::convert::Into<wkt::Timestamp>,
11330    {
11331        self.last_end_time = v.map(|x| x.into());
11332        self
11333    }
11334
11335    /// Sets the value of [errors][crate::model::BackfillJob::errors].
11336    pub fn set_errors<T, V>(mut self, v: T) -> Self
11337    where
11338        T: std::iter::IntoIterator<Item = V>,
11339        V: std::convert::Into<crate::model::Error>,
11340    {
11341        use std::iter::Iterator;
11342        self.errors = v.into_iter().map(|i| i.into()).collect();
11343        self
11344    }
11345}
11346
11347impl wkt::message::Message for BackfillJob {
11348    fn typename() -> &'static str {
11349        "type.googleapis.com/google.cloud.datastream.v1.BackfillJob"
11350    }
11351}
11352
11353/// Defines additional types related to [BackfillJob].
11354pub mod backfill_job {
11355    #[allow(unused_imports)]
11356    use super::*;
11357
11358    /// State of the stream object's backfill job.
11359    ///
11360    /// # Working with unknown values
11361    ///
11362    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11363    /// additional enum variants at any time. Adding new variants is not considered
11364    /// a breaking change. Applications should write their code in anticipation of:
11365    ///
11366    /// - New values appearing in future releases of the client library, **and**
11367    /// - New values received dynamically, without application changes.
11368    ///
11369    /// Please consult the [Working with enums] section in the user guide for some
11370    /// guidelines.
11371    ///
11372    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11373    #[derive(Clone, Debug, PartialEq)]
11374    #[non_exhaustive]
11375    pub enum State {
11376        /// Default value.
11377        Unspecified,
11378        /// Backfill job was never started for the stream object (stream has backfill
11379        /// strategy defined as manual or object was explicitly excluded from
11380        /// automatic backfill).
11381        NotStarted,
11382        /// Backfill job will start pending available resources.
11383        Pending,
11384        /// Backfill job is running.
11385        Active,
11386        /// Backfill job stopped (next job run will start from beginning).
11387        Stopped,
11388        /// Backfill job failed (due to an error).
11389        Failed,
11390        /// Backfill completed successfully.
11391        Completed,
11392        /// Backfill job failed since the table structure is currently unsupported
11393        /// for backfill.
11394        Unsupported,
11395        /// If set, the enum was initialized with an unknown value.
11396        ///
11397        /// Applications can examine the value using [State::value] or
11398        /// [State::name].
11399        UnknownValue(state::UnknownValue),
11400    }
11401
11402    #[doc(hidden)]
11403    pub mod state {
11404        #[allow(unused_imports)]
11405        use super::*;
11406        #[derive(Clone, Debug, PartialEq)]
11407        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11408    }
11409
11410    impl State {
11411        /// Gets the enum value.
11412        ///
11413        /// Returns `None` if the enum contains an unknown value deserialized from
11414        /// the string representation of enums.
11415        pub fn value(&self) -> std::option::Option<i32> {
11416            match self {
11417                Self::Unspecified => std::option::Option::Some(0),
11418                Self::NotStarted => std::option::Option::Some(1),
11419                Self::Pending => std::option::Option::Some(2),
11420                Self::Active => std::option::Option::Some(3),
11421                Self::Stopped => std::option::Option::Some(4),
11422                Self::Failed => std::option::Option::Some(5),
11423                Self::Completed => std::option::Option::Some(6),
11424                Self::Unsupported => std::option::Option::Some(7),
11425                Self::UnknownValue(u) => u.0.value(),
11426            }
11427        }
11428
11429        /// Gets the enum value as a string.
11430        ///
11431        /// Returns `None` if the enum contains an unknown value deserialized from
11432        /// the integer representation of enums.
11433        pub fn name(&self) -> std::option::Option<&str> {
11434            match self {
11435                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
11436                Self::NotStarted => std::option::Option::Some("NOT_STARTED"),
11437                Self::Pending => std::option::Option::Some("PENDING"),
11438                Self::Active => std::option::Option::Some("ACTIVE"),
11439                Self::Stopped => std::option::Option::Some("STOPPED"),
11440                Self::Failed => std::option::Option::Some("FAILED"),
11441                Self::Completed => std::option::Option::Some("COMPLETED"),
11442                Self::Unsupported => std::option::Option::Some("UNSUPPORTED"),
11443                Self::UnknownValue(u) => u.0.name(),
11444            }
11445        }
11446    }
11447
11448    impl std::default::Default for State {
11449        fn default() -> Self {
11450            use std::convert::From;
11451            Self::from(0)
11452        }
11453    }
11454
11455    impl std::fmt::Display for State {
11456        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11457            wkt::internal::display_enum(f, self.name(), self.value())
11458        }
11459    }
11460
11461    impl std::convert::From<i32> for State {
11462        fn from(value: i32) -> Self {
11463            match value {
11464                0 => Self::Unspecified,
11465                1 => Self::NotStarted,
11466                2 => Self::Pending,
11467                3 => Self::Active,
11468                4 => Self::Stopped,
11469                5 => Self::Failed,
11470                6 => Self::Completed,
11471                7 => Self::Unsupported,
11472                _ => Self::UnknownValue(state::UnknownValue(
11473                    wkt::internal::UnknownEnumValue::Integer(value),
11474                )),
11475            }
11476        }
11477    }
11478
11479    impl std::convert::From<&str> for State {
11480        fn from(value: &str) -> Self {
11481            use std::string::ToString;
11482            match value {
11483                "STATE_UNSPECIFIED" => Self::Unspecified,
11484                "NOT_STARTED" => Self::NotStarted,
11485                "PENDING" => Self::Pending,
11486                "ACTIVE" => Self::Active,
11487                "STOPPED" => Self::Stopped,
11488                "FAILED" => Self::Failed,
11489                "COMPLETED" => Self::Completed,
11490                "UNSUPPORTED" => Self::Unsupported,
11491                _ => Self::UnknownValue(state::UnknownValue(
11492                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11493                )),
11494            }
11495        }
11496    }
11497
11498    impl serde::ser::Serialize for State {
11499        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11500        where
11501            S: serde::Serializer,
11502        {
11503            match self {
11504                Self::Unspecified => serializer.serialize_i32(0),
11505                Self::NotStarted => serializer.serialize_i32(1),
11506                Self::Pending => serializer.serialize_i32(2),
11507                Self::Active => serializer.serialize_i32(3),
11508                Self::Stopped => serializer.serialize_i32(4),
11509                Self::Failed => serializer.serialize_i32(5),
11510                Self::Completed => serializer.serialize_i32(6),
11511                Self::Unsupported => serializer.serialize_i32(7),
11512                Self::UnknownValue(u) => u.0.serialize(serializer),
11513            }
11514        }
11515    }
11516
11517    impl<'de> serde::de::Deserialize<'de> for State {
11518        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11519        where
11520            D: serde::Deserializer<'de>,
11521        {
11522            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
11523                ".google.cloud.datastream.v1.BackfillJob.State",
11524            ))
11525        }
11526    }
11527
11528    /// Triggering reason for a backfill job.
11529    ///
11530    /// # Working with unknown values
11531    ///
11532    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11533    /// additional enum variants at any time. Adding new variants is not considered
11534    /// a breaking change. Applications should write their code in anticipation of:
11535    ///
11536    /// - New values appearing in future releases of the client library, **and**
11537    /// - New values received dynamically, without application changes.
11538    ///
11539    /// Please consult the [Working with enums] section in the user guide for some
11540    /// guidelines.
11541    ///
11542    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11543    #[derive(Clone, Debug, PartialEq)]
11544    #[non_exhaustive]
11545    pub enum Trigger {
11546        /// Default value.
11547        Unspecified,
11548        /// Object backfill job was triggered automatically according to the stream's
11549        /// backfill strategy.
11550        Automatic,
11551        /// Object backfill job was triggered manually using the dedicated API.
11552        Manual,
11553        /// If set, the enum was initialized with an unknown value.
11554        ///
11555        /// Applications can examine the value using [Trigger::value] or
11556        /// [Trigger::name].
11557        UnknownValue(trigger::UnknownValue),
11558    }
11559
11560    #[doc(hidden)]
11561    pub mod trigger {
11562        #[allow(unused_imports)]
11563        use super::*;
11564        #[derive(Clone, Debug, PartialEq)]
11565        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11566    }
11567
11568    impl Trigger {
11569        /// Gets the enum value.
11570        ///
11571        /// Returns `None` if the enum contains an unknown value deserialized from
11572        /// the string representation of enums.
11573        pub fn value(&self) -> std::option::Option<i32> {
11574            match self {
11575                Self::Unspecified => std::option::Option::Some(0),
11576                Self::Automatic => std::option::Option::Some(1),
11577                Self::Manual => std::option::Option::Some(2),
11578                Self::UnknownValue(u) => u.0.value(),
11579            }
11580        }
11581
11582        /// Gets the enum value as a string.
11583        ///
11584        /// Returns `None` if the enum contains an unknown value deserialized from
11585        /// the integer representation of enums.
11586        pub fn name(&self) -> std::option::Option<&str> {
11587            match self {
11588                Self::Unspecified => std::option::Option::Some("TRIGGER_UNSPECIFIED"),
11589                Self::Automatic => std::option::Option::Some("AUTOMATIC"),
11590                Self::Manual => std::option::Option::Some("MANUAL"),
11591                Self::UnknownValue(u) => u.0.name(),
11592            }
11593        }
11594    }
11595
11596    impl std::default::Default for Trigger {
11597        fn default() -> Self {
11598            use std::convert::From;
11599            Self::from(0)
11600        }
11601    }
11602
11603    impl std::fmt::Display for Trigger {
11604        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11605            wkt::internal::display_enum(f, self.name(), self.value())
11606        }
11607    }
11608
11609    impl std::convert::From<i32> for Trigger {
11610        fn from(value: i32) -> Self {
11611            match value {
11612                0 => Self::Unspecified,
11613                1 => Self::Automatic,
11614                2 => Self::Manual,
11615                _ => Self::UnknownValue(trigger::UnknownValue(
11616                    wkt::internal::UnknownEnumValue::Integer(value),
11617                )),
11618            }
11619        }
11620    }
11621
11622    impl std::convert::From<&str> for Trigger {
11623        fn from(value: &str) -> Self {
11624            use std::string::ToString;
11625            match value {
11626                "TRIGGER_UNSPECIFIED" => Self::Unspecified,
11627                "AUTOMATIC" => Self::Automatic,
11628                "MANUAL" => Self::Manual,
11629                _ => Self::UnknownValue(trigger::UnknownValue(
11630                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11631                )),
11632            }
11633        }
11634    }
11635
11636    impl serde::ser::Serialize for Trigger {
11637        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11638        where
11639            S: serde::Serializer,
11640        {
11641            match self {
11642                Self::Unspecified => serializer.serialize_i32(0),
11643                Self::Automatic => serializer.serialize_i32(1),
11644                Self::Manual => serializer.serialize_i32(2),
11645                Self::UnknownValue(u) => u.0.serialize(serializer),
11646            }
11647        }
11648    }
11649
11650    impl<'de> serde::de::Deserialize<'de> for Trigger {
11651        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11652        where
11653            D: serde::Deserializer<'de>,
11654        {
11655            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Trigger>::new(
11656                ".google.cloud.datastream.v1.BackfillJob.Trigger",
11657            ))
11658        }
11659    }
11660}
11661
11662/// Represent a user-facing Error.
11663#[derive(Clone, Default, PartialEq)]
11664#[non_exhaustive]
11665pub struct Error {
11666    /// A title that explains the reason for the error.
11667    pub reason: std::string::String,
11668
11669    /// A unique identifier for this specific error,
11670    /// allowing it to be traced throughout the system in logs and API responses.
11671    pub error_uuid: std::string::String,
11672
11673    /// A message containing more information about the error that occurred.
11674    pub message: std::string::String,
11675
11676    /// The time when the error occurred.
11677    pub error_time: std::option::Option<wkt::Timestamp>,
11678
11679    /// Additional information about the error.
11680    pub details: std::collections::HashMap<std::string::String, std::string::String>,
11681
11682    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11683}
11684
11685impl Error {
11686    pub fn new() -> Self {
11687        std::default::Default::default()
11688    }
11689
11690    /// Sets the value of [reason][crate::model::Error::reason].
11691    pub fn set_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11692        self.reason = v.into();
11693        self
11694    }
11695
11696    /// Sets the value of [error_uuid][crate::model::Error::error_uuid].
11697    pub fn set_error_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11698        self.error_uuid = v.into();
11699        self
11700    }
11701
11702    /// Sets the value of [message][crate::model::Error::message].
11703    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11704        self.message = v.into();
11705        self
11706    }
11707
11708    /// Sets the value of [error_time][crate::model::Error::error_time].
11709    pub fn set_error_time<T>(mut self, v: T) -> Self
11710    where
11711        T: std::convert::Into<wkt::Timestamp>,
11712    {
11713        self.error_time = std::option::Option::Some(v.into());
11714        self
11715    }
11716
11717    /// Sets or clears the value of [error_time][crate::model::Error::error_time].
11718    pub fn set_or_clear_error_time<T>(mut self, v: std::option::Option<T>) -> Self
11719    where
11720        T: std::convert::Into<wkt::Timestamp>,
11721    {
11722        self.error_time = v.map(|x| x.into());
11723        self
11724    }
11725
11726    /// Sets the value of [details][crate::model::Error::details].
11727    pub fn set_details<T, K, V>(mut self, v: T) -> Self
11728    where
11729        T: std::iter::IntoIterator<Item = (K, V)>,
11730        K: std::convert::Into<std::string::String>,
11731        V: std::convert::Into<std::string::String>,
11732    {
11733        use std::iter::Iterator;
11734        self.details = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11735        self
11736    }
11737}
11738
11739impl wkt::message::Message for Error {
11740    fn typename() -> &'static str {
11741        "type.googleapis.com/google.cloud.datastream.v1.Error"
11742    }
11743}
11744
11745/// Contains the current validation results.
11746#[derive(Clone, Default, PartialEq)]
11747#[non_exhaustive]
11748pub struct ValidationResult {
11749    /// A list of validations (includes both executed as well as not executed
11750    /// validations).
11751    pub validations: std::vec::Vec<crate::model::Validation>,
11752
11753    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11754}
11755
11756impl ValidationResult {
11757    pub fn new() -> Self {
11758        std::default::Default::default()
11759    }
11760
11761    /// Sets the value of [validations][crate::model::ValidationResult::validations].
11762    pub fn set_validations<T, V>(mut self, v: T) -> Self
11763    where
11764        T: std::iter::IntoIterator<Item = V>,
11765        V: std::convert::Into<crate::model::Validation>,
11766    {
11767        use std::iter::Iterator;
11768        self.validations = v.into_iter().map(|i| i.into()).collect();
11769        self
11770    }
11771}
11772
11773impl wkt::message::Message for ValidationResult {
11774    fn typename() -> &'static str {
11775        "type.googleapis.com/google.cloud.datastream.v1.ValidationResult"
11776    }
11777}
11778
11779/// A validation to perform on a stream.
11780#[derive(Clone, Default, PartialEq)]
11781#[non_exhaustive]
11782pub struct Validation {
11783    /// A short description of the validation.
11784    pub description: std::string::String,
11785
11786    /// Output only. Validation execution status.
11787    pub state: crate::model::validation::State,
11788
11789    /// Messages reflecting the validation results.
11790    pub message: std::vec::Vec<crate::model::ValidationMessage>,
11791
11792    /// A custom code identifying this validation.
11793    pub code: std::string::String,
11794
11795    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11796}
11797
11798impl Validation {
11799    pub fn new() -> Self {
11800        std::default::Default::default()
11801    }
11802
11803    /// Sets the value of [description][crate::model::Validation::description].
11804    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11805        self.description = v.into();
11806        self
11807    }
11808
11809    /// Sets the value of [state][crate::model::Validation::state].
11810    pub fn set_state<T: std::convert::Into<crate::model::validation::State>>(
11811        mut self,
11812        v: T,
11813    ) -> Self {
11814        self.state = v.into();
11815        self
11816    }
11817
11818    /// Sets the value of [message][crate::model::Validation::message].
11819    pub fn set_message<T, V>(mut self, v: T) -> Self
11820    where
11821        T: std::iter::IntoIterator<Item = V>,
11822        V: std::convert::Into<crate::model::ValidationMessage>,
11823    {
11824        use std::iter::Iterator;
11825        self.message = v.into_iter().map(|i| i.into()).collect();
11826        self
11827    }
11828
11829    /// Sets the value of [code][crate::model::Validation::code].
11830    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11831        self.code = v.into();
11832        self
11833    }
11834}
11835
11836impl wkt::message::Message for Validation {
11837    fn typename() -> &'static str {
11838        "type.googleapis.com/google.cloud.datastream.v1.Validation"
11839    }
11840}
11841
11842/// Defines additional types related to [Validation].
11843pub mod validation {
11844    #[allow(unused_imports)]
11845    use super::*;
11846
11847    /// Validation execution state.
11848    ///
11849    /// # Working with unknown values
11850    ///
11851    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11852    /// additional enum variants at any time. Adding new variants is not considered
11853    /// a breaking change. Applications should write their code in anticipation of:
11854    ///
11855    /// - New values appearing in future releases of the client library, **and**
11856    /// - New values received dynamically, without application changes.
11857    ///
11858    /// Please consult the [Working with enums] section in the user guide for some
11859    /// guidelines.
11860    ///
11861    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11862    #[derive(Clone, Debug, PartialEq)]
11863    #[non_exhaustive]
11864    pub enum State {
11865        /// Unspecified state.
11866        Unspecified,
11867        /// Validation did not execute.
11868        NotExecuted,
11869        /// Validation failed.
11870        Failed,
11871        /// Validation passed.
11872        Passed,
11873        /// Validation executed with warnings.
11874        Warning,
11875        /// If set, the enum was initialized with an unknown value.
11876        ///
11877        /// Applications can examine the value using [State::value] or
11878        /// [State::name].
11879        UnknownValue(state::UnknownValue),
11880    }
11881
11882    #[doc(hidden)]
11883    pub mod state {
11884        #[allow(unused_imports)]
11885        use super::*;
11886        #[derive(Clone, Debug, PartialEq)]
11887        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11888    }
11889
11890    impl State {
11891        /// Gets the enum value.
11892        ///
11893        /// Returns `None` if the enum contains an unknown value deserialized from
11894        /// the string representation of enums.
11895        pub fn value(&self) -> std::option::Option<i32> {
11896            match self {
11897                Self::Unspecified => std::option::Option::Some(0),
11898                Self::NotExecuted => std::option::Option::Some(1),
11899                Self::Failed => std::option::Option::Some(2),
11900                Self::Passed => std::option::Option::Some(3),
11901                Self::Warning => std::option::Option::Some(4),
11902                Self::UnknownValue(u) => u.0.value(),
11903            }
11904        }
11905
11906        /// Gets the enum value as a string.
11907        ///
11908        /// Returns `None` if the enum contains an unknown value deserialized from
11909        /// the integer representation of enums.
11910        pub fn name(&self) -> std::option::Option<&str> {
11911            match self {
11912                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
11913                Self::NotExecuted => std::option::Option::Some("NOT_EXECUTED"),
11914                Self::Failed => std::option::Option::Some("FAILED"),
11915                Self::Passed => std::option::Option::Some("PASSED"),
11916                Self::Warning => std::option::Option::Some("WARNING"),
11917                Self::UnknownValue(u) => u.0.name(),
11918            }
11919        }
11920    }
11921
11922    impl std::default::Default for State {
11923        fn default() -> Self {
11924            use std::convert::From;
11925            Self::from(0)
11926        }
11927    }
11928
11929    impl std::fmt::Display for State {
11930        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11931            wkt::internal::display_enum(f, self.name(), self.value())
11932        }
11933    }
11934
11935    impl std::convert::From<i32> for State {
11936        fn from(value: i32) -> Self {
11937            match value {
11938                0 => Self::Unspecified,
11939                1 => Self::NotExecuted,
11940                2 => Self::Failed,
11941                3 => Self::Passed,
11942                4 => Self::Warning,
11943                _ => Self::UnknownValue(state::UnknownValue(
11944                    wkt::internal::UnknownEnumValue::Integer(value),
11945                )),
11946            }
11947        }
11948    }
11949
11950    impl std::convert::From<&str> for State {
11951        fn from(value: &str) -> Self {
11952            use std::string::ToString;
11953            match value {
11954                "STATE_UNSPECIFIED" => Self::Unspecified,
11955                "NOT_EXECUTED" => Self::NotExecuted,
11956                "FAILED" => Self::Failed,
11957                "PASSED" => Self::Passed,
11958                "WARNING" => Self::Warning,
11959                _ => Self::UnknownValue(state::UnknownValue(
11960                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11961                )),
11962            }
11963        }
11964    }
11965
11966    impl serde::ser::Serialize for State {
11967        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11968        where
11969            S: serde::Serializer,
11970        {
11971            match self {
11972                Self::Unspecified => serializer.serialize_i32(0),
11973                Self::NotExecuted => serializer.serialize_i32(1),
11974                Self::Failed => serializer.serialize_i32(2),
11975                Self::Passed => serializer.serialize_i32(3),
11976                Self::Warning => serializer.serialize_i32(4),
11977                Self::UnknownValue(u) => u.0.serialize(serializer),
11978            }
11979        }
11980    }
11981
11982    impl<'de> serde::de::Deserialize<'de> for State {
11983        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11984        where
11985            D: serde::Deserializer<'de>,
11986        {
11987            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
11988                ".google.cloud.datastream.v1.Validation.State",
11989            ))
11990        }
11991    }
11992}
11993
11994/// Represent user-facing validation result message.
11995#[derive(Clone, Default, PartialEq)]
11996#[non_exhaustive]
11997pub struct ValidationMessage {
11998    /// The result of the validation.
11999    pub message: std::string::String,
12000
12001    /// Message severity level (warning or error).
12002    pub level: crate::model::validation_message::Level,
12003
12004    /// Additional metadata related to the result.
12005    pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
12006
12007    /// A custom code identifying this specific message.
12008    pub code: std::string::String,
12009
12010    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12011}
12012
12013impl ValidationMessage {
12014    pub fn new() -> Self {
12015        std::default::Default::default()
12016    }
12017
12018    /// Sets the value of [message][crate::model::ValidationMessage::message].
12019    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12020        self.message = v.into();
12021        self
12022    }
12023
12024    /// Sets the value of [level][crate::model::ValidationMessage::level].
12025    pub fn set_level<T: std::convert::Into<crate::model::validation_message::Level>>(
12026        mut self,
12027        v: T,
12028    ) -> Self {
12029        self.level = v.into();
12030        self
12031    }
12032
12033    /// Sets the value of [metadata][crate::model::ValidationMessage::metadata].
12034    pub fn set_metadata<T, K, V>(mut self, v: T) -> Self
12035    where
12036        T: std::iter::IntoIterator<Item = (K, V)>,
12037        K: std::convert::Into<std::string::String>,
12038        V: std::convert::Into<std::string::String>,
12039    {
12040        use std::iter::Iterator;
12041        self.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12042        self
12043    }
12044
12045    /// Sets the value of [code][crate::model::ValidationMessage::code].
12046    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12047        self.code = v.into();
12048        self
12049    }
12050}
12051
12052impl wkt::message::Message for ValidationMessage {
12053    fn typename() -> &'static str {
12054        "type.googleapis.com/google.cloud.datastream.v1.ValidationMessage"
12055    }
12056}
12057
12058/// Defines additional types related to [ValidationMessage].
12059pub mod validation_message {
12060    #[allow(unused_imports)]
12061    use super::*;
12062
12063    /// Validation message level.
12064    ///
12065    /// # Working with unknown values
12066    ///
12067    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12068    /// additional enum variants at any time. Adding new variants is not considered
12069    /// a breaking change. Applications should write their code in anticipation of:
12070    ///
12071    /// - New values appearing in future releases of the client library, **and**
12072    /// - New values received dynamically, without application changes.
12073    ///
12074    /// Please consult the [Working with enums] section in the user guide for some
12075    /// guidelines.
12076    ///
12077    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12078    #[derive(Clone, Debug, PartialEq)]
12079    #[non_exhaustive]
12080    pub enum Level {
12081        /// Unspecified level.
12082        Unspecified,
12083        /// Potentially cause issues with the Stream.
12084        Warning,
12085        /// Definitely cause issues with the Stream.
12086        Error,
12087        /// If set, the enum was initialized with an unknown value.
12088        ///
12089        /// Applications can examine the value using [Level::value] or
12090        /// [Level::name].
12091        UnknownValue(level::UnknownValue),
12092    }
12093
12094    #[doc(hidden)]
12095    pub mod level {
12096        #[allow(unused_imports)]
12097        use super::*;
12098        #[derive(Clone, Debug, PartialEq)]
12099        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12100    }
12101
12102    impl Level {
12103        /// Gets the enum value.
12104        ///
12105        /// Returns `None` if the enum contains an unknown value deserialized from
12106        /// the string representation of enums.
12107        pub fn value(&self) -> std::option::Option<i32> {
12108            match self {
12109                Self::Unspecified => std::option::Option::Some(0),
12110                Self::Warning => std::option::Option::Some(1),
12111                Self::Error => std::option::Option::Some(2),
12112                Self::UnknownValue(u) => u.0.value(),
12113            }
12114        }
12115
12116        /// Gets the enum value as a string.
12117        ///
12118        /// Returns `None` if the enum contains an unknown value deserialized from
12119        /// the integer representation of enums.
12120        pub fn name(&self) -> std::option::Option<&str> {
12121            match self {
12122                Self::Unspecified => std::option::Option::Some("LEVEL_UNSPECIFIED"),
12123                Self::Warning => std::option::Option::Some("WARNING"),
12124                Self::Error => std::option::Option::Some("ERROR"),
12125                Self::UnknownValue(u) => u.0.name(),
12126            }
12127        }
12128    }
12129
12130    impl std::default::Default for Level {
12131        fn default() -> Self {
12132            use std::convert::From;
12133            Self::from(0)
12134        }
12135    }
12136
12137    impl std::fmt::Display for Level {
12138        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12139            wkt::internal::display_enum(f, self.name(), self.value())
12140        }
12141    }
12142
12143    impl std::convert::From<i32> for Level {
12144        fn from(value: i32) -> Self {
12145            match value {
12146                0 => Self::Unspecified,
12147                1 => Self::Warning,
12148                2 => Self::Error,
12149                _ => Self::UnknownValue(level::UnknownValue(
12150                    wkt::internal::UnknownEnumValue::Integer(value),
12151                )),
12152            }
12153        }
12154    }
12155
12156    impl std::convert::From<&str> for Level {
12157        fn from(value: &str) -> Self {
12158            use std::string::ToString;
12159            match value {
12160                "LEVEL_UNSPECIFIED" => Self::Unspecified,
12161                "WARNING" => Self::Warning,
12162                "ERROR" => Self::Error,
12163                _ => Self::UnknownValue(level::UnknownValue(
12164                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12165                )),
12166            }
12167        }
12168    }
12169
12170    impl serde::ser::Serialize for Level {
12171        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12172        where
12173            S: serde::Serializer,
12174        {
12175            match self {
12176                Self::Unspecified => serializer.serialize_i32(0),
12177                Self::Warning => serializer.serialize_i32(1),
12178                Self::Error => serializer.serialize_i32(2),
12179                Self::UnknownValue(u) => u.0.serialize(serializer),
12180            }
12181        }
12182    }
12183
12184    impl<'de> serde::de::Deserialize<'de> for Level {
12185        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12186        where
12187            D: serde::Deserializer<'de>,
12188        {
12189            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Level>::new(
12190                ".google.cloud.datastream.v1.ValidationMessage.Level",
12191            ))
12192        }
12193    }
12194}
12195
12196/// The strategy that the stream uses for CDC replication.
12197#[derive(Clone, Default, PartialEq)]
12198#[non_exhaustive]
12199pub struct CdcStrategy {
12200    /// The position to start reading from when starting, resuming, or recovering
12201    /// the stream.
12202    /// If not set, the system's default value will be used.
12203    pub start_position: std::option::Option<crate::model::cdc_strategy::StartPosition>,
12204
12205    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12206}
12207
12208impl CdcStrategy {
12209    pub fn new() -> Self {
12210        std::default::Default::default()
12211    }
12212
12213    /// Sets the value of [start_position][crate::model::CdcStrategy::start_position].
12214    ///
12215    /// Note that all the setters affecting `start_position` are mutually
12216    /// exclusive.
12217    pub fn set_start_position<
12218        T: std::convert::Into<std::option::Option<crate::model::cdc_strategy::StartPosition>>,
12219    >(
12220        mut self,
12221        v: T,
12222    ) -> Self {
12223        self.start_position = v.into();
12224        self
12225    }
12226
12227    /// The value of [start_position][crate::model::CdcStrategy::start_position]
12228    /// if it holds a `MostRecentStartPosition`, `None` if the field is not set or
12229    /// holds a different branch.
12230    pub fn most_recent_start_position(
12231        &self,
12232    ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>>
12233    {
12234        #[allow(unreachable_patterns)]
12235        self.start_position.as_ref().and_then(|v| match v {
12236            crate::model::cdc_strategy::StartPosition::MostRecentStartPosition(v) => {
12237                std::option::Option::Some(v)
12238            }
12239            _ => std::option::Option::None,
12240        })
12241    }
12242
12243    /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
12244    /// to hold a `MostRecentStartPosition`.
12245    ///
12246    /// Note that all the setters affecting `start_position` are
12247    /// mutually exclusive.
12248    pub fn set_most_recent_start_position<
12249        T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>>,
12250    >(
12251        mut self,
12252        v: T,
12253    ) -> Self {
12254        self.start_position = std::option::Option::Some(
12255            crate::model::cdc_strategy::StartPosition::MostRecentStartPosition(v.into()),
12256        );
12257        self
12258    }
12259
12260    /// The value of [start_position][crate::model::CdcStrategy::start_position]
12261    /// if it holds a `NextAvailableStartPosition`, `None` if the field is not set or
12262    /// holds a different branch.
12263    pub fn next_available_start_position(
12264        &self,
12265    ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>>
12266    {
12267        #[allow(unreachable_patterns)]
12268        self.start_position.as_ref().and_then(|v| match v {
12269            crate::model::cdc_strategy::StartPosition::NextAvailableStartPosition(v) => {
12270                std::option::Option::Some(v)
12271            }
12272            _ => std::option::Option::None,
12273        })
12274    }
12275
12276    /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
12277    /// to hold a `NextAvailableStartPosition`.
12278    ///
12279    /// Note that all the setters affecting `start_position` are
12280    /// mutually exclusive.
12281    pub fn set_next_available_start_position<
12282        T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>>,
12283    >(
12284        mut self,
12285        v: T,
12286    ) -> Self {
12287        self.start_position = std::option::Option::Some(
12288            crate::model::cdc_strategy::StartPosition::NextAvailableStartPosition(v.into()),
12289        );
12290        self
12291    }
12292
12293    /// The value of [start_position][crate::model::CdcStrategy::start_position]
12294    /// if it holds a `SpecificStartPosition`, `None` if the field is not set or
12295    /// holds a different branch.
12296    pub fn specific_start_position(
12297        &self,
12298    ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>>
12299    {
12300        #[allow(unreachable_patterns)]
12301        self.start_position.as_ref().and_then(|v| match v {
12302            crate::model::cdc_strategy::StartPosition::SpecificStartPosition(v) => {
12303                std::option::Option::Some(v)
12304            }
12305            _ => std::option::Option::None,
12306        })
12307    }
12308
12309    /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
12310    /// to hold a `SpecificStartPosition`.
12311    ///
12312    /// Note that all the setters affecting `start_position` are
12313    /// mutually exclusive.
12314    pub fn set_specific_start_position<
12315        T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>>,
12316    >(
12317        mut self,
12318        v: T,
12319    ) -> Self {
12320        self.start_position = std::option::Option::Some(
12321            crate::model::cdc_strategy::StartPosition::SpecificStartPosition(v.into()),
12322        );
12323        self
12324    }
12325}
12326
12327impl wkt::message::Message for CdcStrategy {
12328    fn typename() -> &'static str {
12329        "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy"
12330    }
12331}
12332
12333/// Defines additional types related to [CdcStrategy].
12334pub mod cdc_strategy {
12335    #[allow(unused_imports)]
12336    use super::*;
12337
12338    /// CDC strategy to start replicating from the most recent position in the
12339    /// source.
12340    #[derive(Clone, Default, PartialEq)]
12341    #[non_exhaustive]
12342    pub struct MostRecentStartPosition {
12343        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12344    }
12345
12346    impl MostRecentStartPosition {
12347        pub fn new() -> Self {
12348            std::default::Default::default()
12349        }
12350    }
12351
12352    impl wkt::message::Message for MostRecentStartPosition {
12353        fn typename() -> &'static str {
12354            "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.MostRecentStartPosition"
12355        }
12356    }
12357
12358    /// CDC strategy to resume replication from the next available position in the
12359    /// source.
12360    #[derive(Clone, Default, PartialEq)]
12361    #[non_exhaustive]
12362    pub struct NextAvailableStartPosition {
12363        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12364    }
12365
12366    impl NextAvailableStartPosition {
12367        pub fn new() -> Self {
12368            std::default::Default::default()
12369        }
12370    }
12371
12372    impl wkt::message::Message for NextAvailableStartPosition {
12373        fn typename() -> &'static str {
12374            "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.NextAvailableStartPosition"
12375        }
12376    }
12377
12378    /// CDC strategy to start replicating from a specific position in the source.
12379    #[derive(Clone, Default, PartialEq)]
12380    #[non_exhaustive]
12381    pub struct SpecificStartPosition {
12382        pub position:
12383            std::option::Option<crate::model::cdc_strategy::specific_start_position::Position>,
12384
12385        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12386    }
12387
12388    impl SpecificStartPosition {
12389        pub fn new() -> Self {
12390            std::default::Default::default()
12391        }
12392
12393        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position].
12394        ///
12395        /// Note that all the setters affecting `position` are mutually
12396        /// exclusive.
12397        pub fn set_position<
12398            T: std::convert::Into<
12399                    std::option::Option<
12400                        crate::model::cdc_strategy::specific_start_position::Position,
12401                    >,
12402                >,
12403        >(
12404            mut self,
12405            v: T,
12406        ) -> Self {
12407            self.position = v.into();
12408            self
12409        }
12410
12411        /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
12412        /// if it holds a `MysqlLogPosition`, `None` if the field is not set or
12413        /// holds a different branch.
12414        pub fn mysql_log_position(
12415            &self,
12416        ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlLogPosition>> {
12417            #[allow(unreachable_patterns)]
12418            self.position.as_ref().and_then(|v| match v {
12419                crate::model::cdc_strategy::specific_start_position::Position::MysqlLogPosition(
12420                    v,
12421                ) => std::option::Option::Some(v),
12422                _ => std::option::Option::None,
12423            })
12424        }
12425
12426        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
12427        /// to hold a `MysqlLogPosition`.
12428        ///
12429        /// Note that all the setters affecting `position` are
12430        /// mutually exclusive.
12431        pub fn set_mysql_log_position<
12432            T: std::convert::Into<std::boxed::Box<crate::model::MysqlLogPosition>>,
12433        >(
12434            mut self,
12435            v: T,
12436        ) -> Self {
12437            self.position = std::option::Option::Some(
12438                crate::model::cdc_strategy::specific_start_position::Position::MysqlLogPosition(
12439                    v.into(),
12440                ),
12441            );
12442            self
12443        }
12444
12445        /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
12446        /// if it holds a `OracleScnPosition`, `None` if the field is not set or
12447        /// holds a different branch.
12448        pub fn oracle_scn_position(
12449            &self,
12450        ) -> std::option::Option<&std::boxed::Box<crate::model::OracleScnPosition>> {
12451            #[allow(unreachable_patterns)]
12452            self.position.as_ref().and_then(|v| match v {
12453                crate::model::cdc_strategy::specific_start_position::Position::OracleScnPosition(v) => std::option::Option::Some(v),
12454                _ => std::option::Option::None,
12455            })
12456        }
12457
12458        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
12459        /// to hold a `OracleScnPosition`.
12460        ///
12461        /// Note that all the setters affecting `position` are
12462        /// mutually exclusive.
12463        pub fn set_oracle_scn_position<
12464            T: std::convert::Into<std::boxed::Box<crate::model::OracleScnPosition>>,
12465        >(
12466            mut self,
12467            v: T,
12468        ) -> Self {
12469            self.position = std::option::Option::Some(
12470                crate::model::cdc_strategy::specific_start_position::Position::OracleScnPosition(
12471                    v.into(),
12472                ),
12473            );
12474            self
12475        }
12476
12477        /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
12478        /// if it holds a `SqlServerLsnPosition`, `None` if the field is not set or
12479        /// holds a different branch.
12480        pub fn sql_server_lsn_position(
12481            &self,
12482        ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerLsnPosition>> {
12483            #[allow(unreachable_patterns)]
12484            self.position.as_ref().and_then(|v| match v {
12485                crate::model::cdc_strategy::specific_start_position::Position::SqlServerLsnPosition(v) => std::option::Option::Some(v),
12486                _ => std::option::Option::None,
12487            })
12488        }
12489
12490        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
12491        /// to hold a `SqlServerLsnPosition`.
12492        ///
12493        /// Note that all the setters affecting `position` are
12494        /// mutually exclusive.
12495        pub fn set_sql_server_lsn_position<
12496            T: std::convert::Into<std::boxed::Box<crate::model::SqlServerLsnPosition>>,
12497        >(
12498            mut self,
12499            v: T,
12500        ) -> Self {
12501            self.position = std::option::Option::Some(
12502                crate::model::cdc_strategy::specific_start_position::Position::SqlServerLsnPosition(
12503                    v.into(),
12504                ),
12505            );
12506            self
12507        }
12508
12509        /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
12510        /// if it holds a `MysqlGtidPosition`, `None` if the field is not set or
12511        /// holds a different branch.
12512        pub fn mysql_gtid_position(
12513            &self,
12514        ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlGtidPosition>> {
12515            #[allow(unreachable_patterns)]
12516            self.position.as_ref().and_then(|v| match v {
12517                crate::model::cdc_strategy::specific_start_position::Position::MysqlGtidPosition(v) => std::option::Option::Some(v),
12518                _ => std::option::Option::None,
12519            })
12520        }
12521
12522        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
12523        /// to hold a `MysqlGtidPosition`.
12524        ///
12525        /// Note that all the setters affecting `position` are
12526        /// mutually exclusive.
12527        pub fn set_mysql_gtid_position<
12528            T: std::convert::Into<std::boxed::Box<crate::model::MysqlGtidPosition>>,
12529        >(
12530            mut self,
12531            v: T,
12532        ) -> Self {
12533            self.position = std::option::Option::Some(
12534                crate::model::cdc_strategy::specific_start_position::Position::MysqlGtidPosition(
12535                    v.into(),
12536                ),
12537            );
12538            self
12539        }
12540    }
12541
12542    impl wkt::message::Message for SpecificStartPosition {
12543        fn typename() -> &'static str {
12544            "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.SpecificStartPosition"
12545        }
12546    }
12547
12548    /// Defines additional types related to [SpecificStartPosition].
12549    pub mod specific_start_position {
12550        #[allow(unused_imports)]
12551        use super::*;
12552
12553        #[derive(Clone, Debug, PartialEq)]
12554        #[non_exhaustive]
12555        pub enum Position {
12556            /// MySQL specific log position to start replicating from.
12557            MysqlLogPosition(std::boxed::Box<crate::model::MysqlLogPosition>),
12558            /// Oracle SCN to start replicating from.
12559            OracleScnPosition(std::boxed::Box<crate::model::OracleScnPosition>),
12560            /// SqlServer LSN to start replicating from.
12561            SqlServerLsnPosition(std::boxed::Box<crate::model::SqlServerLsnPosition>),
12562            /// MySQL GTID set to start replicating from.
12563            MysqlGtidPosition(std::boxed::Box<crate::model::MysqlGtidPosition>),
12564        }
12565    }
12566
12567    /// The position to start reading from when starting, resuming, or recovering
12568    /// the stream.
12569    /// If not set, the system's default value will be used.
12570    #[derive(Clone, Debug, PartialEq)]
12571    #[non_exhaustive]
12572    pub enum StartPosition {
12573        /// Optional. Start replicating from the most recent position in the source.
12574        MostRecentStartPosition(
12575            std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>,
12576        ),
12577        /// Optional. Resume replication from the next available position in the
12578        /// source.
12579        NextAvailableStartPosition(
12580            std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>,
12581        ),
12582        /// Optional. Start replicating from a specific position in the source.
12583        SpecificStartPosition(std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>),
12584    }
12585}
12586
12587/// SQL Server LSN position
12588#[derive(Clone, Default, PartialEq)]
12589#[non_exhaustive]
12590pub struct SqlServerLsnPosition {
12591    /// Required. Log sequence number (LSN) from where Logs will be read
12592    pub lsn: std::string::String,
12593
12594    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12595}
12596
12597impl SqlServerLsnPosition {
12598    pub fn new() -> Self {
12599        std::default::Default::default()
12600    }
12601
12602    /// Sets the value of [lsn][crate::model::SqlServerLsnPosition::lsn].
12603    pub fn set_lsn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12604        self.lsn = v.into();
12605        self
12606    }
12607}
12608
12609impl wkt::message::Message for SqlServerLsnPosition {
12610    fn typename() -> &'static str {
12611        "type.googleapis.com/google.cloud.datastream.v1.SqlServerLsnPosition"
12612    }
12613}
12614
12615/// Oracle SCN position
12616#[derive(Clone, Default, PartialEq)]
12617#[non_exhaustive]
12618pub struct OracleScnPosition {
12619    /// Required. SCN number from where Logs will be read
12620    pub scn: i64,
12621
12622    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12623}
12624
12625impl OracleScnPosition {
12626    pub fn new() -> Self {
12627        std::default::Default::default()
12628    }
12629
12630    /// Sets the value of [scn][crate::model::OracleScnPosition::scn].
12631    pub fn set_scn<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12632        self.scn = v.into();
12633        self
12634    }
12635}
12636
12637impl wkt::message::Message for OracleScnPosition {
12638    fn typename() -> &'static str {
12639        "type.googleapis.com/google.cloud.datastream.v1.OracleScnPosition"
12640    }
12641}
12642
12643/// MySQL log position
12644#[derive(Clone, Default, PartialEq)]
12645#[non_exhaustive]
12646pub struct MysqlLogPosition {
12647    /// Required. The binary log file name.
12648    pub log_file: std::string::String,
12649
12650    /// Optional. The position within the binary log file. Default is head of file.
12651    pub log_position: std::option::Option<i32>,
12652
12653    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12654}
12655
12656impl MysqlLogPosition {
12657    pub fn new() -> Self {
12658        std::default::Default::default()
12659    }
12660
12661    /// Sets the value of [log_file][crate::model::MysqlLogPosition::log_file].
12662    pub fn set_log_file<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12663        self.log_file = v.into();
12664        self
12665    }
12666
12667    /// Sets the value of [log_position][crate::model::MysqlLogPosition::log_position].
12668    pub fn set_log_position<T>(mut self, v: T) -> Self
12669    where
12670        T: std::convert::Into<i32>,
12671    {
12672        self.log_position = std::option::Option::Some(v.into());
12673        self
12674    }
12675
12676    /// Sets or clears the value of [log_position][crate::model::MysqlLogPosition::log_position].
12677    pub fn set_or_clear_log_position<T>(mut self, v: std::option::Option<T>) -> Self
12678    where
12679        T: std::convert::Into<i32>,
12680    {
12681        self.log_position = v.map(|x| x.into());
12682        self
12683    }
12684}
12685
12686impl wkt::message::Message for MysqlLogPosition {
12687    fn typename() -> &'static str {
12688        "type.googleapis.com/google.cloud.datastream.v1.MysqlLogPosition"
12689    }
12690}
12691
12692/// MySQL GTID position
12693#[derive(Clone, Default, PartialEq)]
12694#[non_exhaustive]
12695pub struct MysqlGtidPosition {
12696    /// Required. The gtid set to start replication from.
12697    pub gtid_set: std::string::String,
12698
12699    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12700}
12701
12702impl MysqlGtidPosition {
12703    pub fn new() -> Self {
12704        std::default::Default::default()
12705    }
12706
12707    /// Sets the value of [gtid_set][crate::model::MysqlGtidPosition::gtid_set].
12708    pub fn set_gtid_set<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12709        self.gtid_set = v.into();
12710        self
12711    }
12712}
12713
12714impl wkt::message::Message for MysqlGtidPosition {
12715    fn typename() -> &'static str {
12716        "type.googleapis.com/google.cloud.datastream.v1.MysqlGtidPosition"
12717    }
12718}