google_cloud_datastream_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate lazy_static;
25extern crate location;
26extern crate longrunning;
27extern crate lro;
28extern crate reqwest;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36/// Request message for 'discover' ConnectionProfile request.
37#[serde_with::serde_as]
38#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
39#[serde(default, rename_all = "camelCase")]
40#[non_exhaustive]
41pub struct DiscoverConnectionProfileRequest {
42    /// Required. The parent resource of the connection profile type. Must be in
43    /// the format `projects/*/locations/*`.
44    #[serde(skip_serializing_if = "std::string::String::is_empty")]
45    pub parent: std::string::String,
46
47    /// The connection profile on which to run discover.
48    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
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    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
53    pub hierarchy:
54        std::option::Option<crate::model::discover_connection_profile_request::Hierarchy>,
55
56    /// The data object to populate with child data objects and metadata.
57    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
58    pub data_object:
59        std::option::Option<crate::model::discover_connection_profile_request::DataObject>,
60
61    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
62    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
63}
64
65impl DiscoverConnectionProfileRequest {
66    pub fn new() -> Self {
67        std::default::Default::default()
68    }
69
70    /// Sets the value of [parent][crate::model::DiscoverConnectionProfileRequest::parent].
71    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
72        self.parent = v.into();
73        self
74    }
75
76    /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target].
77    ///
78    /// Note that all the setters affecting `target` are mutually
79    /// exclusive.
80    pub fn set_target<
81        T: std::convert::Into<
82                std::option::Option<crate::model::discover_connection_profile_request::Target>,
83            >,
84    >(
85        mut self,
86        v: T,
87    ) -> Self {
88        self.target = v.into();
89        self
90    }
91
92    /// The value of [target][crate::model::DiscoverConnectionProfileRequest::target]
93    /// if it holds a `ConnectionProfile`, `None` if the field is not set or
94    /// holds a different branch.
95    pub fn connection_profile(
96        &self,
97    ) -> std::option::Option<&std::boxed::Box<crate::model::ConnectionProfile>> {
98        #[allow(unreachable_patterns)]
99        self.target.as_ref().and_then(|v| match v {
100            crate::model::discover_connection_profile_request::Target::ConnectionProfile(v) => {
101                std::option::Option::Some(v)
102            }
103            _ => std::option::Option::None,
104        })
105    }
106
107    /// The value of [target][crate::model::DiscoverConnectionProfileRequest::target]
108    /// if it holds a `ConnectionProfileName`, `None` if the field is not set or
109    /// holds a different branch.
110    pub fn connection_profile_name(&self) -> std::option::Option<&std::string::String> {
111        #[allow(unreachable_patterns)]
112        self.target.as_ref().and_then(|v| match v {
113            crate::model::discover_connection_profile_request::Target::ConnectionProfileName(v) => {
114                std::option::Option::Some(v)
115            }
116            _ => std::option::Option::None,
117        })
118    }
119
120    /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target]
121    /// to hold a `ConnectionProfile`.
122    ///
123    /// Note that all the setters affecting `target` are
124    /// mutually exclusive.
125    pub fn set_connection_profile<
126        T: std::convert::Into<std::boxed::Box<crate::model::ConnectionProfile>>,
127    >(
128        mut self,
129        v: T,
130    ) -> Self {
131        self.target = std::option::Option::Some(
132            crate::model::discover_connection_profile_request::Target::ConnectionProfile(v.into()),
133        );
134        self
135    }
136
137    /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target]
138    /// to hold a `ConnectionProfileName`.
139    ///
140    /// Note that all the setters affecting `target` are
141    /// mutually exclusive.
142    pub fn set_connection_profile_name<T: std::convert::Into<std::string::String>>(
143        mut self,
144        v: T,
145    ) -> Self {
146        self.target = std::option::Option::Some(
147            crate::model::discover_connection_profile_request::Target::ConnectionProfileName(
148                v.into(),
149            ),
150        );
151        self
152    }
153
154    /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy].
155    ///
156    /// Note that all the setters affecting `hierarchy` are mutually
157    /// exclusive.
158    pub fn set_hierarchy<
159        T: std::convert::Into<
160                std::option::Option<crate::model::discover_connection_profile_request::Hierarchy>,
161            >,
162    >(
163        mut self,
164        v: T,
165    ) -> Self {
166        self.hierarchy = v.into();
167        self
168    }
169
170    /// The value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
171    /// if it holds a `FullHierarchy`, `None` if the field is not set or
172    /// holds a different branch.
173    pub fn full_hierarchy(&self) -> std::option::Option<&bool> {
174        #[allow(unreachable_patterns)]
175        self.hierarchy.as_ref().and_then(|v| match v {
176            crate::model::discover_connection_profile_request::Hierarchy::FullHierarchy(v) => {
177                std::option::Option::Some(v)
178            }
179            _ => std::option::Option::None,
180        })
181    }
182
183    /// The value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
184    /// if it holds a `HierarchyDepth`, `None` if the field is not set or
185    /// holds a different branch.
186    pub fn hierarchy_depth(&self) -> std::option::Option<&i32> {
187        #[allow(unreachable_patterns)]
188        self.hierarchy.as_ref().and_then(|v| match v {
189            crate::model::discover_connection_profile_request::Hierarchy::HierarchyDepth(v) => {
190                std::option::Option::Some(v)
191            }
192            _ => std::option::Option::None,
193        })
194    }
195
196    /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
197    /// to hold a `FullHierarchy`.
198    ///
199    /// Note that all the setters affecting `hierarchy` are
200    /// mutually exclusive.
201    pub fn set_full_hierarchy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
202        self.hierarchy = std::option::Option::Some(
203            crate::model::discover_connection_profile_request::Hierarchy::FullHierarchy(v.into()),
204        );
205        self
206    }
207
208    /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
209    /// to hold a `HierarchyDepth`.
210    ///
211    /// Note that all the setters affecting `hierarchy` are
212    /// mutually exclusive.
213    pub fn set_hierarchy_depth<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
214        self.hierarchy = std::option::Option::Some(
215            crate::model::discover_connection_profile_request::Hierarchy::HierarchyDepth(v.into()),
216        );
217        self
218    }
219
220    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object].
221    ///
222    /// Note that all the setters affecting `data_object` are mutually
223    /// exclusive.
224    pub fn set_data_object<
225        T: std::convert::Into<
226                std::option::Option<crate::model::discover_connection_profile_request::DataObject>,
227            >,
228    >(
229        mut self,
230        v: T,
231    ) -> Self {
232        self.data_object = v.into();
233        self
234    }
235
236    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
237    /// if it holds a `OracleRdbms`, `None` if the field is not set or
238    /// holds a different branch.
239    pub fn oracle_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
240        #[allow(unreachable_patterns)]
241        self.data_object.as_ref().and_then(|v| match v {
242            crate::model::discover_connection_profile_request::DataObject::OracleRdbms(v) => {
243                std::option::Option::Some(v)
244            }
245            _ => std::option::Option::None,
246        })
247    }
248
249    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
250    /// if it holds a `MysqlRdbms`, `None` if the field is not set or
251    /// holds a different branch.
252    pub fn mysql_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
253        #[allow(unreachable_patterns)]
254        self.data_object.as_ref().and_then(|v| match v {
255            crate::model::discover_connection_profile_request::DataObject::MysqlRdbms(v) => {
256                std::option::Option::Some(v)
257            }
258            _ => std::option::Option::None,
259        })
260    }
261
262    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
263    /// if it holds a `PostgresqlRdbms`, `None` if the field is not set or
264    /// holds a different branch.
265    pub fn postgresql_rdbms(
266        &self,
267    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
268        #[allow(unreachable_patterns)]
269        self.data_object.as_ref().and_then(|v| match v {
270            crate::model::discover_connection_profile_request::DataObject::PostgresqlRdbms(v) => {
271                std::option::Option::Some(v)
272            }
273            _ => std::option::Option::None,
274        })
275    }
276
277    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
278    /// if it holds a `SqlServerRdbms`, `None` if the field is not set or
279    /// holds a different branch.
280    pub fn sql_server_rdbms(
281        &self,
282    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
283        #[allow(unreachable_patterns)]
284        self.data_object.as_ref().and_then(|v| match v {
285            crate::model::discover_connection_profile_request::DataObject::SqlServerRdbms(v) => {
286                std::option::Option::Some(v)
287            }
288            _ => std::option::Option::None,
289        })
290    }
291
292    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
293    /// to hold a `OracleRdbms`.
294    ///
295    /// Note that all the setters affecting `data_object` are
296    /// mutually exclusive.
297    pub fn set_oracle_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>>(
298        mut self,
299        v: T,
300    ) -> Self {
301        self.data_object = std::option::Option::Some(
302            crate::model::discover_connection_profile_request::DataObject::OracleRdbms(v.into()),
303        );
304        self
305    }
306
307    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
308    /// to hold a `MysqlRdbms`.
309    ///
310    /// Note that all the setters affecting `data_object` are
311    /// mutually exclusive.
312    pub fn set_mysql_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>>(
313        mut self,
314        v: T,
315    ) -> Self {
316        self.data_object = std::option::Option::Some(
317            crate::model::discover_connection_profile_request::DataObject::MysqlRdbms(v.into()),
318        );
319        self
320    }
321
322    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
323    /// to hold a `PostgresqlRdbms`.
324    ///
325    /// Note that all the setters affecting `data_object` are
326    /// mutually exclusive.
327    pub fn set_postgresql_rdbms<
328        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
329    >(
330        mut self,
331        v: T,
332    ) -> Self {
333        self.data_object = std::option::Option::Some(
334            crate::model::discover_connection_profile_request::DataObject::PostgresqlRdbms(
335                v.into(),
336            ),
337        );
338        self
339    }
340
341    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
342    /// to hold a `SqlServerRdbms`.
343    ///
344    /// Note that all the setters affecting `data_object` are
345    /// mutually exclusive.
346    pub fn set_sql_server_rdbms<
347        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
348    >(
349        mut self,
350        v: T,
351    ) -> Self {
352        self.data_object = std::option::Option::Some(
353            crate::model::discover_connection_profile_request::DataObject::SqlServerRdbms(v.into()),
354        );
355        self
356    }
357}
358
359impl wkt::message::Message for DiscoverConnectionProfileRequest {
360    fn typename() -> &'static str {
361        "type.googleapis.com/google.cloud.datastream.v1.DiscoverConnectionProfileRequest"
362    }
363}
364
365/// Defines additional types related to [DiscoverConnectionProfileRequest].
366pub mod discover_connection_profile_request {
367    #[allow(unused_imports)]
368    use super::*;
369
370    /// The connection profile on which to run discover.
371    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
372    #[serde(rename_all = "camelCase")]
373    #[non_exhaustive]
374    pub enum Target {
375        /// An ad-hoc connection profile configuration.
376        ConnectionProfile(std::boxed::Box<crate::model::ConnectionProfile>),
377        /// A reference to an existing connection profile.
378        ConnectionProfileName(std::string::String),
379    }
380
381    /// The depth of the retrieved hierarchy of data objects.
382    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
383    #[serde(rename_all = "camelCase")]
384    #[non_exhaustive]
385    pub enum Hierarchy {
386        /// Whether to retrieve the full hierarchy of data objects (TRUE) or only the
387        /// current level (FALSE).
388        FullHierarchy(bool),
389        /// The number of hierarchy levels below the current level to be retrieved.
390        HierarchyDepth(i32),
391    }
392
393    /// The data object to populate with child data objects and metadata.
394    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
395    #[serde(rename_all = "camelCase")]
396    #[non_exhaustive]
397    pub enum DataObject {
398        /// Oracle RDBMS to enrich with child data objects and metadata.
399        OracleRdbms(std::boxed::Box<crate::model::OracleRdbms>),
400        /// MySQL RDBMS to enrich with child data objects and metadata.
401        MysqlRdbms(std::boxed::Box<crate::model::MysqlRdbms>),
402        /// PostgreSQL RDBMS to enrich with child data objects and metadata.
403        PostgresqlRdbms(std::boxed::Box<crate::model::PostgresqlRdbms>),
404        /// SQLServer RDBMS to enrich with child data objects and metadata.
405        SqlServerRdbms(std::boxed::Box<crate::model::SqlServerRdbms>),
406    }
407}
408
409/// Response from a discover request.
410#[serde_with::serde_as]
411#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
412#[serde(default, rename_all = "camelCase")]
413#[non_exhaustive]
414pub struct DiscoverConnectionProfileResponse {
415    /// The data object that has been enriched by the discover API call.
416    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
417    pub data_object:
418        std::option::Option<crate::model::discover_connection_profile_response::DataObject>,
419
420    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
421    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
422}
423
424impl DiscoverConnectionProfileResponse {
425    pub fn new() -> Self {
426        std::default::Default::default()
427    }
428
429    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object].
430    ///
431    /// Note that all the setters affecting `data_object` are mutually
432    /// exclusive.
433    pub fn set_data_object<
434        T: std::convert::Into<
435                std::option::Option<crate::model::discover_connection_profile_response::DataObject>,
436            >,
437    >(
438        mut self,
439        v: T,
440    ) -> Self {
441        self.data_object = v.into();
442        self
443    }
444
445    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
446    /// if it holds a `OracleRdbms`, `None` if the field is not set or
447    /// holds a different branch.
448    pub fn oracle_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
449        #[allow(unreachable_patterns)]
450        self.data_object.as_ref().and_then(|v| match v {
451            crate::model::discover_connection_profile_response::DataObject::OracleRdbms(v) => {
452                std::option::Option::Some(v)
453            }
454            _ => std::option::Option::None,
455        })
456    }
457
458    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
459    /// if it holds a `MysqlRdbms`, `None` if the field is not set or
460    /// holds a different branch.
461    pub fn mysql_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
462        #[allow(unreachable_patterns)]
463        self.data_object.as_ref().and_then(|v| match v {
464            crate::model::discover_connection_profile_response::DataObject::MysqlRdbms(v) => {
465                std::option::Option::Some(v)
466            }
467            _ => std::option::Option::None,
468        })
469    }
470
471    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
472    /// if it holds a `PostgresqlRdbms`, `None` if the field is not set or
473    /// holds a different branch.
474    pub fn postgresql_rdbms(
475        &self,
476    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
477        #[allow(unreachable_patterns)]
478        self.data_object.as_ref().and_then(|v| match v {
479            crate::model::discover_connection_profile_response::DataObject::PostgresqlRdbms(v) => {
480                std::option::Option::Some(v)
481            }
482            _ => std::option::Option::None,
483        })
484    }
485
486    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
487    /// if it holds a `SqlServerRdbms`, `None` if the field is not set or
488    /// holds a different branch.
489    pub fn sql_server_rdbms(
490        &self,
491    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
492        #[allow(unreachable_patterns)]
493        self.data_object.as_ref().and_then(|v| match v {
494            crate::model::discover_connection_profile_response::DataObject::SqlServerRdbms(v) => {
495                std::option::Option::Some(v)
496            }
497            _ => std::option::Option::None,
498        })
499    }
500
501    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
502    /// to hold a `OracleRdbms`.
503    ///
504    /// Note that all the setters affecting `data_object` are
505    /// mutually exclusive.
506    pub fn set_oracle_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>>(
507        mut self,
508        v: T,
509    ) -> Self {
510        self.data_object = std::option::Option::Some(
511            crate::model::discover_connection_profile_response::DataObject::OracleRdbms(v.into()),
512        );
513        self
514    }
515
516    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
517    /// to hold a `MysqlRdbms`.
518    ///
519    /// Note that all the setters affecting `data_object` are
520    /// mutually exclusive.
521    pub fn set_mysql_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>>(
522        mut self,
523        v: T,
524    ) -> Self {
525        self.data_object = std::option::Option::Some(
526            crate::model::discover_connection_profile_response::DataObject::MysqlRdbms(v.into()),
527        );
528        self
529    }
530
531    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
532    /// to hold a `PostgresqlRdbms`.
533    ///
534    /// Note that all the setters affecting `data_object` are
535    /// mutually exclusive.
536    pub fn set_postgresql_rdbms<
537        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
538    >(
539        mut self,
540        v: T,
541    ) -> Self {
542        self.data_object = std::option::Option::Some(
543            crate::model::discover_connection_profile_response::DataObject::PostgresqlRdbms(
544                v.into(),
545            ),
546        );
547        self
548    }
549
550    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
551    /// to hold a `SqlServerRdbms`.
552    ///
553    /// Note that all the setters affecting `data_object` are
554    /// mutually exclusive.
555    pub fn set_sql_server_rdbms<
556        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
557    >(
558        mut self,
559        v: T,
560    ) -> Self {
561        self.data_object = std::option::Option::Some(
562            crate::model::discover_connection_profile_response::DataObject::SqlServerRdbms(
563                v.into(),
564            ),
565        );
566        self
567    }
568}
569
570impl wkt::message::Message for DiscoverConnectionProfileResponse {
571    fn typename() -> &'static str {
572        "type.googleapis.com/google.cloud.datastream.v1.DiscoverConnectionProfileResponse"
573    }
574}
575
576/// Defines additional types related to [DiscoverConnectionProfileResponse].
577pub mod discover_connection_profile_response {
578    #[allow(unused_imports)]
579    use super::*;
580
581    /// The data object that has been enriched by the discover API call.
582    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
583    #[serde(rename_all = "camelCase")]
584    #[non_exhaustive]
585    pub enum DataObject {
586        /// Enriched Oracle RDBMS object.
587        OracleRdbms(std::boxed::Box<crate::model::OracleRdbms>),
588        /// Enriched MySQL RDBMS object.
589        MysqlRdbms(std::boxed::Box<crate::model::MysqlRdbms>),
590        /// Enriched PostgreSQL RDBMS object.
591        PostgresqlRdbms(std::boxed::Box<crate::model::PostgresqlRdbms>),
592        /// Enriched SQLServer RDBMS object.
593        SqlServerRdbms(std::boxed::Box<crate::model::SqlServerRdbms>),
594    }
595}
596
597/// Request message for 'FetchStaticIps' request.
598#[serde_with::serde_as]
599#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
600#[serde(default, rename_all = "camelCase")]
601#[non_exhaustive]
602pub struct FetchStaticIpsRequest {
603    /// Required. The resource name for the location for which static IPs should be
604    /// returned. Must be in the format `projects/*/locations/*`.
605    #[serde(skip_serializing_if = "std::string::String::is_empty")]
606    pub name: std::string::String,
607
608    /// Maximum number of Ips to return, will likely not be specified.
609    pub page_size: i32,
610
611    /// A page token, received from a previous `ListStaticIps` call.
612    /// will likely not be specified.
613    #[serde(skip_serializing_if = "std::string::String::is_empty")]
614    pub page_token: std::string::String,
615
616    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
617    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
618}
619
620impl FetchStaticIpsRequest {
621    pub fn new() -> Self {
622        std::default::Default::default()
623    }
624
625    /// Sets the value of [name][crate::model::FetchStaticIpsRequest::name].
626    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
627        self.name = v.into();
628        self
629    }
630
631    /// Sets the value of [page_size][crate::model::FetchStaticIpsRequest::page_size].
632    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
633        self.page_size = v.into();
634        self
635    }
636
637    /// Sets the value of [page_token][crate::model::FetchStaticIpsRequest::page_token].
638    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
639        self.page_token = v.into();
640        self
641    }
642}
643
644impl wkt::message::Message for FetchStaticIpsRequest {
645    fn typename() -> &'static str {
646        "type.googleapis.com/google.cloud.datastream.v1.FetchStaticIpsRequest"
647    }
648}
649
650/// Response message for a 'FetchStaticIps' response.
651#[serde_with::serde_as]
652#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
653#[serde(default, rename_all = "camelCase")]
654#[non_exhaustive]
655pub struct FetchStaticIpsResponse {
656    /// list of static ips by account
657    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
658    pub static_ips: std::vec::Vec<std::string::String>,
659
660    /// A token that can be sent as `page_token` to retrieve the next page.
661    /// If this field is omitted, there are no subsequent pages.
662    #[serde(skip_serializing_if = "std::string::String::is_empty")]
663    pub next_page_token: std::string::String,
664
665    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
666    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
667}
668
669impl FetchStaticIpsResponse {
670    pub fn new() -> Self {
671        std::default::Default::default()
672    }
673
674    /// Sets the value of [next_page_token][crate::model::FetchStaticIpsResponse::next_page_token].
675    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
676        self.next_page_token = v.into();
677        self
678    }
679
680    /// Sets the value of [static_ips][crate::model::FetchStaticIpsResponse::static_ips].
681    pub fn set_static_ips<T, V>(mut self, v: T) -> Self
682    where
683        T: std::iter::IntoIterator<Item = V>,
684        V: std::convert::Into<std::string::String>,
685    {
686        use std::iter::Iterator;
687        self.static_ips = v.into_iter().map(|i| i.into()).collect();
688        self
689    }
690}
691
692impl wkt::message::Message for FetchStaticIpsResponse {
693    fn typename() -> &'static str {
694        "type.googleapis.com/google.cloud.datastream.v1.FetchStaticIpsResponse"
695    }
696}
697
698/// Request message for listing connection profiles.
699#[serde_with::serde_as]
700#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
701#[serde(default, rename_all = "camelCase")]
702#[non_exhaustive]
703pub struct ListConnectionProfilesRequest {
704    /// Required. The parent that owns the collection of connection profiles.
705    #[serde(skip_serializing_if = "std::string::String::is_empty")]
706    pub parent: std::string::String,
707
708    /// Maximum number of connection profiles to return.
709    /// If unspecified, at most 50 connection profiles will be returned.
710    /// The maximum value is 1000; values above 1000 will be coerced to 1000.
711    pub page_size: i32,
712
713    /// Page token received from a previous `ListConnectionProfiles` call.
714    /// Provide this to retrieve the subsequent page.
715    ///
716    /// When paginating, all other parameters provided to `ListConnectionProfiles`
717    /// must match the call that provided the page token.
718    #[serde(skip_serializing_if = "std::string::String::is_empty")]
719    pub page_token: std::string::String,
720
721    /// Filter request.
722    #[serde(skip_serializing_if = "std::string::String::is_empty")]
723    pub filter: std::string::String,
724
725    /// Order by fields for the result.
726    #[serde(skip_serializing_if = "std::string::String::is_empty")]
727    pub order_by: std::string::String,
728
729    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
730    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
731}
732
733impl ListConnectionProfilesRequest {
734    pub fn new() -> Self {
735        std::default::Default::default()
736    }
737
738    /// Sets the value of [parent][crate::model::ListConnectionProfilesRequest::parent].
739    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
740        self.parent = v.into();
741        self
742    }
743
744    /// Sets the value of [page_size][crate::model::ListConnectionProfilesRequest::page_size].
745    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
746        self.page_size = v.into();
747        self
748    }
749
750    /// Sets the value of [page_token][crate::model::ListConnectionProfilesRequest::page_token].
751    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
752        self.page_token = v.into();
753        self
754    }
755
756    /// Sets the value of [filter][crate::model::ListConnectionProfilesRequest::filter].
757    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
758        self.filter = v.into();
759        self
760    }
761
762    /// Sets the value of [order_by][crate::model::ListConnectionProfilesRequest::order_by].
763    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
764        self.order_by = v.into();
765        self
766    }
767}
768
769impl wkt::message::Message for ListConnectionProfilesRequest {
770    fn typename() -> &'static str {
771        "type.googleapis.com/google.cloud.datastream.v1.ListConnectionProfilesRequest"
772    }
773}
774
775/// Response message for listing connection profiles.
776#[serde_with::serde_as]
777#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
778#[serde(default, rename_all = "camelCase")]
779#[non_exhaustive]
780pub struct ListConnectionProfilesResponse {
781    /// List of connection profiles.
782    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
783    pub connection_profiles: std::vec::Vec<crate::model::ConnectionProfile>,
784
785    /// A token, which can be sent as `page_token` to retrieve the next page.
786    /// If this field is omitted, there are no subsequent pages.
787    #[serde(skip_serializing_if = "std::string::String::is_empty")]
788    pub next_page_token: std::string::String,
789
790    /// Locations that could not be reached.
791    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
792    pub unreachable: std::vec::Vec<std::string::String>,
793
794    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
795    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
796}
797
798impl ListConnectionProfilesResponse {
799    pub fn new() -> Self {
800        std::default::Default::default()
801    }
802
803    /// Sets the value of [next_page_token][crate::model::ListConnectionProfilesResponse::next_page_token].
804    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
805        self.next_page_token = v.into();
806        self
807    }
808
809    /// Sets the value of [connection_profiles][crate::model::ListConnectionProfilesResponse::connection_profiles].
810    pub fn set_connection_profiles<T, V>(mut self, v: T) -> Self
811    where
812        T: std::iter::IntoIterator<Item = V>,
813        V: std::convert::Into<crate::model::ConnectionProfile>,
814    {
815        use std::iter::Iterator;
816        self.connection_profiles = v.into_iter().map(|i| i.into()).collect();
817        self
818    }
819
820    /// Sets the value of [unreachable][crate::model::ListConnectionProfilesResponse::unreachable].
821    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
822    where
823        T: std::iter::IntoIterator<Item = V>,
824        V: std::convert::Into<std::string::String>,
825    {
826        use std::iter::Iterator;
827        self.unreachable = v.into_iter().map(|i| i.into()).collect();
828        self
829    }
830}
831
832impl wkt::message::Message for ListConnectionProfilesResponse {
833    fn typename() -> &'static str {
834        "type.googleapis.com/google.cloud.datastream.v1.ListConnectionProfilesResponse"
835    }
836}
837
838#[doc(hidden)]
839impl gax::paginator::internal::PageableResponse for ListConnectionProfilesResponse {
840    type PageItem = crate::model::ConnectionProfile;
841
842    fn items(self) -> std::vec::Vec<Self::PageItem> {
843        self.connection_profiles
844    }
845
846    fn next_page_token(&self) -> std::string::String {
847        use std::clone::Clone;
848        self.next_page_token.clone()
849    }
850}
851
852/// Request message for getting a connection profile.
853#[serde_with::serde_as]
854#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
855#[serde(default, rename_all = "camelCase")]
856#[non_exhaustive]
857pub struct GetConnectionProfileRequest {
858    /// Required. The name of the connection profile resource to get.
859    #[serde(skip_serializing_if = "std::string::String::is_empty")]
860    pub name: std::string::String,
861
862    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
863    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
864}
865
866impl GetConnectionProfileRequest {
867    pub fn new() -> Self {
868        std::default::Default::default()
869    }
870
871    /// Sets the value of [name][crate::model::GetConnectionProfileRequest::name].
872    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
873        self.name = v.into();
874        self
875    }
876}
877
878impl wkt::message::Message for GetConnectionProfileRequest {
879    fn typename() -> &'static str {
880        "type.googleapis.com/google.cloud.datastream.v1.GetConnectionProfileRequest"
881    }
882}
883
884/// Request message for creating a connection profile.
885#[serde_with::serde_as]
886#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
887#[serde(default, rename_all = "camelCase")]
888#[non_exhaustive]
889pub struct CreateConnectionProfileRequest {
890    /// Required. The parent that owns the collection of ConnectionProfiles.
891    #[serde(skip_serializing_if = "std::string::String::is_empty")]
892    pub parent: std::string::String,
893
894    /// Required. The connection profile identifier.
895    #[serde(skip_serializing_if = "std::string::String::is_empty")]
896    pub connection_profile_id: std::string::String,
897
898    /// Required. The connection profile resource to create.
899    #[serde(skip_serializing_if = "std::option::Option::is_none")]
900    pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
901
902    /// Optional. A request ID to identify requests. Specify a unique request ID
903    /// so that if you must retry your request, the server will know to ignore
904    /// the request if it has already been completed. The server will guarantee
905    /// that for at least 60 minutes since the first request.
906    ///
907    /// For example, consider a situation where you make an initial request and the
908    /// request times out. If you make the request again with the same request ID,
909    /// the server can check if original operation with the same request ID was
910    /// received, and if so, will ignore the second request. This prevents clients
911    /// from accidentally creating duplicate commitments.
912    ///
913    /// The request ID must be a valid UUID with the exception that zero UUID is
914    /// not supported (00000000-0000-0000-0000-000000000000).
915    #[serde(skip_serializing_if = "std::string::String::is_empty")]
916    pub request_id: std::string::String,
917
918    /// Optional. Only validate the connection profile, but don't create any
919    /// resources. The default is false.
920    pub validate_only: bool,
921
922    /// Optional. Create the connection profile without validating it.
923    pub force: bool,
924
925    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
926    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
927}
928
929impl CreateConnectionProfileRequest {
930    pub fn new() -> Self {
931        std::default::Default::default()
932    }
933
934    /// Sets the value of [parent][crate::model::CreateConnectionProfileRequest::parent].
935    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
936        self.parent = v.into();
937        self
938    }
939
940    /// Sets the value of [connection_profile_id][crate::model::CreateConnectionProfileRequest::connection_profile_id].
941    pub fn set_connection_profile_id<T: std::convert::Into<std::string::String>>(
942        mut self,
943        v: T,
944    ) -> Self {
945        self.connection_profile_id = v.into();
946        self
947    }
948
949    /// Sets the value of [connection_profile][crate::model::CreateConnectionProfileRequest::connection_profile].
950    pub fn set_connection_profile<
951        T: std::convert::Into<std::option::Option<crate::model::ConnectionProfile>>,
952    >(
953        mut self,
954        v: T,
955    ) -> Self {
956        self.connection_profile = v.into();
957        self
958    }
959
960    /// Sets the value of [request_id][crate::model::CreateConnectionProfileRequest::request_id].
961    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
962        self.request_id = v.into();
963        self
964    }
965
966    /// Sets the value of [validate_only][crate::model::CreateConnectionProfileRequest::validate_only].
967    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
968        self.validate_only = v.into();
969        self
970    }
971
972    /// Sets the value of [force][crate::model::CreateConnectionProfileRequest::force].
973    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
974        self.force = v.into();
975        self
976    }
977}
978
979impl wkt::message::Message for CreateConnectionProfileRequest {
980    fn typename() -> &'static str {
981        "type.googleapis.com/google.cloud.datastream.v1.CreateConnectionProfileRequest"
982    }
983}
984
985/// Connection profile update message.
986#[serde_with::serde_as]
987#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
988#[serde(default, rename_all = "camelCase")]
989#[non_exhaustive]
990pub struct UpdateConnectionProfileRequest {
991    /// Optional. Field mask is used to specify the fields to be overwritten in the
992    /// ConnectionProfile resource by the update.
993    /// The fields specified in the update_mask are relative to the resource, not
994    /// the full request. A field will be overwritten if it is in the mask. If the
995    /// user does not provide a mask then all fields will be overwritten.
996    #[serde(skip_serializing_if = "std::option::Option::is_none")]
997    pub update_mask: std::option::Option<wkt::FieldMask>,
998
999    /// Required. The connection profile to update.
1000    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1001    pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
1002
1003    /// Optional. A request ID to identify requests. Specify a unique request ID
1004    /// so that if you must retry your request, the server will know to ignore
1005    /// the request if it has already been completed. The server will guarantee
1006    /// that for at least 60 minutes since the first request.
1007    ///
1008    /// For example, consider a situation where you make an initial request and the
1009    /// request times out. If you make the request again with the same request ID,
1010    /// the server can check if original operation with the same request ID was
1011    /// received, and if so, will ignore the second request. This prevents clients
1012    /// from accidentally creating duplicate commitments.
1013    ///
1014    /// The request ID must be a valid UUID with the exception that zero UUID is
1015    /// not supported (00000000-0000-0000-0000-000000000000).
1016    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1017    pub request_id: std::string::String,
1018
1019    /// Optional. Only validate the connection profile, but don't update any
1020    /// resources. The default is false.
1021    pub validate_only: bool,
1022
1023    /// Optional. Update the connection profile without validating it.
1024    pub force: bool,
1025
1026    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1027    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1028}
1029
1030impl UpdateConnectionProfileRequest {
1031    pub fn new() -> Self {
1032        std::default::Default::default()
1033    }
1034
1035    /// Sets the value of [update_mask][crate::model::UpdateConnectionProfileRequest::update_mask].
1036    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
1037        mut self,
1038        v: T,
1039    ) -> Self {
1040        self.update_mask = v.into();
1041        self
1042    }
1043
1044    /// Sets the value of [connection_profile][crate::model::UpdateConnectionProfileRequest::connection_profile].
1045    pub fn set_connection_profile<
1046        T: std::convert::Into<std::option::Option<crate::model::ConnectionProfile>>,
1047    >(
1048        mut self,
1049        v: T,
1050    ) -> Self {
1051        self.connection_profile = v.into();
1052        self
1053    }
1054
1055    /// Sets the value of [request_id][crate::model::UpdateConnectionProfileRequest::request_id].
1056    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1057        self.request_id = v.into();
1058        self
1059    }
1060
1061    /// Sets the value of [validate_only][crate::model::UpdateConnectionProfileRequest::validate_only].
1062    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1063        self.validate_only = v.into();
1064        self
1065    }
1066
1067    /// Sets the value of [force][crate::model::UpdateConnectionProfileRequest::force].
1068    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1069        self.force = v.into();
1070        self
1071    }
1072}
1073
1074impl wkt::message::Message for UpdateConnectionProfileRequest {
1075    fn typename() -> &'static str {
1076        "type.googleapis.com/google.cloud.datastream.v1.UpdateConnectionProfileRequest"
1077    }
1078}
1079
1080/// Request message for deleting a connection profile.
1081#[serde_with::serde_as]
1082#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1083#[serde(default, rename_all = "camelCase")]
1084#[non_exhaustive]
1085pub struct DeleteConnectionProfileRequest {
1086    /// Required. The name of the connection profile resource to delete.
1087    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1088    pub name: std::string::String,
1089
1090    /// Optional. A request ID to identify requests. Specify a unique request ID
1091    /// so that if you must retry your request, the server will know to ignore
1092    /// the request if it has already been completed. The server will guarantee
1093    /// that for at least 60 minutes after the first request.
1094    ///
1095    /// For example, consider a situation where you make an initial request and the
1096    /// request times out. If you make the request again with the same request ID,
1097    /// the server can check if original operation with the same request ID was
1098    /// received, and if so, will ignore the second request. This prevents clients
1099    /// from accidentally creating duplicate commitments.
1100    ///
1101    /// The request ID must be a valid UUID with the exception that zero UUID is
1102    /// not supported (00000000-0000-0000-0000-000000000000).
1103    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1104    pub request_id: std::string::String,
1105
1106    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1107    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1108}
1109
1110impl DeleteConnectionProfileRequest {
1111    pub fn new() -> Self {
1112        std::default::Default::default()
1113    }
1114
1115    /// Sets the value of [name][crate::model::DeleteConnectionProfileRequest::name].
1116    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1117        self.name = v.into();
1118        self
1119    }
1120
1121    /// Sets the value of [request_id][crate::model::DeleteConnectionProfileRequest::request_id].
1122    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1123        self.request_id = v.into();
1124        self
1125    }
1126}
1127
1128impl wkt::message::Message for DeleteConnectionProfileRequest {
1129    fn typename() -> &'static str {
1130        "type.googleapis.com/google.cloud.datastream.v1.DeleteConnectionProfileRequest"
1131    }
1132}
1133
1134/// Request message for listing streams.
1135#[serde_with::serde_as]
1136#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1137#[serde(default, rename_all = "camelCase")]
1138#[non_exhaustive]
1139pub struct ListStreamsRequest {
1140    /// Required. The parent that owns the collection of streams.
1141    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1142    pub parent: std::string::String,
1143
1144    /// Maximum number of streams to return.
1145    /// If unspecified, at most 50 streams will  be returned. The maximum
1146    /// value is 1000; values above 1000 will be coerced to 1000.
1147    pub page_size: i32,
1148
1149    /// Page token received from a previous `ListStreams` call.
1150    /// Provide this to retrieve the subsequent page.
1151    ///
1152    /// When paginating, all other parameters provided to `ListStreams`
1153    /// must match the call that provided the page token.
1154    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1155    pub page_token: std::string::String,
1156
1157    /// Filter request.
1158    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1159    pub filter: std::string::String,
1160
1161    /// Order by fields for the result.
1162    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1163    pub order_by: std::string::String,
1164
1165    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1166    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1167}
1168
1169impl ListStreamsRequest {
1170    pub fn new() -> Self {
1171        std::default::Default::default()
1172    }
1173
1174    /// Sets the value of [parent][crate::model::ListStreamsRequest::parent].
1175    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1176        self.parent = v.into();
1177        self
1178    }
1179
1180    /// Sets the value of [page_size][crate::model::ListStreamsRequest::page_size].
1181    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1182        self.page_size = v.into();
1183        self
1184    }
1185
1186    /// Sets the value of [page_token][crate::model::ListStreamsRequest::page_token].
1187    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1188        self.page_token = v.into();
1189        self
1190    }
1191
1192    /// Sets the value of [filter][crate::model::ListStreamsRequest::filter].
1193    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1194        self.filter = v.into();
1195        self
1196    }
1197
1198    /// Sets the value of [order_by][crate::model::ListStreamsRequest::order_by].
1199    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1200        self.order_by = v.into();
1201        self
1202    }
1203}
1204
1205impl wkt::message::Message for ListStreamsRequest {
1206    fn typename() -> &'static str {
1207        "type.googleapis.com/google.cloud.datastream.v1.ListStreamsRequest"
1208    }
1209}
1210
1211/// Response message for listing streams.
1212#[serde_with::serde_as]
1213#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1214#[serde(default, rename_all = "camelCase")]
1215#[non_exhaustive]
1216pub struct ListStreamsResponse {
1217    /// List of streams
1218    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1219    pub streams: std::vec::Vec<crate::model::Stream>,
1220
1221    /// A token, which can be sent as `page_token` to retrieve the next page.
1222    /// If this field is omitted, there are no subsequent pages.
1223    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1224    pub next_page_token: std::string::String,
1225
1226    /// Locations that could not be reached.
1227    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1228    pub unreachable: std::vec::Vec<std::string::String>,
1229
1230    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1231    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1232}
1233
1234impl ListStreamsResponse {
1235    pub fn new() -> Self {
1236        std::default::Default::default()
1237    }
1238
1239    /// Sets the value of [next_page_token][crate::model::ListStreamsResponse::next_page_token].
1240    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1241        self.next_page_token = v.into();
1242        self
1243    }
1244
1245    /// Sets the value of [streams][crate::model::ListStreamsResponse::streams].
1246    pub fn set_streams<T, V>(mut self, v: T) -> Self
1247    where
1248        T: std::iter::IntoIterator<Item = V>,
1249        V: std::convert::Into<crate::model::Stream>,
1250    {
1251        use std::iter::Iterator;
1252        self.streams = v.into_iter().map(|i| i.into()).collect();
1253        self
1254    }
1255
1256    /// Sets the value of [unreachable][crate::model::ListStreamsResponse::unreachable].
1257    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1258    where
1259        T: std::iter::IntoIterator<Item = V>,
1260        V: std::convert::Into<std::string::String>,
1261    {
1262        use std::iter::Iterator;
1263        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1264        self
1265    }
1266}
1267
1268impl wkt::message::Message for ListStreamsResponse {
1269    fn typename() -> &'static str {
1270        "type.googleapis.com/google.cloud.datastream.v1.ListStreamsResponse"
1271    }
1272}
1273
1274#[doc(hidden)]
1275impl gax::paginator::internal::PageableResponse for ListStreamsResponse {
1276    type PageItem = crate::model::Stream;
1277
1278    fn items(self) -> std::vec::Vec<Self::PageItem> {
1279        self.streams
1280    }
1281
1282    fn next_page_token(&self) -> std::string::String {
1283        use std::clone::Clone;
1284        self.next_page_token.clone()
1285    }
1286}
1287
1288/// Request message for getting a stream.
1289#[serde_with::serde_as]
1290#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1291#[serde(default, rename_all = "camelCase")]
1292#[non_exhaustive]
1293pub struct GetStreamRequest {
1294    /// Required. The name of the stream resource to get.
1295    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1296    pub name: std::string::String,
1297
1298    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1299    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1300}
1301
1302impl GetStreamRequest {
1303    pub fn new() -> Self {
1304        std::default::Default::default()
1305    }
1306
1307    /// Sets the value of [name][crate::model::GetStreamRequest::name].
1308    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1309        self.name = v.into();
1310        self
1311    }
1312}
1313
1314impl wkt::message::Message for GetStreamRequest {
1315    fn typename() -> &'static str {
1316        "type.googleapis.com/google.cloud.datastream.v1.GetStreamRequest"
1317    }
1318}
1319
1320/// Request message for creating a stream.
1321#[serde_with::serde_as]
1322#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1323#[serde(default, rename_all = "camelCase")]
1324#[non_exhaustive]
1325pub struct CreateStreamRequest {
1326    /// Required. The parent that owns the collection of streams.
1327    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1328    pub parent: std::string::String,
1329
1330    /// Required. The stream identifier.
1331    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1332    pub stream_id: std::string::String,
1333
1334    /// Required. The stream resource to create.
1335    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1336    pub stream: std::option::Option<crate::model::Stream>,
1337
1338    /// Optional. A request ID to identify requests. Specify a unique request ID
1339    /// so that if you must retry your request, the server will know to ignore
1340    /// the request if it has already been completed. The server will guarantee
1341    /// that for at least 60 minutes since the first request.
1342    ///
1343    /// For example, consider a situation where you make an initial request and the
1344    /// request times out. If you make the request again with the same request ID,
1345    /// the server can check if original operation with the same request ID was
1346    /// received, and if so, will ignore the second request. This prevents clients
1347    /// from accidentally creating duplicate commitments.
1348    ///
1349    /// The request ID must be a valid UUID with the exception that zero UUID is
1350    /// not supported (00000000-0000-0000-0000-000000000000).
1351    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1352    pub request_id: std::string::String,
1353
1354    /// Optional. Only validate the stream, but don't create any resources.
1355    /// The default is false.
1356    pub validate_only: bool,
1357
1358    /// Optional. Create the stream without validating it.
1359    pub force: bool,
1360
1361    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1362    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1363}
1364
1365impl CreateStreamRequest {
1366    pub fn new() -> Self {
1367        std::default::Default::default()
1368    }
1369
1370    /// Sets the value of [parent][crate::model::CreateStreamRequest::parent].
1371    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1372        self.parent = v.into();
1373        self
1374    }
1375
1376    /// Sets the value of [stream_id][crate::model::CreateStreamRequest::stream_id].
1377    pub fn set_stream_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1378        self.stream_id = v.into();
1379        self
1380    }
1381
1382    /// Sets the value of [stream][crate::model::CreateStreamRequest::stream].
1383    pub fn set_stream<T: std::convert::Into<std::option::Option<crate::model::Stream>>>(
1384        mut self,
1385        v: T,
1386    ) -> Self {
1387        self.stream = v.into();
1388        self
1389    }
1390
1391    /// Sets the value of [request_id][crate::model::CreateStreamRequest::request_id].
1392    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1393        self.request_id = v.into();
1394        self
1395    }
1396
1397    /// Sets the value of [validate_only][crate::model::CreateStreamRequest::validate_only].
1398    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1399        self.validate_only = v.into();
1400        self
1401    }
1402
1403    /// Sets the value of [force][crate::model::CreateStreamRequest::force].
1404    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1405        self.force = v.into();
1406        self
1407    }
1408}
1409
1410impl wkt::message::Message for CreateStreamRequest {
1411    fn typename() -> &'static str {
1412        "type.googleapis.com/google.cloud.datastream.v1.CreateStreamRequest"
1413    }
1414}
1415
1416/// Request message for updating a stream.
1417#[serde_with::serde_as]
1418#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1419#[serde(default, rename_all = "camelCase")]
1420#[non_exhaustive]
1421pub struct UpdateStreamRequest {
1422    /// Optional. Field mask is used to specify the fields to be overwritten in the
1423    /// stream resource by the update.
1424    /// The fields specified in the update_mask are relative to the resource, not
1425    /// the full request. A field will be overwritten if it is in the mask. If the
1426    /// user does not provide a mask then all fields will be overwritten.
1427    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1428    pub update_mask: std::option::Option<wkt::FieldMask>,
1429
1430    /// Required. The stream resource to update.
1431    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1432    pub stream: std::option::Option<crate::model::Stream>,
1433
1434    /// Optional. A request ID to identify requests. Specify a unique request ID
1435    /// so that if you must retry your request, the server will know to ignore
1436    /// the request if it has already been completed. The server will guarantee
1437    /// that for at least 60 minutes since the first request.
1438    ///
1439    /// For example, consider a situation where you make an initial request and the
1440    /// request times out. If you make the request again with the same request ID,
1441    /// the server can check if original operation with the same request ID was
1442    /// received, and if so, will ignore the second request. This prevents clients
1443    /// from accidentally creating duplicate commitments.
1444    ///
1445    /// The request ID must be a valid UUID with the exception that zero UUID is
1446    /// not supported (00000000-0000-0000-0000-000000000000).
1447    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1448    pub request_id: std::string::String,
1449
1450    /// Optional. Only validate the stream with the changes, without actually
1451    /// updating it. The default is false.
1452    pub validate_only: bool,
1453
1454    /// Optional. Update the stream without validating it.
1455    pub force: bool,
1456
1457    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1458    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1459}
1460
1461impl UpdateStreamRequest {
1462    pub fn new() -> Self {
1463        std::default::Default::default()
1464    }
1465
1466    /// Sets the value of [update_mask][crate::model::UpdateStreamRequest::update_mask].
1467    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
1468        mut self,
1469        v: T,
1470    ) -> Self {
1471        self.update_mask = v.into();
1472        self
1473    }
1474
1475    /// Sets the value of [stream][crate::model::UpdateStreamRequest::stream].
1476    pub fn set_stream<T: std::convert::Into<std::option::Option<crate::model::Stream>>>(
1477        mut self,
1478        v: T,
1479    ) -> Self {
1480        self.stream = v.into();
1481        self
1482    }
1483
1484    /// Sets the value of [request_id][crate::model::UpdateStreamRequest::request_id].
1485    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1486        self.request_id = v.into();
1487        self
1488    }
1489
1490    /// Sets the value of [validate_only][crate::model::UpdateStreamRequest::validate_only].
1491    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1492        self.validate_only = v.into();
1493        self
1494    }
1495
1496    /// Sets the value of [force][crate::model::UpdateStreamRequest::force].
1497    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1498        self.force = v.into();
1499        self
1500    }
1501}
1502
1503impl wkt::message::Message for UpdateStreamRequest {
1504    fn typename() -> &'static str {
1505        "type.googleapis.com/google.cloud.datastream.v1.UpdateStreamRequest"
1506    }
1507}
1508
1509/// Request message for deleting a stream.
1510#[serde_with::serde_as]
1511#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1512#[serde(default, rename_all = "camelCase")]
1513#[non_exhaustive]
1514pub struct DeleteStreamRequest {
1515    /// Required. The name of the stream resource to delete.
1516    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1517    pub name: std::string::String,
1518
1519    /// Optional. A request ID to identify requests. Specify a unique request ID
1520    /// so that if you must retry your request, the server will know to ignore
1521    /// the request if it has already been completed. The server will guarantee
1522    /// that for at least 60 minutes after the first request.
1523    ///
1524    /// For example, consider a situation where you make an initial request and the
1525    /// request times out. If you make the request again with the same request ID,
1526    /// the server can check if original operation with the same request ID was
1527    /// received, and if so, will ignore the second request. This prevents clients
1528    /// from accidentally creating duplicate commitments.
1529    ///
1530    /// The request ID must be a valid UUID with the exception that zero UUID is
1531    /// not supported (00000000-0000-0000-0000-000000000000).
1532    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1533    pub request_id: std::string::String,
1534
1535    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1536    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1537}
1538
1539impl DeleteStreamRequest {
1540    pub fn new() -> Self {
1541        std::default::Default::default()
1542    }
1543
1544    /// Sets the value of [name][crate::model::DeleteStreamRequest::name].
1545    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1546        self.name = v.into();
1547        self
1548    }
1549
1550    /// Sets the value of [request_id][crate::model::DeleteStreamRequest::request_id].
1551    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1552        self.request_id = v.into();
1553        self
1554    }
1555}
1556
1557impl wkt::message::Message for DeleteStreamRequest {
1558    fn typename() -> &'static str {
1559        "type.googleapis.com/google.cloud.datastream.v1.DeleteStreamRequest"
1560    }
1561}
1562
1563/// Request message for running a stream.
1564#[serde_with::serde_as]
1565#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1566#[serde(default, rename_all = "camelCase")]
1567#[non_exhaustive]
1568pub struct RunStreamRequest {
1569    /// Required. Name of the stream resource to start, in the format:
1570    /// projects/{project_id}/locations/{location}/streams/{stream_name}
1571    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1572    pub name: std::string::String,
1573
1574    /// Optional. The CDC strategy of the stream. If not set, the system's default
1575    /// value will be used.
1576    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1577    pub cdc_strategy: std::option::Option<crate::model::CdcStrategy>,
1578
1579    /// Optional. Update the stream without validating it.
1580    pub force: bool,
1581
1582    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1583    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1584}
1585
1586impl RunStreamRequest {
1587    pub fn new() -> Self {
1588        std::default::Default::default()
1589    }
1590
1591    /// Sets the value of [name][crate::model::RunStreamRequest::name].
1592    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1593        self.name = v.into();
1594        self
1595    }
1596
1597    /// Sets the value of [cdc_strategy][crate::model::RunStreamRequest::cdc_strategy].
1598    pub fn set_cdc_strategy<
1599        T: std::convert::Into<std::option::Option<crate::model::CdcStrategy>>,
1600    >(
1601        mut self,
1602        v: T,
1603    ) -> Self {
1604        self.cdc_strategy = v.into();
1605        self
1606    }
1607
1608    /// Sets the value of [force][crate::model::RunStreamRequest::force].
1609    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1610        self.force = v.into();
1611        self
1612    }
1613}
1614
1615impl wkt::message::Message for RunStreamRequest {
1616    fn typename() -> &'static str {
1617        "type.googleapis.com/google.cloud.datastream.v1.RunStreamRequest"
1618    }
1619}
1620
1621/// Request for fetching a specific stream object.
1622#[serde_with::serde_as]
1623#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1624#[serde(default, rename_all = "camelCase")]
1625#[non_exhaustive]
1626pub struct GetStreamObjectRequest {
1627    /// Required. The name of the stream object resource to get.
1628    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1629    pub name: std::string::String,
1630
1631    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1632    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1633}
1634
1635impl GetStreamObjectRequest {
1636    pub fn new() -> Self {
1637        std::default::Default::default()
1638    }
1639
1640    /// Sets the value of [name][crate::model::GetStreamObjectRequest::name].
1641    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1642        self.name = v.into();
1643        self
1644    }
1645}
1646
1647impl wkt::message::Message for GetStreamObjectRequest {
1648    fn typename() -> &'static str {
1649        "type.googleapis.com/google.cloud.datastream.v1.GetStreamObjectRequest"
1650    }
1651}
1652
1653/// Request for looking up a specific stream object by its source object
1654/// identifier.
1655#[serde_with::serde_as]
1656#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1657#[serde(default, rename_all = "camelCase")]
1658#[non_exhaustive]
1659pub struct LookupStreamObjectRequest {
1660    /// Required. The parent stream that owns the collection of objects.
1661    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1662    pub parent: std::string::String,
1663
1664    /// Required. The source object identifier which maps to the stream object.
1665    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1666    pub source_object_identifier: std::option::Option<crate::model::SourceObjectIdentifier>,
1667
1668    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1669    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1670}
1671
1672impl LookupStreamObjectRequest {
1673    pub fn new() -> Self {
1674        std::default::Default::default()
1675    }
1676
1677    /// Sets the value of [parent][crate::model::LookupStreamObjectRequest::parent].
1678    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1679        self.parent = v.into();
1680        self
1681    }
1682
1683    /// Sets the value of [source_object_identifier][crate::model::LookupStreamObjectRequest::source_object_identifier].
1684    pub fn set_source_object_identifier<
1685        T: std::convert::Into<std::option::Option<crate::model::SourceObjectIdentifier>>,
1686    >(
1687        mut self,
1688        v: T,
1689    ) -> Self {
1690        self.source_object_identifier = v.into();
1691        self
1692    }
1693}
1694
1695impl wkt::message::Message for LookupStreamObjectRequest {
1696    fn typename() -> &'static str {
1697        "type.googleapis.com/google.cloud.datastream.v1.LookupStreamObjectRequest"
1698    }
1699}
1700
1701/// Request for manually initiating a backfill job for a specific stream object.
1702#[serde_with::serde_as]
1703#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1704#[serde(default, rename_all = "camelCase")]
1705#[non_exhaustive]
1706pub struct StartBackfillJobRequest {
1707    /// Required. The name of the stream object resource to start a backfill job
1708    /// for.
1709    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1710    pub object: std::string::String,
1711
1712    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1713    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1714}
1715
1716impl StartBackfillJobRequest {
1717    pub fn new() -> Self {
1718        std::default::Default::default()
1719    }
1720
1721    /// Sets the value of [object][crate::model::StartBackfillJobRequest::object].
1722    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1723        self.object = v.into();
1724        self
1725    }
1726}
1727
1728impl wkt::message::Message for StartBackfillJobRequest {
1729    fn typename() -> &'static str {
1730        "type.googleapis.com/google.cloud.datastream.v1.StartBackfillJobRequest"
1731    }
1732}
1733
1734/// Response for manually initiating a backfill job for a specific stream object.
1735#[serde_with::serde_as]
1736#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1737#[serde(default, rename_all = "camelCase")]
1738#[non_exhaustive]
1739pub struct StartBackfillJobResponse {
1740    /// The stream object resource a backfill job was started for.
1741    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1742    pub object: std::option::Option<crate::model::StreamObject>,
1743
1744    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1745    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1746}
1747
1748impl StartBackfillJobResponse {
1749    pub fn new() -> Self {
1750        std::default::Default::default()
1751    }
1752
1753    /// Sets the value of [object][crate::model::StartBackfillJobResponse::object].
1754    pub fn set_object<T: std::convert::Into<std::option::Option<crate::model::StreamObject>>>(
1755        mut self,
1756        v: T,
1757    ) -> Self {
1758        self.object = v.into();
1759        self
1760    }
1761}
1762
1763impl wkt::message::Message for StartBackfillJobResponse {
1764    fn typename() -> &'static str {
1765        "type.googleapis.com/google.cloud.datastream.v1.StartBackfillJobResponse"
1766    }
1767}
1768
1769/// Request for manually stopping a running backfill job for a specific stream
1770/// object.
1771#[serde_with::serde_as]
1772#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1773#[serde(default, rename_all = "camelCase")]
1774#[non_exhaustive]
1775pub struct StopBackfillJobRequest {
1776    /// Required. The name of the stream object resource to stop the backfill job
1777    /// for.
1778    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1779    pub object: std::string::String,
1780
1781    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1782    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1783}
1784
1785impl StopBackfillJobRequest {
1786    pub fn new() -> Self {
1787        std::default::Default::default()
1788    }
1789
1790    /// Sets the value of [object][crate::model::StopBackfillJobRequest::object].
1791    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1792        self.object = v.into();
1793        self
1794    }
1795}
1796
1797impl wkt::message::Message for StopBackfillJobRequest {
1798    fn typename() -> &'static str {
1799        "type.googleapis.com/google.cloud.datastream.v1.StopBackfillJobRequest"
1800    }
1801}
1802
1803/// Response for manually stop a backfill job for a specific stream object.
1804#[serde_with::serde_as]
1805#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1806#[serde(default, rename_all = "camelCase")]
1807#[non_exhaustive]
1808pub struct StopBackfillJobResponse {
1809    /// The stream object resource the backfill job was stopped for.
1810    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1811    pub object: std::option::Option<crate::model::StreamObject>,
1812
1813    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1814    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1815}
1816
1817impl StopBackfillJobResponse {
1818    pub fn new() -> Self {
1819        std::default::Default::default()
1820    }
1821
1822    /// Sets the value of [object][crate::model::StopBackfillJobResponse::object].
1823    pub fn set_object<T: std::convert::Into<std::option::Option<crate::model::StreamObject>>>(
1824        mut self,
1825        v: T,
1826    ) -> Self {
1827        self.object = v.into();
1828        self
1829    }
1830}
1831
1832impl wkt::message::Message for StopBackfillJobResponse {
1833    fn typename() -> &'static str {
1834        "type.googleapis.com/google.cloud.datastream.v1.StopBackfillJobResponse"
1835    }
1836}
1837
1838/// Request for listing all objects for a specific stream.
1839#[serde_with::serde_as]
1840#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1841#[serde(default, rename_all = "camelCase")]
1842#[non_exhaustive]
1843pub struct ListStreamObjectsRequest {
1844    /// Required. The parent stream that owns the collection of objects.
1845    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1846    pub parent: std::string::String,
1847
1848    /// Maximum number of objects to return. Default is 50.
1849    /// The maximum value is 1000; values above 1000 will be coerced to 1000.
1850    pub page_size: i32,
1851
1852    /// Page token received from a previous `ListStreamObjectsRequest` call.
1853    /// Provide this to retrieve the subsequent page.
1854    ///
1855    /// When paginating, all other parameters provided to
1856    /// `ListStreamObjectsRequest` must match the call that provided the page
1857    /// token.
1858    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1859    pub page_token: std::string::String,
1860
1861    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1862    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1863}
1864
1865impl ListStreamObjectsRequest {
1866    pub fn new() -> Self {
1867        std::default::Default::default()
1868    }
1869
1870    /// Sets the value of [parent][crate::model::ListStreamObjectsRequest::parent].
1871    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1872        self.parent = v.into();
1873        self
1874    }
1875
1876    /// Sets the value of [page_size][crate::model::ListStreamObjectsRequest::page_size].
1877    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1878        self.page_size = v.into();
1879        self
1880    }
1881
1882    /// Sets the value of [page_token][crate::model::ListStreamObjectsRequest::page_token].
1883    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1884        self.page_token = v.into();
1885        self
1886    }
1887}
1888
1889impl wkt::message::Message for ListStreamObjectsRequest {
1890    fn typename() -> &'static str {
1891        "type.googleapis.com/google.cloud.datastream.v1.ListStreamObjectsRequest"
1892    }
1893}
1894
1895/// Response containing the objects for a stream.
1896#[serde_with::serde_as]
1897#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1898#[serde(default, rename_all = "camelCase")]
1899#[non_exhaustive]
1900pub struct ListStreamObjectsResponse {
1901    /// List of stream objects.
1902    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1903    pub stream_objects: std::vec::Vec<crate::model::StreamObject>,
1904
1905    /// A token, which can be sent as `page_token` to retrieve the next page.
1906    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1907    pub next_page_token: std::string::String,
1908
1909    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1910    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1911}
1912
1913impl ListStreamObjectsResponse {
1914    pub fn new() -> Self {
1915        std::default::Default::default()
1916    }
1917
1918    /// Sets the value of [next_page_token][crate::model::ListStreamObjectsResponse::next_page_token].
1919    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1920        self.next_page_token = v.into();
1921        self
1922    }
1923
1924    /// Sets the value of [stream_objects][crate::model::ListStreamObjectsResponse::stream_objects].
1925    pub fn set_stream_objects<T, V>(mut self, v: T) -> Self
1926    where
1927        T: std::iter::IntoIterator<Item = V>,
1928        V: std::convert::Into<crate::model::StreamObject>,
1929    {
1930        use std::iter::Iterator;
1931        self.stream_objects = v.into_iter().map(|i| i.into()).collect();
1932        self
1933    }
1934}
1935
1936impl wkt::message::Message for ListStreamObjectsResponse {
1937    fn typename() -> &'static str {
1938        "type.googleapis.com/google.cloud.datastream.v1.ListStreamObjectsResponse"
1939    }
1940}
1941
1942#[doc(hidden)]
1943impl gax::paginator::internal::PageableResponse for ListStreamObjectsResponse {
1944    type PageItem = crate::model::StreamObject;
1945
1946    fn items(self) -> std::vec::Vec<Self::PageItem> {
1947        self.stream_objects
1948    }
1949
1950    fn next_page_token(&self) -> std::string::String {
1951        use std::clone::Clone;
1952        self.next_page_token.clone()
1953    }
1954}
1955
1956/// Represents the metadata of the long-running operation.
1957#[serde_with::serde_as]
1958#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1959#[serde(default, rename_all = "camelCase")]
1960#[non_exhaustive]
1961pub struct OperationMetadata {
1962    /// Output only. The time the operation was created.
1963    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1964    pub create_time: std::option::Option<wkt::Timestamp>,
1965
1966    /// Output only. The time the operation finished running.
1967    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1968    pub end_time: std::option::Option<wkt::Timestamp>,
1969
1970    /// Output only. Server-defined resource path for the target of the operation.
1971    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1972    pub target: std::string::String,
1973
1974    /// Output only. Name of the verb executed by the operation.
1975    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1976    pub verb: std::string::String,
1977
1978    /// Output only. Human-readable status of the operation, if any.
1979    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1980    pub status_message: std::string::String,
1981
1982    /// Output only. Identifies whether the user has requested cancellation
1983    /// of the operation. Operations that have successfully been cancelled
1984    /// have
1985    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
1986    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
1987    /// corresponding to `Code.CANCELLED`.
1988    ///
1989    /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
1990    /// [google.rpc.Status.code]: rpc::model::Status::code
1991    pub requested_cancellation: bool,
1992
1993    /// Output only. API version used to start the operation.
1994    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1995    pub api_version: std::string::String,
1996
1997    /// Output only. Results of executed validations if there are any.
1998    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1999    pub validation_result: std::option::Option<crate::model::ValidationResult>,
2000
2001    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2002    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2003}
2004
2005impl OperationMetadata {
2006    pub fn new() -> Self {
2007        std::default::Default::default()
2008    }
2009
2010    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
2011    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2012        mut self,
2013        v: T,
2014    ) -> Self {
2015        self.create_time = v.into();
2016        self
2017    }
2018
2019    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
2020    pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2021        mut self,
2022        v: T,
2023    ) -> Self {
2024        self.end_time = v.into();
2025        self
2026    }
2027
2028    /// Sets the value of [target][crate::model::OperationMetadata::target].
2029    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2030        self.target = v.into();
2031        self
2032    }
2033
2034    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
2035    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2036        self.verb = v.into();
2037        self
2038    }
2039
2040    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
2041    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2042        self.status_message = v.into();
2043        self
2044    }
2045
2046    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
2047    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2048        self.requested_cancellation = v.into();
2049        self
2050    }
2051
2052    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
2053    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2054        self.api_version = v.into();
2055        self
2056    }
2057
2058    /// Sets the value of [validation_result][crate::model::OperationMetadata::validation_result].
2059    pub fn set_validation_result<
2060        T: std::convert::Into<std::option::Option<crate::model::ValidationResult>>,
2061    >(
2062        mut self,
2063        v: T,
2064    ) -> Self {
2065        self.validation_result = v.into();
2066        self
2067    }
2068}
2069
2070impl wkt::message::Message for OperationMetadata {
2071    fn typename() -> &'static str {
2072        "type.googleapis.com/google.cloud.datastream.v1.OperationMetadata"
2073    }
2074}
2075
2076/// Request for creating a private connection.
2077#[serde_with::serde_as]
2078#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2079#[serde(default, rename_all = "camelCase")]
2080#[non_exhaustive]
2081pub struct CreatePrivateConnectionRequest {
2082    /// Required. The parent that owns the collection of PrivateConnections.
2083    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2084    pub parent: std::string::String,
2085
2086    /// Required. The private connectivity identifier.
2087    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2088    pub private_connection_id: std::string::String,
2089
2090    /// Required. The Private Connectivity resource to create.
2091    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2092    pub private_connection: std::option::Option<crate::model::PrivateConnection>,
2093
2094    /// Optional. A request ID to identify requests. Specify a unique request ID
2095    /// so that if you must retry your request, the server will know to ignore
2096    /// the request if it has already been completed. The server will guarantee
2097    /// that for at least 60 minutes since the first request.
2098    ///
2099    /// For example, consider a situation where you make an initial request and the
2100    /// request times out. If you make the request again with the same request ID,
2101    /// the server can check if original operation with the same request ID was
2102    /// received, and if so, will ignore the second request. This prevents clients
2103    /// from accidentally creating duplicate commitments.
2104    ///
2105    /// The request ID must be a valid UUID with the exception that zero UUID is
2106    /// not supported (00000000-0000-0000-0000-000000000000).
2107    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2108    pub request_id: std::string::String,
2109
2110    /// Optional. If set to true, will skip validations.
2111    pub force: bool,
2112
2113    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2114    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2115}
2116
2117impl CreatePrivateConnectionRequest {
2118    pub fn new() -> Self {
2119        std::default::Default::default()
2120    }
2121
2122    /// Sets the value of [parent][crate::model::CreatePrivateConnectionRequest::parent].
2123    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2124        self.parent = v.into();
2125        self
2126    }
2127
2128    /// Sets the value of [private_connection_id][crate::model::CreatePrivateConnectionRequest::private_connection_id].
2129    pub fn set_private_connection_id<T: std::convert::Into<std::string::String>>(
2130        mut self,
2131        v: T,
2132    ) -> Self {
2133        self.private_connection_id = v.into();
2134        self
2135    }
2136
2137    /// Sets the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
2138    pub fn set_private_connection<
2139        T: std::convert::Into<std::option::Option<crate::model::PrivateConnection>>,
2140    >(
2141        mut self,
2142        v: T,
2143    ) -> Self {
2144        self.private_connection = v.into();
2145        self
2146    }
2147
2148    /// Sets the value of [request_id][crate::model::CreatePrivateConnectionRequest::request_id].
2149    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2150        self.request_id = v.into();
2151        self
2152    }
2153
2154    /// Sets the value of [force][crate::model::CreatePrivateConnectionRequest::force].
2155    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2156        self.force = v.into();
2157        self
2158    }
2159}
2160
2161impl wkt::message::Message for CreatePrivateConnectionRequest {
2162    fn typename() -> &'static str {
2163        "type.googleapis.com/google.cloud.datastream.v1.CreatePrivateConnectionRequest"
2164    }
2165}
2166
2167/// Request for listing private connections.
2168#[serde_with::serde_as]
2169#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2170#[serde(default, rename_all = "camelCase")]
2171#[non_exhaustive]
2172pub struct ListPrivateConnectionsRequest {
2173    /// Required. The parent that owns the collection of private connectivity
2174    /// configurations.
2175    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2176    pub parent: std::string::String,
2177
2178    /// Maximum number of private connectivity configurations to return.
2179    /// If unspecified, at most 50 private connectivity configurations that will be
2180    /// returned. The maximum value is 1000; values above 1000 will be coerced to
2181    /// 1000.
2182    pub page_size: i32,
2183
2184    /// Page token received from a previous `ListPrivateConnections` call.
2185    /// Provide this to retrieve the subsequent page.
2186    ///
2187    /// When paginating, all other parameters provided to
2188    /// `ListPrivateConnections` must match the call that provided the page
2189    /// token.
2190    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2191    pub page_token: std::string::String,
2192
2193    /// Filter request.
2194    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2195    pub filter: std::string::String,
2196
2197    /// Order by fields for the result.
2198    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2199    pub order_by: std::string::String,
2200
2201    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2202    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2203}
2204
2205impl ListPrivateConnectionsRequest {
2206    pub fn new() -> Self {
2207        std::default::Default::default()
2208    }
2209
2210    /// Sets the value of [parent][crate::model::ListPrivateConnectionsRequest::parent].
2211    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2212        self.parent = v.into();
2213        self
2214    }
2215
2216    /// Sets the value of [page_size][crate::model::ListPrivateConnectionsRequest::page_size].
2217    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2218        self.page_size = v.into();
2219        self
2220    }
2221
2222    /// Sets the value of [page_token][crate::model::ListPrivateConnectionsRequest::page_token].
2223    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2224        self.page_token = v.into();
2225        self
2226    }
2227
2228    /// Sets the value of [filter][crate::model::ListPrivateConnectionsRequest::filter].
2229    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2230        self.filter = v.into();
2231        self
2232    }
2233
2234    /// Sets the value of [order_by][crate::model::ListPrivateConnectionsRequest::order_by].
2235    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2236        self.order_by = v.into();
2237        self
2238    }
2239}
2240
2241impl wkt::message::Message for ListPrivateConnectionsRequest {
2242    fn typename() -> &'static str {
2243        "type.googleapis.com/google.cloud.datastream.v1.ListPrivateConnectionsRequest"
2244    }
2245}
2246
2247/// Response containing a list of private connection configurations.
2248#[serde_with::serde_as]
2249#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2250#[serde(default, rename_all = "camelCase")]
2251#[non_exhaustive]
2252pub struct ListPrivateConnectionsResponse {
2253    /// List of private connectivity configurations.
2254    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2255    pub private_connections: std::vec::Vec<crate::model::PrivateConnection>,
2256
2257    /// A token, which can be sent as `page_token` to retrieve the next page.
2258    /// If this field is omitted, there are no subsequent pages.
2259    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2260    pub next_page_token: std::string::String,
2261
2262    /// Locations that could not be reached.
2263    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2264    pub unreachable: std::vec::Vec<std::string::String>,
2265
2266    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2267    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2268}
2269
2270impl ListPrivateConnectionsResponse {
2271    pub fn new() -> Self {
2272        std::default::Default::default()
2273    }
2274
2275    /// Sets the value of [next_page_token][crate::model::ListPrivateConnectionsResponse::next_page_token].
2276    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2277        self.next_page_token = v.into();
2278        self
2279    }
2280
2281    /// Sets the value of [private_connections][crate::model::ListPrivateConnectionsResponse::private_connections].
2282    pub fn set_private_connections<T, V>(mut self, v: T) -> Self
2283    where
2284        T: std::iter::IntoIterator<Item = V>,
2285        V: std::convert::Into<crate::model::PrivateConnection>,
2286    {
2287        use std::iter::Iterator;
2288        self.private_connections = v.into_iter().map(|i| i.into()).collect();
2289        self
2290    }
2291
2292    /// Sets the value of [unreachable][crate::model::ListPrivateConnectionsResponse::unreachable].
2293    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2294    where
2295        T: std::iter::IntoIterator<Item = V>,
2296        V: std::convert::Into<std::string::String>,
2297    {
2298        use std::iter::Iterator;
2299        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2300        self
2301    }
2302}
2303
2304impl wkt::message::Message for ListPrivateConnectionsResponse {
2305    fn typename() -> &'static str {
2306        "type.googleapis.com/google.cloud.datastream.v1.ListPrivateConnectionsResponse"
2307    }
2308}
2309
2310#[doc(hidden)]
2311impl gax::paginator::internal::PageableResponse for ListPrivateConnectionsResponse {
2312    type PageItem = crate::model::PrivateConnection;
2313
2314    fn items(self) -> std::vec::Vec<Self::PageItem> {
2315        self.private_connections
2316    }
2317
2318    fn next_page_token(&self) -> std::string::String {
2319        use std::clone::Clone;
2320        self.next_page_token.clone()
2321    }
2322}
2323
2324/// Request to delete a private connection.
2325#[serde_with::serde_as]
2326#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2327#[serde(default, rename_all = "camelCase")]
2328#[non_exhaustive]
2329pub struct DeletePrivateConnectionRequest {
2330    /// Required. The name of the private connectivity configuration to delete.
2331    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2332    pub name: std::string::String,
2333
2334    /// Optional. A request ID to identify requests. Specify a unique request ID
2335    /// so that if you must retry your request, the server will know to ignore
2336    /// the request if it has already been completed. The server will guarantee
2337    /// that for at least 60 minutes after the first request.
2338    ///
2339    /// For example, consider a situation where you make an initial request and the
2340    /// request times out. If you make the request again with the same request ID,
2341    /// the server can check if original operation with the same request ID was
2342    /// received, and if so, will ignore the second request. This prevents clients
2343    /// from accidentally creating duplicate commitments.
2344    ///
2345    /// The request ID must be a valid UUID with the exception that zero UUID is
2346    /// not supported (00000000-0000-0000-0000-000000000000).
2347    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2348    pub request_id: std::string::String,
2349
2350    /// Optional. If set to true, any child routes that belong to this
2351    /// PrivateConnection will also be deleted.
2352    pub force: bool,
2353
2354    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2355    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2356}
2357
2358impl DeletePrivateConnectionRequest {
2359    pub fn new() -> Self {
2360        std::default::Default::default()
2361    }
2362
2363    /// Sets the value of [name][crate::model::DeletePrivateConnectionRequest::name].
2364    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2365        self.name = v.into();
2366        self
2367    }
2368
2369    /// Sets the value of [request_id][crate::model::DeletePrivateConnectionRequest::request_id].
2370    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2371        self.request_id = v.into();
2372        self
2373    }
2374
2375    /// Sets the value of [force][crate::model::DeletePrivateConnectionRequest::force].
2376    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2377        self.force = v.into();
2378        self
2379    }
2380}
2381
2382impl wkt::message::Message for DeletePrivateConnectionRequest {
2383    fn typename() -> &'static str {
2384        "type.googleapis.com/google.cloud.datastream.v1.DeletePrivateConnectionRequest"
2385    }
2386}
2387
2388/// Request to get a private connection configuration.
2389#[serde_with::serde_as]
2390#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2391#[serde(default, rename_all = "camelCase")]
2392#[non_exhaustive]
2393pub struct GetPrivateConnectionRequest {
2394    /// Required. The name of the  private connectivity configuration to get.
2395    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2396    pub name: std::string::String,
2397
2398    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2399    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2400}
2401
2402impl GetPrivateConnectionRequest {
2403    pub fn new() -> Self {
2404        std::default::Default::default()
2405    }
2406
2407    /// Sets the value of [name][crate::model::GetPrivateConnectionRequest::name].
2408    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2409        self.name = v.into();
2410        self
2411    }
2412}
2413
2414impl wkt::message::Message for GetPrivateConnectionRequest {
2415    fn typename() -> &'static str {
2416        "type.googleapis.com/google.cloud.datastream.v1.GetPrivateConnectionRequest"
2417    }
2418}
2419
2420/// Route creation request.
2421#[serde_with::serde_as]
2422#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2423#[serde(default, rename_all = "camelCase")]
2424#[non_exhaustive]
2425pub struct CreateRouteRequest {
2426    /// Required. The parent that owns the collection of Routes.
2427    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2428    pub parent: std::string::String,
2429
2430    /// Required. The Route identifier.
2431    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2432    pub route_id: std::string::String,
2433
2434    /// Required. The Route resource to create.
2435    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2436    pub route: std::option::Option<crate::model::Route>,
2437
2438    /// Optional. A request ID to identify requests. Specify a unique request ID
2439    /// so that if you must retry your request, the server will know to ignore
2440    /// the request if it has already been completed. The server will guarantee
2441    /// that for at least 60 minutes since the first request.
2442    ///
2443    /// For example, consider a situation where you make an initial request and the
2444    /// request times out. If you make the request again with the same request ID,
2445    /// the server can check if original operation with the same request ID was
2446    /// received, and if so, will ignore the second request. This prevents clients
2447    /// from accidentally creating duplicate commitments.
2448    ///
2449    /// The request ID must be a valid UUID with the exception that zero UUID is
2450    /// not supported (00000000-0000-0000-0000-000000000000).
2451    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2452    pub request_id: std::string::String,
2453
2454    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2455    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2456}
2457
2458impl CreateRouteRequest {
2459    pub fn new() -> Self {
2460        std::default::Default::default()
2461    }
2462
2463    /// Sets the value of [parent][crate::model::CreateRouteRequest::parent].
2464    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2465        self.parent = v.into();
2466        self
2467    }
2468
2469    /// Sets the value of [route_id][crate::model::CreateRouteRequest::route_id].
2470    pub fn set_route_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2471        self.route_id = v.into();
2472        self
2473    }
2474
2475    /// Sets the value of [route][crate::model::CreateRouteRequest::route].
2476    pub fn set_route<T: std::convert::Into<std::option::Option<crate::model::Route>>>(
2477        mut self,
2478        v: T,
2479    ) -> Self {
2480        self.route = v.into();
2481        self
2482    }
2483
2484    /// Sets the value of [request_id][crate::model::CreateRouteRequest::request_id].
2485    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2486        self.request_id = v.into();
2487        self
2488    }
2489}
2490
2491impl wkt::message::Message for CreateRouteRequest {
2492    fn typename() -> &'static str {
2493        "type.googleapis.com/google.cloud.datastream.v1.CreateRouteRequest"
2494    }
2495}
2496
2497/// Route list request.
2498#[serde_with::serde_as]
2499#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2500#[serde(default, rename_all = "camelCase")]
2501#[non_exhaustive]
2502pub struct ListRoutesRequest {
2503    /// Required. The parent that owns the collection of Routess.
2504    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2505    pub parent: std::string::String,
2506
2507    /// Maximum number of Routes to return. The service may return
2508    /// fewer than this value. If unspecified, at most 50 Routes
2509    /// will be returned. The maximum value is 1000; values above 1000 will be
2510    /// coerced to 1000.
2511    pub page_size: i32,
2512
2513    /// Page token received from a previous `ListRoutes` call.
2514    /// Provide this to retrieve the subsequent page.
2515    ///
2516    /// When paginating, all other parameters provided to
2517    /// `ListRoutes` must match the call that provided the page
2518    /// token.
2519    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2520    pub page_token: std::string::String,
2521
2522    /// Filter request.
2523    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2524    pub filter: std::string::String,
2525
2526    /// Order by fields for the result.
2527    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2528    pub order_by: std::string::String,
2529
2530    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2531    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2532}
2533
2534impl ListRoutesRequest {
2535    pub fn new() -> Self {
2536        std::default::Default::default()
2537    }
2538
2539    /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
2540    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2541        self.parent = v.into();
2542        self
2543    }
2544
2545    /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
2546    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2547        self.page_size = v.into();
2548        self
2549    }
2550
2551    /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
2552    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2553        self.page_token = v.into();
2554        self
2555    }
2556
2557    /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
2558    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2559        self.filter = v.into();
2560        self
2561    }
2562
2563    /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
2564    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2565        self.order_by = v.into();
2566        self
2567    }
2568}
2569
2570impl wkt::message::Message for ListRoutesRequest {
2571    fn typename() -> &'static str {
2572        "type.googleapis.com/google.cloud.datastream.v1.ListRoutesRequest"
2573    }
2574}
2575
2576/// Route list response.
2577#[serde_with::serde_as]
2578#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2579#[serde(default, rename_all = "camelCase")]
2580#[non_exhaustive]
2581pub struct ListRoutesResponse {
2582    /// List of Routes.
2583    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2584    pub routes: std::vec::Vec<crate::model::Route>,
2585
2586    /// A token, which can be sent as `page_token` to retrieve the next page.
2587    /// If this field is omitted, there are no subsequent pages.
2588    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2589    pub next_page_token: std::string::String,
2590
2591    /// Locations that could not be reached.
2592    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2593    pub unreachable: std::vec::Vec<std::string::String>,
2594
2595    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2596    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2597}
2598
2599impl ListRoutesResponse {
2600    pub fn new() -> Self {
2601        std::default::Default::default()
2602    }
2603
2604    /// Sets the value of [next_page_token][crate::model::ListRoutesResponse::next_page_token].
2605    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2606        self.next_page_token = v.into();
2607        self
2608    }
2609
2610    /// Sets the value of [routes][crate::model::ListRoutesResponse::routes].
2611    pub fn set_routes<T, V>(mut self, v: T) -> Self
2612    where
2613        T: std::iter::IntoIterator<Item = V>,
2614        V: std::convert::Into<crate::model::Route>,
2615    {
2616        use std::iter::Iterator;
2617        self.routes = v.into_iter().map(|i| i.into()).collect();
2618        self
2619    }
2620
2621    /// Sets the value of [unreachable][crate::model::ListRoutesResponse::unreachable].
2622    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2623    where
2624        T: std::iter::IntoIterator<Item = V>,
2625        V: std::convert::Into<std::string::String>,
2626    {
2627        use std::iter::Iterator;
2628        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2629        self
2630    }
2631}
2632
2633impl wkt::message::Message for ListRoutesResponse {
2634    fn typename() -> &'static str {
2635        "type.googleapis.com/google.cloud.datastream.v1.ListRoutesResponse"
2636    }
2637}
2638
2639#[doc(hidden)]
2640impl gax::paginator::internal::PageableResponse for ListRoutesResponse {
2641    type PageItem = crate::model::Route;
2642
2643    fn items(self) -> std::vec::Vec<Self::PageItem> {
2644        self.routes
2645    }
2646
2647    fn next_page_token(&self) -> std::string::String {
2648        use std::clone::Clone;
2649        self.next_page_token.clone()
2650    }
2651}
2652
2653/// Route deletion request.
2654#[serde_with::serde_as]
2655#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2656#[serde(default, rename_all = "camelCase")]
2657#[non_exhaustive]
2658pub struct DeleteRouteRequest {
2659    /// Required. The name of the Route resource to delete.
2660    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2661    pub name: std::string::String,
2662
2663    /// Optional. A request ID to identify requests. Specify a unique request ID
2664    /// so that if you must retry your request, the server will know to ignore
2665    /// the request if it has already been completed. The server will guarantee
2666    /// that for at least 60 minutes after the first request.
2667    ///
2668    /// For example, consider a situation where you make an initial request and the
2669    /// request times out. If you make the request again with the same request ID,
2670    /// the server can check if original operation with the same request ID was
2671    /// received, and if so, will ignore the second request. This prevents clients
2672    /// from accidentally creating duplicate commitments.
2673    ///
2674    /// The request ID must be a valid UUID with the exception that zero UUID is
2675    /// not supported (00000000-0000-0000-0000-000000000000).
2676    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2677    pub request_id: std::string::String,
2678
2679    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2680    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2681}
2682
2683impl DeleteRouteRequest {
2684    pub fn new() -> Self {
2685        std::default::Default::default()
2686    }
2687
2688    /// Sets the value of [name][crate::model::DeleteRouteRequest::name].
2689    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2690        self.name = v.into();
2691        self
2692    }
2693
2694    /// Sets the value of [request_id][crate::model::DeleteRouteRequest::request_id].
2695    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2696        self.request_id = v.into();
2697        self
2698    }
2699}
2700
2701impl wkt::message::Message for DeleteRouteRequest {
2702    fn typename() -> &'static str {
2703        "type.googleapis.com/google.cloud.datastream.v1.DeleteRouteRequest"
2704    }
2705}
2706
2707/// Route get request.
2708#[serde_with::serde_as]
2709#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2710#[serde(default, rename_all = "camelCase")]
2711#[non_exhaustive]
2712pub struct GetRouteRequest {
2713    /// Required. The name of the Route resource to get.
2714    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2715    pub name: std::string::String,
2716
2717    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2718    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2719}
2720
2721impl GetRouteRequest {
2722    pub fn new() -> Self {
2723        std::default::Default::default()
2724    }
2725
2726    /// Sets the value of [name][crate::model::GetRouteRequest::name].
2727    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2728        self.name = v.into();
2729        self
2730    }
2731}
2732
2733impl wkt::message::Message for GetRouteRequest {
2734    fn typename() -> &'static str {
2735        "type.googleapis.com/google.cloud.datastream.v1.GetRouteRequest"
2736    }
2737}
2738
2739/// Oracle database profile.
2740#[serde_with::serde_as]
2741#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2742#[serde(default, rename_all = "camelCase")]
2743#[non_exhaustive]
2744pub struct OracleProfile {
2745    /// Required. Hostname for the Oracle connection.
2746    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2747    pub hostname: std::string::String,
2748
2749    /// Port for the Oracle connection, default value is 1521.
2750    pub port: i32,
2751
2752    /// Required. Username for the Oracle connection.
2753    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2754    pub username: std::string::String,
2755
2756    /// Optional. Password for the Oracle connection. Mutually exclusive with the
2757    /// `secret_manager_stored_password` field.
2758    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2759    pub password: std::string::String,
2760
2761    /// Required. Database for the Oracle connection.
2762    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2763    pub database_service: std::string::String,
2764
2765    /// Connection string attributes
2766    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
2767    pub connection_attributes: std::collections::HashMap<std::string::String, std::string::String>,
2768
2769    /// Optional. SSL configuration for the Oracle connection.
2770    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2771    pub oracle_ssl_config: std::option::Option<crate::model::OracleSslConfig>,
2772
2773    /// Optional. Configuration for Oracle ASM connection.
2774    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2775    pub oracle_asm_config: std::option::Option<crate::model::OracleAsmConfig>,
2776
2777    /// Optional. A reference to a Secret Manager resource name storing the Oracle
2778    /// connection password. Mutually exclusive with the `password` field.
2779    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2780    pub secret_manager_stored_password: std::string::String,
2781
2782    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2783    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2784}
2785
2786impl OracleProfile {
2787    pub fn new() -> Self {
2788        std::default::Default::default()
2789    }
2790
2791    /// Sets the value of [hostname][crate::model::OracleProfile::hostname].
2792    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2793        self.hostname = v.into();
2794        self
2795    }
2796
2797    /// Sets the value of [port][crate::model::OracleProfile::port].
2798    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2799        self.port = v.into();
2800        self
2801    }
2802
2803    /// Sets the value of [username][crate::model::OracleProfile::username].
2804    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2805        self.username = v.into();
2806        self
2807    }
2808
2809    /// Sets the value of [password][crate::model::OracleProfile::password].
2810    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2811        self.password = v.into();
2812        self
2813    }
2814
2815    /// Sets the value of [database_service][crate::model::OracleProfile::database_service].
2816    pub fn set_database_service<T: std::convert::Into<std::string::String>>(
2817        mut self,
2818        v: T,
2819    ) -> Self {
2820        self.database_service = v.into();
2821        self
2822    }
2823
2824    /// Sets the value of [oracle_ssl_config][crate::model::OracleProfile::oracle_ssl_config].
2825    pub fn set_oracle_ssl_config<
2826        T: std::convert::Into<std::option::Option<crate::model::OracleSslConfig>>,
2827    >(
2828        mut self,
2829        v: T,
2830    ) -> Self {
2831        self.oracle_ssl_config = v.into();
2832        self
2833    }
2834
2835    /// Sets the value of [oracle_asm_config][crate::model::OracleProfile::oracle_asm_config].
2836    pub fn set_oracle_asm_config<
2837        T: std::convert::Into<std::option::Option<crate::model::OracleAsmConfig>>,
2838    >(
2839        mut self,
2840        v: T,
2841    ) -> Self {
2842        self.oracle_asm_config = v.into();
2843        self
2844    }
2845
2846    /// Sets the value of [secret_manager_stored_password][crate::model::OracleProfile::secret_manager_stored_password].
2847    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
2848        mut self,
2849        v: T,
2850    ) -> Self {
2851        self.secret_manager_stored_password = v.into();
2852        self
2853    }
2854
2855    /// Sets the value of [connection_attributes][crate::model::OracleProfile::connection_attributes].
2856    pub fn set_connection_attributes<T, K, V>(mut self, v: T) -> Self
2857    where
2858        T: std::iter::IntoIterator<Item = (K, V)>,
2859        K: std::convert::Into<std::string::String>,
2860        V: std::convert::Into<std::string::String>,
2861    {
2862        use std::iter::Iterator;
2863        self.connection_attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2864        self
2865    }
2866}
2867
2868impl wkt::message::Message for OracleProfile {
2869    fn typename() -> &'static str {
2870        "type.googleapis.com/google.cloud.datastream.v1.OracleProfile"
2871    }
2872}
2873
2874/// Configuration for Oracle Automatic Storage Management (ASM) connection.
2875#[serde_with::serde_as]
2876#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2877#[serde(default, rename_all = "camelCase")]
2878#[non_exhaustive]
2879pub struct OracleAsmConfig {
2880    /// Required. Hostname for the Oracle ASM connection.
2881    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2882    pub hostname: std::string::String,
2883
2884    /// Required. Port for the Oracle ASM connection.
2885    pub port: i32,
2886
2887    /// Required. Username for the Oracle ASM connection.
2888    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2889    pub username: std::string::String,
2890
2891    /// Optional. Password for the Oracle ASM connection. Mutually exclusive with
2892    /// the `secret_manager_stored_password` field.
2893    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2894    pub password: std::string::String,
2895
2896    /// Required. ASM service name for the Oracle ASM connection.
2897    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2898    pub asm_service: std::string::String,
2899
2900    /// Optional. Connection string attributes
2901    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
2902    pub connection_attributes: std::collections::HashMap<std::string::String, std::string::String>,
2903
2904    /// Optional. SSL configuration for the Oracle connection.
2905    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2906    pub oracle_ssl_config: std::option::Option<crate::model::OracleSslConfig>,
2907
2908    /// Optional. A reference to a Secret Manager resource name storing the Oracle
2909    /// ASM connection password. Mutually exclusive with the `password` field.
2910    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2911    pub secret_manager_stored_password: std::string::String,
2912
2913    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2914    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2915}
2916
2917impl OracleAsmConfig {
2918    pub fn new() -> Self {
2919        std::default::Default::default()
2920    }
2921
2922    /// Sets the value of [hostname][crate::model::OracleAsmConfig::hostname].
2923    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2924        self.hostname = v.into();
2925        self
2926    }
2927
2928    /// Sets the value of [port][crate::model::OracleAsmConfig::port].
2929    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2930        self.port = v.into();
2931        self
2932    }
2933
2934    /// Sets the value of [username][crate::model::OracleAsmConfig::username].
2935    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2936        self.username = v.into();
2937        self
2938    }
2939
2940    /// Sets the value of [password][crate::model::OracleAsmConfig::password].
2941    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2942        self.password = v.into();
2943        self
2944    }
2945
2946    /// Sets the value of [asm_service][crate::model::OracleAsmConfig::asm_service].
2947    pub fn set_asm_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2948        self.asm_service = v.into();
2949        self
2950    }
2951
2952    /// Sets the value of [oracle_ssl_config][crate::model::OracleAsmConfig::oracle_ssl_config].
2953    pub fn set_oracle_ssl_config<
2954        T: std::convert::Into<std::option::Option<crate::model::OracleSslConfig>>,
2955    >(
2956        mut self,
2957        v: T,
2958    ) -> Self {
2959        self.oracle_ssl_config = v.into();
2960        self
2961    }
2962
2963    /// Sets the value of [secret_manager_stored_password][crate::model::OracleAsmConfig::secret_manager_stored_password].
2964    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
2965        mut self,
2966        v: T,
2967    ) -> Self {
2968        self.secret_manager_stored_password = v.into();
2969        self
2970    }
2971
2972    /// Sets the value of [connection_attributes][crate::model::OracleAsmConfig::connection_attributes].
2973    pub fn set_connection_attributes<T, K, V>(mut self, v: T) -> Self
2974    where
2975        T: std::iter::IntoIterator<Item = (K, V)>,
2976        K: std::convert::Into<std::string::String>,
2977        V: std::convert::Into<std::string::String>,
2978    {
2979        use std::iter::Iterator;
2980        self.connection_attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2981        self
2982    }
2983}
2984
2985impl wkt::message::Message for OracleAsmConfig {
2986    fn typename() -> &'static str {
2987        "type.googleapis.com/google.cloud.datastream.v1.OracleAsmConfig"
2988    }
2989}
2990
2991/// MySQL database profile.
2992#[serde_with::serde_as]
2993#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2994#[serde(default, rename_all = "camelCase")]
2995#[non_exhaustive]
2996pub struct MysqlProfile {
2997    /// Required. Hostname for the MySQL connection.
2998    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2999    pub hostname: std::string::String,
3000
3001    /// Port for the MySQL connection, default value is 3306.
3002    pub port: i32,
3003
3004    /// Required. Username for the MySQL connection.
3005    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3006    pub username: std::string::String,
3007
3008    /// Optional. Input only. Password for the MySQL connection. Mutually exclusive
3009    /// with the `secret_manager_stored_password` field.
3010    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3011    pub password: std::string::String,
3012
3013    /// SSL configuration for the MySQL connection.
3014    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3015    pub ssl_config: std::option::Option<crate::model::MysqlSslConfig>,
3016
3017    /// Optional. A reference to a Secret Manager resource name storing the MySQL
3018    /// connection password. Mutually exclusive with the `password` field.
3019    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3020    pub secret_manager_stored_password: std::string::String,
3021
3022    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3023    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3024}
3025
3026impl MysqlProfile {
3027    pub fn new() -> Self {
3028        std::default::Default::default()
3029    }
3030
3031    /// Sets the value of [hostname][crate::model::MysqlProfile::hostname].
3032    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3033        self.hostname = v.into();
3034        self
3035    }
3036
3037    /// Sets the value of [port][crate::model::MysqlProfile::port].
3038    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3039        self.port = v.into();
3040        self
3041    }
3042
3043    /// Sets the value of [username][crate::model::MysqlProfile::username].
3044    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3045        self.username = v.into();
3046        self
3047    }
3048
3049    /// Sets the value of [password][crate::model::MysqlProfile::password].
3050    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3051        self.password = v.into();
3052        self
3053    }
3054
3055    /// Sets the value of [ssl_config][crate::model::MysqlProfile::ssl_config].
3056    pub fn set_ssl_config<
3057        T: std::convert::Into<std::option::Option<crate::model::MysqlSslConfig>>,
3058    >(
3059        mut self,
3060        v: T,
3061    ) -> Self {
3062        self.ssl_config = v.into();
3063        self
3064    }
3065
3066    /// Sets the value of [secret_manager_stored_password][crate::model::MysqlProfile::secret_manager_stored_password].
3067    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
3068        mut self,
3069        v: T,
3070    ) -> Self {
3071        self.secret_manager_stored_password = v.into();
3072        self
3073    }
3074}
3075
3076impl wkt::message::Message for MysqlProfile {
3077    fn typename() -> &'static str {
3078        "type.googleapis.com/google.cloud.datastream.v1.MysqlProfile"
3079    }
3080}
3081
3082/// PostgreSQL database profile.
3083#[serde_with::serde_as]
3084#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3085#[serde(default, rename_all = "camelCase")]
3086#[non_exhaustive]
3087pub struct PostgresqlProfile {
3088    /// Required. Hostname for the PostgreSQL connection.
3089    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3090    pub hostname: std::string::String,
3091
3092    /// Port for the PostgreSQL connection, default value is 5432.
3093    pub port: i32,
3094
3095    /// Required. Username for the PostgreSQL connection.
3096    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3097    pub username: std::string::String,
3098
3099    /// Optional. Password for the PostgreSQL connection. Mutually exclusive with
3100    /// the `secret_manager_stored_password` field.
3101    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3102    pub password: std::string::String,
3103
3104    /// Required. Database for the PostgreSQL connection.
3105    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3106    pub database: std::string::String,
3107
3108    /// Optional. A reference to a Secret Manager resource name storing the
3109    /// PostgreSQL connection password. Mutually exclusive with the `password`
3110    /// field.
3111    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3112    pub secret_manager_stored_password: std::string::String,
3113
3114    /// Optional. SSL configuration for the PostgreSQL connection.
3115    /// In case PostgresqlSslConfig is not set, the connection will use the default
3116    /// SSL mode, which is `prefer` (i.e. this mode will only use encryption if
3117    /// enabled from database side, otherwise will use unencrypted communication)
3118    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3119    pub ssl_config: std::option::Option<crate::model::PostgresqlSslConfig>,
3120
3121    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3122    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3123}
3124
3125impl PostgresqlProfile {
3126    pub fn new() -> Self {
3127        std::default::Default::default()
3128    }
3129
3130    /// Sets the value of [hostname][crate::model::PostgresqlProfile::hostname].
3131    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3132        self.hostname = v.into();
3133        self
3134    }
3135
3136    /// Sets the value of [port][crate::model::PostgresqlProfile::port].
3137    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3138        self.port = v.into();
3139        self
3140    }
3141
3142    /// Sets the value of [username][crate::model::PostgresqlProfile::username].
3143    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3144        self.username = v.into();
3145        self
3146    }
3147
3148    /// Sets the value of [password][crate::model::PostgresqlProfile::password].
3149    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3150        self.password = v.into();
3151        self
3152    }
3153
3154    /// Sets the value of [database][crate::model::PostgresqlProfile::database].
3155    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3156        self.database = v.into();
3157        self
3158    }
3159
3160    /// Sets the value of [secret_manager_stored_password][crate::model::PostgresqlProfile::secret_manager_stored_password].
3161    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
3162        mut self,
3163        v: T,
3164    ) -> Self {
3165        self.secret_manager_stored_password = v.into();
3166        self
3167    }
3168
3169    /// Sets the value of [ssl_config][crate::model::PostgresqlProfile::ssl_config].
3170    pub fn set_ssl_config<
3171        T: std::convert::Into<std::option::Option<crate::model::PostgresqlSslConfig>>,
3172    >(
3173        mut self,
3174        v: T,
3175    ) -> Self {
3176        self.ssl_config = v.into();
3177        self
3178    }
3179}
3180
3181impl wkt::message::Message for PostgresqlProfile {
3182    fn typename() -> &'static str {
3183        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlProfile"
3184    }
3185}
3186
3187/// SQLServer database profile.
3188#[serde_with::serde_as]
3189#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3190#[serde(default, rename_all = "camelCase")]
3191#[non_exhaustive]
3192pub struct SqlServerProfile {
3193    /// Required. Hostname for the SQLServer connection.
3194    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3195    pub hostname: std::string::String,
3196
3197    /// Port for the SQLServer connection, default value is 1433.
3198    pub port: i32,
3199
3200    /// Required. Username for the SQLServer connection.
3201    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3202    pub username: std::string::String,
3203
3204    /// Optional. Password for the SQLServer connection. Mutually exclusive with
3205    /// the `secret_manager_stored_password` field.
3206    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3207    pub password: std::string::String,
3208
3209    /// Required. Database for the SQLServer connection.
3210    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3211    pub database: std::string::String,
3212
3213    /// Optional. A reference to a Secret Manager resource name storing the
3214    /// SQLServer connection password. Mutually exclusive with the `password`
3215    /// field.
3216    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3217    pub secret_manager_stored_password: std::string::String,
3218
3219    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3220    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3221}
3222
3223impl SqlServerProfile {
3224    pub fn new() -> Self {
3225        std::default::Default::default()
3226    }
3227
3228    /// Sets the value of [hostname][crate::model::SqlServerProfile::hostname].
3229    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3230        self.hostname = v.into();
3231        self
3232    }
3233
3234    /// Sets the value of [port][crate::model::SqlServerProfile::port].
3235    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3236        self.port = v.into();
3237        self
3238    }
3239
3240    /// Sets the value of [username][crate::model::SqlServerProfile::username].
3241    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3242        self.username = v.into();
3243        self
3244    }
3245
3246    /// Sets the value of [password][crate::model::SqlServerProfile::password].
3247    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3248        self.password = v.into();
3249        self
3250    }
3251
3252    /// Sets the value of [database][crate::model::SqlServerProfile::database].
3253    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3254        self.database = v.into();
3255        self
3256    }
3257
3258    /// Sets the value of [secret_manager_stored_password][crate::model::SqlServerProfile::secret_manager_stored_password].
3259    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
3260        mut self,
3261        v: T,
3262    ) -> Self {
3263        self.secret_manager_stored_password = v.into();
3264        self
3265    }
3266}
3267
3268impl wkt::message::Message for SqlServerProfile {
3269    fn typename() -> &'static str {
3270        "type.googleapis.com/google.cloud.datastream.v1.SqlServerProfile"
3271    }
3272}
3273
3274/// Salesforce profile
3275#[serde_with::serde_as]
3276#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3277#[serde(default, rename_all = "camelCase")]
3278#[non_exhaustive]
3279pub struct SalesforceProfile {
3280    /// Required. Domain endpoint for the Salesforce connection.
3281    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3282    pub domain: std::string::String,
3283
3284    /// Credentials for Salesforce connection.
3285    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
3286    pub credentials: std::option::Option<crate::model::salesforce_profile::Credentials>,
3287
3288    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3289    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3290}
3291
3292impl SalesforceProfile {
3293    pub fn new() -> Self {
3294        std::default::Default::default()
3295    }
3296
3297    /// Sets the value of [domain][crate::model::SalesforceProfile::domain].
3298    pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3299        self.domain = v.into();
3300        self
3301    }
3302
3303    /// Sets the value of [credentials][crate::model::SalesforceProfile::credentials].
3304    ///
3305    /// Note that all the setters affecting `credentials` are mutually
3306    /// exclusive.
3307    pub fn set_credentials<
3308        T: std::convert::Into<std::option::Option<crate::model::salesforce_profile::Credentials>>,
3309    >(
3310        mut self,
3311        v: T,
3312    ) -> Self {
3313        self.credentials = v.into();
3314        self
3315    }
3316
3317    /// The value of [credentials][crate::model::SalesforceProfile::credentials]
3318    /// if it holds a `UserCredentials`, `None` if the field is not set or
3319    /// holds a different branch.
3320    pub fn user_credentials(
3321        &self,
3322    ) -> std::option::Option<&std::boxed::Box<crate::model::salesforce_profile::UserCredentials>>
3323    {
3324        #[allow(unreachable_patterns)]
3325        self.credentials.as_ref().and_then(|v| match v {
3326            crate::model::salesforce_profile::Credentials::UserCredentials(v) => {
3327                std::option::Option::Some(v)
3328            }
3329            _ => std::option::Option::None,
3330        })
3331    }
3332
3333    /// The value of [credentials][crate::model::SalesforceProfile::credentials]
3334    /// if it holds a `Oauth2ClientCredentials`, `None` if the field is not set or
3335    /// holds a different branch.
3336    pub fn oauth2_client_credentials(
3337        &self,
3338    ) -> std::option::Option<
3339        &std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>,
3340    > {
3341        #[allow(unreachable_patterns)]
3342        self.credentials.as_ref().and_then(|v| match v {
3343            crate::model::salesforce_profile::Credentials::Oauth2ClientCredentials(v) => {
3344                std::option::Option::Some(v)
3345            }
3346            _ => std::option::Option::None,
3347        })
3348    }
3349
3350    /// Sets the value of [credentials][crate::model::SalesforceProfile::credentials]
3351    /// to hold a `UserCredentials`.
3352    ///
3353    /// Note that all the setters affecting `credentials` are
3354    /// mutually exclusive.
3355    pub fn set_user_credentials<
3356        T: std::convert::Into<std::boxed::Box<crate::model::salesforce_profile::UserCredentials>>,
3357    >(
3358        mut self,
3359        v: T,
3360    ) -> Self {
3361        self.credentials = std::option::Option::Some(
3362            crate::model::salesforce_profile::Credentials::UserCredentials(v.into()),
3363        );
3364        self
3365    }
3366
3367    /// Sets the value of [credentials][crate::model::SalesforceProfile::credentials]
3368    /// to hold a `Oauth2ClientCredentials`.
3369    ///
3370    /// Note that all the setters affecting `credentials` are
3371    /// mutually exclusive.
3372    pub fn set_oauth2_client_credentials<
3373        T: std::convert::Into<
3374                std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>,
3375            >,
3376    >(
3377        mut self,
3378        v: T,
3379    ) -> Self {
3380        self.credentials = std::option::Option::Some(
3381            crate::model::salesforce_profile::Credentials::Oauth2ClientCredentials(v.into()),
3382        );
3383        self
3384    }
3385}
3386
3387impl wkt::message::Message for SalesforceProfile {
3388    fn typename() -> &'static str {
3389        "type.googleapis.com/google.cloud.datastream.v1.SalesforceProfile"
3390    }
3391}
3392
3393/// Defines additional types related to [SalesforceProfile].
3394pub mod salesforce_profile {
3395    #[allow(unused_imports)]
3396    use super::*;
3397
3398    /// Username-password credentials.
3399    #[serde_with::serde_as]
3400    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3401    #[serde(default, rename_all = "camelCase")]
3402    #[non_exhaustive]
3403    pub struct UserCredentials {
3404        /// Required. Username for the Salesforce connection.
3405        #[serde(skip_serializing_if = "std::string::String::is_empty")]
3406        pub username: std::string::String,
3407
3408        /// Optional. Password for the Salesforce connection.
3409        /// Mutually exclusive with the `secret_manager_stored_password` field.
3410        #[serde(skip_serializing_if = "std::string::String::is_empty")]
3411        pub password: std::string::String,
3412
3413        /// Optional. Security token for the Salesforce connection.
3414        /// Mutually exclusive with the `secret_manager_stored_security_token` field.
3415        #[serde(skip_serializing_if = "std::string::String::is_empty")]
3416        pub security_token: std::string::String,
3417
3418        /// Optional. A reference to a Secret Manager resource name storing the
3419        /// Salesforce connection's password. Mutually exclusive with the `password`
3420        /// field.
3421        #[serde(skip_serializing_if = "std::string::String::is_empty")]
3422        pub secret_manager_stored_password: std::string::String,
3423
3424        /// Optional. A reference to a Secret Manager resource name storing the
3425        /// Salesforce connection's security token. Mutually exclusive with the
3426        /// `security_token` field.
3427        #[serde(skip_serializing_if = "std::string::String::is_empty")]
3428        pub secret_manager_stored_security_token: std::string::String,
3429
3430        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3431        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3432    }
3433
3434    impl UserCredentials {
3435        pub fn new() -> Self {
3436            std::default::Default::default()
3437        }
3438
3439        /// Sets the value of [username][crate::model::salesforce_profile::UserCredentials::username].
3440        pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3441            self.username = v.into();
3442            self
3443        }
3444
3445        /// Sets the value of [password][crate::model::salesforce_profile::UserCredentials::password].
3446        pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3447            self.password = v.into();
3448            self
3449        }
3450
3451        /// Sets the value of [security_token][crate::model::salesforce_profile::UserCredentials::security_token].
3452        pub fn set_security_token<T: std::convert::Into<std::string::String>>(
3453            mut self,
3454            v: T,
3455        ) -> Self {
3456            self.security_token = v.into();
3457            self
3458        }
3459
3460        /// Sets the value of [secret_manager_stored_password][crate::model::salesforce_profile::UserCredentials::secret_manager_stored_password].
3461        pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
3462            mut self,
3463            v: T,
3464        ) -> Self {
3465            self.secret_manager_stored_password = v.into();
3466            self
3467        }
3468
3469        /// Sets the value of [secret_manager_stored_security_token][crate::model::salesforce_profile::UserCredentials::secret_manager_stored_security_token].
3470        pub fn set_secret_manager_stored_security_token<
3471            T: std::convert::Into<std::string::String>,
3472        >(
3473            mut self,
3474            v: T,
3475        ) -> Self {
3476            self.secret_manager_stored_security_token = v.into();
3477            self
3478        }
3479    }
3480
3481    impl wkt::message::Message for UserCredentials {
3482        fn typename() -> &'static str {
3483            "type.googleapis.com/google.cloud.datastream.v1.SalesforceProfile.UserCredentials"
3484        }
3485    }
3486
3487    /// OAuth2 Client Credentials.
3488    #[serde_with::serde_as]
3489    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3490    #[serde(default, rename_all = "camelCase")]
3491    #[non_exhaustive]
3492    pub struct Oauth2ClientCredentials {
3493        /// Required. Client ID for Salesforce OAuth2 Client Credentials.
3494        #[serde(skip_serializing_if = "std::string::String::is_empty")]
3495        pub client_id: std::string::String,
3496
3497        /// Optional. Client secret for Salesforce OAuth2 Client Credentials.
3498        /// Mutually exclusive with the `secret_manager_stored_client_secret` field.
3499        #[serde(skip_serializing_if = "std::string::String::is_empty")]
3500        pub client_secret: std::string::String,
3501
3502        /// Optional. A reference to a Secret Manager resource name storing the
3503        /// Salesforce OAuth2 client_secret. Mutually exclusive with the
3504        /// `client_secret` field.
3505        #[serde(skip_serializing_if = "std::string::String::is_empty")]
3506        pub secret_manager_stored_client_secret: std::string::String,
3507
3508        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3509        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3510    }
3511
3512    impl Oauth2ClientCredentials {
3513        pub fn new() -> Self {
3514            std::default::Default::default()
3515        }
3516
3517        /// Sets the value of [client_id][crate::model::salesforce_profile::Oauth2ClientCredentials::client_id].
3518        pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3519            self.client_id = v.into();
3520            self
3521        }
3522
3523        /// Sets the value of [client_secret][crate::model::salesforce_profile::Oauth2ClientCredentials::client_secret].
3524        pub fn set_client_secret<T: std::convert::Into<std::string::String>>(
3525            mut self,
3526            v: T,
3527        ) -> Self {
3528            self.client_secret = v.into();
3529            self
3530        }
3531
3532        /// Sets the value of [secret_manager_stored_client_secret][crate::model::salesforce_profile::Oauth2ClientCredentials::secret_manager_stored_client_secret].
3533        pub fn set_secret_manager_stored_client_secret<
3534            T: std::convert::Into<std::string::String>,
3535        >(
3536            mut self,
3537            v: T,
3538        ) -> Self {
3539            self.secret_manager_stored_client_secret = v.into();
3540            self
3541        }
3542    }
3543
3544    impl wkt::message::Message for Oauth2ClientCredentials {
3545        fn typename() -> &'static str {
3546            "type.googleapis.com/google.cloud.datastream.v1.SalesforceProfile.Oauth2ClientCredentials"
3547        }
3548    }
3549
3550    /// Credentials for Salesforce connection.
3551    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3552    #[serde(rename_all = "camelCase")]
3553    #[non_exhaustive]
3554    pub enum Credentials {
3555        /// User-password authentication.
3556        UserCredentials(std::boxed::Box<crate::model::salesforce_profile::UserCredentials>),
3557        /// Connected app authentication.
3558        Oauth2ClientCredentials(
3559            std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>,
3560        ),
3561    }
3562}
3563
3564/// Cloud Storage bucket profile.
3565#[serde_with::serde_as]
3566#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3567#[serde(default, rename_all = "camelCase")]
3568#[non_exhaustive]
3569pub struct GcsProfile {
3570    /// Required. The Cloud Storage bucket name.
3571    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3572    pub bucket: std::string::String,
3573
3574    /// The root path inside the Cloud Storage bucket.
3575    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3576    pub root_path: std::string::String,
3577
3578    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3579    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3580}
3581
3582impl GcsProfile {
3583    pub fn new() -> Self {
3584        std::default::Default::default()
3585    }
3586
3587    /// Sets the value of [bucket][crate::model::GcsProfile::bucket].
3588    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3589        self.bucket = v.into();
3590        self
3591    }
3592
3593    /// Sets the value of [root_path][crate::model::GcsProfile::root_path].
3594    pub fn set_root_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3595        self.root_path = v.into();
3596        self
3597    }
3598}
3599
3600impl wkt::message::Message for GcsProfile {
3601    fn typename() -> &'static str {
3602        "type.googleapis.com/google.cloud.datastream.v1.GcsProfile"
3603    }
3604}
3605
3606/// BigQuery warehouse profile.
3607#[serde_with::serde_as]
3608#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3609#[serde(default, rename_all = "camelCase")]
3610#[non_exhaustive]
3611pub struct BigQueryProfile {
3612    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3613    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3614}
3615
3616impl BigQueryProfile {
3617    pub fn new() -> Self {
3618        std::default::Default::default()
3619    }
3620}
3621
3622impl wkt::message::Message for BigQueryProfile {
3623    fn typename() -> &'static str {
3624        "type.googleapis.com/google.cloud.datastream.v1.BigQueryProfile"
3625    }
3626}
3627
3628/// Static IP address connectivity. Used when the source database is configured
3629/// to allow incoming connections from the Datastream public IP addresses
3630/// for the region specified in the connection profile.
3631#[serde_with::serde_as]
3632#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3633#[serde(default, rename_all = "camelCase")]
3634#[non_exhaustive]
3635pub struct StaticServiceIpConnectivity {
3636    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3637    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3638}
3639
3640impl StaticServiceIpConnectivity {
3641    pub fn new() -> Self {
3642        std::default::Default::default()
3643    }
3644}
3645
3646impl wkt::message::Message for StaticServiceIpConnectivity {
3647    fn typename() -> &'static str {
3648        "type.googleapis.com/google.cloud.datastream.v1.StaticServiceIpConnectivity"
3649    }
3650}
3651
3652/// Forward SSH Tunnel connectivity.
3653#[serde_with::serde_as]
3654#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3655#[serde(default, rename_all = "camelCase")]
3656#[non_exhaustive]
3657pub struct ForwardSshTunnelConnectivity {
3658    /// Required. Hostname for the SSH tunnel.
3659    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3660    pub hostname: std::string::String,
3661
3662    /// Required. Username for the SSH tunnel.
3663    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3664    pub username: std::string::String,
3665
3666    /// Port for the SSH tunnel, default value is 22.
3667    pub port: i32,
3668
3669    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
3670    pub authentication_method:
3671        std::option::Option<crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod>,
3672
3673    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3674    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3675}
3676
3677impl ForwardSshTunnelConnectivity {
3678    pub fn new() -> Self {
3679        std::default::Default::default()
3680    }
3681
3682    /// Sets the value of [hostname][crate::model::ForwardSshTunnelConnectivity::hostname].
3683    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3684        self.hostname = v.into();
3685        self
3686    }
3687
3688    /// Sets the value of [username][crate::model::ForwardSshTunnelConnectivity::username].
3689    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3690        self.username = v.into();
3691        self
3692    }
3693
3694    /// Sets the value of [port][crate::model::ForwardSshTunnelConnectivity::port].
3695    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3696        self.port = v.into();
3697        self
3698    }
3699
3700    /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method].
3701    ///
3702    /// Note that all the setters affecting `authentication_method` are mutually
3703    /// exclusive.
3704    pub fn set_authentication_method<
3705        T: std::convert::Into<
3706                std::option::Option<
3707                    crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod,
3708                >,
3709            >,
3710    >(
3711        mut self,
3712        v: T,
3713    ) -> Self {
3714        self.authentication_method = v.into();
3715        self
3716    }
3717
3718    /// The value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
3719    /// if it holds a `Password`, `None` if the field is not set or
3720    /// holds a different branch.
3721    pub fn password(&self) -> std::option::Option<&std::string::String> {
3722        #[allow(unreachable_patterns)]
3723        self.authentication_method.as_ref().and_then(|v| match v {
3724            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::Password(v) => {
3725                std::option::Option::Some(v)
3726            }
3727            _ => std::option::Option::None,
3728        })
3729    }
3730
3731    /// The value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
3732    /// if it holds a `PrivateKey`, `None` if the field is not set or
3733    /// holds a different branch.
3734    pub fn private_key(&self) -> std::option::Option<&std::string::String> {
3735        #[allow(unreachable_patterns)]
3736        self.authentication_method.as_ref().and_then(|v| match v {
3737            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::PrivateKey(v) => {
3738                std::option::Option::Some(v)
3739            }
3740            _ => std::option::Option::None,
3741        })
3742    }
3743
3744    /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
3745    /// to hold a `Password`.
3746    ///
3747    /// Note that all the setters affecting `authentication_method` are
3748    /// mutually exclusive.
3749    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3750        self.authentication_method = std::option::Option::Some(
3751            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::Password(v.into()),
3752        );
3753        self
3754    }
3755
3756    /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
3757    /// to hold a `PrivateKey`.
3758    ///
3759    /// Note that all the setters affecting `authentication_method` are
3760    /// mutually exclusive.
3761    pub fn set_private_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3762        self.authentication_method = std::option::Option::Some(
3763            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::PrivateKey(
3764                v.into(),
3765            ),
3766        );
3767        self
3768    }
3769}
3770
3771impl wkt::message::Message for ForwardSshTunnelConnectivity {
3772    fn typename() -> &'static str {
3773        "type.googleapis.com/google.cloud.datastream.v1.ForwardSshTunnelConnectivity"
3774    }
3775}
3776
3777/// Defines additional types related to [ForwardSshTunnelConnectivity].
3778pub mod forward_ssh_tunnel_connectivity {
3779    #[allow(unused_imports)]
3780    use super::*;
3781
3782    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3783    #[serde(rename_all = "camelCase")]
3784    #[non_exhaustive]
3785    pub enum AuthenticationMethod {
3786        /// Input only. SSH password.
3787        Password(std::string::String),
3788        /// Input only. SSH private key.
3789        PrivateKey(std::string::String),
3790    }
3791}
3792
3793/// The VPC Peering configuration is used to create VPC peering between
3794/// Datastream and the consumer's VPC.
3795#[serde_with::serde_as]
3796#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3797#[serde(default, rename_all = "camelCase")]
3798#[non_exhaustive]
3799pub struct VpcPeeringConfig {
3800    /// Required. Fully qualified name of the VPC that Datastream will peer to.
3801    /// Format: `projects/{project}/global/{networks}/{name}`
3802    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3803    pub vpc: std::string::String,
3804
3805    /// Required. A free subnet for peering. (CIDR of /29)
3806    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3807    pub subnet: std::string::String,
3808
3809    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3810    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3811}
3812
3813impl VpcPeeringConfig {
3814    pub fn new() -> Self {
3815        std::default::Default::default()
3816    }
3817
3818    /// Sets the value of [vpc][crate::model::VpcPeeringConfig::vpc].
3819    pub fn set_vpc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3820        self.vpc = v.into();
3821        self
3822    }
3823
3824    /// Sets the value of [subnet][crate::model::VpcPeeringConfig::subnet].
3825    pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3826        self.subnet = v.into();
3827        self
3828    }
3829}
3830
3831impl wkt::message::Message for VpcPeeringConfig {
3832    fn typename() -> &'static str {
3833        "type.googleapis.com/google.cloud.datastream.v1.VpcPeeringConfig"
3834    }
3835}
3836
3837/// The PrivateConnection resource is used to establish private connectivity
3838/// between Datastream and a customer's network.
3839#[serde_with::serde_as]
3840#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3841#[serde(default, rename_all = "camelCase")]
3842#[non_exhaustive]
3843pub struct PrivateConnection {
3844    /// Output only. Identifier. The resource's name.
3845    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3846    pub name: std::string::String,
3847
3848    /// Output only. The create time of the resource.
3849    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3850    pub create_time: std::option::Option<wkt::Timestamp>,
3851
3852    /// Output only. The update time of the resource.
3853    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3854    pub update_time: std::option::Option<wkt::Timestamp>,
3855
3856    /// Labels.
3857    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
3858    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3859
3860    /// Required. Display name.
3861    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3862    pub display_name: std::string::String,
3863
3864    /// Output only. The state of the Private Connection.
3865    pub state: crate::model::private_connection::State,
3866
3867    /// Output only. In case of error, the details of the error in a user-friendly
3868    /// format.
3869    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3870    pub error: std::option::Option<crate::model::Error>,
3871
3872    /// Output only. Reserved for future use.
3873    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3874    pub satisfies_pzs: std::option::Option<bool>,
3875
3876    /// Output only. Reserved for future use.
3877    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3878    pub satisfies_pzi: std::option::Option<bool>,
3879
3880    /// VPC Peering Config.
3881    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3882    pub vpc_peering_config: std::option::Option<crate::model::VpcPeeringConfig>,
3883
3884    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3885    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3886}
3887
3888impl PrivateConnection {
3889    pub fn new() -> Self {
3890        std::default::Default::default()
3891    }
3892
3893    /// Sets the value of [name][crate::model::PrivateConnection::name].
3894    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3895        self.name = v.into();
3896        self
3897    }
3898
3899    /// Sets the value of [create_time][crate::model::PrivateConnection::create_time].
3900    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3901        mut self,
3902        v: T,
3903    ) -> Self {
3904        self.create_time = v.into();
3905        self
3906    }
3907
3908    /// Sets the value of [update_time][crate::model::PrivateConnection::update_time].
3909    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3910        mut self,
3911        v: T,
3912    ) -> Self {
3913        self.update_time = v.into();
3914        self
3915    }
3916
3917    /// Sets the value of [display_name][crate::model::PrivateConnection::display_name].
3918    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3919        self.display_name = v.into();
3920        self
3921    }
3922
3923    /// Sets the value of [state][crate::model::PrivateConnection::state].
3924    pub fn set_state<T: std::convert::Into<crate::model::private_connection::State>>(
3925        mut self,
3926        v: T,
3927    ) -> Self {
3928        self.state = v.into();
3929        self
3930    }
3931
3932    /// Sets the value of [error][crate::model::PrivateConnection::error].
3933    pub fn set_error<T: std::convert::Into<std::option::Option<crate::model::Error>>>(
3934        mut self,
3935        v: T,
3936    ) -> Self {
3937        self.error = v.into();
3938        self
3939    }
3940
3941    /// Sets the value of [satisfies_pzs][crate::model::PrivateConnection::satisfies_pzs].
3942    pub fn set_satisfies_pzs<T: std::convert::Into<std::option::Option<bool>>>(
3943        mut self,
3944        v: T,
3945    ) -> Self {
3946        self.satisfies_pzs = v.into();
3947        self
3948    }
3949
3950    /// Sets the value of [satisfies_pzi][crate::model::PrivateConnection::satisfies_pzi].
3951    pub fn set_satisfies_pzi<T: std::convert::Into<std::option::Option<bool>>>(
3952        mut self,
3953        v: T,
3954    ) -> Self {
3955        self.satisfies_pzi = v.into();
3956        self
3957    }
3958
3959    /// Sets the value of [vpc_peering_config][crate::model::PrivateConnection::vpc_peering_config].
3960    pub fn set_vpc_peering_config<
3961        T: std::convert::Into<std::option::Option<crate::model::VpcPeeringConfig>>,
3962    >(
3963        mut self,
3964        v: T,
3965    ) -> Self {
3966        self.vpc_peering_config = v.into();
3967        self
3968    }
3969
3970    /// Sets the value of [labels][crate::model::PrivateConnection::labels].
3971    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3972    where
3973        T: std::iter::IntoIterator<Item = (K, V)>,
3974        K: std::convert::Into<std::string::String>,
3975        V: std::convert::Into<std::string::String>,
3976    {
3977        use std::iter::Iterator;
3978        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3979        self
3980    }
3981}
3982
3983impl wkt::message::Message for PrivateConnection {
3984    fn typename() -> &'static str {
3985        "type.googleapis.com/google.cloud.datastream.v1.PrivateConnection"
3986    }
3987}
3988
3989/// Defines additional types related to [PrivateConnection].
3990pub mod private_connection {
3991    #[allow(unused_imports)]
3992    use super::*;
3993
3994    /// Private Connection state.
3995    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3996    pub struct State(i32);
3997
3998    impl State {
3999        /// Unspecified state.
4000        pub const STATE_UNSPECIFIED: State = State::new(0);
4001
4002        /// The private connection is in creation state - creating resources.
4003        pub const CREATING: State = State::new(1);
4004
4005        /// The private connection has been created with all of its resources.
4006        pub const CREATED: State = State::new(2);
4007
4008        /// The private connection creation has failed.
4009        pub const FAILED: State = State::new(3);
4010
4011        /// The private connection is being deleted.
4012        pub const DELETING: State = State::new(4);
4013
4014        /// Delete request has failed, resource is in invalid state.
4015        pub const FAILED_TO_DELETE: State = State::new(5);
4016
4017        /// Creates a new State instance.
4018        pub(crate) const fn new(value: i32) -> Self {
4019            Self(value)
4020        }
4021
4022        /// Gets the enum value.
4023        pub fn value(&self) -> i32 {
4024            self.0
4025        }
4026
4027        /// Gets the enum value as a string.
4028        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
4029            match self.0 {
4030                0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
4031                1 => std::borrow::Cow::Borrowed("CREATING"),
4032                2 => std::borrow::Cow::Borrowed("CREATED"),
4033                3 => std::borrow::Cow::Borrowed("FAILED"),
4034                4 => std::borrow::Cow::Borrowed("DELETING"),
4035                5 => std::borrow::Cow::Borrowed("FAILED_TO_DELETE"),
4036                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
4037            }
4038        }
4039
4040        /// Creates an enum value from the value name.
4041        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
4042            match name {
4043                "STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
4044                "CREATING" => std::option::Option::Some(Self::CREATING),
4045                "CREATED" => std::option::Option::Some(Self::CREATED),
4046                "FAILED" => std::option::Option::Some(Self::FAILED),
4047                "DELETING" => std::option::Option::Some(Self::DELETING),
4048                "FAILED_TO_DELETE" => std::option::Option::Some(Self::FAILED_TO_DELETE),
4049                _ => std::option::Option::None,
4050            }
4051        }
4052    }
4053
4054    impl std::convert::From<i32> for State {
4055        fn from(value: i32) -> Self {
4056            Self::new(value)
4057        }
4058    }
4059
4060    impl std::default::Default for State {
4061        fn default() -> Self {
4062            Self::new(0)
4063        }
4064    }
4065}
4066
4067/// Private Connectivity
4068#[serde_with::serde_as]
4069#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4070#[serde(default, rename_all = "camelCase")]
4071#[non_exhaustive]
4072pub struct PrivateConnectivity {
4073    /// Required. A reference to a private connection resource.
4074    /// Format: `projects/{project}/locations/{location}/privateConnections/{name}`
4075    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4076    pub private_connection: std::string::String,
4077
4078    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4079    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4080}
4081
4082impl PrivateConnectivity {
4083    pub fn new() -> Self {
4084        std::default::Default::default()
4085    }
4086
4087    /// Sets the value of [private_connection][crate::model::PrivateConnectivity::private_connection].
4088    pub fn set_private_connection<T: std::convert::Into<std::string::String>>(
4089        mut self,
4090        v: T,
4091    ) -> Self {
4092        self.private_connection = v.into();
4093        self
4094    }
4095}
4096
4097impl wkt::message::Message for PrivateConnectivity {
4098    fn typename() -> &'static str {
4099        "type.googleapis.com/google.cloud.datastream.v1.PrivateConnectivity"
4100    }
4101}
4102
4103/// The route resource is the child of the private connection resource,
4104/// used for defining a route for a private connection.
4105#[serde_with::serde_as]
4106#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4107#[serde(default, rename_all = "camelCase")]
4108#[non_exhaustive]
4109pub struct Route {
4110    /// Output only. Identifier. The resource's name.
4111    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4112    pub name: std::string::String,
4113
4114    /// Output only. The create time of the resource.
4115    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4116    pub create_time: std::option::Option<wkt::Timestamp>,
4117
4118    /// Output only. The update time of the resource.
4119    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4120    pub update_time: std::option::Option<wkt::Timestamp>,
4121
4122    /// Labels.
4123    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
4124    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4125
4126    /// Required. Display name.
4127    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4128    pub display_name: std::string::String,
4129
4130    /// Required. Destination address for connection
4131    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4132    pub destination_address: std::string::String,
4133
4134    /// Destination port for connection
4135    pub destination_port: i32,
4136
4137    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4138    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4139}
4140
4141impl Route {
4142    pub fn new() -> Self {
4143        std::default::Default::default()
4144    }
4145
4146    /// Sets the value of [name][crate::model::Route::name].
4147    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4148        self.name = v.into();
4149        self
4150    }
4151
4152    /// Sets the value of [create_time][crate::model::Route::create_time].
4153    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4154        mut self,
4155        v: T,
4156    ) -> Self {
4157        self.create_time = v.into();
4158        self
4159    }
4160
4161    /// Sets the value of [update_time][crate::model::Route::update_time].
4162    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4163        mut self,
4164        v: T,
4165    ) -> Self {
4166        self.update_time = v.into();
4167        self
4168    }
4169
4170    /// Sets the value of [display_name][crate::model::Route::display_name].
4171    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4172        self.display_name = v.into();
4173        self
4174    }
4175
4176    /// Sets the value of [destination_address][crate::model::Route::destination_address].
4177    pub fn set_destination_address<T: std::convert::Into<std::string::String>>(
4178        mut self,
4179        v: T,
4180    ) -> Self {
4181        self.destination_address = v.into();
4182        self
4183    }
4184
4185    /// Sets the value of [destination_port][crate::model::Route::destination_port].
4186    pub fn set_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4187        self.destination_port = v.into();
4188        self
4189    }
4190
4191    /// Sets the value of [labels][crate::model::Route::labels].
4192    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4193    where
4194        T: std::iter::IntoIterator<Item = (K, V)>,
4195        K: std::convert::Into<std::string::String>,
4196        V: std::convert::Into<std::string::String>,
4197    {
4198        use std::iter::Iterator;
4199        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4200        self
4201    }
4202}
4203
4204impl wkt::message::Message for Route {
4205    fn typename() -> &'static str {
4206        "type.googleapis.com/google.cloud.datastream.v1.Route"
4207    }
4208}
4209
4210/// MySQL SSL configuration information.
4211#[serde_with::serde_as]
4212#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4213#[serde(default, rename_all = "camelCase")]
4214#[non_exhaustive]
4215pub struct MysqlSslConfig {
4216    /// Optional. Input only. PEM-encoded private key associated with the Client
4217    /// Certificate. If this field is used then the 'client_certificate' and the
4218    /// 'ca_certificate' fields are mandatory.
4219    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4220    pub client_key: std::string::String,
4221
4222    /// Output only. Indicates whether the client_key field is set.
4223    pub client_key_set: bool,
4224
4225    /// Optional. Input only. PEM-encoded certificate that will be used by the
4226    /// replica to authenticate against the source database server. If this field
4227    /// is used then the 'client_key' and the 'ca_certificate' fields are
4228    /// mandatory.
4229    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4230    pub client_certificate: std::string::String,
4231
4232    /// Output only. Indicates whether the client_certificate field is set.
4233    pub client_certificate_set: bool,
4234
4235    /// Input only. PEM-encoded certificate of the CA that signed the source
4236    /// database server's certificate.
4237    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4238    pub ca_certificate: std::string::String,
4239
4240    /// Output only. Indicates whether the ca_certificate field is set.
4241    pub ca_certificate_set: bool,
4242
4243    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4244    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4245}
4246
4247impl MysqlSslConfig {
4248    pub fn new() -> Self {
4249        std::default::Default::default()
4250    }
4251
4252    /// Sets the value of [client_key][crate::model::MysqlSslConfig::client_key].
4253    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4254        self.client_key = v.into();
4255        self
4256    }
4257
4258    /// Sets the value of [client_key_set][crate::model::MysqlSslConfig::client_key_set].
4259    pub fn set_client_key_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4260        self.client_key_set = v.into();
4261        self
4262    }
4263
4264    /// Sets the value of [client_certificate][crate::model::MysqlSslConfig::client_certificate].
4265    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
4266        mut self,
4267        v: T,
4268    ) -> Self {
4269        self.client_certificate = v.into();
4270        self
4271    }
4272
4273    /// Sets the value of [client_certificate_set][crate::model::MysqlSslConfig::client_certificate_set].
4274    pub fn set_client_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4275        self.client_certificate_set = v.into();
4276        self
4277    }
4278
4279    /// Sets the value of [ca_certificate][crate::model::MysqlSslConfig::ca_certificate].
4280    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4281        self.ca_certificate = v.into();
4282        self
4283    }
4284
4285    /// Sets the value of [ca_certificate_set][crate::model::MysqlSslConfig::ca_certificate_set].
4286    pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4287        self.ca_certificate_set = v.into();
4288        self
4289    }
4290}
4291
4292impl wkt::message::Message for MysqlSslConfig {
4293    fn typename() -> &'static str {
4294        "type.googleapis.com/google.cloud.datastream.v1.MysqlSslConfig"
4295    }
4296}
4297
4298/// Oracle SSL configuration information.
4299#[serde_with::serde_as]
4300#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4301#[serde(default, rename_all = "camelCase")]
4302#[non_exhaustive]
4303pub struct OracleSslConfig {
4304    /// Input only. PEM-encoded certificate of the CA that signed the source
4305    /// database server's certificate.
4306    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4307    pub ca_certificate: std::string::String,
4308
4309    /// Output only. Indicates whether the ca_certificate field has been set for
4310    /// this Connection-Profile.
4311    pub ca_certificate_set: bool,
4312
4313    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4314    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4315}
4316
4317impl OracleSslConfig {
4318    pub fn new() -> Self {
4319        std::default::Default::default()
4320    }
4321
4322    /// Sets the value of [ca_certificate][crate::model::OracleSslConfig::ca_certificate].
4323    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4324        self.ca_certificate = v.into();
4325        self
4326    }
4327
4328    /// Sets the value of [ca_certificate_set][crate::model::OracleSslConfig::ca_certificate_set].
4329    pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4330        self.ca_certificate_set = v.into();
4331        self
4332    }
4333}
4334
4335impl wkt::message::Message for OracleSslConfig {
4336    fn typename() -> &'static str {
4337        "type.googleapis.com/google.cloud.datastream.v1.OracleSslConfig"
4338    }
4339}
4340
4341/// PostgreSQL SSL configuration information.
4342#[serde_with::serde_as]
4343#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4344#[serde(default, rename_all = "camelCase")]
4345#[non_exhaustive]
4346pub struct PostgresqlSslConfig {
4347    /// The encryption settings available for PostgreSQL connection profiles.
4348    /// This captures various SSL mode supported by PostgreSQL, which includes
4349    /// TLS encryption with server verification, TLS encryption with both server
4350    /// and client verification and no TLS encryption.
4351    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
4352    pub encryption_setting:
4353        std::option::Option<crate::model::postgresql_ssl_config::EncryptionSetting>,
4354
4355    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4356    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4357}
4358
4359impl PostgresqlSslConfig {
4360    pub fn new() -> Self {
4361        std::default::Default::default()
4362    }
4363
4364    /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting].
4365    ///
4366    /// Note that all the setters affecting `encryption_setting` are mutually
4367    /// exclusive.
4368    pub fn set_encryption_setting<
4369        T: std::convert::Into<
4370                std::option::Option<crate::model::postgresql_ssl_config::EncryptionSetting>,
4371            >,
4372    >(
4373        mut self,
4374        v: T,
4375    ) -> Self {
4376        self.encryption_setting = v.into();
4377        self
4378    }
4379
4380    /// The value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
4381    /// if it holds a `ServerVerification`, `None` if the field is not set or
4382    /// holds a different branch.
4383    pub fn server_verification(
4384        &self,
4385    ) -> std::option::Option<
4386        &std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
4387    > {
4388        #[allow(unreachable_patterns)]
4389        self.encryption_setting.as_ref().and_then(|v| match v {
4390            crate::model::postgresql_ssl_config::EncryptionSetting::ServerVerification(v) => {
4391                std::option::Option::Some(v)
4392            }
4393            _ => std::option::Option::None,
4394        })
4395    }
4396
4397    /// The value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
4398    /// if it holds a `ServerAndClientVerification`, `None` if the field is not set or
4399    /// holds a different branch.
4400    pub fn server_and_client_verification(
4401        &self,
4402    ) -> std::option::Option<
4403        &std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
4404    > {
4405        #[allow(unreachable_patterns)]
4406        self.encryption_setting.as_ref().and_then(|v| match v {
4407            crate::model::postgresql_ssl_config::EncryptionSetting::ServerAndClientVerification(
4408                v,
4409            ) => std::option::Option::Some(v),
4410            _ => std::option::Option::None,
4411        })
4412    }
4413
4414    /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
4415    /// to hold a `ServerVerification`.
4416    ///
4417    /// Note that all the setters affecting `encryption_setting` are
4418    /// mutually exclusive.
4419    pub fn set_server_verification<
4420        T: std::convert::Into<
4421                std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
4422            >,
4423    >(
4424        mut self,
4425        v: T,
4426    ) -> Self {
4427        self.encryption_setting = std::option::Option::Some(
4428            crate::model::postgresql_ssl_config::EncryptionSetting::ServerVerification(v.into()),
4429        );
4430        self
4431    }
4432
4433    /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
4434    /// to hold a `ServerAndClientVerification`.
4435    ///
4436    /// Note that all the setters affecting `encryption_setting` are
4437    /// mutually exclusive.
4438    pub fn set_server_and_client_verification<
4439        T: std::convert::Into<
4440                std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
4441            >,
4442    >(
4443        mut self,
4444        v: T,
4445    ) -> Self {
4446        self.encryption_setting = std::option::Option::Some(
4447            crate::model::postgresql_ssl_config::EncryptionSetting::ServerAndClientVerification(
4448                v.into(),
4449            ),
4450        );
4451        self
4452    }
4453}
4454
4455impl wkt::message::Message for PostgresqlSslConfig {
4456    fn typename() -> &'static str {
4457        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig"
4458    }
4459}
4460
4461/// Defines additional types related to [PostgresqlSslConfig].
4462pub mod postgresql_ssl_config {
4463    #[allow(unused_imports)]
4464    use super::*;
4465
4466    /// Message represents the option where Datastream will enforce the encryption
4467    /// and authenticate the server identity. ca_certificate must be set if user
4468    /// selects this option.
4469    #[serde_with::serde_as]
4470    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4471    #[serde(default, rename_all = "camelCase")]
4472    #[non_exhaustive]
4473    pub struct ServerVerification {
4474        /// Required. Input only. PEM-encoded server root CA certificate.
4475        #[serde(skip_serializing_if = "std::string::String::is_empty")]
4476        pub ca_certificate: std::string::String,
4477
4478        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4479        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4480    }
4481
4482    impl ServerVerification {
4483        pub fn new() -> Self {
4484            std::default::Default::default()
4485        }
4486
4487        /// Sets the value of [ca_certificate][crate::model::postgresql_ssl_config::ServerVerification::ca_certificate].
4488        pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(
4489            mut self,
4490            v: T,
4491        ) -> Self {
4492            self.ca_certificate = v.into();
4493            self
4494        }
4495    }
4496
4497    impl wkt::message::Message for ServerVerification {
4498        fn typename() -> &'static str {
4499            "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig.ServerVerification"
4500        }
4501    }
4502
4503    /// Message represents the option where Datastream will enforce the encryption
4504    /// and authenticate the server identity as well as the client identity.
4505    /// ca_certificate, client_certificate and client_key must be set if user
4506    /// selects this option.
4507    #[serde_with::serde_as]
4508    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4509    #[serde(default, rename_all = "camelCase")]
4510    #[non_exhaustive]
4511    pub struct ServerAndClientVerification {
4512        /// Required. Input only. PEM-encoded certificate used by the source database
4513        /// to authenticate the client identity (i.e., the Datastream's identity).
4514        /// This certificate is signed by either a root certificate trusted by the
4515        /// server or one or more intermediate certificates (which is stored with the
4516        /// leaf certificate) to link the this certificate to the trusted root
4517        /// certificate.
4518        #[serde(skip_serializing_if = "std::string::String::is_empty")]
4519        pub client_certificate: std::string::String,
4520
4521        /// Optional. Input only. PEM-encoded private key associated with the client
4522        /// certificate. This value will be used during the SSL/TLS handshake,
4523        /// allowing the PostgreSQL server to authenticate the client's identity,
4524        /// i.e. identity of the Datastream.
4525        #[serde(skip_serializing_if = "std::string::String::is_empty")]
4526        pub client_key: std::string::String,
4527
4528        /// Required. Input only. PEM-encoded server root CA certificate.
4529        #[serde(skip_serializing_if = "std::string::String::is_empty")]
4530        pub ca_certificate: std::string::String,
4531
4532        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4533        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4534    }
4535
4536    impl ServerAndClientVerification {
4537        pub fn new() -> Self {
4538            std::default::Default::default()
4539        }
4540
4541        /// Sets the value of [client_certificate][crate::model::postgresql_ssl_config::ServerAndClientVerification::client_certificate].
4542        pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
4543            mut self,
4544            v: T,
4545        ) -> Self {
4546            self.client_certificate = v.into();
4547            self
4548        }
4549
4550        /// Sets the value of [client_key][crate::model::postgresql_ssl_config::ServerAndClientVerification::client_key].
4551        pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4552            self.client_key = v.into();
4553            self
4554        }
4555
4556        /// Sets the value of [ca_certificate][crate::model::postgresql_ssl_config::ServerAndClientVerification::ca_certificate].
4557        pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(
4558            mut self,
4559            v: T,
4560        ) -> Self {
4561            self.ca_certificate = v.into();
4562            self
4563        }
4564    }
4565
4566    impl wkt::message::Message for ServerAndClientVerification {
4567        fn typename() -> &'static str {
4568            "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig.ServerAndClientVerification"
4569        }
4570    }
4571
4572    /// The encryption settings available for PostgreSQL connection profiles.
4573    /// This captures various SSL mode supported by PostgreSQL, which includes
4574    /// TLS encryption with server verification, TLS encryption with both server
4575    /// and client verification and no TLS encryption.
4576    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
4577    #[serde(rename_all = "camelCase")]
4578    #[non_exhaustive]
4579    pub enum EncryptionSetting {
4580        ///  If this field is set, the communication will be encrypted with TLS
4581        /// encryption and the server identity will be authenticated.
4582        ServerVerification(
4583            std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
4584        ),
4585        /// If this field is set, the communication will be encrypted with TLS
4586        /// encryption and both the server identity and the client identity will be
4587        /// authenticated.
4588        ServerAndClientVerification(
4589            std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
4590        ),
4591    }
4592}
4593
4594/// A set of reusable connection configurations to be used as a source or
4595/// destination for a stream.
4596#[serde_with::serde_as]
4597#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4598#[serde(default, rename_all = "camelCase")]
4599#[non_exhaustive]
4600pub struct ConnectionProfile {
4601    /// Output only. Identifier. The resource's name.
4602    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4603    pub name: std::string::String,
4604
4605    /// Output only. The create time of the resource.
4606    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4607    pub create_time: std::option::Option<wkt::Timestamp>,
4608
4609    /// Output only. The update time of the resource.
4610    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4611    pub update_time: std::option::Option<wkt::Timestamp>,
4612
4613    /// Labels.
4614    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
4615    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4616
4617    /// Required. Display name.
4618    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4619    pub display_name: std::string::String,
4620
4621    /// Output only. Reserved for future use.
4622    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4623    pub satisfies_pzs: std::option::Option<bool>,
4624
4625    /// Output only. Reserved for future use.
4626    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4627    pub satisfies_pzi: std::option::Option<bool>,
4628
4629    /// Connection configuration for the ConnectionProfile.
4630    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
4631    pub profile: std::option::Option<crate::model::connection_profile::Profile>,
4632
4633    /// Connectivity options used to establish a connection to the profile.
4634    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
4635    pub connectivity: std::option::Option<crate::model::connection_profile::Connectivity>,
4636
4637    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4638    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4639}
4640
4641impl ConnectionProfile {
4642    pub fn new() -> Self {
4643        std::default::Default::default()
4644    }
4645
4646    /// Sets the value of [name][crate::model::ConnectionProfile::name].
4647    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4648        self.name = v.into();
4649        self
4650    }
4651
4652    /// Sets the value of [create_time][crate::model::ConnectionProfile::create_time].
4653    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4654        mut self,
4655        v: T,
4656    ) -> Self {
4657        self.create_time = v.into();
4658        self
4659    }
4660
4661    /// Sets the value of [update_time][crate::model::ConnectionProfile::update_time].
4662    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4663        mut self,
4664        v: T,
4665    ) -> Self {
4666        self.update_time = v.into();
4667        self
4668    }
4669
4670    /// Sets the value of [display_name][crate::model::ConnectionProfile::display_name].
4671    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4672        self.display_name = v.into();
4673        self
4674    }
4675
4676    /// Sets the value of [satisfies_pzs][crate::model::ConnectionProfile::satisfies_pzs].
4677    pub fn set_satisfies_pzs<T: std::convert::Into<std::option::Option<bool>>>(
4678        mut self,
4679        v: T,
4680    ) -> Self {
4681        self.satisfies_pzs = v.into();
4682        self
4683    }
4684
4685    /// Sets the value of [satisfies_pzi][crate::model::ConnectionProfile::satisfies_pzi].
4686    pub fn set_satisfies_pzi<T: std::convert::Into<std::option::Option<bool>>>(
4687        mut self,
4688        v: T,
4689    ) -> Self {
4690        self.satisfies_pzi = v.into();
4691        self
4692    }
4693
4694    /// Sets the value of [labels][crate::model::ConnectionProfile::labels].
4695    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4696    where
4697        T: std::iter::IntoIterator<Item = (K, V)>,
4698        K: std::convert::Into<std::string::String>,
4699        V: std::convert::Into<std::string::String>,
4700    {
4701        use std::iter::Iterator;
4702        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4703        self
4704    }
4705
4706    /// Sets the value of [profile][crate::model::ConnectionProfile::profile].
4707    ///
4708    /// Note that all the setters affecting `profile` are mutually
4709    /// exclusive.
4710    pub fn set_profile<
4711        T: std::convert::Into<std::option::Option<crate::model::connection_profile::Profile>>,
4712    >(
4713        mut self,
4714        v: T,
4715    ) -> Self {
4716        self.profile = v.into();
4717        self
4718    }
4719
4720    /// The value of [profile][crate::model::ConnectionProfile::profile]
4721    /// if it holds a `OracleProfile`, `None` if the field is not set or
4722    /// holds a different branch.
4723    pub fn oracle_profile(
4724        &self,
4725    ) -> std::option::Option<&std::boxed::Box<crate::model::OracleProfile>> {
4726        #[allow(unreachable_patterns)]
4727        self.profile.as_ref().and_then(|v| match v {
4728            crate::model::connection_profile::Profile::OracleProfile(v) => {
4729                std::option::Option::Some(v)
4730            }
4731            _ => std::option::Option::None,
4732        })
4733    }
4734
4735    /// The value of [profile][crate::model::ConnectionProfile::profile]
4736    /// if it holds a `GcsProfile`, `None` if the field is not set or
4737    /// holds a different branch.
4738    pub fn gcs_profile(&self) -> std::option::Option<&std::boxed::Box<crate::model::GcsProfile>> {
4739        #[allow(unreachable_patterns)]
4740        self.profile.as_ref().and_then(|v| match v {
4741            crate::model::connection_profile::Profile::GcsProfile(v) => {
4742                std::option::Option::Some(v)
4743            }
4744            _ => std::option::Option::None,
4745        })
4746    }
4747
4748    /// The value of [profile][crate::model::ConnectionProfile::profile]
4749    /// if it holds a `MysqlProfile`, `None` if the field is not set or
4750    /// holds a different branch.
4751    pub fn mysql_profile(
4752        &self,
4753    ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlProfile>> {
4754        #[allow(unreachable_patterns)]
4755        self.profile.as_ref().and_then(|v| match v {
4756            crate::model::connection_profile::Profile::MysqlProfile(v) => {
4757                std::option::Option::Some(v)
4758            }
4759            _ => std::option::Option::None,
4760        })
4761    }
4762
4763    /// The value of [profile][crate::model::ConnectionProfile::profile]
4764    /// if it holds a `BigqueryProfile`, `None` if the field is not set or
4765    /// holds a different branch.
4766    pub fn bigquery_profile(
4767        &self,
4768    ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryProfile>> {
4769        #[allow(unreachable_patterns)]
4770        self.profile.as_ref().and_then(|v| match v {
4771            crate::model::connection_profile::Profile::BigqueryProfile(v) => {
4772                std::option::Option::Some(v)
4773            }
4774            _ => std::option::Option::None,
4775        })
4776    }
4777
4778    /// The value of [profile][crate::model::ConnectionProfile::profile]
4779    /// if it holds a `PostgresqlProfile`, `None` if the field is not set or
4780    /// holds a different branch.
4781    pub fn postgresql_profile(
4782        &self,
4783    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlProfile>> {
4784        #[allow(unreachable_patterns)]
4785        self.profile.as_ref().and_then(|v| match v {
4786            crate::model::connection_profile::Profile::PostgresqlProfile(v) => {
4787                std::option::Option::Some(v)
4788            }
4789            _ => std::option::Option::None,
4790        })
4791    }
4792
4793    /// The value of [profile][crate::model::ConnectionProfile::profile]
4794    /// if it holds a `SqlServerProfile`, `None` if the field is not set or
4795    /// holds a different branch.
4796    pub fn sql_server_profile(
4797        &self,
4798    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerProfile>> {
4799        #[allow(unreachable_patterns)]
4800        self.profile.as_ref().and_then(|v| match v {
4801            crate::model::connection_profile::Profile::SqlServerProfile(v) => {
4802                std::option::Option::Some(v)
4803            }
4804            _ => std::option::Option::None,
4805        })
4806    }
4807
4808    /// The value of [profile][crate::model::ConnectionProfile::profile]
4809    /// if it holds a `SalesforceProfile`, `None` if the field is not set or
4810    /// holds a different branch.
4811    pub fn salesforce_profile(
4812        &self,
4813    ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceProfile>> {
4814        #[allow(unreachable_patterns)]
4815        self.profile.as_ref().and_then(|v| match v {
4816            crate::model::connection_profile::Profile::SalesforceProfile(v) => {
4817                std::option::Option::Some(v)
4818            }
4819            _ => std::option::Option::None,
4820        })
4821    }
4822
4823    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
4824    /// to hold a `OracleProfile`.
4825    ///
4826    /// Note that all the setters affecting `profile` are
4827    /// mutually exclusive.
4828    pub fn set_oracle_profile<
4829        T: std::convert::Into<std::boxed::Box<crate::model::OracleProfile>>,
4830    >(
4831        mut self,
4832        v: T,
4833    ) -> Self {
4834        self.profile = std::option::Option::Some(
4835            crate::model::connection_profile::Profile::OracleProfile(v.into()),
4836        );
4837        self
4838    }
4839
4840    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
4841    /// to hold a `GcsProfile`.
4842    ///
4843    /// Note that all the setters affecting `profile` are
4844    /// mutually exclusive.
4845    pub fn set_gcs_profile<T: std::convert::Into<std::boxed::Box<crate::model::GcsProfile>>>(
4846        mut self,
4847        v: T,
4848    ) -> Self {
4849        self.profile = std::option::Option::Some(
4850            crate::model::connection_profile::Profile::GcsProfile(v.into()),
4851        );
4852        self
4853    }
4854
4855    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
4856    /// to hold a `MysqlProfile`.
4857    ///
4858    /// Note that all the setters affecting `profile` are
4859    /// mutually exclusive.
4860    pub fn set_mysql_profile<T: std::convert::Into<std::boxed::Box<crate::model::MysqlProfile>>>(
4861        mut self,
4862        v: T,
4863    ) -> Self {
4864        self.profile = std::option::Option::Some(
4865            crate::model::connection_profile::Profile::MysqlProfile(v.into()),
4866        );
4867        self
4868    }
4869
4870    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
4871    /// to hold a `BigqueryProfile`.
4872    ///
4873    /// Note that all the setters affecting `profile` are
4874    /// mutually exclusive.
4875    pub fn set_bigquery_profile<
4876        T: std::convert::Into<std::boxed::Box<crate::model::BigQueryProfile>>,
4877    >(
4878        mut self,
4879        v: T,
4880    ) -> Self {
4881        self.profile = std::option::Option::Some(
4882            crate::model::connection_profile::Profile::BigqueryProfile(v.into()),
4883        );
4884        self
4885    }
4886
4887    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
4888    /// to hold a `PostgresqlProfile`.
4889    ///
4890    /// Note that all the setters affecting `profile` are
4891    /// mutually exclusive.
4892    pub fn set_postgresql_profile<
4893        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlProfile>>,
4894    >(
4895        mut self,
4896        v: T,
4897    ) -> Self {
4898        self.profile = std::option::Option::Some(
4899            crate::model::connection_profile::Profile::PostgresqlProfile(v.into()),
4900        );
4901        self
4902    }
4903
4904    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
4905    /// to hold a `SqlServerProfile`.
4906    ///
4907    /// Note that all the setters affecting `profile` are
4908    /// mutually exclusive.
4909    pub fn set_sql_server_profile<
4910        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerProfile>>,
4911    >(
4912        mut self,
4913        v: T,
4914    ) -> Self {
4915        self.profile = std::option::Option::Some(
4916            crate::model::connection_profile::Profile::SqlServerProfile(v.into()),
4917        );
4918        self
4919    }
4920
4921    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
4922    /// to hold a `SalesforceProfile`.
4923    ///
4924    /// Note that all the setters affecting `profile` are
4925    /// mutually exclusive.
4926    pub fn set_salesforce_profile<
4927        T: std::convert::Into<std::boxed::Box<crate::model::SalesforceProfile>>,
4928    >(
4929        mut self,
4930        v: T,
4931    ) -> Self {
4932        self.profile = std::option::Option::Some(
4933            crate::model::connection_profile::Profile::SalesforceProfile(v.into()),
4934        );
4935        self
4936    }
4937
4938    /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity].
4939    ///
4940    /// Note that all the setters affecting `connectivity` are mutually
4941    /// exclusive.
4942    pub fn set_connectivity<
4943        T: std::convert::Into<std::option::Option<crate::model::connection_profile::Connectivity>>,
4944    >(
4945        mut self,
4946        v: T,
4947    ) -> Self {
4948        self.connectivity = v.into();
4949        self
4950    }
4951
4952    /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
4953    /// if it holds a `StaticServiceIpConnectivity`, `None` if the field is not set or
4954    /// holds a different branch.
4955    pub fn static_service_ip_connectivity(
4956        &self,
4957    ) -> std::option::Option<&std::boxed::Box<crate::model::StaticServiceIpConnectivity>> {
4958        #[allow(unreachable_patterns)]
4959        self.connectivity.as_ref().and_then(|v| match v {
4960            crate::model::connection_profile::Connectivity::StaticServiceIpConnectivity(v) => {
4961                std::option::Option::Some(v)
4962            }
4963            _ => std::option::Option::None,
4964        })
4965    }
4966
4967    /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
4968    /// if it holds a `ForwardSshConnectivity`, `None` if the field is not set or
4969    /// holds a different branch.
4970    pub fn forward_ssh_connectivity(
4971        &self,
4972    ) -> std::option::Option<&std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>> {
4973        #[allow(unreachable_patterns)]
4974        self.connectivity.as_ref().and_then(|v| match v {
4975            crate::model::connection_profile::Connectivity::ForwardSshConnectivity(v) => {
4976                std::option::Option::Some(v)
4977            }
4978            _ => std::option::Option::None,
4979        })
4980    }
4981
4982    /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
4983    /// if it holds a `PrivateConnectivity`, `None` if the field is not set or
4984    /// holds a different branch.
4985    pub fn private_connectivity(
4986        &self,
4987    ) -> std::option::Option<&std::boxed::Box<crate::model::PrivateConnectivity>> {
4988        #[allow(unreachable_patterns)]
4989        self.connectivity.as_ref().and_then(|v| match v {
4990            crate::model::connection_profile::Connectivity::PrivateConnectivity(v) => {
4991                std::option::Option::Some(v)
4992            }
4993            _ => std::option::Option::None,
4994        })
4995    }
4996
4997    /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
4998    /// to hold a `StaticServiceIpConnectivity`.
4999    ///
5000    /// Note that all the setters affecting `connectivity` are
5001    /// mutually exclusive.
5002    pub fn set_static_service_ip_connectivity<
5003        T: std::convert::Into<std::boxed::Box<crate::model::StaticServiceIpConnectivity>>,
5004    >(
5005        mut self,
5006        v: T,
5007    ) -> Self {
5008        self.connectivity = std::option::Option::Some(
5009            crate::model::connection_profile::Connectivity::StaticServiceIpConnectivity(v.into()),
5010        );
5011        self
5012    }
5013
5014    /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
5015    /// to hold a `ForwardSshConnectivity`.
5016    ///
5017    /// Note that all the setters affecting `connectivity` are
5018    /// mutually exclusive.
5019    pub fn set_forward_ssh_connectivity<
5020        T: std::convert::Into<std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>>,
5021    >(
5022        mut self,
5023        v: T,
5024    ) -> Self {
5025        self.connectivity = std::option::Option::Some(
5026            crate::model::connection_profile::Connectivity::ForwardSshConnectivity(v.into()),
5027        );
5028        self
5029    }
5030
5031    /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
5032    /// to hold a `PrivateConnectivity`.
5033    ///
5034    /// Note that all the setters affecting `connectivity` are
5035    /// mutually exclusive.
5036    pub fn set_private_connectivity<
5037        T: std::convert::Into<std::boxed::Box<crate::model::PrivateConnectivity>>,
5038    >(
5039        mut self,
5040        v: T,
5041    ) -> Self {
5042        self.connectivity = std::option::Option::Some(
5043            crate::model::connection_profile::Connectivity::PrivateConnectivity(v.into()),
5044        );
5045        self
5046    }
5047}
5048
5049impl wkt::message::Message for ConnectionProfile {
5050    fn typename() -> &'static str {
5051        "type.googleapis.com/google.cloud.datastream.v1.ConnectionProfile"
5052    }
5053}
5054
5055/// Defines additional types related to [ConnectionProfile].
5056pub mod connection_profile {
5057    #[allow(unused_imports)]
5058    use super::*;
5059
5060    /// Connection configuration for the ConnectionProfile.
5061    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
5062    #[serde(rename_all = "camelCase")]
5063    #[non_exhaustive]
5064    pub enum Profile {
5065        /// Oracle ConnectionProfile configuration.
5066        OracleProfile(std::boxed::Box<crate::model::OracleProfile>),
5067        /// Cloud Storage ConnectionProfile configuration.
5068        GcsProfile(std::boxed::Box<crate::model::GcsProfile>),
5069        /// MySQL ConnectionProfile configuration.
5070        MysqlProfile(std::boxed::Box<crate::model::MysqlProfile>),
5071        /// BigQuery Connection Profile configuration.
5072        BigqueryProfile(std::boxed::Box<crate::model::BigQueryProfile>),
5073        /// PostgreSQL Connection Profile configuration.
5074        PostgresqlProfile(std::boxed::Box<crate::model::PostgresqlProfile>),
5075        /// SQLServer Connection Profile configuration.
5076        SqlServerProfile(std::boxed::Box<crate::model::SqlServerProfile>),
5077        /// Salesforce Connection Profile configuration.
5078        SalesforceProfile(std::boxed::Box<crate::model::SalesforceProfile>),
5079    }
5080
5081    /// Connectivity options used to establish a connection to the profile.
5082    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
5083    #[serde(rename_all = "camelCase")]
5084    #[non_exhaustive]
5085    pub enum Connectivity {
5086        /// Static Service IP connectivity.
5087        StaticServiceIpConnectivity(std::boxed::Box<crate::model::StaticServiceIpConnectivity>),
5088        /// Forward SSH tunnel connectivity.
5089        ForwardSshConnectivity(std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>),
5090        /// Private connectivity.
5091        PrivateConnectivity(std::boxed::Box<crate::model::PrivateConnectivity>),
5092    }
5093}
5094
5095/// Oracle Column.
5096#[serde_with::serde_as]
5097#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5098#[serde(default, rename_all = "camelCase")]
5099#[non_exhaustive]
5100pub struct OracleColumn {
5101    /// Column name.
5102    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5103    pub column: std::string::String,
5104
5105    /// The Oracle data type.
5106    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5107    pub data_type: std::string::String,
5108
5109    /// Column length.
5110    pub length: i32,
5111
5112    /// Column precision.
5113    pub precision: i32,
5114
5115    /// Column scale.
5116    pub scale: i32,
5117
5118    /// Column encoding.
5119    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5120    pub encoding: std::string::String,
5121
5122    /// Whether or not the column represents a primary key.
5123    pub primary_key: bool,
5124
5125    /// Whether or not the column can accept a null value.
5126    pub nullable: bool,
5127
5128    /// The ordinal position of the column in the table.
5129    pub ordinal_position: i32,
5130
5131    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5132    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5133}
5134
5135impl OracleColumn {
5136    pub fn new() -> Self {
5137        std::default::Default::default()
5138    }
5139
5140    /// Sets the value of [column][crate::model::OracleColumn::column].
5141    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5142        self.column = v.into();
5143        self
5144    }
5145
5146    /// Sets the value of [data_type][crate::model::OracleColumn::data_type].
5147    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5148        self.data_type = v.into();
5149        self
5150    }
5151
5152    /// Sets the value of [length][crate::model::OracleColumn::length].
5153    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5154        self.length = v.into();
5155        self
5156    }
5157
5158    /// Sets the value of [precision][crate::model::OracleColumn::precision].
5159    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5160        self.precision = v.into();
5161        self
5162    }
5163
5164    /// Sets the value of [scale][crate::model::OracleColumn::scale].
5165    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5166        self.scale = v.into();
5167        self
5168    }
5169
5170    /// Sets the value of [encoding][crate::model::OracleColumn::encoding].
5171    pub fn set_encoding<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5172        self.encoding = v.into();
5173        self
5174    }
5175
5176    /// Sets the value of [primary_key][crate::model::OracleColumn::primary_key].
5177    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5178        self.primary_key = v.into();
5179        self
5180    }
5181
5182    /// Sets the value of [nullable][crate::model::OracleColumn::nullable].
5183    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5184        self.nullable = v.into();
5185        self
5186    }
5187
5188    /// Sets the value of [ordinal_position][crate::model::OracleColumn::ordinal_position].
5189    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5190        self.ordinal_position = v.into();
5191        self
5192    }
5193}
5194
5195impl wkt::message::Message for OracleColumn {
5196    fn typename() -> &'static str {
5197        "type.googleapis.com/google.cloud.datastream.v1.OracleColumn"
5198    }
5199}
5200
5201/// Oracle table.
5202#[serde_with::serde_as]
5203#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5204#[serde(default, rename_all = "camelCase")]
5205#[non_exhaustive]
5206pub struct OracleTable {
5207    /// Table name.
5208    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5209    pub table: std::string::String,
5210
5211    /// Oracle columns in the schema.
5212    /// When unspecified as part of include/exclude objects, includes/excludes
5213    /// everything.
5214    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5215    pub oracle_columns: std::vec::Vec<crate::model::OracleColumn>,
5216
5217    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5218    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5219}
5220
5221impl OracleTable {
5222    pub fn new() -> Self {
5223        std::default::Default::default()
5224    }
5225
5226    /// Sets the value of [table][crate::model::OracleTable::table].
5227    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5228        self.table = v.into();
5229        self
5230    }
5231
5232    /// Sets the value of [oracle_columns][crate::model::OracleTable::oracle_columns].
5233    pub fn set_oracle_columns<T, V>(mut self, v: T) -> Self
5234    where
5235        T: std::iter::IntoIterator<Item = V>,
5236        V: std::convert::Into<crate::model::OracleColumn>,
5237    {
5238        use std::iter::Iterator;
5239        self.oracle_columns = v.into_iter().map(|i| i.into()).collect();
5240        self
5241    }
5242}
5243
5244impl wkt::message::Message for OracleTable {
5245    fn typename() -> &'static str {
5246        "type.googleapis.com/google.cloud.datastream.v1.OracleTable"
5247    }
5248}
5249
5250/// Oracle schema.
5251#[serde_with::serde_as]
5252#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5253#[serde(default, rename_all = "camelCase")]
5254#[non_exhaustive]
5255pub struct OracleSchema {
5256    /// Schema name.
5257    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5258    pub schema: std::string::String,
5259
5260    /// Tables in the schema.
5261    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5262    pub oracle_tables: std::vec::Vec<crate::model::OracleTable>,
5263
5264    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5265    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5266}
5267
5268impl OracleSchema {
5269    pub fn new() -> Self {
5270        std::default::Default::default()
5271    }
5272
5273    /// Sets the value of [schema][crate::model::OracleSchema::schema].
5274    pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5275        self.schema = v.into();
5276        self
5277    }
5278
5279    /// Sets the value of [oracle_tables][crate::model::OracleSchema::oracle_tables].
5280    pub fn set_oracle_tables<T, V>(mut self, v: T) -> Self
5281    where
5282        T: std::iter::IntoIterator<Item = V>,
5283        V: std::convert::Into<crate::model::OracleTable>,
5284    {
5285        use std::iter::Iterator;
5286        self.oracle_tables = v.into_iter().map(|i| i.into()).collect();
5287        self
5288    }
5289}
5290
5291impl wkt::message::Message for OracleSchema {
5292    fn typename() -> &'static str {
5293        "type.googleapis.com/google.cloud.datastream.v1.OracleSchema"
5294    }
5295}
5296
5297/// Oracle database structure.
5298#[serde_with::serde_as]
5299#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5300#[serde(default, rename_all = "camelCase")]
5301#[non_exhaustive]
5302pub struct OracleRdbms {
5303    /// Oracle schemas/databases in the database server.
5304    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5305    pub oracle_schemas: std::vec::Vec<crate::model::OracleSchema>,
5306
5307    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5308    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5309}
5310
5311impl OracleRdbms {
5312    pub fn new() -> Self {
5313        std::default::Default::default()
5314    }
5315
5316    /// Sets the value of [oracle_schemas][crate::model::OracleRdbms::oracle_schemas].
5317    pub fn set_oracle_schemas<T, V>(mut self, v: T) -> Self
5318    where
5319        T: std::iter::IntoIterator<Item = V>,
5320        V: std::convert::Into<crate::model::OracleSchema>,
5321    {
5322        use std::iter::Iterator;
5323        self.oracle_schemas = v.into_iter().map(|i| i.into()).collect();
5324        self
5325    }
5326}
5327
5328impl wkt::message::Message for OracleRdbms {
5329    fn typename() -> &'static str {
5330        "type.googleapis.com/google.cloud.datastream.v1.OracleRdbms"
5331    }
5332}
5333
5334/// Oracle data source configuration
5335#[serde_with::serde_as]
5336#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5337#[serde(default, rename_all = "camelCase")]
5338#[non_exhaustive]
5339pub struct OracleSourceConfig {
5340    /// Oracle objects to include in the stream.
5341    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5342    pub include_objects: std::option::Option<crate::model::OracleRdbms>,
5343
5344    /// Oracle objects to exclude from the stream.
5345    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5346    pub exclude_objects: std::option::Option<crate::model::OracleRdbms>,
5347
5348    /// Maximum number of concurrent CDC tasks. The number should be non-negative.
5349    /// If not set (or set to 0), the system's default value is used.
5350    pub max_concurrent_cdc_tasks: i32,
5351
5352    /// Maximum number of concurrent backfill tasks. The number should be
5353    /// non-negative. If not set (or set to 0), the system's default value is used.
5354    pub max_concurrent_backfill_tasks: i32,
5355
5356    /// The configuration for handle Oracle large objects.
5357    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
5358    pub large_objects_handling:
5359        std::option::Option<crate::model::oracle_source_config::LargeObjectsHandling>,
5360
5361    /// Configuration to select the CDC method.
5362    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
5363    pub cdc_method: std::option::Option<crate::model::oracle_source_config::CdcMethod>,
5364
5365    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5366    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5367}
5368
5369impl OracleSourceConfig {
5370    pub fn new() -> Self {
5371        std::default::Default::default()
5372    }
5373
5374    /// Sets the value of [include_objects][crate::model::OracleSourceConfig::include_objects].
5375    pub fn set_include_objects<
5376        T: std::convert::Into<std::option::Option<crate::model::OracleRdbms>>,
5377    >(
5378        mut self,
5379        v: T,
5380    ) -> Self {
5381        self.include_objects = v.into();
5382        self
5383    }
5384
5385    /// Sets the value of [exclude_objects][crate::model::OracleSourceConfig::exclude_objects].
5386    pub fn set_exclude_objects<
5387        T: std::convert::Into<std::option::Option<crate::model::OracleRdbms>>,
5388    >(
5389        mut self,
5390        v: T,
5391    ) -> Self {
5392        self.exclude_objects = v.into();
5393        self
5394    }
5395
5396    /// Sets the value of [max_concurrent_cdc_tasks][crate::model::OracleSourceConfig::max_concurrent_cdc_tasks].
5397    pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5398        self.max_concurrent_cdc_tasks = v.into();
5399        self
5400    }
5401
5402    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::OracleSourceConfig::max_concurrent_backfill_tasks].
5403    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5404        self.max_concurrent_backfill_tasks = v.into();
5405        self
5406    }
5407
5408    /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling].
5409    ///
5410    /// Note that all the setters affecting `large_objects_handling` are mutually
5411    /// exclusive.
5412    pub fn set_large_objects_handling<
5413        T: std::convert::Into<
5414                std::option::Option<crate::model::oracle_source_config::LargeObjectsHandling>,
5415            >,
5416    >(
5417        mut self,
5418        v: T,
5419    ) -> Self {
5420        self.large_objects_handling = v.into();
5421        self
5422    }
5423
5424    /// The value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
5425    /// if it holds a `DropLargeObjects`, `None` if the field is not set or
5426    /// holds a different branch.
5427    pub fn drop_large_objects(
5428        &self,
5429    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>>
5430    {
5431        #[allow(unreachable_patterns)]
5432        self.large_objects_handling.as_ref().and_then(|v| match v {
5433            crate::model::oracle_source_config::LargeObjectsHandling::DropLargeObjects(v) => {
5434                std::option::Option::Some(v)
5435            }
5436            _ => std::option::Option::None,
5437        })
5438    }
5439
5440    /// The value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
5441    /// if it holds a `StreamLargeObjects`, `None` if the field is not set or
5442    /// holds a different branch.
5443    pub fn stream_large_objects(
5444        &self,
5445    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>>
5446    {
5447        #[allow(unreachable_patterns)]
5448        self.large_objects_handling.as_ref().and_then(|v| match v {
5449            crate::model::oracle_source_config::LargeObjectsHandling::StreamLargeObjects(v) => {
5450                std::option::Option::Some(v)
5451            }
5452            _ => std::option::Option::None,
5453        })
5454    }
5455
5456    /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
5457    /// to hold a `DropLargeObjects`.
5458    ///
5459    /// Note that all the setters affecting `large_objects_handling` are
5460    /// mutually exclusive.
5461    pub fn set_drop_large_objects<
5462        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>>,
5463    >(
5464        mut self,
5465        v: T,
5466    ) -> Self {
5467        self.large_objects_handling = std::option::Option::Some(
5468            crate::model::oracle_source_config::LargeObjectsHandling::DropLargeObjects(v.into()),
5469        );
5470        self
5471    }
5472
5473    /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
5474    /// to hold a `StreamLargeObjects`.
5475    ///
5476    /// Note that all the setters affecting `large_objects_handling` are
5477    /// mutually exclusive.
5478    pub fn set_stream_large_objects<
5479        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>>,
5480    >(
5481        mut self,
5482        v: T,
5483    ) -> Self {
5484        self.large_objects_handling = std::option::Option::Some(
5485            crate::model::oracle_source_config::LargeObjectsHandling::StreamLargeObjects(v.into()),
5486        );
5487        self
5488    }
5489
5490    /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method].
5491    ///
5492    /// Note that all the setters affecting `cdc_method` are mutually
5493    /// exclusive.
5494    pub fn set_cdc_method<
5495        T: std::convert::Into<std::option::Option<crate::model::oracle_source_config::CdcMethod>>,
5496    >(
5497        mut self,
5498        v: T,
5499    ) -> Self {
5500        self.cdc_method = v.into();
5501        self
5502    }
5503
5504    /// The value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
5505    /// if it holds a `LogMiner`, `None` if the field is not set or
5506    /// holds a different branch.
5507    pub fn log_miner(
5508        &self,
5509    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::LogMiner>> {
5510        #[allow(unreachable_patterns)]
5511        self.cdc_method.as_ref().and_then(|v| match v {
5512            crate::model::oracle_source_config::CdcMethod::LogMiner(v) => {
5513                std::option::Option::Some(v)
5514            }
5515            _ => std::option::Option::None,
5516        })
5517    }
5518
5519    /// The value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
5520    /// if it holds a `BinaryLogParser`, `None` if the field is not set or
5521    /// holds a different branch.
5522    pub fn binary_log_parser(
5523        &self,
5524    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>>
5525    {
5526        #[allow(unreachable_patterns)]
5527        self.cdc_method.as_ref().and_then(|v| match v {
5528            crate::model::oracle_source_config::CdcMethod::BinaryLogParser(v) => {
5529                std::option::Option::Some(v)
5530            }
5531            _ => std::option::Option::None,
5532        })
5533    }
5534
5535    /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
5536    /// to hold a `LogMiner`.
5537    ///
5538    /// Note that all the setters affecting `cdc_method` are
5539    /// mutually exclusive.
5540    pub fn set_log_miner<
5541        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::LogMiner>>,
5542    >(
5543        mut self,
5544        v: T,
5545    ) -> Self {
5546        self.cdc_method = std::option::Option::Some(
5547            crate::model::oracle_source_config::CdcMethod::LogMiner(v.into()),
5548        );
5549        self
5550    }
5551
5552    /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
5553    /// to hold a `BinaryLogParser`.
5554    ///
5555    /// Note that all the setters affecting `cdc_method` are
5556    /// mutually exclusive.
5557    pub fn set_binary_log_parser<
5558        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>>,
5559    >(
5560        mut self,
5561        v: T,
5562    ) -> Self {
5563        self.cdc_method = std::option::Option::Some(
5564            crate::model::oracle_source_config::CdcMethod::BinaryLogParser(v.into()),
5565        );
5566        self
5567    }
5568}
5569
5570impl wkt::message::Message for OracleSourceConfig {
5571    fn typename() -> &'static str {
5572        "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig"
5573    }
5574}
5575
5576/// Defines additional types related to [OracleSourceConfig].
5577pub mod oracle_source_config {
5578    #[allow(unused_imports)]
5579    use super::*;
5580
5581    /// Configuration to drop large object values.
5582    #[serde_with::serde_as]
5583    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5584    #[serde(default, rename_all = "camelCase")]
5585    #[non_exhaustive]
5586    pub struct DropLargeObjects {
5587        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5588        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5589    }
5590
5591    impl DropLargeObjects {
5592        pub fn new() -> Self {
5593            std::default::Default::default()
5594        }
5595    }
5596
5597    impl wkt::message::Message for DropLargeObjects {
5598        fn typename() -> &'static str {
5599            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.DropLargeObjects"
5600        }
5601    }
5602
5603    /// Configuration to stream large object values.
5604    #[serde_with::serde_as]
5605    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5606    #[serde(default, rename_all = "camelCase")]
5607    #[non_exhaustive]
5608    pub struct StreamLargeObjects {
5609        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5610        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5611    }
5612
5613    impl StreamLargeObjects {
5614        pub fn new() -> Self {
5615            std::default::Default::default()
5616        }
5617    }
5618
5619    impl wkt::message::Message for StreamLargeObjects {
5620        fn typename() -> &'static str {
5621            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.StreamLargeObjects"
5622        }
5623    }
5624
5625    /// Configuration to use LogMiner CDC method.
5626    #[serde_with::serde_as]
5627    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5628    #[serde(default, rename_all = "camelCase")]
5629    #[non_exhaustive]
5630    pub struct LogMiner {
5631        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5632        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5633    }
5634
5635    impl LogMiner {
5636        pub fn new() -> Self {
5637            std::default::Default::default()
5638        }
5639    }
5640
5641    impl wkt::message::Message for LogMiner {
5642        fn typename() -> &'static str {
5643            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.LogMiner"
5644        }
5645    }
5646
5647    /// Configuration to use Binary Log Parser CDC technique.
5648    #[serde_with::serde_as]
5649    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5650    #[serde(default, rename_all = "camelCase")]
5651    #[non_exhaustive]
5652    pub struct BinaryLogParser {
5653        /// Configuration to specify how the log file should be accessed.
5654        #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
5655        pub log_file_access: std::option::Option<
5656            crate::model::oracle_source_config::binary_log_parser::LogFileAccess,
5657        >,
5658
5659        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5660        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5661    }
5662
5663    impl BinaryLogParser {
5664        pub fn new() -> Self {
5665            std::default::Default::default()
5666        }
5667
5668        /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access].
5669        ///
5670        /// Note that all the setters affecting `log_file_access` are mutually
5671        /// exclusive.
5672        pub fn set_log_file_access<
5673            T: std::convert::Into<
5674                    std::option::Option<
5675                        crate::model::oracle_source_config::binary_log_parser::LogFileAccess,
5676                    >,
5677                >,
5678        >(
5679            mut self,
5680            v: T,
5681        ) -> Self {
5682            self.log_file_access = v.into();
5683            self
5684        }
5685
5686        /// The value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
5687        /// if it holds a `OracleAsmLogFileAccess`, `None` if the field is not set or
5688        /// holds a different branch.
5689        pub fn oracle_asm_log_file_access(
5690            &self,
5691        ) -> std::option::Option<
5692            &std::boxed::Box<
5693                crate::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess,
5694            >,
5695        > {
5696            #[allow(unreachable_patterns)]
5697            self.log_file_access.as_ref().and_then(|v| match v {
5698                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::OracleAsmLogFileAccess(v) => std::option::Option::Some(v),
5699                _ => std::option::Option::None,
5700            })
5701        }
5702
5703        /// The value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
5704        /// if it holds a `LogFileDirectories`, `None` if the field is not set or
5705        /// holds a different branch.
5706        pub fn log_file_directories(
5707            &self,
5708        ) -> std::option::Option<
5709            &std::boxed::Box<
5710                crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
5711            >,
5712        > {
5713            #[allow(unreachable_patterns)]
5714            self.log_file_access.as_ref().and_then(|v| match v {
5715                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::LogFileDirectories(v) => std::option::Option::Some(v),
5716                _ => std::option::Option::None,
5717            })
5718        }
5719
5720        /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
5721        /// to hold a `OracleAsmLogFileAccess`.
5722        ///
5723        /// Note that all the setters affecting `log_file_access` are
5724        /// mutually exclusive.
5725        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{
5726            self.log_file_access = std::option::Option::Some(
5727                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::OracleAsmLogFileAccess(
5728                    v.into()
5729                )
5730            );
5731            self
5732        }
5733
5734        /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
5735        /// to hold a `LogFileDirectories`.
5736        ///
5737        /// Note that all the setters affecting `log_file_access` are
5738        /// mutually exclusive.
5739        pub fn set_log_file_directories<
5740            T: std::convert::Into<
5741                    std::boxed::Box<
5742                        crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
5743                    >,
5744                >,
5745        >(
5746            mut self,
5747            v: T,
5748        ) -> Self {
5749            self.log_file_access = std::option::Option::Some(
5750                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::LogFileDirectories(
5751                    v.into()
5752                )
5753            );
5754            self
5755        }
5756    }
5757
5758    impl wkt::message::Message for BinaryLogParser {
5759        fn typename() -> &'static str {
5760            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser"
5761        }
5762    }
5763
5764    /// Defines additional types related to [BinaryLogParser].
5765    pub mod binary_log_parser {
5766        #[allow(unused_imports)]
5767        use super::*;
5768
5769        /// Configuration to use Oracle ASM to access the log files.
5770        #[serde_with::serde_as]
5771        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5772        #[serde(default, rename_all = "camelCase")]
5773        #[non_exhaustive]
5774        pub struct OracleAsmLogFileAccess {
5775            #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5776            _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5777        }
5778
5779        impl OracleAsmLogFileAccess {
5780            pub fn new() -> Self {
5781                std::default::Default::default()
5782            }
5783        }
5784
5785        impl wkt::message::Message for OracleAsmLogFileAccess {
5786            fn typename() -> &'static str {
5787                "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser.OracleAsmLogFileAccess"
5788            }
5789        }
5790
5791        /// Configuration to specify the Oracle directories to access the log files.
5792        #[serde_with::serde_as]
5793        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5794        #[serde(default, rename_all = "camelCase")]
5795        #[non_exhaustive]
5796        pub struct LogFileDirectories {
5797            /// Required. Oracle directory for online logs.
5798            #[serde(skip_serializing_if = "std::string::String::is_empty")]
5799            pub online_log_directory: std::string::String,
5800
5801            /// Required. Oracle directory for archived logs.
5802            #[serde(skip_serializing_if = "std::string::String::is_empty")]
5803            pub archived_log_directory: std::string::String,
5804
5805            #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5806            _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5807        }
5808
5809        impl LogFileDirectories {
5810            pub fn new() -> Self {
5811                std::default::Default::default()
5812            }
5813
5814            /// Sets the value of [online_log_directory][crate::model::oracle_source_config::binary_log_parser::LogFileDirectories::online_log_directory].
5815            pub fn set_online_log_directory<T: std::convert::Into<std::string::String>>(
5816                mut self,
5817                v: T,
5818            ) -> Self {
5819                self.online_log_directory = v.into();
5820                self
5821            }
5822
5823            /// Sets the value of [archived_log_directory][crate::model::oracle_source_config::binary_log_parser::LogFileDirectories::archived_log_directory].
5824            pub fn set_archived_log_directory<T: std::convert::Into<std::string::String>>(
5825                mut self,
5826                v: T,
5827            ) -> Self {
5828                self.archived_log_directory = v.into();
5829                self
5830            }
5831        }
5832
5833        impl wkt::message::Message for LogFileDirectories {
5834            fn typename() -> &'static str {
5835                "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser.LogFileDirectories"
5836            }
5837        }
5838
5839        /// Configuration to specify how the log file should be accessed.
5840        #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
5841        #[serde(rename_all = "camelCase")]
5842        #[non_exhaustive]
5843        pub enum LogFileAccess {
5844            /// Use Oracle ASM.
5845            OracleAsmLogFileAccess(
5846                std::boxed::Box<
5847                    crate::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess,
5848                >,
5849            ),
5850            /// Use Oracle directories.
5851            LogFileDirectories(
5852                std::boxed::Box<
5853                    crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
5854                >,
5855            ),
5856        }
5857    }
5858
5859    /// The configuration for handle Oracle large objects.
5860    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
5861    #[serde(rename_all = "camelCase")]
5862    #[non_exhaustive]
5863    pub enum LargeObjectsHandling {
5864        /// Drop large object values.
5865        DropLargeObjects(std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>),
5866        /// Stream large object values.
5867        StreamLargeObjects(std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>),
5868    }
5869
5870    /// Configuration to select the CDC method.
5871    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
5872    #[serde(rename_all = "camelCase")]
5873    #[non_exhaustive]
5874    pub enum CdcMethod {
5875        /// Use LogMiner.
5876        LogMiner(std::boxed::Box<crate::model::oracle_source_config::LogMiner>),
5877        /// Use Binary Log Parser.
5878        BinaryLogParser(std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>),
5879    }
5880}
5881
5882/// PostgreSQL Column.
5883#[serde_with::serde_as]
5884#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5885#[serde(default, rename_all = "camelCase")]
5886#[non_exhaustive]
5887pub struct PostgresqlColumn {
5888    /// Column name.
5889    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5890    pub column: std::string::String,
5891
5892    /// The PostgreSQL data type.
5893    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5894    pub data_type: std::string::String,
5895
5896    /// Column length.
5897    pub length: i32,
5898
5899    /// Column precision.
5900    pub precision: i32,
5901
5902    /// Column scale.
5903    pub scale: i32,
5904
5905    /// Whether or not the column represents a primary key.
5906    pub primary_key: bool,
5907
5908    /// Whether or not the column can accept a null value.
5909    pub nullable: bool,
5910
5911    /// The ordinal position of the column in the table.
5912    pub ordinal_position: i32,
5913
5914    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5915    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5916}
5917
5918impl PostgresqlColumn {
5919    pub fn new() -> Self {
5920        std::default::Default::default()
5921    }
5922
5923    /// Sets the value of [column][crate::model::PostgresqlColumn::column].
5924    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5925        self.column = v.into();
5926        self
5927    }
5928
5929    /// Sets the value of [data_type][crate::model::PostgresqlColumn::data_type].
5930    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5931        self.data_type = v.into();
5932        self
5933    }
5934
5935    /// Sets the value of [length][crate::model::PostgresqlColumn::length].
5936    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5937        self.length = v.into();
5938        self
5939    }
5940
5941    /// Sets the value of [precision][crate::model::PostgresqlColumn::precision].
5942    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5943        self.precision = v.into();
5944        self
5945    }
5946
5947    /// Sets the value of [scale][crate::model::PostgresqlColumn::scale].
5948    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5949        self.scale = v.into();
5950        self
5951    }
5952
5953    /// Sets the value of [primary_key][crate::model::PostgresqlColumn::primary_key].
5954    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5955        self.primary_key = v.into();
5956        self
5957    }
5958
5959    /// Sets the value of [nullable][crate::model::PostgresqlColumn::nullable].
5960    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5961        self.nullable = v.into();
5962        self
5963    }
5964
5965    /// Sets the value of [ordinal_position][crate::model::PostgresqlColumn::ordinal_position].
5966    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5967        self.ordinal_position = v.into();
5968        self
5969    }
5970}
5971
5972impl wkt::message::Message for PostgresqlColumn {
5973    fn typename() -> &'static str {
5974        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlColumn"
5975    }
5976}
5977
5978/// PostgreSQL table.
5979#[serde_with::serde_as]
5980#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5981#[serde(default, rename_all = "camelCase")]
5982#[non_exhaustive]
5983pub struct PostgresqlTable {
5984    /// Table name.
5985    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5986    pub table: std::string::String,
5987
5988    /// PostgreSQL columns in the schema.
5989    /// When unspecified as part of include/exclude objects,
5990    /// includes/excludes everything.
5991    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5992    pub postgresql_columns: std::vec::Vec<crate::model::PostgresqlColumn>,
5993
5994    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5995    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5996}
5997
5998impl PostgresqlTable {
5999    pub fn new() -> Self {
6000        std::default::Default::default()
6001    }
6002
6003    /// Sets the value of [table][crate::model::PostgresqlTable::table].
6004    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6005        self.table = v.into();
6006        self
6007    }
6008
6009    /// Sets the value of [postgresql_columns][crate::model::PostgresqlTable::postgresql_columns].
6010    pub fn set_postgresql_columns<T, V>(mut self, v: T) -> Self
6011    where
6012        T: std::iter::IntoIterator<Item = V>,
6013        V: std::convert::Into<crate::model::PostgresqlColumn>,
6014    {
6015        use std::iter::Iterator;
6016        self.postgresql_columns = v.into_iter().map(|i| i.into()).collect();
6017        self
6018    }
6019}
6020
6021impl wkt::message::Message for PostgresqlTable {
6022    fn typename() -> &'static str {
6023        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlTable"
6024    }
6025}
6026
6027/// PostgreSQL schema.
6028#[serde_with::serde_as]
6029#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6030#[serde(default, rename_all = "camelCase")]
6031#[non_exhaustive]
6032pub struct PostgresqlSchema {
6033    /// Schema name.
6034    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6035    pub schema: std::string::String,
6036
6037    /// Tables in the schema.
6038    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6039    pub postgresql_tables: std::vec::Vec<crate::model::PostgresqlTable>,
6040
6041    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6042    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6043}
6044
6045impl PostgresqlSchema {
6046    pub fn new() -> Self {
6047        std::default::Default::default()
6048    }
6049
6050    /// Sets the value of [schema][crate::model::PostgresqlSchema::schema].
6051    pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6052        self.schema = v.into();
6053        self
6054    }
6055
6056    /// Sets the value of [postgresql_tables][crate::model::PostgresqlSchema::postgresql_tables].
6057    pub fn set_postgresql_tables<T, V>(mut self, v: T) -> Self
6058    where
6059        T: std::iter::IntoIterator<Item = V>,
6060        V: std::convert::Into<crate::model::PostgresqlTable>,
6061    {
6062        use std::iter::Iterator;
6063        self.postgresql_tables = v.into_iter().map(|i| i.into()).collect();
6064        self
6065    }
6066}
6067
6068impl wkt::message::Message for PostgresqlSchema {
6069    fn typename() -> &'static str {
6070        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSchema"
6071    }
6072}
6073
6074/// PostgreSQL database structure.
6075#[serde_with::serde_as]
6076#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6077#[serde(default, rename_all = "camelCase")]
6078#[non_exhaustive]
6079pub struct PostgresqlRdbms {
6080    /// PostgreSQL schemas in the database server.
6081    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6082    pub postgresql_schemas: std::vec::Vec<crate::model::PostgresqlSchema>,
6083
6084    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6085    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6086}
6087
6088impl PostgresqlRdbms {
6089    pub fn new() -> Self {
6090        std::default::Default::default()
6091    }
6092
6093    /// Sets the value of [postgresql_schemas][crate::model::PostgresqlRdbms::postgresql_schemas].
6094    pub fn set_postgresql_schemas<T, V>(mut self, v: T) -> Self
6095    where
6096        T: std::iter::IntoIterator<Item = V>,
6097        V: std::convert::Into<crate::model::PostgresqlSchema>,
6098    {
6099        use std::iter::Iterator;
6100        self.postgresql_schemas = v.into_iter().map(|i| i.into()).collect();
6101        self
6102    }
6103}
6104
6105impl wkt::message::Message for PostgresqlRdbms {
6106    fn typename() -> &'static str {
6107        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlRdbms"
6108    }
6109}
6110
6111/// PostgreSQL data source configuration
6112#[serde_with::serde_as]
6113#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6114#[serde(default, rename_all = "camelCase")]
6115#[non_exhaustive]
6116pub struct PostgresqlSourceConfig {
6117    /// PostgreSQL objects to include in the stream.
6118    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6119    pub include_objects: std::option::Option<crate::model::PostgresqlRdbms>,
6120
6121    /// PostgreSQL objects to exclude from the stream.
6122    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6123    pub exclude_objects: std::option::Option<crate::model::PostgresqlRdbms>,
6124
6125    /// Required. Immutable. The name of the logical replication slot that's
6126    /// configured with the pgoutput plugin.
6127    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6128    pub replication_slot: std::string::String,
6129
6130    /// Required. The name of the publication that includes the set of all tables
6131    /// that are defined in the stream's include_objects.
6132    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6133    pub publication: std::string::String,
6134
6135    /// Maximum number of concurrent backfill tasks. The number should be non
6136    /// negative. If not set (or set to 0), the system's default value will be
6137    /// used.
6138    pub max_concurrent_backfill_tasks: i32,
6139
6140    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6141    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6142}
6143
6144impl PostgresqlSourceConfig {
6145    pub fn new() -> Self {
6146        std::default::Default::default()
6147    }
6148
6149    /// Sets the value of [include_objects][crate::model::PostgresqlSourceConfig::include_objects].
6150    pub fn set_include_objects<
6151        T: std::convert::Into<std::option::Option<crate::model::PostgresqlRdbms>>,
6152    >(
6153        mut self,
6154        v: T,
6155    ) -> Self {
6156        self.include_objects = v.into();
6157        self
6158    }
6159
6160    /// Sets the value of [exclude_objects][crate::model::PostgresqlSourceConfig::exclude_objects].
6161    pub fn set_exclude_objects<
6162        T: std::convert::Into<std::option::Option<crate::model::PostgresqlRdbms>>,
6163    >(
6164        mut self,
6165        v: T,
6166    ) -> Self {
6167        self.exclude_objects = v.into();
6168        self
6169    }
6170
6171    /// Sets the value of [replication_slot][crate::model::PostgresqlSourceConfig::replication_slot].
6172    pub fn set_replication_slot<T: std::convert::Into<std::string::String>>(
6173        mut self,
6174        v: T,
6175    ) -> Self {
6176        self.replication_slot = v.into();
6177        self
6178    }
6179
6180    /// Sets the value of [publication][crate::model::PostgresqlSourceConfig::publication].
6181    pub fn set_publication<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6182        self.publication = v.into();
6183        self
6184    }
6185
6186    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::PostgresqlSourceConfig::max_concurrent_backfill_tasks].
6187    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6188        self.max_concurrent_backfill_tasks = v.into();
6189        self
6190    }
6191}
6192
6193impl wkt::message::Message for PostgresqlSourceConfig {
6194    fn typename() -> &'static str {
6195        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSourceConfig"
6196    }
6197}
6198
6199/// SQLServer Column.
6200#[serde_with::serde_as]
6201#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6202#[serde(default, rename_all = "camelCase")]
6203#[non_exhaustive]
6204pub struct SqlServerColumn {
6205    /// Column name.
6206    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6207    pub column: std::string::String,
6208
6209    /// The SQLServer data type.
6210    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6211    pub data_type: std::string::String,
6212
6213    /// Column length.
6214    pub length: i32,
6215
6216    /// Column precision.
6217    pub precision: i32,
6218
6219    /// Column scale.
6220    pub scale: i32,
6221
6222    /// Whether or not the column represents a primary key.
6223    pub primary_key: bool,
6224
6225    /// Whether or not the column can accept a null value.
6226    pub nullable: bool,
6227
6228    /// The ordinal position of the column in the table.
6229    pub ordinal_position: i32,
6230
6231    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6232    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6233}
6234
6235impl SqlServerColumn {
6236    pub fn new() -> Self {
6237        std::default::Default::default()
6238    }
6239
6240    /// Sets the value of [column][crate::model::SqlServerColumn::column].
6241    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6242        self.column = v.into();
6243        self
6244    }
6245
6246    /// Sets the value of [data_type][crate::model::SqlServerColumn::data_type].
6247    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6248        self.data_type = v.into();
6249        self
6250    }
6251
6252    /// Sets the value of [length][crate::model::SqlServerColumn::length].
6253    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6254        self.length = v.into();
6255        self
6256    }
6257
6258    /// Sets the value of [precision][crate::model::SqlServerColumn::precision].
6259    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6260        self.precision = v.into();
6261        self
6262    }
6263
6264    /// Sets the value of [scale][crate::model::SqlServerColumn::scale].
6265    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6266        self.scale = v.into();
6267        self
6268    }
6269
6270    /// Sets the value of [primary_key][crate::model::SqlServerColumn::primary_key].
6271    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6272        self.primary_key = v.into();
6273        self
6274    }
6275
6276    /// Sets the value of [nullable][crate::model::SqlServerColumn::nullable].
6277    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6278        self.nullable = v.into();
6279        self
6280    }
6281
6282    /// Sets the value of [ordinal_position][crate::model::SqlServerColumn::ordinal_position].
6283    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6284        self.ordinal_position = v.into();
6285        self
6286    }
6287}
6288
6289impl wkt::message::Message for SqlServerColumn {
6290    fn typename() -> &'static str {
6291        "type.googleapis.com/google.cloud.datastream.v1.SqlServerColumn"
6292    }
6293}
6294
6295/// SQLServer table.
6296#[serde_with::serde_as]
6297#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6298#[serde(default, rename_all = "camelCase")]
6299#[non_exhaustive]
6300pub struct SqlServerTable {
6301    /// Table name.
6302    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6303    pub table: std::string::String,
6304
6305    /// SQLServer columns in the schema.
6306    /// When unspecified as part of include/exclude objects,
6307    /// includes/excludes everything.
6308    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6309    pub columns: std::vec::Vec<crate::model::SqlServerColumn>,
6310
6311    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6312    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6313}
6314
6315impl SqlServerTable {
6316    pub fn new() -> Self {
6317        std::default::Default::default()
6318    }
6319
6320    /// Sets the value of [table][crate::model::SqlServerTable::table].
6321    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6322        self.table = v.into();
6323        self
6324    }
6325
6326    /// Sets the value of [columns][crate::model::SqlServerTable::columns].
6327    pub fn set_columns<T, V>(mut self, v: T) -> Self
6328    where
6329        T: std::iter::IntoIterator<Item = V>,
6330        V: std::convert::Into<crate::model::SqlServerColumn>,
6331    {
6332        use std::iter::Iterator;
6333        self.columns = v.into_iter().map(|i| i.into()).collect();
6334        self
6335    }
6336}
6337
6338impl wkt::message::Message for SqlServerTable {
6339    fn typename() -> &'static str {
6340        "type.googleapis.com/google.cloud.datastream.v1.SqlServerTable"
6341    }
6342}
6343
6344/// SQLServer schema.
6345#[serde_with::serde_as]
6346#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6347#[serde(default, rename_all = "camelCase")]
6348#[non_exhaustive]
6349pub struct SqlServerSchema {
6350    /// Schema name.
6351    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6352    pub schema: std::string::String,
6353
6354    /// Tables in the schema.
6355    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6356    pub tables: std::vec::Vec<crate::model::SqlServerTable>,
6357
6358    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6359    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6360}
6361
6362impl SqlServerSchema {
6363    pub fn new() -> Self {
6364        std::default::Default::default()
6365    }
6366
6367    /// Sets the value of [schema][crate::model::SqlServerSchema::schema].
6368    pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6369        self.schema = v.into();
6370        self
6371    }
6372
6373    /// Sets the value of [tables][crate::model::SqlServerSchema::tables].
6374    pub fn set_tables<T, V>(mut self, v: T) -> Self
6375    where
6376        T: std::iter::IntoIterator<Item = V>,
6377        V: std::convert::Into<crate::model::SqlServerTable>,
6378    {
6379        use std::iter::Iterator;
6380        self.tables = v.into_iter().map(|i| i.into()).collect();
6381        self
6382    }
6383}
6384
6385impl wkt::message::Message for SqlServerSchema {
6386    fn typename() -> &'static str {
6387        "type.googleapis.com/google.cloud.datastream.v1.SqlServerSchema"
6388    }
6389}
6390
6391/// SQLServer database structure.
6392#[serde_with::serde_as]
6393#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6394#[serde(default, rename_all = "camelCase")]
6395#[non_exhaustive]
6396pub struct SqlServerRdbms {
6397    /// SQLServer schemas in the database server.
6398    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6399    pub schemas: std::vec::Vec<crate::model::SqlServerSchema>,
6400
6401    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6402    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6403}
6404
6405impl SqlServerRdbms {
6406    pub fn new() -> Self {
6407        std::default::Default::default()
6408    }
6409
6410    /// Sets the value of [schemas][crate::model::SqlServerRdbms::schemas].
6411    pub fn set_schemas<T, V>(mut self, v: T) -> Self
6412    where
6413        T: std::iter::IntoIterator<Item = V>,
6414        V: std::convert::Into<crate::model::SqlServerSchema>,
6415    {
6416        use std::iter::Iterator;
6417        self.schemas = v.into_iter().map(|i| i.into()).collect();
6418        self
6419    }
6420}
6421
6422impl wkt::message::Message for SqlServerRdbms {
6423    fn typename() -> &'static str {
6424        "type.googleapis.com/google.cloud.datastream.v1.SqlServerRdbms"
6425    }
6426}
6427
6428/// SQLServer data source configuration
6429#[serde_with::serde_as]
6430#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6431#[serde(default, rename_all = "camelCase")]
6432#[non_exhaustive]
6433pub struct SqlServerSourceConfig {
6434    /// SQLServer objects to include in the stream.
6435    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6436    pub include_objects: std::option::Option<crate::model::SqlServerRdbms>,
6437
6438    /// SQLServer objects to exclude from the stream.
6439    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6440    pub exclude_objects: std::option::Option<crate::model::SqlServerRdbms>,
6441
6442    /// Max concurrent CDC tasks.
6443    pub max_concurrent_cdc_tasks: i32,
6444
6445    /// Max concurrent backfill tasks.
6446    pub max_concurrent_backfill_tasks: i32,
6447
6448    /// Configuration to select the CDC read method for the stream.
6449    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
6450    pub cdc_method: std::option::Option<crate::model::sql_server_source_config::CdcMethod>,
6451
6452    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6453    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6454}
6455
6456impl SqlServerSourceConfig {
6457    pub fn new() -> Self {
6458        std::default::Default::default()
6459    }
6460
6461    /// Sets the value of [include_objects][crate::model::SqlServerSourceConfig::include_objects].
6462    pub fn set_include_objects<
6463        T: std::convert::Into<std::option::Option<crate::model::SqlServerRdbms>>,
6464    >(
6465        mut self,
6466        v: T,
6467    ) -> Self {
6468        self.include_objects = v.into();
6469        self
6470    }
6471
6472    /// Sets the value of [exclude_objects][crate::model::SqlServerSourceConfig::exclude_objects].
6473    pub fn set_exclude_objects<
6474        T: std::convert::Into<std::option::Option<crate::model::SqlServerRdbms>>,
6475    >(
6476        mut self,
6477        v: T,
6478    ) -> Self {
6479        self.exclude_objects = v.into();
6480        self
6481    }
6482
6483    /// Sets the value of [max_concurrent_cdc_tasks][crate::model::SqlServerSourceConfig::max_concurrent_cdc_tasks].
6484    pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6485        self.max_concurrent_cdc_tasks = v.into();
6486        self
6487    }
6488
6489    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::SqlServerSourceConfig::max_concurrent_backfill_tasks].
6490    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6491        self.max_concurrent_backfill_tasks = v.into();
6492        self
6493    }
6494
6495    /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method].
6496    ///
6497    /// Note that all the setters affecting `cdc_method` are mutually
6498    /// exclusive.
6499    pub fn set_cdc_method<
6500        T: std::convert::Into<std::option::Option<crate::model::sql_server_source_config::CdcMethod>>,
6501    >(
6502        mut self,
6503        v: T,
6504    ) -> Self {
6505        self.cdc_method = v.into();
6506        self
6507    }
6508
6509    /// The value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
6510    /// if it holds a `TransactionLogs`, `None` if the field is not set or
6511    /// holds a different branch.
6512    pub fn transaction_logs(
6513        &self,
6514    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerTransactionLogs>> {
6515        #[allow(unreachable_patterns)]
6516        self.cdc_method.as_ref().and_then(|v| match v {
6517            crate::model::sql_server_source_config::CdcMethod::TransactionLogs(v) => {
6518                std::option::Option::Some(v)
6519            }
6520            _ => std::option::Option::None,
6521        })
6522    }
6523
6524    /// The value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
6525    /// if it holds a `ChangeTables`, `None` if the field is not set or
6526    /// holds a different branch.
6527    pub fn change_tables(
6528        &self,
6529    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerChangeTables>> {
6530        #[allow(unreachable_patterns)]
6531        self.cdc_method.as_ref().and_then(|v| match v {
6532            crate::model::sql_server_source_config::CdcMethod::ChangeTables(v) => {
6533                std::option::Option::Some(v)
6534            }
6535            _ => std::option::Option::None,
6536        })
6537    }
6538
6539    /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
6540    /// to hold a `TransactionLogs`.
6541    ///
6542    /// Note that all the setters affecting `cdc_method` are
6543    /// mutually exclusive.
6544    pub fn set_transaction_logs<
6545        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerTransactionLogs>>,
6546    >(
6547        mut self,
6548        v: T,
6549    ) -> Self {
6550        self.cdc_method = std::option::Option::Some(
6551            crate::model::sql_server_source_config::CdcMethod::TransactionLogs(v.into()),
6552        );
6553        self
6554    }
6555
6556    /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
6557    /// to hold a `ChangeTables`.
6558    ///
6559    /// Note that all the setters affecting `cdc_method` are
6560    /// mutually exclusive.
6561    pub fn set_change_tables<
6562        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerChangeTables>>,
6563    >(
6564        mut self,
6565        v: T,
6566    ) -> Self {
6567        self.cdc_method = std::option::Option::Some(
6568            crate::model::sql_server_source_config::CdcMethod::ChangeTables(v.into()),
6569        );
6570        self
6571    }
6572}
6573
6574impl wkt::message::Message for SqlServerSourceConfig {
6575    fn typename() -> &'static str {
6576        "type.googleapis.com/google.cloud.datastream.v1.SqlServerSourceConfig"
6577    }
6578}
6579
6580/// Defines additional types related to [SqlServerSourceConfig].
6581pub mod sql_server_source_config {
6582    #[allow(unused_imports)]
6583    use super::*;
6584
6585    /// Configuration to select the CDC read method for the stream.
6586    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
6587    #[serde(rename_all = "camelCase")]
6588    #[non_exhaustive]
6589    pub enum CdcMethod {
6590        /// CDC reader reads from transaction logs.
6591        TransactionLogs(std::boxed::Box<crate::model::SqlServerTransactionLogs>),
6592        /// CDC reader reads from change tables.
6593        ChangeTables(std::boxed::Box<crate::model::SqlServerChangeTables>),
6594    }
6595}
6596
6597/// Configuration to use Transaction Logs CDC read method.
6598#[serde_with::serde_as]
6599#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6600#[serde(default, rename_all = "camelCase")]
6601#[non_exhaustive]
6602pub struct SqlServerTransactionLogs {
6603    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6604    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6605}
6606
6607impl SqlServerTransactionLogs {
6608    pub fn new() -> Self {
6609        std::default::Default::default()
6610    }
6611}
6612
6613impl wkt::message::Message for SqlServerTransactionLogs {
6614    fn typename() -> &'static str {
6615        "type.googleapis.com/google.cloud.datastream.v1.SqlServerTransactionLogs"
6616    }
6617}
6618
6619/// Configuration to use Change Tables CDC read method.
6620#[serde_with::serde_as]
6621#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6622#[serde(default, rename_all = "camelCase")]
6623#[non_exhaustive]
6624pub struct SqlServerChangeTables {
6625    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6626    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6627}
6628
6629impl SqlServerChangeTables {
6630    pub fn new() -> Self {
6631        std::default::Default::default()
6632    }
6633}
6634
6635impl wkt::message::Message for SqlServerChangeTables {
6636    fn typename() -> &'static str {
6637        "type.googleapis.com/google.cloud.datastream.v1.SqlServerChangeTables"
6638    }
6639}
6640
6641/// MySQL Column.
6642#[serde_with::serde_as]
6643#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6644#[serde(default, rename_all = "camelCase")]
6645#[non_exhaustive]
6646pub struct MysqlColumn {
6647    /// Column name.
6648    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6649    pub column: std::string::String,
6650
6651    /// The MySQL data type. Full data types list can be found here:
6652    /// <https://dev.mysql.com/doc/refman/8.0/en/data-types.html>
6653    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6654    pub data_type: std::string::String,
6655
6656    /// Column length.
6657    pub length: i32,
6658
6659    /// Column collation.
6660    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6661    pub collation: std::string::String,
6662
6663    /// Whether or not the column represents a primary key.
6664    pub primary_key: bool,
6665
6666    /// Whether or not the column can accept a null value.
6667    pub nullable: bool,
6668
6669    /// The ordinal position of the column in the table.
6670    pub ordinal_position: i32,
6671
6672    /// Column precision.
6673    pub precision: i32,
6674
6675    /// Column scale.
6676    pub scale: i32,
6677
6678    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6679    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6680}
6681
6682impl MysqlColumn {
6683    pub fn new() -> Self {
6684        std::default::Default::default()
6685    }
6686
6687    /// Sets the value of [column][crate::model::MysqlColumn::column].
6688    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6689        self.column = v.into();
6690        self
6691    }
6692
6693    /// Sets the value of [data_type][crate::model::MysqlColumn::data_type].
6694    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6695        self.data_type = v.into();
6696        self
6697    }
6698
6699    /// Sets the value of [length][crate::model::MysqlColumn::length].
6700    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6701        self.length = v.into();
6702        self
6703    }
6704
6705    /// Sets the value of [collation][crate::model::MysqlColumn::collation].
6706    pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6707        self.collation = v.into();
6708        self
6709    }
6710
6711    /// Sets the value of [primary_key][crate::model::MysqlColumn::primary_key].
6712    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6713        self.primary_key = v.into();
6714        self
6715    }
6716
6717    /// Sets the value of [nullable][crate::model::MysqlColumn::nullable].
6718    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6719        self.nullable = v.into();
6720        self
6721    }
6722
6723    /// Sets the value of [ordinal_position][crate::model::MysqlColumn::ordinal_position].
6724    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6725        self.ordinal_position = v.into();
6726        self
6727    }
6728
6729    /// Sets the value of [precision][crate::model::MysqlColumn::precision].
6730    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6731        self.precision = v.into();
6732        self
6733    }
6734
6735    /// Sets the value of [scale][crate::model::MysqlColumn::scale].
6736    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6737        self.scale = v.into();
6738        self
6739    }
6740}
6741
6742impl wkt::message::Message for MysqlColumn {
6743    fn typename() -> &'static str {
6744        "type.googleapis.com/google.cloud.datastream.v1.MysqlColumn"
6745    }
6746}
6747
6748/// MySQL table.
6749#[serde_with::serde_as]
6750#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6751#[serde(default, rename_all = "camelCase")]
6752#[non_exhaustive]
6753pub struct MysqlTable {
6754    /// Table name.
6755    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6756    pub table: std::string::String,
6757
6758    /// MySQL columns in the database.
6759    /// When unspecified as part of include/exclude objects, includes/excludes
6760    /// everything.
6761    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6762    pub mysql_columns: std::vec::Vec<crate::model::MysqlColumn>,
6763
6764    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6765    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6766}
6767
6768impl MysqlTable {
6769    pub fn new() -> Self {
6770        std::default::Default::default()
6771    }
6772
6773    /// Sets the value of [table][crate::model::MysqlTable::table].
6774    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6775        self.table = v.into();
6776        self
6777    }
6778
6779    /// Sets the value of [mysql_columns][crate::model::MysqlTable::mysql_columns].
6780    pub fn set_mysql_columns<T, V>(mut self, v: T) -> Self
6781    where
6782        T: std::iter::IntoIterator<Item = V>,
6783        V: std::convert::Into<crate::model::MysqlColumn>,
6784    {
6785        use std::iter::Iterator;
6786        self.mysql_columns = v.into_iter().map(|i| i.into()).collect();
6787        self
6788    }
6789}
6790
6791impl wkt::message::Message for MysqlTable {
6792    fn typename() -> &'static str {
6793        "type.googleapis.com/google.cloud.datastream.v1.MysqlTable"
6794    }
6795}
6796
6797/// MySQL database.
6798#[serde_with::serde_as]
6799#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6800#[serde(default, rename_all = "camelCase")]
6801#[non_exhaustive]
6802pub struct MysqlDatabase {
6803    /// Database name.
6804    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6805    pub database: std::string::String,
6806
6807    /// Tables in the database.
6808    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6809    pub mysql_tables: std::vec::Vec<crate::model::MysqlTable>,
6810
6811    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6812    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6813}
6814
6815impl MysqlDatabase {
6816    pub fn new() -> Self {
6817        std::default::Default::default()
6818    }
6819
6820    /// Sets the value of [database][crate::model::MysqlDatabase::database].
6821    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6822        self.database = v.into();
6823        self
6824    }
6825
6826    /// Sets the value of [mysql_tables][crate::model::MysqlDatabase::mysql_tables].
6827    pub fn set_mysql_tables<T, V>(mut self, v: T) -> Self
6828    where
6829        T: std::iter::IntoIterator<Item = V>,
6830        V: std::convert::Into<crate::model::MysqlTable>,
6831    {
6832        use std::iter::Iterator;
6833        self.mysql_tables = v.into_iter().map(|i| i.into()).collect();
6834        self
6835    }
6836}
6837
6838impl wkt::message::Message for MysqlDatabase {
6839    fn typename() -> &'static str {
6840        "type.googleapis.com/google.cloud.datastream.v1.MysqlDatabase"
6841    }
6842}
6843
6844/// MySQL database structure
6845#[serde_with::serde_as]
6846#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6847#[serde(default, rename_all = "camelCase")]
6848#[non_exhaustive]
6849pub struct MysqlRdbms {
6850    /// Mysql databases on the server
6851    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6852    pub mysql_databases: std::vec::Vec<crate::model::MysqlDatabase>,
6853
6854    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6855    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6856}
6857
6858impl MysqlRdbms {
6859    pub fn new() -> Self {
6860        std::default::Default::default()
6861    }
6862
6863    /// Sets the value of [mysql_databases][crate::model::MysqlRdbms::mysql_databases].
6864    pub fn set_mysql_databases<T, V>(mut self, v: T) -> Self
6865    where
6866        T: std::iter::IntoIterator<Item = V>,
6867        V: std::convert::Into<crate::model::MysqlDatabase>,
6868    {
6869        use std::iter::Iterator;
6870        self.mysql_databases = v.into_iter().map(|i| i.into()).collect();
6871        self
6872    }
6873}
6874
6875impl wkt::message::Message for MysqlRdbms {
6876    fn typename() -> &'static str {
6877        "type.googleapis.com/google.cloud.datastream.v1.MysqlRdbms"
6878    }
6879}
6880
6881/// MySQL source configuration
6882#[serde_with::serde_as]
6883#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6884#[serde(default, rename_all = "camelCase")]
6885#[non_exhaustive]
6886pub struct MysqlSourceConfig {
6887    /// MySQL objects to retrieve from the source.
6888    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6889    pub include_objects: std::option::Option<crate::model::MysqlRdbms>,
6890
6891    /// MySQL objects to exclude from the stream.
6892    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6893    pub exclude_objects: std::option::Option<crate::model::MysqlRdbms>,
6894
6895    /// Maximum number of concurrent CDC tasks. The number should be non negative.
6896    /// If not set (or set to 0), the system's default value will be used.
6897    pub max_concurrent_cdc_tasks: i32,
6898
6899    /// Maximum number of concurrent backfill tasks. The number should be non
6900    /// negative. If not set (or set to 0), the system's default value will be
6901    /// used.
6902    pub max_concurrent_backfill_tasks: i32,
6903
6904    /// The CDC method to use for the stream.
6905    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
6906    pub cdc_method: std::option::Option<crate::model::mysql_source_config::CdcMethod>,
6907
6908    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6909    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6910}
6911
6912impl MysqlSourceConfig {
6913    pub fn new() -> Self {
6914        std::default::Default::default()
6915    }
6916
6917    /// Sets the value of [include_objects][crate::model::MysqlSourceConfig::include_objects].
6918    pub fn set_include_objects<
6919        T: std::convert::Into<std::option::Option<crate::model::MysqlRdbms>>,
6920    >(
6921        mut self,
6922        v: T,
6923    ) -> Self {
6924        self.include_objects = v.into();
6925        self
6926    }
6927
6928    /// Sets the value of [exclude_objects][crate::model::MysqlSourceConfig::exclude_objects].
6929    pub fn set_exclude_objects<
6930        T: std::convert::Into<std::option::Option<crate::model::MysqlRdbms>>,
6931    >(
6932        mut self,
6933        v: T,
6934    ) -> Self {
6935        self.exclude_objects = v.into();
6936        self
6937    }
6938
6939    /// Sets the value of [max_concurrent_cdc_tasks][crate::model::MysqlSourceConfig::max_concurrent_cdc_tasks].
6940    pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6941        self.max_concurrent_cdc_tasks = v.into();
6942        self
6943    }
6944
6945    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::MysqlSourceConfig::max_concurrent_backfill_tasks].
6946    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6947        self.max_concurrent_backfill_tasks = v.into();
6948        self
6949    }
6950
6951    /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method].
6952    ///
6953    /// Note that all the setters affecting `cdc_method` are mutually
6954    /// exclusive.
6955    pub fn set_cdc_method<
6956        T: std::convert::Into<std::option::Option<crate::model::mysql_source_config::CdcMethod>>,
6957    >(
6958        mut self,
6959        v: T,
6960    ) -> Self {
6961        self.cdc_method = v.into();
6962        self
6963    }
6964
6965    /// The value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
6966    /// if it holds a `BinaryLogPosition`, `None` if the field is not set or
6967    /// holds a different branch.
6968    pub fn binary_log_position(
6969        &self,
6970    ) -> std::option::Option<&std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>>
6971    {
6972        #[allow(unreachable_patterns)]
6973        self.cdc_method.as_ref().and_then(|v| match v {
6974            crate::model::mysql_source_config::CdcMethod::BinaryLogPosition(v) => {
6975                std::option::Option::Some(v)
6976            }
6977            _ => std::option::Option::None,
6978        })
6979    }
6980
6981    /// The value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
6982    /// if it holds a `Gtid`, `None` if the field is not set or
6983    /// holds a different branch.
6984    pub fn gtid(
6985        &self,
6986    ) -> std::option::Option<&std::boxed::Box<crate::model::mysql_source_config::Gtid>> {
6987        #[allow(unreachable_patterns)]
6988        self.cdc_method.as_ref().and_then(|v| match v {
6989            crate::model::mysql_source_config::CdcMethod::Gtid(v) => std::option::Option::Some(v),
6990            _ => std::option::Option::None,
6991        })
6992    }
6993
6994    /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
6995    /// to hold a `BinaryLogPosition`.
6996    ///
6997    /// Note that all the setters affecting `cdc_method` are
6998    /// mutually exclusive.
6999    pub fn set_binary_log_position<
7000        T: std::convert::Into<std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>>,
7001    >(
7002        mut self,
7003        v: T,
7004    ) -> Self {
7005        self.cdc_method = std::option::Option::Some(
7006            crate::model::mysql_source_config::CdcMethod::BinaryLogPosition(v.into()),
7007        );
7008        self
7009    }
7010
7011    /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
7012    /// to hold a `Gtid`.
7013    ///
7014    /// Note that all the setters affecting `cdc_method` are
7015    /// mutually exclusive.
7016    pub fn set_gtid<
7017        T: std::convert::Into<std::boxed::Box<crate::model::mysql_source_config::Gtid>>,
7018    >(
7019        mut self,
7020        v: T,
7021    ) -> Self {
7022        self.cdc_method =
7023            std::option::Option::Some(crate::model::mysql_source_config::CdcMethod::Gtid(v.into()));
7024        self
7025    }
7026}
7027
7028impl wkt::message::Message for MysqlSourceConfig {
7029    fn typename() -> &'static str {
7030        "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig"
7031    }
7032}
7033
7034/// Defines additional types related to [MysqlSourceConfig].
7035pub mod mysql_source_config {
7036    #[allow(unused_imports)]
7037    use super::*;
7038
7039    /// Use Binary log position based replication.
7040    #[serde_with::serde_as]
7041    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7042    #[serde(default, rename_all = "camelCase")]
7043    #[non_exhaustive]
7044    pub struct BinaryLogPosition {
7045        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7046        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7047    }
7048
7049    impl BinaryLogPosition {
7050        pub fn new() -> Self {
7051            std::default::Default::default()
7052        }
7053    }
7054
7055    impl wkt::message::Message for BinaryLogPosition {
7056        fn typename() -> &'static str {
7057            "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig.BinaryLogPosition"
7058        }
7059    }
7060
7061    /// Use GTID based replication.
7062    #[serde_with::serde_as]
7063    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7064    #[serde(default, rename_all = "camelCase")]
7065    #[non_exhaustive]
7066    pub struct Gtid {
7067        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7068        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7069    }
7070
7071    impl Gtid {
7072        pub fn new() -> Self {
7073            std::default::Default::default()
7074        }
7075    }
7076
7077    impl wkt::message::Message for Gtid {
7078        fn typename() -> &'static str {
7079            "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig.Gtid"
7080        }
7081    }
7082
7083    /// The CDC method to use for the stream.
7084    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
7085    #[serde(rename_all = "camelCase")]
7086    #[non_exhaustive]
7087    pub enum CdcMethod {
7088        /// Use Binary log position based replication.
7089        BinaryLogPosition(std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>),
7090        /// Use GTID based replication.
7091        Gtid(std::boxed::Box<crate::model::mysql_source_config::Gtid>),
7092    }
7093}
7094
7095/// Salesforce source configuration
7096#[serde_with::serde_as]
7097#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7098#[serde(default, rename_all = "camelCase")]
7099#[non_exhaustive]
7100pub struct SalesforceSourceConfig {
7101    /// Salesforce objects to retrieve from the source.
7102    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7103    pub include_objects: std::option::Option<crate::model::SalesforceOrg>,
7104
7105    /// Salesforce objects to exclude from the stream.
7106    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7107    pub exclude_objects: std::option::Option<crate::model::SalesforceOrg>,
7108
7109    /// Required. Salesforce objects polling interval. The interval at which new
7110    /// changes will be polled for each object. The duration must be between 5
7111    /// minutes and 24 hours.
7112    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7113    pub polling_interval: std::option::Option<wkt::Duration>,
7114
7115    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7116    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7117}
7118
7119impl SalesforceSourceConfig {
7120    pub fn new() -> Self {
7121        std::default::Default::default()
7122    }
7123
7124    /// Sets the value of [include_objects][crate::model::SalesforceSourceConfig::include_objects].
7125    pub fn set_include_objects<
7126        T: std::convert::Into<std::option::Option<crate::model::SalesforceOrg>>,
7127    >(
7128        mut self,
7129        v: T,
7130    ) -> Self {
7131        self.include_objects = v.into();
7132        self
7133    }
7134
7135    /// Sets the value of [exclude_objects][crate::model::SalesforceSourceConfig::exclude_objects].
7136    pub fn set_exclude_objects<
7137        T: std::convert::Into<std::option::Option<crate::model::SalesforceOrg>>,
7138    >(
7139        mut self,
7140        v: T,
7141    ) -> Self {
7142        self.exclude_objects = v.into();
7143        self
7144    }
7145
7146    /// Sets the value of [polling_interval][crate::model::SalesforceSourceConfig::polling_interval].
7147    pub fn set_polling_interval<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
7148        mut self,
7149        v: T,
7150    ) -> Self {
7151        self.polling_interval = v.into();
7152        self
7153    }
7154}
7155
7156impl wkt::message::Message for SalesforceSourceConfig {
7157    fn typename() -> &'static str {
7158        "type.googleapis.com/google.cloud.datastream.v1.SalesforceSourceConfig"
7159    }
7160}
7161
7162/// Salesforce organization structure.
7163#[serde_with::serde_as]
7164#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7165#[serde(default, rename_all = "camelCase")]
7166#[non_exhaustive]
7167pub struct SalesforceOrg {
7168    /// Salesforce objects in the database server.
7169    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7170    pub objects: std::vec::Vec<crate::model::SalesforceObject>,
7171
7172    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7173    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7174}
7175
7176impl SalesforceOrg {
7177    pub fn new() -> Self {
7178        std::default::Default::default()
7179    }
7180
7181    /// Sets the value of [objects][crate::model::SalesforceOrg::objects].
7182    pub fn set_objects<T, V>(mut self, v: T) -> Self
7183    where
7184        T: std::iter::IntoIterator<Item = V>,
7185        V: std::convert::Into<crate::model::SalesforceObject>,
7186    {
7187        use std::iter::Iterator;
7188        self.objects = v.into_iter().map(|i| i.into()).collect();
7189        self
7190    }
7191}
7192
7193impl wkt::message::Message for SalesforceOrg {
7194    fn typename() -> &'static str {
7195        "type.googleapis.com/google.cloud.datastream.v1.SalesforceOrg"
7196    }
7197}
7198
7199/// Salesforce object.
7200#[serde_with::serde_as]
7201#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7202#[serde(default, rename_all = "camelCase")]
7203#[non_exhaustive]
7204pub struct SalesforceObject {
7205    /// Object name.
7206    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7207    pub object_name: std::string::String,
7208
7209    /// Salesforce fields.
7210    /// When unspecified as part of include objects,
7211    /// includes everything, when unspecified as part of exclude objects,
7212    /// excludes nothing.
7213    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7214    pub fields: std::vec::Vec<crate::model::SalesforceField>,
7215
7216    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7217    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7218}
7219
7220impl SalesforceObject {
7221    pub fn new() -> Self {
7222        std::default::Default::default()
7223    }
7224
7225    /// Sets the value of [object_name][crate::model::SalesforceObject::object_name].
7226    pub fn set_object_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7227        self.object_name = v.into();
7228        self
7229    }
7230
7231    /// Sets the value of [fields][crate::model::SalesforceObject::fields].
7232    pub fn set_fields<T, V>(mut self, v: T) -> Self
7233    where
7234        T: std::iter::IntoIterator<Item = V>,
7235        V: std::convert::Into<crate::model::SalesforceField>,
7236    {
7237        use std::iter::Iterator;
7238        self.fields = v.into_iter().map(|i| i.into()).collect();
7239        self
7240    }
7241}
7242
7243impl wkt::message::Message for SalesforceObject {
7244    fn typename() -> &'static str {
7245        "type.googleapis.com/google.cloud.datastream.v1.SalesforceObject"
7246    }
7247}
7248
7249/// Salesforce field.
7250#[serde_with::serde_as]
7251#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7252#[serde(default, rename_all = "camelCase")]
7253#[non_exhaustive]
7254pub struct SalesforceField {
7255    /// Field name.
7256    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7257    pub name: std::string::String,
7258
7259    /// The data type.
7260    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7261    pub data_type: std::string::String,
7262
7263    /// Indicates whether the field can accept nil values.
7264    pub nillable: bool,
7265
7266    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7267    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7268}
7269
7270impl SalesforceField {
7271    pub fn new() -> Self {
7272        std::default::Default::default()
7273    }
7274
7275    /// Sets the value of [name][crate::model::SalesforceField::name].
7276    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7277        self.name = v.into();
7278        self
7279    }
7280
7281    /// Sets the value of [data_type][crate::model::SalesforceField::data_type].
7282    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7283        self.data_type = v.into();
7284        self
7285    }
7286
7287    /// Sets the value of [nillable][crate::model::SalesforceField::nillable].
7288    pub fn set_nillable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7289        self.nillable = v.into();
7290        self
7291    }
7292}
7293
7294impl wkt::message::Message for SalesforceField {
7295    fn typename() -> &'static str {
7296        "type.googleapis.com/google.cloud.datastream.v1.SalesforceField"
7297    }
7298}
7299
7300/// The configuration of the stream source.
7301#[serde_with::serde_as]
7302#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7303#[serde(default, rename_all = "camelCase")]
7304#[non_exhaustive]
7305pub struct SourceConfig {
7306    /// Required. Source connection profile resource.
7307    /// Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
7308    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7309    pub source_connection_profile: std::string::String,
7310
7311    /// Stream configuration that is specific to the data source type.
7312    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
7313    pub source_stream_config: std::option::Option<crate::model::source_config::SourceStreamConfig>,
7314
7315    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7316    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7317}
7318
7319impl SourceConfig {
7320    pub fn new() -> Self {
7321        std::default::Default::default()
7322    }
7323
7324    /// Sets the value of [source_connection_profile][crate::model::SourceConfig::source_connection_profile].
7325    pub fn set_source_connection_profile<T: std::convert::Into<std::string::String>>(
7326        mut self,
7327        v: T,
7328    ) -> Self {
7329        self.source_connection_profile = v.into();
7330        self
7331    }
7332
7333    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config].
7334    ///
7335    /// Note that all the setters affecting `source_stream_config` are mutually
7336    /// exclusive.
7337    pub fn set_source_stream_config<
7338        T: std::convert::Into<std::option::Option<crate::model::source_config::SourceStreamConfig>>,
7339    >(
7340        mut self,
7341        v: T,
7342    ) -> Self {
7343        self.source_stream_config = v.into();
7344        self
7345    }
7346
7347    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
7348    /// if it holds a `OracleSourceConfig`, `None` if the field is not set or
7349    /// holds a different branch.
7350    pub fn oracle_source_config(
7351        &self,
7352    ) -> std::option::Option<&std::boxed::Box<crate::model::OracleSourceConfig>> {
7353        #[allow(unreachable_patterns)]
7354        self.source_stream_config.as_ref().and_then(|v| match v {
7355            crate::model::source_config::SourceStreamConfig::OracleSourceConfig(v) => {
7356                std::option::Option::Some(v)
7357            }
7358            _ => std::option::Option::None,
7359        })
7360    }
7361
7362    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
7363    /// if it holds a `MysqlSourceConfig`, `None` if the field is not set or
7364    /// holds a different branch.
7365    pub fn mysql_source_config(
7366        &self,
7367    ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlSourceConfig>> {
7368        #[allow(unreachable_patterns)]
7369        self.source_stream_config.as_ref().and_then(|v| match v {
7370            crate::model::source_config::SourceStreamConfig::MysqlSourceConfig(v) => {
7371                std::option::Option::Some(v)
7372            }
7373            _ => std::option::Option::None,
7374        })
7375    }
7376
7377    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
7378    /// if it holds a `PostgresqlSourceConfig`, `None` if the field is not set or
7379    /// holds a different branch.
7380    pub fn postgresql_source_config(
7381        &self,
7382    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlSourceConfig>> {
7383        #[allow(unreachable_patterns)]
7384        self.source_stream_config.as_ref().and_then(|v| match v {
7385            crate::model::source_config::SourceStreamConfig::PostgresqlSourceConfig(v) => {
7386                std::option::Option::Some(v)
7387            }
7388            _ => std::option::Option::None,
7389        })
7390    }
7391
7392    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
7393    /// if it holds a `SqlServerSourceConfig`, `None` if the field is not set or
7394    /// holds a different branch.
7395    pub fn sql_server_source_config(
7396        &self,
7397    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerSourceConfig>> {
7398        #[allow(unreachable_patterns)]
7399        self.source_stream_config.as_ref().and_then(|v| match v {
7400            crate::model::source_config::SourceStreamConfig::SqlServerSourceConfig(v) => {
7401                std::option::Option::Some(v)
7402            }
7403            _ => std::option::Option::None,
7404        })
7405    }
7406
7407    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
7408    /// if it holds a `SalesforceSourceConfig`, `None` if the field is not set or
7409    /// holds a different branch.
7410    pub fn salesforce_source_config(
7411        &self,
7412    ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceSourceConfig>> {
7413        #[allow(unreachable_patterns)]
7414        self.source_stream_config.as_ref().and_then(|v| match v {
7415            crate::model::source_config::SourceStreamConfig::SalesforceSourceConfig(v) => {
7416                std::option::Option::Some(v)
7417            }
7418            _ => std::option::Option::None,
7419        })
7420    }
7421
7422    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
7423    /// to hold a `OracleSourceConfig`.
7424    ///
7425    /// Note that all the setters affecting `source_stream_config` are
7426    /// mutually exclusive.
7427    pub fn set_oracle_source_config<
7428        T: std::convert::Into<std::boxed::Box<crate::model::OracleSourceConfig>>,
7429    >(
7430        mut self,
7431        v: T,
7432    ) -> Self {
7433        self.source_stream_config = std::option::Option::Some(
7434            crate::model::source_config::SourceStreamConfig::OracleSourceConfig(v.into()),
7435        );
7436        self
7437    }
7438
7439    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
7440    /// to hold a `MysqlSourceConfig`.
7441    ///
7442    /// Note that all the setters affecting `source_stream_config` are
7443    /// mutually exclusive.
7444    pub fn set_mysql_source_config<
7445        T: std::convert::Into<std::boxed::Box<crate::model::MysqlSourceConfig>>,
7446    >(
7447        mut self,
7448        v: T,
7449    ) -> Self {
7450        self.source_stream_config = std::option::Option::Some(
7451            crate::model::source_config::SourceStreamConfig::MysqlSourceConfig(v.into()),
7452        );
7453        self
7454    }
7455
7456    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
7457    /// to hold a `PostgresqlSourceConfig`.
7458    ///
7459    /// Note that all the setters affecting `source_stream_config` are
7460    /// mutually exclusive.
7461    pub fn set_postgresql_source_config<
7462        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlSourceConfig>>,
7463    >(
7464        mut self,
7465        v: T,
7466    ) -> Self {
7467        self.source_stream_config = std::option::Option::Some(
7468            crate::model::source_config::SourceStreamConfig::PostgresqlSourceConfig(v.into()),
7469        );
7470        self
7471    }
7472
7473    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
7474    /// to hold a `SqlServerSourceConfig`.
7475    ///
7476    /// Note that all the setters affecting `source_stream_config` are
7477    /// mutually exclusive.
7478    pub fn set_sql_server_source_config<
7479        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerSourceConfig>>,
7480    >(
7481        mut self,
7482        v: T,
7483    ) -> Self {
7484        self.source_stream_config = std::option::Option::Some(
7485            crate::model::source_config::SourceStreamConfig::SqlServerSourceConfig(v.into()),
7486        );
7487        self
7488    }
7489
7490    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
7491    /// to hold a `SalesforceSourceConfig`.
7492    ///
7493    /// Note that all the setters affecting `source_stream_config` are
7494    /// mutually exclusive.
7495    pub fn set_salesforce_source_config<
7496        T: std::convert::Into<std::boxed::Box<crate::model::SalesforceSourceConfig>>,
7497    >(
7498        mut self,
7499        v: T,
7500    ) -> Self {
7501        self.source_stream_config = std::option::Option::Some(
7502            crate::model::source_config::SourceStreamConfig::SalesforceSourceConfig(v.into()),
7503        );
7504        self
7505    }
7506}
7507
7508impl wkt::message::Message for SourceConfig {
7509    fn typename() -> &'static str {
7510        "type.googleapis.com/google.cloud.datastream.v1.SourceConfig"
7511    }
7512}
7513
7514/// Defines additional types related to [SourceConfig].
7515pub mod source_config {
7516    #[allow(unused_imports)]
7517    use super::*;
7518
7519    /// Stream configuration that is specific to the data source type.
7520    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
7521    #[serde(rename_all = "camelCase")]
7522    #[non_exhaustive]
7523    pub enum SourceStreamConfig {
7524        /// Oracle data source configuration.
7525        OracleSourceConfig(std::boxed::Box<crate::model::OracleSourceConfig>),
7526        /// MySQL data source configuration.
7527        MysqlSourceConfig(std::boxed::Box<crate::model::MysqlSourceConfig>),
7528        /// PostgreSQL data source configuration.
7529        PostgresqlSourceConfig(std::boxed::Box<crate::model::PostgresqlSourceConfig>),
7530        /// SQLServer data source configuration.
7531        SqlServerSourceConfig(std::boxed::Box<crate::model::SqlServerSourceConfig>),
7532        /// Salesforce data source configuration.
7533        SalesforceSourceConfig(std::boxed::Box<crate::model::SalesforceSourceConfig>),
7534    }
7535}
7536
7537/// AVRO file format configuration.
7538#[serde_with::serde_as]
7539#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7540#[serde(default, rename_all = "camelCase")]
7541#[non_exhaustive]
7542pub struct AvroFileFormat {
7543    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7544    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7545}
7546
7547impl AvroFileFormat {
7548    pub fn new() -> Self {
7549        std::default::Default::default()
7550    }
7551}
7552
7553impl wkt::message::Message for AvroFileFormat {
7554    fn typename() -> &'static str {
7555        "type.googleapis.com/google.cloud.datastream.v1.AvroFileFormat"
7556    }
7557}
7558
7559/// JSON file format configuration.
7560#[serde_with::serde_as]
7561#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7562#[serde(default, rename_all = "camelCase")]
7563#[non_exhaustive]
7564pub struct JsonFileFormat {
7565    /// The schema file format along JSON data files.
7566    pub schema_file_format: crate::model::json_file_format::SchemaFileFormat,
7567
7568    /// Compression of the loaded JSON file.
7569    pub compression: crate::model::json_file_format::JsonCompression,
7570
7571    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7572    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7573}
7574
7575impl JsonFileFormat {
7576    pub fn new() -> Self {
7577        std::default::Default::default()
7578    }
7579
7580    /// Sets the value of [schema_file_format][crate::model::JsonFileFormat::schema_file_format].
7581    pub fn set_schema_file_format<
7582        T: std::convert::Into<crate::model::json_file_format::SchemaFileFormat>,
7583    >(
7584        mut self,
7585        v: T,
7586    ) -> Self {
7587        self.schema_file_format = v.into();
7588        self
7589    }
7590
7591    /// Sets the value of [compression][crate::model::JsonFileFormat::compression].
7592    pub fn set_compression<
7593        T: std::convert::Into<crate::model::json_file_format::JsonCompression>,
7594    >(
7595        mut self,
7596        v: T,
7597    ) -> Self {
7598        self.compression = v.into();
7599        self
7600    }
7601}
7602
7603impl wkt::message::Message for JsonFileFormat {
7604    fn typename() -> &'static str {
7605        "type.googleapis.com/google.cloud.datastream.v1.JsonFileFormat"
7606    }
7607}
7608
7609/// Defines additional types related to [JsonFileFormat].
7610pub mod json_file_format {
7611    #[allow(unused_imports)]
7612    use super::*;
7613
7614    /// Schema file format.
7615    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
7616    pub struct SchemaFileFormat(i32);
7617
7618    impl SchemaFileFormat {
7619        /// Unspecified schema file format.
7620        pub const SCHEMA_FILE_FORMAT_UNSPECIFIED: SchemaFileFormat = SchemaFileFormat::new(0);
7621
7622        /// Do not attach schema file.
7623        pub const NO_SCHEMA_FILE: SchemaFileFormat = SchemaFileFormat::new(1);
7624
7625        /// Avro schema format.
7626        pub const AVRO_SCHEMA_FILE: SchemaFileFormat = SchemaFileFormat::new(2);
7627
7628        /// Creates a new SchemaFileFormat instance.
7629        pub(crate) const fn new(value: i32) -> Self {
7630            Self(value)
7631        }
7632
7633        /// Gets the enum value.
7634        pub fn value(&self) -> i32 {
7635            self.0
7636        }
7637
7638        /// Gets the enum value as a string.
7639        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
7640            match self.0 {
7641                0 => std::borrow::Cow::Borrowed("SCHEMA_FILE_FORMAT_UNSPECIFIED"),
7642                1 => std::borrow::Cow::Borrowed("NO_SCHEMA_FILE"),
7643                2 => std::borrow::Cow::Borrowed("AVRO_SCHEMA_FILE"),
7644                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
7645            }
7646        }
7647
7648        /// Creates an enum value from the value name.
7649        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
7650            match name {
7651                "SCHEMA_FILE_FORMAT_UNSPECIFIED" => {
7652                    std::option::Option::Some(Self::SCHEMA_FILE_FORMAT_UNSPECIFIED)
7653                }
7654                "NO_SCHEMA_FILE" => std::option::Option::Some(Self::NO_SCHEMA_FILE),
7655                "AVRO_SCHEMA_FILE" => std::option::Option::Some(Self::AVRO_SCHEMA_FILE),
7656                _ => std::option::Option::None,
7657            }
7658        }
7659    }
7660
7661    impl std::convert::From<i32> for SchemaFileFormat {
7662        fn from(value: i32) -> Self {
7663            Self::new(value)
7664        }
7665    }
7666
7667    impl std::default::Default for SchemaFileFormat {
7668        fn default() -> Self {
7669            Self::new(0)
7670        }
7671    }
7672
7673    /// Json file compression.
7674    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
7675    pub struct JsonCompression(i32);
7676
7677    impl JsonCompression {
7678        /// Unspecified json file compression.
7679        pub const JSON_COMPRESSION_UNSPECIFIED: JsonCompression = JsonCompression::new(0);
7680
7681        /// Do not compress JSON file.
7682        pub const NO_COMPRESSION: JsonCompression = JsonCompression::new(1);
7683
7684        /// Gzip compression.
7685        pub const GZIP: JsonCompression = JsonCompression::new(2);
7686
7687        /// Creates a new JsonCompression instance.
7688        pub(crate) const fn new(value: i32) -> Self {
7689            Self(value)
7690        }
7691
7692        /// Gets the enum value.
7693        pub fn value(&self) -> i32 {
7694            self.0
7695        }
7696
7697        /// Gets the enum value as a string.
7698        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
7699            match self.0 {
7700                0 => std::borrow::Cow::Borrowed("JSON_COMPRESSION_UNSPECIFIED"),
7701                1 => std::borrow::Cow::Borrowed("NO_COMPRESSION"),
7702                2 => std::borrow::Cow::Borrowed("GZIP"),
7703                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
7704            }
7705        }
7706
7707        /// Creates an enum value from the value name.
7708        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
7709            match name {
7710                "JSON_COMPRESSION_UNSPECIFIED" => {
7711                    std::option::Option::Some(Self::JSON_COMPRESSION_UNSPECIFIED)
7712                }
7713                "NO_COMPRESSION" => std::option::Option::Some(Self::NO_COMPRESSION),
7714                "GZIP" => std::option::Option::Some(Self::GZIP),
7715                _ => std::option::Option::None,
7716            }
7717        }
7718    }
7719
7720    impl std::convert::From<i32> for JsonCompression {
7721        fn from(value: i32) -> Self {
7722            Self::new(value)
7723        }
7724    }
7725
7726    impl std::default::Default for JsonCompression {
7727        fn default() -> Self {
7728            Self::new(0)
7729        }
7730    }
7731}
7732
7733/// Google Cloud Storage destination configuration
7734#[serde_with::serde_as]
7735#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7736#[serde(default, rename_all = "camelCase")]
7737#[non_exhaustive]
7738pub struct GcsDestinationConfig {
7739    /// Path inside the Cloud Storage bucket to write data to.
7740    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7741    pub path: std::string::String,
7742
7743    /// The maximum file size to be saved in the bucket.
7744    pub file_rotation_mb: i32,
7745
7746    /// The maximum duration for which new events are added before a file is
7747    /// closed and a new file is created. Values within the range of 15-60 seconds
7748    /// are allowed.
7749    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7750    pub file_rotation_interval: std::option::Option<wkt::Duration>,
7751
7752    /// File Format that the data should be written in.
7753    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
7754    pub file_format: std::option::Option<crate::model::gcs_destination_config::FileFormat>,
7755
7756    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7757    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7758}
7759
7760impl GcsDestinationConfig {
7761    pub fn new() -> Self {
7762        std::default::Default::default()
7763    }
7764
7765    /// Sets the value of [path][crate::model::GcsDestinationConfig::path].
7766    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7767        self.path = v.into();
7768        self
7769    }
7770
7771    /// Sets the value of [file_rotation_mb][crate::model::GcsDestinationConfig::file_rotation_mb].
7772    pub fn set_file_rotation_mb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7773        self.file_rotation_mb = v.into();
7774        self
7775    }
7776
7777    /// Sets the value of [file_rotation_interval][crate::model::GcsDestinationConfig::file_rotation_interval].
7778    pub fn set_file_rotation_interval<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
7779        mut self,
7780        v: T,
7781    ) -> Self {
7782        self.file_rotation_interval = v.into();
7783        self
7784    }
7785
7786    /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format].
7787    ///
7788    /// Note that all the setters affecting `file_format` are mutually
7789    /// exclusive.
7790    pub fn set_file_format<
7791        T: std::convert::Into<std::option::Option<crate::model::gcs_destination_config::FileFormat>>,
7792    >(
7793        mut self,
7794        v: T,
7795    ) -> Self {
7796        self.file_format = v.into();
7797        self
7798    }
7799
7800    /// The value of [file_format][crate::model::GcsDestinationConfig::file_format]
7801    /// if it holds a `AvroFileFormat`, `None` if the field is not set or
7802    /// holds a different branch.
7803    pub fn avro_file_format(
7804        &self,
7805    ) -> std::option::Option<&std::boxed::Box<crate::model::AvroFileFormat>> {
7806        #[allow(unreachable_patterns)]
7807        self.file_format.as_ref().and_then(|v| match v {
7808            crate::model::gcs_destination_config::FileFormat::AvroFileFormat(v) => {
7809                std::option::Option::Some(v)
7810            }
7811            _ => std::option::Option::None,
7812        })
7813    }
7814
7815    /// The value of [file_format][crate::model::GcsDestinationConfig::file_format]
7816    /// if it holds a `JsonFileFormat`, `None` if the field is not set or
7817    /// holds a different branch.
7818    pub fn json_file_format(
7819        &self,
7820    ) -> std::option::Option<&std::boxed::Box<crate::model::JsonFileFormat>> {
7821        #[allow(unreachable_patterns)]
7822        self.file_format.as_ref().and_then(|v| match v {
7823            crate::model::gcs_destination_config::FileFormat::JsonFileFormat(v) => {
7824                std::option::Option::Some(v)
7825            }
7826            _ => std::option::Option::None,
7827        })
7828    }
7829
7830    /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format]
7831    /// to hold a `AvroFileFormat`.
7832    ///
7833    /// Note that all the setters affecting `file_format` are
7834    /// mutually exclusive.
7835    pub fn set_avro_file_format<
7836        T: std::convert::Into<std::boxed::Box<crate::model::AvroFileFormat>>,
7837    >(
7838        mut self,
7839        v: T,
7840    ) -> Self {
7841        self.file_format = std::option::Option::Some(
7842            crate::model::gcs_destination_config::FileFormat::AvroFileFormat(v.into()),
7843        );
7844        self
7845    }
7846
7847    /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format]
7848    /// to hold a `JsonFileFormat`.
7849    ///
7850    /// Note that all the setters affecting `file_format` are
7851    /// mutually exclusive.
7852    pub fn set_json_file_format<
7853        T: std::convert::Into<std::boxed::Box<crate::model::JsonFileFormat>>,
7854    >(
7855        mut self,
7856        v: T,
7857    ) -> Self {
7858        self.file_format = std::option::Option::Some(
7859            crate::model::gcs_destination_config::FileFormat::JsonFileFormat(v.into()),
7860        );
7861        self
7862    }
7863}
7864
7865impl wkt::message::Message for GcsDestinationConfig {
7866    fn typename() -> &'static str {
7867        "type.googleapis.com/google.cloud.datastream.v1.GcsDestinationConfig"
7868    }
7869}
7870
7871/// Defines additional types related to [GcsDestinationConfig].
7872pub mod gcs_destination_config {
7873    #[allow(unused_imports)]
7874    use super::*;
7875
7876    /// File Format that the data should be written in.
7877    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
7878    #[serde(rename_all = "camelCase")]
7879    #[non_exhaustive]
7880    pub enum FileFormat {
7881        /// AVRO file format configuration.
7882        AvroFileFormat(std::boxed::Box<crate::model::AvroFileFormat>),
7883        /// JSON file format configuration.
7884        JsonFileFormat(std::boxed::Box<crate::model::JsonFileFormat>),
7885    }
7886}
7887
7888/// BigQuery destination configuration
7889#[serde_with::serde_as]
7890#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7891#[serde(default, rename_all = "camelCase")]
7892#[non_exhaustive]
7893pub struct BigQueryDestinationConfig {
7894    /// The guaranteed data freshness (in seconds) when querying tables created by
7895    /// the stream. Editing this field will only affect new tables created in the
7896    /// future, but existing tables will not be impacted. Lower values mean that
7897    /// queries will return fresher data, but may result in higher cost.
7898    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7899    pub data_freshness: std::option::Option<wkt::Duration>,
7900
7901    /// Optional. Big Lake Managed Tables (BLMT) configuration.
7902    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7903    pub blmt_config: std::option::Option<crate::model::big_query_destination_config::BlmtConfig>,
7904
7905    /// Target dataset(s) configuration.
7906    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
7907    pub dataset_config:
7908        std::option::Option<crate::model::big_query_destination_config::DatasetConfig>,
7909
7910    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
7911    pub write_mode: std::option::Option<crate::model::big_query_destination_config::WriteMode>,
7912
7913    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7914    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7915}
7916
7917impl BigQueryDestinationConfig {
7918    pub fn new() -> Self {
7919        std::default::Default::default()
7920    }
7921
7922    /// Sets the value of [data_freshness][crate::model::BigQueryDestinationConfig::data_freshness].
7923    pub fn set_data_freshness<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
7924        mut self,
7925        v: T,
7926    ) -> Self {
7927        self.data_freshness = v.into();
7928        self
7929    }
7930
7931    /// Sets the value of [blmt_config][crate::model::BigQueryDestinationConfig::blmt_config].
7932    pub fn set_blmt_config<
7933        T: std::convert::Into<
7934                std::option::Option<crate::model::big_query_destination_config::BlmtConfig>,
7935            >,
7936    >(
7937        mut self,
7938        v: T,
7939    ) -> Self {
7940        self.blmt_config = v.into();
7941        self
7942    }
7943
7944    /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config].
7945    ///
7946    /// Note that all the setters affecting `dataset_config` are mutually
7947    /// exclusive.
7948    pub fn set_dataset_config<
7949        T: std::convert::Into<
7950                std::option::Option<crate::model::big_query_destination_config::DatasetConfig>,
7951            >,
7952    >(
7953        mut self,
7954        v: T,
7955    ) -> Self {
7956        self.dataset_config = v.into();
7957        self
7958    }
7959
7960    /// The value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
7961    /// if it holds a `SingleTargetDataset`, `None` if the field is not set or
7962    /// holds a different branch.
7963    pub fn single_target_dataset(
7964        &self,
7965    ) -> std::option::Option<
7966        &std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
7967    > {
7968        #[allow(unreachable_patterns)]
7969        self.dataset_config.as_ref().and_then(|v| match v {
7970            crate::model::big_query_destination_config::DatasetConfig::SingleTargetDataset(v) => {
7971                std::option::Option::Some(v)
7972            }
7973            _ => std::option::Option::None,
7974        })
7975    }
7976
7977    /// The value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
7978    /// if it holds a `SourceHierarchyDatasets`, `None` if the field is not set or
7979    /// holds a different branch.
7980    pub fn source_hierarchy_datasets(
7981        &self,
7982    ) -> std::option::Option<
7983        &std::boxed::Box<crate::model::big_query_destination_config::SourceHierarchyDatasets>,
7984    > {
7985        #[allow(unreachable_patterns)]
7986        self.dataset_config.as_ref().and_then(|v| match v {
7987            crate::model::big_query_destination_config::DatasetConfig::SourceHierarchyDatasets(
7988                v,
7989            ) => std::option::Option::Some(v),
7990            _ => std::option::Option::None,
7991        })
7992    }
7993
7994    /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
7995    /// to hold a `SingleTargetDataset`.
7996    ///
7997    /// Note that all the setters affecting `dataset_config` are
7998    /// mutually exclusive.
7999    pub fn set_single_target_dataset<
8000        T: std::convert::Into<
8001                std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
8002            >,
8003    >(
8004        mut self,
8005        v: T,
8006    ) -> Self {
8007        self.dataset_config = std::option::Option::Some(
8008            crate::model::big_query_destination_config::DatasetConfig::SingleTargetDataset(
8009                v.into(),
8010            ),
8011        );
8012        self
8013    }
8014
8015    /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
8016    /// to hold a `SourceHierarchyDatasets`.
8017    ///
8018    /// Note that all the setters affecting `dataset_config` are
8019    /// mutually exclusive.
8020    pub fn set_source_hierarchy_datasets<
8021        T: std::convert::Into<
8022                std::boxed::Box<
8023                    crate::model::big_query_destination_config::SourceHierarchyDatasets,
8024                >,
8025            >,
8026    >(
8027        mut self,
8028        v: T,
8029    ) -> Self {
8030        self.dataset_config = std::option::Option::Some(
8031            crate::model::big_query_destination_config::DatasetConfig::SourceHierarchyDatasets(
8032                v.into(),
8033            ),
8034        );
8035        self
8036    }
8037
8038    /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode].
8039    ///
8040    /// Note that all the setters affecting `write_mode` are mutually
8041    /// exclusive.
8042    pub fn set_write_mode<
8043        T: std::convert::Into<
8044                std::option::Option<crate::model::big_query_destination_config::WriteMode>,
8045            >,
8046    >(
8047        mut self,
8048        v: T,
8049    ) -> Self {
8050        self.write_mode = v.into();
8051        self
8052    }
8053
8054    /// The value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
8055    /// if it holds a `Merge`, `None` if the field is not set or
8056    /// holds a different branch.
8057    pub fn merge(
8058        &self,
8059    ) -> std::option::Option<&std::boxed::Box<crate::model::big_query_destination_config::Merge>>
8060    {
8061        #[allow(unreachable_patterns)]
8062        self.write_mode.as_ref().and_then(|v| match v {
8063            crate::model::big_query_destination_config::WriteMode::Merge(v) => {
8064                std::option::Option::Some(v)
8065            }
8066            _ => std::option::Option::None,
8067        })
8068    }
8069
8070    /// The value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
8071    /// if it holds a `AppendOnly`, `None` if the field is not set or
8072    /// holds a different branch.
8073    pub fn append_only(
8074        &self,
8075    ) -> std::option::Option<&std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>>
8076    {
8077        #[allow(unreachable_patterns)]
8078        self.write_mode.as_ref().and_then(|v| match v {
8079            crate::model::big_query_destination_config::WriteMode::AppendOnly(v) => {
8080                std::option::Option::Some(v)
8081            }
8082            _ => std::option::Option::None,
8083        })
8084    }
8085
8086    /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
8087    /// to hold a `Merge`.
8088    ///
8089    /// Note that all the setters affecting `write_mode` are
8090    /// mutually exclusive.
8091    pub fn set_merge<
8092        T: std::convert::Into<std::boxed::Box<crate::model::big_query_destination_config::Merge>>,
8093    >(
8094        mut self,
8095        v: T,
8096    ) -> Self {
8097        self.write_mode = std::option::Option::Some(
8098            crate::model::big_query_destination_config::WriteMode::Merge(v.into()),
8099        );
8100        self
8101    }
8102
8103    /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
8104    /// to hold a `AppendOnly`.
8105    ///
8106    /// Note that all the setters affecting `write_mode` are
8107    /// mutually exclusive.
8108    pub fn set_append_only<
8109        T: std::convert::Into<std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>>,
8110    >(
8111        mut self,
8112        v: T,
8113    ) -> Self {
8114        self.write_mode = std::option::Option::Some(
8115            crate::model::big_query_destination_config::WriteMode::AppendOnly(v.into()),
8116        );
8117        self
8118    }
8119}
8120
8121impl wkt::message::Message for BigQueryDestinationConfig {
8122    fn typename() -> &'static str {
8123        "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig"
8124    }
8125}
8126
8127/// Defines additional types related to [BigQueryDestinationConfig].
8128pub mod big_query_destination_config {
8129    #[allow(unused_imports)]
8130    use super::*;
8131
8132    /// A single target dataset to which all data will be streamed.
8133    #[serde_with::serde_as]
8134    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8135    #[serde(default, rename_all = "camelCase")]
8136    #[non_exhaustive]
8137    pub struct SingleTargetDataset {
8138        /// The dataset ID of the target dataset.
8139        /// DatasetIds allowed characters:
8140        /// <https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets#datasetreference>.
8141        #[serde(skip_serializing_if = "std::string::String::is_empty")]
8142        pub dataset_id: std::string::String,
8143
8144        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8145        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8146    }
8147
8148    impl SingleTargetDataset {
8149        pub fn new() -> Self {
8150            std::default::Default::default()
8151        }
8152
8153        /// Sets the value of [dataset_id][crate::model::big_query_destination_config::SingleTargetDataset::dataset_id].
8154        pub fn set_dataset_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8155            self.dataset_id = v.into();
8156            self
8157        }
8158    }
8159
8160    impl wkt::message::Message for SingleTargetDataset {
8161        fn typename() -> &'static str {
8162            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SingleTargetDataset"
8163        }
8164    }
8165
8166    /// Destination datasets are created so that hierarchy of the destination data
8167    /// objects matches the source hierarchy.
8168    #[serde_with::serde_as]
8169    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8170    #[serde(default, rename_all = "camelCase")]
8171    #[non_exhaustive]
8172    pub struct SourceHierarchyDatasets {
8173        /// The dataset template to use for dynamic dataset creation.
8174        #[serde(skip_serializing_if = "std::option::Option::is_none")]
8175        pub dataset_template: std::option::Option<
8176            crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate,
8177        >,
8178
8179        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8180        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8181    }
8182
8183    impl SourceHierarchyDatasets {
8184        pub fn new() -> Self {
8185            std::default::Default::default()
8186        }
8187
8188        /// Sets the value of [dataset_template][crate::model::big_query_destination_config::SourceHierarchyDatasets::dataset_template].
8189        pub fn set_dataset_template<T: std::convert::Into<std::option::Option<crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate>>>(mut self, v: T) -> Self{
8190            self.dataset_template = v.into();
8191            self
8192        }
8193    }
8194
8195    impl wkt::message::Message for SourceHierarchyDatasets {
8196        fn typename() -> &'static str {
8197            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SourceHierarchyDatasets"
8198        }
8199    }
8200
8201    /// Defines additional types related to [SourceHierarchyDatasets].
8202    pub mod source_hierarchy_datasets {
8203        #[allow(unused_imports)]
8204        use super::*;
8205
8206        /// Dataset template used for dynamic dataset creation.
8207        #[serde_with::serde_as]
8208        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8209        #[serde(default, rename_all = "camelCase")]
8210        #[non_exhaustive]
8211        pub struct DatasetTemplate {
8212            /// Required. The geographic location where the dataset should reside. See
8213            /// <https://cloud.google.com/bigquery/docs/locations> for supported
8214            /// locations.
8215            #[serde(skip_serializing_if = "std::string::String::is_empty")]
8216            pub location: std::string::String,
8217
8218            /// If supplied, every created dataset will have its name prefixed by the
8219            /// provided value. The prefix and name will be separated by an underscore.
8220            /// i.e. \<prefix\>_<dataset_name>.
8221            #[serde(skip_serializing_if = "std::string::String::is_empty")]
8222            pub dataset_id_prefix: std::string::String,
8223
8224            /// Describes the Cloud KMS encryption key that will be used to
8225            /// protect destination BigQuery table. The BigQuery Service Account
8226            /// associated with your project requires access to this encryption key.
8227            /// i.e.
8228            /// projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{cryptoKey}.
8229            /// See <https://cloud.google.com/bigquery/docs/customer-managed-encryption>
8230            /// for more information.
8231            #[serde(skip_serializing_if = "std::string::String::is_empty")]
8232            pub kms_key_name: std::string::String,
8233
8234            #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8235            _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8236        }
8237
8238        impl DatasetTemplate {
8239            pub fn new() -> Self {
8240                std::default::Default::default()
8241            }
8242
8243            /// Sets the value of [location][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::location].
8244            pub fn set_location<T: std::convert::Into<std::string::String>>(
8245                mut self,
8246                v: T,
8247            ) -> Self {
8248                self.location = v.into();
8249                self
8250            }
8251
8252            /// Sets the value of [dataset_id_prefix][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::dataset_id_prefix].
8253            pub fn set_dataset_id_prefix<T: std::convert::Into<std::string::String>>(
8254                mut self,
8255                v: T,
8256            ) -> Self {
8257                self.dataset_id_prefix = v.into();
8258                self
8259            }
8260
8261            /// Sets the value of [kms_key_name][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::kms_key_name].
8262            pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(
8263                mut self,
8264                v: T,
8265            ) -> Self {
8266                self.kms_key_name = v.into();
8267                self
8268            }
8269        }
8270
8271        impl wkt::message::Message for DatasetTemplate {
8272            fn typename() -> &'static str {
8273                "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SourceHierarchyDatasets.DatasetTemplate"
8274            }
8275        }
8276    }
8277
8278    /// The configuration for BLMT.
8279    #[serde_with::serde_as]
8280    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8281    #[serde(default, rename_all = "camelCase")]
8282    #[non_exhaustive]
8283    pub struct BlmtConfig {
8284        /// Required. The Cloud Storage bucket name.
8285        #[serde(skip_serializing_if = "std::string::String::is_empty")]
8286        pub bucket: std::string::String,
8287
8288        /// The root path inside the Cloud Storage bucket.
8289        #[serde(skip_serializing_if = "std::string::String::is_empty")]
8290        pub root_path: std::string::String,
8291
8292        /// Required. The bigquery connection.
8293        /// Format: `{project}.{location}.{name}`
8294        #[serde(skip_serializing_if = "std::string::String::is_empty")]
8295        pub connection_name: std::string::String,
8296
8297        /// Required. The file format.
8298        pub file_format: crate::model::big_query_destination_config::blmt_config::FileFormat,
8299
8300        /// Required. The table format.
8301        pub table_format: crate::model::big_query_destination_config::blmt_config::TableFormat,
8302
8303        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8304        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8305    }
8306
8307    impl BlmtConfig {
8308        pub fn new() -> Self {
8309            std::default::Default::default()
8310        }
8311
8312        /// Sets the value of [bucket][crate::model::big_query_destination_config::BlmtConfig::bucket].
8313        pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8314            self.bucket = v.into();
8315            self
8316        }
8317
8318        /// Sets the value of [root_path][crate::model::big_query_destination_config::BlmtConfig::root_path].
8319        pub fn set_root_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8320            self.root_path = v.into();
8321            self
8322        }
8323
8324        /// Sets the value of [connection_name][crate::model::big_query_destination_config::BlmtConfig::connection_name].
8325        pub fn set_connection_name<T: std::convert::Into<std::string::String>>(
8326            mut self,
8327            v: T,
8328        ) -> Self {
8329            self.connection_name = v.into();
8330            self
8331        }
8332
8333        /// Sets the value of [file_format][crate::model::big_query_destination_config::BlmtConfig::file_format].
8334        pub fn set_file_format<
8335            T: std::convert::Into<crate::model::big_query_destination_config::blmt_config::FileFormat>,
8336        >(
8337            mut self,
8338            v: T,
8339        ) -> Self {
8340            self.file_format = v.into();
8341            self
8342        }
8343
8344        /// Sets the value of [table_format][crate::model::big_query_destination_config::BlmtConfig::table_format].
8345        pub fn set_table_format<
8346            T: std::convert::Into<
8347                    crate::model::big_query_destination_config::blmt_config::TableFormat,
8348                >,
8349        >(
8350            mut self,
8351            v: T,
8352        ) -> Self {
8353            self.table_format = v.into();
8354            self
8355        }
8356    }
8357
8358    impl wkt::message::Message for BlmtConfig {
8359        fn typename() -> &'static str {
8360            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig"
8361        }
8362    }
8363
8364    /// Defines additional types related to [BlmtConfig].
8365    pub mod blmt_config {
8366        #[allow(unused_imports)]
8367        use super::*;
8368
8369        /// Supported file formats for BigLake managed tables.
8370        #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8371        pub struct FileFormat(i32);
8372
8373        impl FileFormat {
8374            /// Default value.
8375            pub const FILE_FORMAT_UNSPECIFIED: FileFormat = FileFormat::new(0);
8376
8377            /// Parquet file format.
8378            pub const PARQUET: FileFormat = FileFormat::new(1);
8379
8380            /// Creates a new FileFormat instance.
8381            pub(crate) const fn new(value: i32) -> Self {
8382                Self(value)
8383            }
8384
8385            /// Gets the enum value.
8386            pub fn value(&self) -> i32 {
8387                self.0
8388            }
8389
8390            /// Gets the enum value as a string.
8391            pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
8392                match self.0 {
8393                    0 => std::borrow::Cow::Borrowed("FILE_FORMAT_UNSPECIFIED"),
8394                    1 => std::borrow::Cow::Borrowed("PARQUET"),
8395                    _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
8396                }
8397            }
8398
8399            /// Creates an enum value from the value name.
8400            pub fn from_str_name(name: &str) -> std::option::Option<Self> {
8401                match name {
8402                    "FILE_FORMAT_UNSPECIFIED" => {
8403                        std::option::Option::Some(Self::FILE_FORMAT_UNSPECIFIED)
8404                    }
8405                    "PARQUET" => std::option::Option::Some(Self::PARQUET),
8406                    _ => std::option::Option::None,
8407                }
8408            }
8409        }
8410
8411        impl std::convert::From<i32> for FileFormat {
8412            fn from(value: i32) -> Self {
8413                Self::new(value)
8414            }
8415        }
8416
8417        impl std::default::Default for FileFormat {
8418            fn default() -> Self {
8419                Self::new(0)
8420            }
8421        }
8422
8423        /// Supported table formats for BigLake managed tables.
8424        #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8425        pub struct TableFormat(i32);
8426
8427        impl TableFormat {
8428            /// Default value.
8429            pub const TABLE_FORMAT_UNSPECIFIED: TableFormat = TableFormat::new(0);
8430
8431            /// Iceberg table format.
8432            pub const ICEBERG: TableFormat = TableFormat::new(1);
8433
8434            /// Creates a new TableFormat instance.
8435            pub(crate) const fn new(value: i32) -> Self {
8436                Self(value)
8437            }
8438
8439            /// Gets the enum value.
8440            pub fn value(&self) -> i32 {
8441                self.0
8442            }
8443
8444            /// Gets the enum value as a string.
8445            pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
8446                match self.0 {
8447                    0 => std::borrow::Cow::Borrowed("TABLE_FORMAT_UNSPECIFIED"),
8448                    1 => std::borrow::Cow::Borrowed("ICEBERG"),
8449                    _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
8450                }
8451            }
8452
8453            /// Creates an enum value from the value name.
8454            pub fn from_str_name(name: &str) -> std::option::Option<Self> {
8455                match name {
8456                    "TABLE_FORMAT_UNSPECIFIED" => {
8457                        std::option::Option::Some(Self::TABLE_FORMAT_UNSPECIFIED)
8458                    }
8459                    "ICEBERG" => std::option::Option::Some(Self::ICEBERG),
8460                    _ => std::option::Option::None,
8461                }
8462            }
8463        }
8464
8465        impl std::convert::From<i32> for TableFormat {
8466            fn from(value: i32) -> Self {
8467                Self::new(value)
8468            }
8469        }
8470
8471        impl std::default::Default for TableFormat {
8472            fn default() -> Self {
8473                Self::new(0)
8474            }
8475        }
8476    }
8477
8478    /// AppendOnly mode defines that all changes to a table will be written to the
8479    /// destination table.
8480    #[serde_with::serde_as]
8481    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8482    #[serde(default, rename_all = "camelCase")]
8483    #[non_exhaustive]
8484    pub struct AppendOnly {
8485        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8486        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8487    }
8488
8489    impl AppendOnly {
8490        pub fn new() -> Self {
8491            std::default::Default::default()
8492        }
8493    }
8494
8495    impl wkt::message::Message for AppendOnly {
8496        fn typename() -> &'static str {
8497            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.AppendOnly"
8498        }
8499    }
8500
8501    /// Merge mode defines that all changes to a table will be merged at the
8502    /// destination table.
8503    #[serde_with::serde_as]
8504    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8505    #[serde(default, rename_all = "camelCase")]
8506    #[non_exhaustive]
8507    pub struct Merge {
8508        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8509        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8510    }
8511
8512    impl Merge {
8513        pub fn new() -> Self {
8514            std::default::Default::default()
8515        }
8516    }
8517
8518    impl wkt::message::Message for Merge {
8519        fn typename() -> &'static str {
8520            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.Merge"
8521        }
8522    }
8523
8524    /// Target dataset(s) configuration.
8525    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8526    #[serde(rename_all = "camelCase")]
8527    #[non_exhaustive]
8528    pub enum DatasetConfig {
8529        /// Single destination dataset.
8530        SingleTargetDataset(
8531            std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
8532        ),
8533        /// Source hierarchy datasets.
8534        SourceHierarchyDatasets(
8535            std::boxed::Box<crate::model::big_query_destination_config::SourceHierarchyDatasets>,
8536        ),
8537    }
8538
8539    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8540    #[serde(rename_all = "camelCase")]
8541    #[non_exhaustive]
8542    pub enum WriteMode {
8543        /// The standard mode
8544        Merge(std::boxed::Box<crate::model::big_query_destination_config::Merge>),
8545        /// Append only mode
8546        AppendOnly(std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>),
8547    }
8548}
8549
8550/// The configuration of the stream destination.
8551#[serde_with::serde_as]
8552#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8553#[serde(default, rename_all = "camelCase")]
8554#[non_exhaustive]
8555pub struct DestinationConfig {
8556    /// Required. Destination connection profile resource.
8557    /// Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
8558    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8559    pub destination_connection_profile: std::string::String,
8560
8561    /// Stream configuration that is specific to the data destination type.
8562    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
8563    pub destination_stream_config:
8564        std::option::Option<crate::model::destination_config::DestinationStreamConfig>,
8565
8566    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8567    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8568}
8569
8570impl DestinationConfig {
8571    pub fn new() -> Self {
8572        std::default::Default::default()
8573    }
8574
8575    /// Sets the value of [destination_connection_profile][crate::model::DestinationConfig::destination_connection_profile].
8576    pub fn set_destination_connection_profile<T: std::convert::Into<std::string::String>>(
8577        mut self,
8578        v: T,
8579    ) -> Self {
8580        self.destination_connection_profile = v.into();
8581        self
8582    }
8583
8584    /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config].
8585    ///
8586    /// Note that all the setters affecting `destination_stream_config` are mutually
8587    /// exclusive.
8588    pub fn set_destination_stream_config<
8589        T: std::convert::Into<
8590                std::option::Option<crate::model::destination_config::DestinationStreamConfig>,
8591            >,
8592    >(
8593        mut self,
8594        v: T,
8595    ) -> Self {
8596        self.destination_stream_config = v.into();
8597        self
8598    }
8599
8600    /// The value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
8601    /// if it holds a `GcsDestinationConfig`, `None` if the field is not set or
8602    /// holds a different branch.
8603    pub fn gcs_destination_config(
8604        &self,
8605    ) -> std::option::Option<&std::boxed::Box<crate::model::GcsDestinationConfig>> {
8606        #[allow(unreachable_patterns)]
8607        self.destination_stream_config
8608            .as_ref()
8609            .and_then(|v| match v {
8610                crate::model::destination_config::DestinationStreamConfig::GcsDestinationConfig(
8611                    v,
8612                ) => std::option::Option::Some(v),
8613                _ => std::option::Option::None,
8614            })
8615    }
8616
8617    /// The value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
8618    /// if it holds a `BigqueryDestinationConfig`, `None` if the field is not set or
8619    /// holds a different branch.
8620    pub fn bigquery_destination_config(
8621        &self,
8622    ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryDestinationConfig>> {
8623        #[allow(unreachable_patterns)]
8624        self.destination_stream_config.as_ref().and_then(|v| match v {
8625            crate::model::destination_config::DestinationStreamConfig::BigqueryDestinationConfig(v) => std::option::Option::Some(v),
8626            _ => std::option::Option::None,
8627        })
8628    }
8629
8630    /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
8631    /// to hold a `GcsDestinationConfig`.
8632    ///
8633    /// Note that all the setters affecting `destination_stream_config` are
8634    /// mutually exclusive.
8635    pub fn set_gcs_destination_config<
8636        T: std::convert::Into<std::boxed::Box<crate::model::GcsDestinationConfig>>,
8637    >(
8638        mut self,
8639        v: T,
8640    ) -> Self {
8641        self.destination_stream_config = std::option::Option::Some(
8642            crate::model::destination_config::DestinationStreamConfig::GcsDestinationConfig(
8643                v.into(),
8644            ),
8645        );
8646        self
8647    }
8648
8649    /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
8650    /// to hold a `BigqueryDestinationConfig`.
8651    ///
8652    /// Note that all the setters affecting `destination_stream_config` are
8653    /// mutually exclusive.
8654    pub fn set_bigquery_destination_config<
8655        T: std::convert::Into<std::boxed::Box<crate::model::BigQueryDestinationConfig>>,
8656    >(
8657        mut self,
8658        v: T,
8659    ) -> Self {
8660        self.destination_stream_config = std::option::Option::Some(
8661            crate::model::destination_config::DestinationStreamConfig::BigqueryDestinationConfig(
8662                v.into(),
8663            ),
8664        );
8665        self
8666    }
8667}
8668
8669impl wkt::message::Message for DestinationConfig {
8670    fn typename() -> &'static str {
8671        "type.googleapis.com/google.cloud.datastream.v1.DestinationConfig"
8672    }
8673}
8674
8675/// Defines additional types related to [DestinationConfig].
8676pub mod destination_config {
8677    #[allow(unused_imports)]
8678    use super::*;
8679
8680    /// Stream configuration that is specific to the data destination type.
8681    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8682    #[serde(rename_all = "camelCase")]
8683    #[non_exhaustive]
8684    pub enum DestinationStreamConfig {
8685        /// A configuration for how data should be loaded to Cloud Storage.
8686        GcsDestinationConfig(std::boxed::Box<crate::model::GcsDestinationConfig>),
8687        /// BigQuery destination configuration.
8688        BigqueryDestinationConfig(std::boxed::Box<crate::model::BigQueryDestinationConfig>),
8689    }
8690}
8691
8692/// A resource representing streaming data from a source to a destination.
8693#[serde_with::serde_as]
8694#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8695#[serde(default, rename_all = "camelCase")]
8696#[non_exhaustive]
8697pub struct Stream {
8698    /// Output only. Identifier. The stream's name.
8699    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8700    pub name: std::string::String,
8701
8702    /// Output only. The creation time of the stream.
8703    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8704    pub create_time: std::option::Option<wkt::Timestamp>,
8705
8706    /// Output only. The last update time of the stream.
8707    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8708    pub update_time: std::option::Option<wkt::Timestamp>,
8709
8710    /// Labels.
8711    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
8712    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8713
8714    /// Required. Display name.
8715    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8716    pub display_name: std::string::String,
8717
8718    /// Required. Source connection profile configuration.
8719    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8720    pub source_config: std::option::Option<crate::model::SourceConfig>,
8721
8722    /// Required. Destination connection profile configuration.
8723    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8724    pub destination_config: std::option::Option<crate::model::DestinationConfig>,
8725
8726    /// The state of the stream.
8727    pub state: crate::model::stream::State,
8728
8729    /// Output only. Errors on the Stream.
8730    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8731    pub errors: std::vec::Vec<crate::model::Error>,
8732
8733    /// Immutable. A reference to a KMS encryption key.
8734    /// If provided, it will be used to encrypt the data.
8735    /// If left blank, data will be encrypted using an internal Stream-specific
8736    /// encryption key provisioned through KMS.
8737    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8738    pub customer_managed_encryption_key: std::option::Option<std::string::String>,
8739
8740    /// Output only. If the stream was recovered, the time of the last recovery.
8741    /// Note: This field is currently experimental.
8742    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8743    pub last_recovery_time: std::option::Option<wkt::Timestamp>,
8744
8745    /// Output only. Reserved for future use.
8746    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8747    pub satisfies_pzs: std::option::Option<bool>,
8748
8749    /// Output only. Reserved for future use.
8750    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8751    pub satisfies_pzi: std::option::Option<bool>,
8752
8753    /// Stream backfill strategy.
8754    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
8755    pub backfill_strategy: std::option::Option<crate::model::stream::BackfillStrategy>,
8756
8757    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8758    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8759}
8760
8761impl Stream {
8762    pub fn new() -> Self {
8763        std::default::Default::default()
8764    }
8765
8766    /// Sets the value of [name][crate::model::Stream::name].
8767    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8768        self.name = v.into();
8769        self
8770    }
8771
8772    /// Sets the value of [create_time][crate::model::Stream::create_time].
8773    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
8774        mut self,
8775        v: T,
8776    ) -> Self {
8777        self.create_time = v.into();
8778        self
8779    }
8780
8781    /// Sets the value of [update_time][crate::model::Stream::update_time].
8782    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
8783        mut self,
8784        v: T,
8785    ) -> Self {
8786        self.update_time = v.into();
8787        self
8788    }
8789
8790    /// Sets the value of [display_name][crate::model::Stream::display_name].
8791    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8792        self.display_name = v.into();
8793        self
8794    }
8795
8796    /// Sets the value of [source_config][crate::model::Stream::source_config].
8797    pub fn set_source_config<
8798        T: std::convert::Into<std::option::Option<crate::model::SourceConfig>>,
8799    >(
8800        mut self,
8801        v: T,
8802    ) -> Self {
8803        self.source_config = v.into();
8804        self
8805    }
8806
8807    /// Sets the value of [destination_config][crate::model::Stream::destination_config].
8808    pub fn set_destination_config<
8809        T: std::convert::Into<std::option::Option<crate::model::DestinationConfig>>,
8810    >(
8811        mut self,
8812        v: T,
8813    ) -> Self {
8814        self.destination_config = v.into();
8815        self
8816    }
8817
8818    /// Sets the value of [state][crate::model::Stream::state].
8819    pub fn set_state<T: std::convert::Into<crate::model::stream::State>>(mut self, v: T) -> Self {
8820        self.state = v.into();
8821        self
8822    }
8823
8824    /// Sets the value of [customer_managed_encryption_key][crate::model::Stream::customer_managed_encryption_key].
8825    pub fn set_customer_managed_encryption_key<
8826        T: std::convert::Into<std::option::Option<std::string::String>>,
8827    >(
8828        mut self,
8829        v: T,
8830    ) -> Self {
8831        self.customer_managed_encryption_key = v.into();
8832        self
8833    }
8834
8835    /// Sets the value of [last_recovery_time][crate::model::Stream::last_recovery_time].
8836    pub fn set_last_recovery_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
8837        mut self,
8838        v: T,
8839    ) -> Self {
8840        self.last_recovery_time = v.into();
8841        self
8842    }
8843
8844    /// Sets the value of [satisfies_pzs][crate::model::Stream::satisfies_pzs].
8845    pub fn set_satisfies_pzs<T: std::convert::Into<std::option::Option<bool>>>(
8846        mut self,
8847        v: T,
8848    ) -> Self {
8849        self.satisfies_pzs = v.into();
8850        self
8851    }
8852
8853    /// Sets the value of [satisfies_pzi][crate::model::Stream::satisfies_pzi].
8854    pub fn set_satisfies_pzi<T: std::convert::Into<std::option::Option<bool>>>(
8855        mut self,
8856        v: T,
8857    ) -> Self {
8858        self.satisfies_pzi = v.into();
8859        self
8860    }
8861
8862    /// Sets the value of [errors][crate::model::Stream::errors].
8863    pub fn set_errors<T, V>(mut self, v: T) -> Self
8864    where
8865        T: std::iter::IntoIterator<Item = V>,
8866        V: std::convert::Into<crate::model::Error>,
8867    {
8868        use std::iter::Iterator;
8869        self.errors = v.into_iter().map(|i| i.into()).collect();
8870        self
8871    }
8872
8873    /// Sets the value of [labels][crate::model::Stream::labels].
8874    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8875    where
8876        T: std::iter::IntoIterator<Item = (K, V)>,
8877        K: std::convert::Into<std::string::String>,
8878        V: std::convert::Into<std::string::String>,
8879    {
8880        use std::iter::Iterator;
8881        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8882        self
8883    }
8884
8885    /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy].
8886    ///
8887    /// Note that all the setters affecting `backfill_strategy` are mutually
8888    /// exclusive.
8889    pub fn set_backfill_strategy<
8890        T: std::convert::Into<std::option::Option<crate::model::stream::BackfillStrategy>>,
8891    >(
8892        mut self,
8893        v: T,
8894    ) -> Self {
8895        self.backfill_strategy = v.into();
8896        self
8897    }
8898
8899    /// The value of [backfill_strategy][crate::model::Stream::backfill_strategy]
8900    /// if it holds a `BackfillAll`, `None` if the field is not set or
8901    /// holds a different branch.
8902    pub fn backfill_all(
8903        &self,
8904    ) -> std::option::Option<&std::boxed::Box<crate::model::stream::BackfillAllStrategy>> {
8905        #[allow(unreachable_patterns)]
8906        self.backfill_strategy.as_ref().and_then(|v| match v {
8907            crate::model::stream::BackfillStrategy::BackfillAll(v) => std::option::Option::Some(v),
8908            _ => std::option::Option::None,
8909        })
8910    }
8911
8912    /// The value of [backfill_strategy][crate::model::Stream::backfill_strategy]
8913    /// if it holds a `BackfillNone`, `None` if the field is not set or
8914    /// holds a different branch.
8915    pub fn backfill_none(
8916        &self,
8917    ) -> std::option::Option<&std::boxed::Box<crate::model::stream::BackfillNoneStrategy>> {
8918        #[allow(unreachable_patterns)]
8919        self.backfill_strategy.as_ref().and_then(|v| match v {
8920            crate::model::stream::BackfillStrategy::BackfillNone(v) => std::option::Option::Some(v),
8921            _ => std::option::Option::None,
8922        })
8923    }
8924
8925    /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy]
8926    /// to hold a `BackfillAll`.
8927    ///
8928    /// Note that all the setters affecting `backfill_strategy` are
8929    /// mutually exclusive.
8930    pub fn set_backfill_all<
8931        T: std::convert::Into<std::boxed::Box<crate::model::stream::BackfillAllStrategy>>,
8932    >(
8933        mut self,
8934        v: T,
8935    ) -> Self {
8936        self.backfill_strategy = std::option::Option::Some(
8937            crate::model::stream::BackfillStrategy::BackfillAll(v.into()),
8938        );
8939        self
8940    }
8941
8942    /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy]
8943    /// to hold a `BackfillNone`.
8944    ///
8945    /// Note that all the setters affecting `backfill_strategy` are
8946    /// mutually exclusive.
8947    pub fn set_backfill_none<
8948        T: std::convert::Into<std::boxed::Box<crate::model::stream::BackfillNoneStrategy>>,
8949    >(
8950        mut self,
8951        v: T,
8952    ) -> Self {
8953        self.backfill_strategy = std::option::Option::Some(
8954            crate::model::stream::BackfillStrategy::BackfillNone(v.into()),
8955        );
8956        self
8957    }
8958}
8959
8960impl wkt::message::Message for Stream {
8961    fn typename() -> &'static str {
8962        "type.googleapis.com/google.cloud.datastream.v1.Stream"
8963    }
8964}
8965
8966/// Defines additional types related to [Stream].
8967pub mod stream {
8968    #[allow(unused_imports)]
8969    use super::*;
8970
8971    /// Backfill strategy to automatically backfill the Stream's objects.
8972    /// Specific objects can be excluded.
8973    #[serde_with::serde_as]
8974    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8975    #[serde(default, rename_all = "camelCase")]
8976    #[non_exhaustive]
8977    pub struct BackfillAllStrategy {
8978        /// List of objects to exclude.
8979        #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
8980        pub excluded_objects:
8981            std::option::Option<crate::model::stream::backfill_all_strategy::ExcludedObjects>,
8982
8983        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8984        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8985    }
8986
8987    impl BackfillAllStrategy {
8988        pub fn new() -> Self {
8989            std::default::Default::default()
8990        }
8991
8992        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects].
8993        ///
8994        /// Note that all the setters affecting `excluded_objects` are mutually
8995        /// exclusive.
8996        pub fn set_excluded_objects<
8997            T: std::convert::Into<
8998                    std::option::Option<
8999                        crate::model::stream::backfill_all_strategy::ExcludedObjects,
9000                    >,
9001                >,
9002        >(
9003            mut self,
9004            v: T,
9005        ) -> Self {
9006            self.excluded_objects = v.into();
9007            self
9008        }
9009
9010        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
9011        /// if it holds a `OracleExcludedObjects`, `None` if the field is not set or
9012        /// holds a different branch.
9013        pub fn oracle_excluded_objects(
9014            &self,
9015        ) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
9016            #[allow(unreachable_patterns)]
9017            self.excluded_objects.as_ref().and_then(|v| match v {
9018                crate::model::stream::backfill_all_strategy::ExcludedObjects::OracleExcludedObjects(v) => std::option::Option::Some(v),
9019                _ => std::option::Option::None,
9020            })
9021        }
9022
9023        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
9024        /// if it holds a `MysqlExcludedObjects`, `None` if the field is not set or
9025        /// holds a different branch.
9026        pub fn mysql_excluded_objects(
9027            &self,
9028        ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
9029            #[allow(unreachable_patterns)]
9030            self.excluded_objects.as_ref().and_then(|v| match v {
9031                crate::model::stream::backfill_all_strategy::ExcludedObjects::MysqlExcludedObjects(v) => std::option::Option::Some(v),
9032                _ => std::option::Option::None,
9033            })
9034        }
9035
9036        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
9037        /// if it holds a `PostgresqlExcludedObjects`, `None` if the field is not set or
9038        /// holds a different branch.
9039        pub fn postgresql_excluded_objects(
9040            &self,
9041        ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
9042            #[allow(unreachable_patterns)]
9043            self.excluded_objects.as_ref().and_then(|v| match v {
9044                crate::model::stream::backfill_all_strategy::ExcludedObjects::PostgresqlExcludedObjects(v) => std::option::Option::Some(v),
9045                _ => std::option::Option::None,
9046            })
9047        }
9048
9049        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
9050        /// if it holds a `SqlServerExcludedObjects`, `None` if the field is not set or
9051        /// holds a different branch.
9052        pub fn sql_server_excluded_objects(
9053            &self,
9054        ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
9055            #[allow(unreachable_patterns)]
9056            self.excluded_objects.as_ref().and_then(|v| match v {
9057                crate::model::stream::backfill_all_strategy::ExcludedObjects::SqlServerExcludedObjects(v) => std::option::Option::Some(v),
9058                _ => std::option::Option::None,
9059            })
9060        }
9061
9062        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
9063        /// if it holds a `SalesforceExcludedObjects`, `None` if the field is not set or
9064        /// holds a different branch.
9065        pub fn salesforce_excluded_objects(
9066            &self,
9067        ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceOrg>> {
9068            #[allow(unreachable_patterns)]
9069            self.excluded_objects.as_ref().and_then(|v| match v {
9070                crate::model::stream::backfill_all_strategy::ExcludedObjects::SalesforceExcludedObjects(v) => std::option::Option::Some(v),
9071                _ => std::option::Option::None,
9072            })
9073        }
9074
9075        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
9076        /// to hold a `OracleExcludedObjects`.
9077        ///
9078        /// Note that all the setters affecting `excluded_objects` are
9079        /// mutually exclusive.
9080        pub fn set_oracle_excluded_objects<
9081            T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>,
9082        >(
9083            mut self,
9084            v: T,
9085        ) -> Self {
9086            self.excluded_objects = std::option::Option::Some(
9087                crate::model::stream::backfill_all_strategy::ExcludedObjects::OracleExcludedObjects(
9088                    v.into(),
9089                ),
9090            );
9091            self
9092        }
9093
9094        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
9095        /// to hold a `MysqlExcludedObjects`.
9096        ///
9097        /// Note that all the setters affecting `excluded_objects` are
9098        /// mutually exclusive.
9099        pub fn set_mysql_excluded_objects<
9100            T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>,
9101        >(
9102            mut self,
9103            v: T,
9104        ) -> Self {
9105            self.excluded_objects = std::option::Option::Some(
9106                crate::model::stream::backfill_all_strategy::ExcludedObjects::MysqlExcludedObjects(
9107                    v.into(),
9108                ),
9109            );
9110            self
9111        }
9112
9113        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
9114        /// to hold a `PostgresqlExcludedObjects`.
9115        ///
9116        /// Note that all the setters affecting `excluded_objects` are
9117        /// mutually exclusive.
9118        pub fn set_postgresql_excluded_objects<
9119            T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
9120        >(
9121            mut self,
9122            v: T,
9123        ) -> Self {
9124            self.excluded_objects = std::option::Option::Some(
9125                crate::model::stream::backfill_all_strategy::ExcludedObjects::PostgresqlExcludedObjects(
9126                    v.into()
9127                )
9128            );
9129            self
9130        }
9131
9132        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
9133        /// to hold a `SqlServerExcludedObjects`.
9134        ///
9135        /// Note that all the setters affecting `excluded_objects` are
9136        /// mutually exclusive.
9137        pub fn set_sql_server_excluded_objects<
9138            T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
9139        >(
9140            mut self,
9141            v: T,
9142        ) -> Self {
9143            self.excluded_objects = std::option::Option::Some(
9144                crate::model::stream::backfill_all_strategy::ExcludedObjects::SqlServerExcludedObjects(
9145                    v.into()
9146                )
9147            );
9148            self
9149        }
9150
9151        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
9152        /// to hold a `SalesforceExcludedObjects`.
9153        ///
9154        /// Note that all the setters affecting `excluded_objects` are
9155        /// mutually exclusive.
9156        pub fn set_salesforce_excluded_objects<
9157            T: std::convert::Into<std::boxed::Box<crate::model::SalesforceOrg>>,
9158        >(
9159            mut self,
9160            v: T,
9161        ) -> Self {
9162            self.excluded_objects = std::option::Option::Some(
9163                crate::model::stream::backfill_all_strategy::ExcludedObjects::SalesforceExcludedObjects(
9164                    v.into()
9165                )
9166            );
9167            self
9168        }
9169    }
9170
9171    impl wkt::message::Message for BackfillAllStrategy {
9172        fn typename() -> &'static str {
9173            "type.googleapis.com/google.cloud.datastream.v1.Stream.BackfillAllStrategy"
9174        }
9175    }
9176
9177    /// Defines additional types related to [BackfillAllStrategy].
9178    pub mod backfill_all_strategy {
9179        #[allow(unused_imports)]
9180        use super::*;
9181
9182        /// List of objects to exclude.
9183        #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9184        #[serde(rename_all = "camelCase")]
9185        #[non_exhaustive]
9186        pub enum ExcludedObjects {
9187            /// Oracle data source objects to avoid backfilling.
9188            OracleExcludedObjects(std::boxed::Box<crate::model::OracleRdbms>),
9189            /// MySQL data source objects to avoid backfilling.
9190            MysqlExcludedObjects(std::boxed::Box<crate::model::MysqlRdbms>),
9191            /// PostgreSQL data source objects to avoid backfilling.
9192            PostgresqlExcludedObjects(std::boxed::Box<crate::model::PostgresqlRdbms>),
9193            /// SQLServer data source objects to avoid backfilling
9194            SqlServerExcludedObjects(std::boxed::Box<crate::model::SqlServerRdbms>),
9195            /// Salesforce data source objects to avoid backfilling
9196            SalesforceExcludedObjects(std::boxed::Box<crate::model::SalesforceOrg>),
9197        }
9198    }
9199
9200    /// Backfill strategy to disable automatic backfill for the Stream's objects.
9201    #[serde_with::serde_as]
9202    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9203    #[serde(default, rename_all = "camelCase")]
9204    #[non_exhaustive]
9205    pub struct BackfillNoneStrategy {
9206        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9207        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9208    }
9209
9210    impl BackfillNoneStrategy {
9211        pub fn new() -> Self {
9212            std::default::Default::default()
9213        }
9214    }
9215
9216    impl wkt::message::Message for BackfillNoneStrategy {
9217        fn typename() -> &'static str {
9218            "type.googleapis.com/google.cloud.datastream.v1.Stream.BackfillNoneStrategy"
9219        }
9220    }
9221
9222    /// Stream state.
9223    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9224    pub struct State(i32);
9225
9226    impl State {
9227        /// Unspecified stream state.
9228        pub const STATE_UNSPECIFIED: State = State::new(0);
9229
9230        /// The stream has been created but has not yet started streaming data.
9231        pub const NOT_STARTED: State = State::new(1);
9232
9233        /// The stream is running.
9234        pub const RUNNING: State = State::new(2);
9235
9236        /// The stream is paused.
9237        pub const PAUSED: State = State::new(3);
9238
9239        /// The stream is in maintenance mode.
9240        ///
9241        /// Updates are rejected on the resource in this state.
9242        pub const MAINTENANCE: State = State::new(4);
9243
9244        /// The stream is experiencing an error that is preventing data from being
9245        /// streamed.
9246        pub const FAILED: State = State::new(5);
9247
9248        /// The stream has experienced a terminal failure.
9249        pub const FAILED_PERMANENTLY: State = State::new(6);
9250
9251        /// The stream is starting, but not yet running.
9252        pub const STARTING: State = State::new(7);
9253
9254        /// The Stream is no longer reading new events, but still writing events in
9255        /// the buffer.
9256        pub const DRAINING: State = State::new(8);
9257
9258        /// Creates a new State instance.
9259        pub(crate) const fn new(value: i32) -> Self {
9260            Self(value)
9261        }
9262
9263        /// Gets the enum value.
9264        pub fn value(&self) -> i32 {
9265            self.0
9266        }
9267
9268        /// Gets the enum value as a string.
9269        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
9270            match self.0 {
9271                0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
9272                1 => std::borrow::Cow::Borrowed("NOT_STARTED"),
9273                2 => std::borrow::Cow::Borrowed("RUNNING"),
9274                3 => std::borrow::Cow::Borrowed("PAUSED"),
9275                4 => std::borrow::Cow::Borrowed("MAINTENANCE"),
9276                5 => std::borrow::Cow::Borrowed("FAILED"),
9277                6 => std::borrow::Cow::Borrowed("FAILED_PERMANENTLY"),
9278                7 => std::borrow::Cow::Borrowed("STARTING"),
9279                8 => std::borrow::Cow::Borrowed("DRAINING"),
9280                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
9281            }
9282        }
9283
9284        /// Creates an enum value from the value name.
9285        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
9286            match name {
9287                "STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
9288                "NOT_STARTED" => std::option::Option::Some(Self::NOT_STARTED),
9289                "RUNNING" => std::option::Option::Some(Self::RUNNING),
9290                "PAUSED" => std::option::Option::Some(Self::PAUSED),
9291                "MAINTENANCE" => std::option::Option::Some(Self::MAINTENANCE),
9292                "FAILED" => std::option::Option::Some(Self::FAILED),
9293                "FAILED_PERMANENTLY" => std::option::Option::Some(Self::FAILED_PERMANENTLY),
9294                "STARTING" => std::option::Option::Some(Self::STARTING),
9295                "DRAINING" => std::option::Option::Some(Self::DRAINING),
9296                _ => std::option::Option::None,
9297            }
9298        }
9299    }
9300
9301    impl std::convert::From<i32> for State {
9302        fn from(value: i32) -> Self {
9303            Self::new(value)
9304        }
9305    }
9306
9307    impl std::default::Default for State {
9308        fn default() -> Self {
9309            Self::new(0)
9310        }
9311    }
9312
9313    /// Stream backfill strategy.
9314    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9315    #[serde(rename_all = "camelCase")]
9316    #[non_exhaustive]
9317    pub enum BackfillStrategy {
9318        /// Automatically backfill objects included in the stream source
9319        /// configuration. Specific objects can be excluded.
9320        BackfillAll(std::boxed::Box<crate::model::stream::BackfillAllStrategy>),
9321        /// Do not automatically backfill any objects.
9322        BackfillNone(std::boxed::Box<crate::model::stream::BackfillNoneStrategy>),
9323    }
9324}
9325
9326/// A specific stream object (e.g a specific DB table).
9327#[serde_with::serde_as]
9328#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9329#[serde(default, rename_all = "camelCase")]
9330#[non_exhaustive]
9331pub struct StreamObject {
9332    /// Output only. Identifier. The object resource's name.
9333    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9334    pub name: std::string::String,
9335
9336    /// Output only. The creation time of the object.
9337    #[serde(skip_serializing_if = "std::option::Option::is_none")]
9338    pub create_time: std::option::Option<wkt::Timestamp>,
9339
9340    /// Output only. The last update time of the object.
9341    #[serde(skip_serializing_if = "std::option::Option::is_none")]
9342    pub update_time: std::option::Option<wkt::Timestamp>,
9343
9344    /// Required. Display name.
9345    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9346    pub display_name: std::string::String,
9347
9348    /// Output only. Active errors on the object.
9349    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
9350    pub errors: std::vec::Vec<crate::model::Error>,
9351
9352    /// The latest backfill job that was initiated for the stream object.
9353    #[serde(skip_serializing_if = "std::option::Option::is_none")]
9354    pub backfill_job: std::option::Option<crate::model::BackfillJob>,
9355
9356    /// The object identifier in the data source.
9357    #[serde(skip_serializing_if = "std::option::Option::is_none")]
9358    pub source_object: std::option::Option<crate::model::SourceObjectIdentifier>,
9359
9360    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9361    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9362}
9363
9364impl StreamObject {
9365    pub fn new() -> Self {
9366        std::default::Default::default()
9367    }
9368
9369    /// Sets the value of [name][crate::model::StreamObject::name].
9370    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9371        self.name = v.into();
9372        self
9373    }
9374
9375    /// Sets the value of [create_time][crate::model::StreamObject::create_time].
9376    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
9377        mut self,
9378        v: T,
9379    ) -> Self {
9380        self.create_time = v.into();
9381        self
9382    }
9383
9384    /// Sets the value of [update_time][crate::model::StreamObject::update_time].
9385    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
9386        mut self,
9387        v: T,
9388    ) -> Self {
9389        self.update_time = v.into();
9390        self
9391    }
9392
9393    /// Sets the value of [display_name][crate::model::StreamObject::display_name].
9394    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9395        self.display_name = v.into();
9396        self
9397    }
9398
9399    /// Sets the value of [backfill_job][crate::model::StreamObject::backfill_job].
9400    pub fn set_backfill_job<
9401        T: std::convert::Into<std::option::Option<crate::model::BackfillJob>>,
9402    >(
9403        mut self,
9404        v: T,
9405    ) -> Self {
9406        self.backfill_job = v.into();
9407        self
9408    }
9409
9410    /// Sets the value of [source_object][crate::model::StreamObject::source_object].
9411    pub fn set_source_object<
9412        T: std::convert::Into<std::option::Option<crate::model::SourceObjectIdentifier>>,
9413    >(
9414        mut self,
9415        v: T,
9416    ) -> Self {
9417        self.source_object = v.into();
9418        self
9419    }
9420
9421    /// Sets the value of [errors][crate::model::StreamObject::errors].
9422    pub fn set_errors<T, V>(mut self, v: T) -> Self
9423    where
9424        T: std::iter::IntoIterator<Item = V>,
9425        V: std::convert::Into<crate::model::Error>,
9426    {
9427        use std::iter::Iterator;
9428        self.errors = v.into_iter().map(|i| i.into()).collect();
9429        self
9430    }
9431}
9432
9433impl wkt::message::Message for StreamObject {
9434    fn typename() -> &'static str {
9435        "type.googleapis.com/google.cloud.datastream.v1.StreamObject"
9436    }
9437}
9438
9439/// Represents an identifier of an object in the data source.
9440#[serde_with::serde_as]
9441#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9442#[serde(default, rename_all = "camelCase")]
9443#[non_exhaustive]
9444pub struct SourceObjectIdentifier {
9445    /// The identifier for an object in the data source.
9446    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
9447    pub source_identifier:
9448        std::option::Option<crate::model::source_object_identifier::SourceIdentifier>,
9449
9450    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9451    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9452}
9453
9454impl SourceObjectIdentifier {
9455    pub fn new() -> Self {
9456        std::default::Default::default()
9457    }
9458
9459    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier].
9460    ///
9461    /// Note that all the setters affecting `source_identifier` are mutually
9462    /// exclusive.
9463    pub fn set_source_identifier<
9464        T: std::convert::Into<
9465                std::option::Option<crate::model::source_object_identifier::SourceIdentifier>,
9466            >,
9467    >(
9468        mut self,
9469        v: T,
9470    ) -> Self {
9471        self.source_identifier = v.into();
9472        self
9473    }
9474
9475    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
9476    /// if it holds a `OracleIdentifier`, `None` if the field is not set or
9477    /// holds a different branch.
9478    pub fn oracle_identifier(
9479        &self,
9480    ) -> std::option::Option<
9481        &std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
9482    > {
9483        #[allow(unreachable_patterns)]
9484        self.source_identifier.as_ref().and_then(|v| match v {
9485            crate::model::source_object_identifier::SourceIdentifier::OracleIdentifier(v) => {
9486                std::option::Option::Some(v)
9487            }
9488            _ => std::option::Option::None,
9489        })
9490    }
9491
9492    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
9493    /// if it holds a `MysqlIdentifier`, `None` if the field is not set or
9494    /// holds a different branch.
9495    pub fn mysql_identifier(
9496        &self,
9497    ) -> std::option::Option<
9498        &std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
9499    > {
9500        #[allow(unreachable_patterns)]
9501        self.source_identifier.as_ref().and_then(|v| match v {
9502            crate::model::source_object_identifier::SourceIdentifier::MysqlIdentifier(v) => {
9503                std::option::Option::Some(v)
9504            }
9505            _ => std::option::Option::None,
9506        })
9507    }
9508
9509    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
9510    /// if it holds a `PostgresqlIdentifier`, `None` if the field is not set or
9511    /// holds a different branch.
9512    pub fn postgresql_identifier(
9513        &self,
9514    ) -> std::option::Option<
9515        &std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
9516    > {
9517        #[allow(unreachable_patterns)]
9518        self.source_identifier.as_ref().and_then(|v| match v {
9519            crate::model::source_object_identifier::SourceIdentifier::PostgresqlIdentifier(v) => {
9520                std::option::Option::Some(v)
9521            }
9522            _ => std::option::Option::None,
9523        })
9524    }
9525
9526    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
9527    /// if it holds a `SqlServerIdentifier`, `None` if the field is not set or
9528    /// holds a different branch.
9529    pub fn sql_server_identifier(
9530        &self,
9531    ) -> std::option::Option<
9532        &std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
9533    > {
9534        #[allow(unreachable_patterns)]
9535        self.source_identifier.as_ref().and_then(|v| match v {
9536            crate::model::source_object_identifier::SourceIdentifier::SqlServerIdentifier(v) => {
9537                std::option::Option::Some(v)
9538            }
9539            _ => std::option::Option::None,
9540        })
9541    }
9542
9543    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
9544    /// if it holds a `SalesforceIdentifier`, `None` if the field is not set or
9545    /// holds a different branch.
9546    pub fn salesforce_identifier(
9547        &self,
9548    ) -> std::option::Option<
9549        &std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>,
9550    > {
9551        #[allow(unreachable_patterns)]
9552        self.source_identifier.as_ref().and_then(|v| match v {
9553            crate::model::source_object_identifier::SourceIdentifier::SalesforceIdentifier(v) => {
9554                std::option::Option::Some(v)
9555            }
9556            _ => std::option::Option::None,
9557        })
9558    }
9559
9560    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
9561    /// to hold a `OracleIdentifier`.
9562    ///
9563    /// Note that all the setters affecting `source_identifier` are
9564    /// mutually exclusive.
9565    pub fn set_oracle_identifier<
9566        T: std::convert::Into<
9567                std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
9568            >,
9569    >(
9570        mut self,
9571        v: T,
9572    ) -> Self {
9573        self.source_identifier = std::option::Option::Some(
9574            crate::model::source_object_identifier::SourceIdentifier::OracleIdentifier(v.into()),
9575        );
9576        self
9577    }
9578
9579    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
9580    /// to hold a `MysqlIdentifier`.
9581    ///
9582    /// Note that all the setters affecting `source_identifier` are
9583    /// mutually exclusive.
9584    pub fn set_mysql_identifier<
9585        T: std::convert::Into<
9586                std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
9587            >,
9588    >(
9589        mut self,
9590        v: T,
9591    ) -> Self {
9592        self.source_identifier = std::option::Option::Some(
9593            crate::model::source_object_identifier::SourceIdentifier::MysqlIdentifier(v.into()),
9594        );
9595        self
9596    }
9597
9598    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
9599    /// to hold a `PostgresqlIdentifier`.
9600    ///
9601    /// Note that all the setters affecting `source_identifier` are
9602    /// mutually exclusive.
9603    pub fn set_postgresql_identifier<
9604        T: std::convert::Into<
9605                std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
9606            >,
9607    >(
9608        mut self,
9609        v: T,
9610    ) -> Self {
9611        self.source_identifier = std::option::Option::Some(
9612            crate::model::source_object_identifier::SourceIdentifier::PostgresqlIdentifier(
9613                v.into(),
9614            ),
9615        );
9616        self
9617    }
9618
9619    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
9620    /// to hold a `SqlServerIdentifier`.
9621    ///
9622    /// Note that all the setters affecting `source_identifier` are
9623    /// mutually exclusive.
9624    pub fn set_sql_server_identifier<
9625        T: std::convert::Into<
9626                std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
9627            >,
9628    >(
9629        mut self,
9630        v: T,
9631    ) -> Self {
9632        self.source_identifier = std::option::Option::Some(
9633            crate::model::source_object_identifier::SourceIdentifier::SqlServerIdentifier(v.into()),
9634        );
9635        self
9636    }
9637
9638    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
9639    /// to hold a `SalesforceIdentifier`.
9640    ///
9641    /// Note that all the setters affecting `source_identifier` are
9642    /// mutually exclusive.
9643    pub fn set_salesforce_identifier<
9644        T: std::convert::Into<
9645                std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>,
9646            >,
9647    >(
9648        mut self,
9649        v: T,
9650    ) -> Self {
9651        self.source_identifier = std::option::Option::Some(
9652            crate::model::source_object_identifier::SourceIdentifier::SalesforceIdentifier(
9653                v.into(),
9654            ),
9655        );
9656        self
9657    }
9658}
9659
9660impl wkt::message::Message for SourceObjectIdentifier {
9661    fn typename() -> &'static str {
9662        "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier"
9663    }
9664}
9665
9666/// Defines additional types related to [SourceObjectIdentifier].
9667pub mod source_object_identifier {
9668    #[allow(unused_imports)]
9669    use super::*;
9670
9671    /// Oracle data source object identifier.
9672    #[serde_with::serde_as]
9673    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9674    #[serde(default, rename_all = "camelCase")]
9675    #[non_exhaustive]
9676    pub struct OracleObjectIdentifier {
9677        /// Required. The schema name.
9678        #[serde(skip_serializing_if = "std::string::String::is_empty")]
9679        pub schema: std::string::String,
9680
9681        /// Required. The table name.
9682        #[serde(skip_serializing_if = "std::string::String::is_empty")]
9683        pub table: std::string::String,
9684
9685        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9686        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9687    }
9688
9689    impl OracleObjectIdentifier {
9690        pub fn new() -> Self {
9691            std::default::Default::default()
9692        }
9693
9694        /// Sets the value of [schema][crate::model::source_object_identifier::OracleObjectIdentifier::schema].
9695        pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9696            self.schema = v.into();
9697            self
9698        }
9699
9700        /// Sets the value of [table][crate::model::source_object_identifier::OracleObjectIdentifier::table].
9701        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9702            self.table = v.into();
9703            self
9704        }
9705    }
9706
9707    impl wkt::message::Message for OracleObjectIdentifier {
9708        fn typename() -> &'static str {
9709            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.OracleObjectIdentifier"
9710        }
9711    }
9712
9713    /// PostgreSQL data source object identifier.
9714    #[serde_with::serde_as]
9715    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9716    #[serde(default, rename_all = "camelCase")]
9717    #[non_exhaustive]
9718    pub struct PostgresqlObjectIdentifier {
9719        /// Required. The schema name.
9720        #[serde(skip_serializing_if = "std::string::String::is_empty")]
9721        pub schema: std::string::String,
9722
9723        /// Required. The table name.
9724        #[serde(skip_serializing_if = "std::string::String::is_empty")]
9725        pub table: std::string::String,
9726
9727        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9728        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9729    }
9730
9731    impl PostgresqlObjectIdentifier {
9732        pub fn new() -> Self {
9733            std::default::Default::default()
9734        }
9735
9736        /// Sets the value of [schema][crate::model::source_object_identifier::PostgresqlObjectIdentifier::schema].
9737        pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9738            self.schema = v.into();
9739            self
9740        }
9741
9742        /// Sets the value of [table][crate::model::source_object_identifier::PostgresqlObjectIdentifier::table].
9743        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9744            self.table = v.into();
9745            self
9746        }
9747    }
9748
9749    impl wkt::message::Message for PostgresqlObjectIdentifier {
9750        fn typename() -> &'static str {
9751            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.PostgresqlObjectIdentifier"
9752        }
9753    }
9754
9755    /// Mysql data source object identifier.
9756    #[serde_with::serde_as]
9757    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9758    #[serde(default, rename_all = "camelCase")]
9759    #[non_exhaustive]
9760    pub struct MysqlObjectIdentifier {
9761        /// Required. The database name.
9762        #[serde(skip_serializing_if = "std::string::String::is_empty")]
9763        pub database: std::string::String,
9764
9765        /// Required. The table name.
9766        #[serde(skip_serializing_if = "std::string::String::is_empty")]
9767        pub table: std::string::String,
9768
9769        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9770        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9771    }
9772
9773    impl MysqlObjectIdentifier {
9774        pub fn new() -> Self {
9775            std::default::Default::default()
9776        }
9777
9778        /// Sets the value of [database][crate::model::source_object_identifier::MysqlObjectIdentifier::database].
9779        pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9780            self.database = v.into();
9781            self
9782        }
9783
9784        /// Sets the value of [table][crate::model::source_object_identifier::MysqlObjectIdentifier::table].
9785        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9786            self.table = v.into();
9787            self
9788        }
9789    }
9790
9791    impl wkt::message::Message for MysqlObjectIdentifier {
9792        fn typename() -> &'static str {
9793            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.MysqlObjectIdentifier"
9794        }
9795    }
9796
9797    /// SQLServer data source object identifier.
9798    #[serde_with::serde_as]
9799    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9800    #[serde(default, rename_all = "camelCase")]
9801    #[non_exhaustive]
9802    pub struct SqlServerObjectIdentifier {
9803        /// Required. The schema name.
9804        #[serde(skip_serializing_if = "std::string::String::is_empty")]
9805        pub schema: std::string::String,
9806
9807        /// Required. The table name.
9808        #[serde(skip_serializing_if = "std::string::String::is_empty")]
9809        pub table: std::string::String,
9810
9811        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9812        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9813    }
9814
9815    impl SqlServerObjectIdentifier {
9816        pub fn new() -> Self {
9817            std::default::Default::default()
9818        }
9819
9820        /// Sets the value of [schema][crate::model::source_object_identifier::SqlServerObjectIdentifier::schema].
9821        pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9822            self.schema = v.into();
9823            self
9824        }
9825
9826        /// Sets the value of [table][crate::model::source_object_identifier::SqlServerObjectIdentifier::table].
9827        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9828            self.table = v.into();
9829            self
9830        }
9831    }
9832
9833    impl wkt::message::Message for SqlServerObjectIdentifier {
9834        fn typename() -> &'static str {
9835            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.SqlServerObjectIdentifier"
9836        }
9837    }
9838
9839    /// Salesforce data source object identifier.
9840    #[serde_with::serde_as]
9841    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9842    #[serde(default, rename_all = "camelCase")]
9843    #[non_exhaustive]
9844    pub struct SalesforceObjectIdentifier {
9845        /// Required. The object name.
9846        #[serde(skip_serializing_if = "std::string::String::is_empty")]
9847        pub object_name: std::string::String,
9848
9849        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9850        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9851    }
9852
9853    impl SalesforceObjectIdentifier {
9854        pub fn new() -> Self {
9855            std::default::Default::default()
9856        }
9857
9858        /// Sets the value of [object_name][crate::model::source_object_identifier::SalesforceObjectIdentifier::object_name].
9859        pub fn set_object_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9860            self.object_name = v.into();
9861            self
9862        }
9863    }
9864
9865    impl wkt::message::Message for SalesforceObjectIdentifier {
9866        fn typename() -> &'static str {
9867            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.SalesforceObjectIdentifier"
9868        }
9869    }
9870
9871    /// The identifier for an object in the data source.
9872    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9873    #[serde(rename_all = "camelCase")]
9874    #[non_exhaustive]
9875    pub enum SourceIdentifier {
9876        /// Oracle data source object identifier.
9877        OracleIdentifier(
9878            std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
9879        ),
9880        /// Mysql data source object identifier.
9881        MysqlIdentifier(
9882            std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
9883        ),
9884        /// PostgreSQL data source object identifier.
9885        PostgresqlIdentifier(
9886            std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
9887        ),
9888        /// SQLServer data source object identifier.
9889        SqlServerIdentifier(
9890            std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
9891        ),
9892        /// Salesforce data source object identifier.
9893        SalesforceIdentifier(
9894            std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>,
9895        ),
9896    }
9897}
9898
9899/// Represents a backfill job on a specific stream object.
9900#[serde_with::serde_as]
9901#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9902#[serde(default, rename_all = "camelCase")]
9903#[non_exhaustive]
9904pub struct BackfillJob {
9905    /// Output only. Backfill job state.
9906    pub state: crate::model::backfill_job::State,
9907
9908    /// Backfill job's triggering reason.
9909    pub trigger: crate::model::backfill_job::Trigger,
9910
9911    /// Output only. Backfill job's start time.
9912    #[serde(skip_serializing_if = "std::option::Option::is_none")]
9913    pub last_start_time: std::option::Option<wkt::Timestamp>,
9914
9915    /// Output only. Backfill job's end time.
9916    #[serde(skip_serializing_if = "std::option::Option::is_none")]
9917    pub last_end_time: std::option::Option<wkt::Timestamp>,
9918
9919    /// Output only. Errors which caused the backfill job to fail.
9920    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
9921    pub errors: std::vec::Vec<crate::model::Error>,
9922
9923    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9924    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9925}
9926
9927impl BackfillJob {
9928    pub fn new() -> Self {
9929        std::default::Default::default()
9930    }
9931
9932    /// Sets the value of [state][crate::model::BackfillJob::state].
9933    pub fn set_state<T: std::convert::Into<crate::model::backfill_job::State>>(
9934        mut self,
9935        v: T,
9936    ) -> Self {
9937        self.state = v.into();
9938        self
9939    }
9940
9941    /// Sets the value of [trigger][crate::model::BackfillJob::trigger].
9942    pub fn set_trigger<T: std::convert::Into<crate::model::backfill_job::Trigger>>(
9943        mut self,
9944        v: T,
9945    ) -> Self {
9946        self.trigger = v.into();
9947        self
9948    }
9949
9950    /// Sets the value of [last_start_time][crate::model::BackfillJob::last_start_time].
9951    pub fn set_last_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
9952        mut self,
9953        v: T,
9954    ) -> Self {
9955        self.last_start_time = v.into();
9956        self
9957    }
9958
9959    /// Sets the value of [last_end_time][crate::model::BackfillJob::last_end_time].
9960    pub fn set_last_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
9961        mut self,
9962        v: T,
9963    ) -> Self {
9964        self.last_end_time = v.into();
9965        self
9966    }
9967
9968    /// Sets the value of [errors][crate::model::BackfillJob::errors].
9969    pub fn set_errors<T, V>(mut self, v: T) -> Self
9970    where
9971        T: std::iter::IntoIterator<Item = V>,
9972        V: std::convert::Into<crate::model::Error>,
9973    {
9974        use std::iter::Iterator;
9975        self.errors = v.into_iter().map(|i| i.into()).collect();
9976        self
9977    }
9978}
9979
9980impl wkt::message::Message for BackfillJob {
9981    fn typename() -> &'static str {
9982        "type.googleapis.com/google.cloud.datastream.v1.BackfillJob"
9983    }
9984}
9985
9986/// Defines additional types related to [BackfillJob].
9987pub mod backfill_job {
9988    #[allow(unused_imports)]
9989    use super::*;
9990
9991    /// State of the stream object's backfill job.
9992    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9993    pub struct State(i32);
9994
9995    impl State {
9996        /// Default value.
9997        pub const STATE_UNSPECIFIED: State = State::new(0);
9998
9999        /// Backfill job was never started for the stream object (stream has backfill
10000        /// strategy defined as manual or object was explicitly excluded from
10001        /// automatic backfill).
10002        pub const NOT_STARTED: State = State::new(1);
10003
10004        /// Backfill job will start pending available resources.
10005        pub const PENDING: State = State::new(2);
10006
10007        /// Backfill job is running.
10008        pub const ACTIVE: State = State::new(3);
10009
10010        /// Backfill job stopped (next job run will start from beginning).
10011        pub const STOPPED: State = State::new(4);
10012
10013        /// Backfill job failed (due to an error).
10014        pub const FAILED: State = State::new(5);
10015
10016        /// Backfill completed successfully.
10017        pub const COMPLETED: State = State::new(6);
10018
10019        /// Backfill job failed since the table structure is currently unsupported
10020        /// for backfill.
10021        pub const UNSUPPORTED: State = State::new(7);
10022
10023        /// Creates a new State instance.
10024        pub(crate) const fn new(value: i32) -> Self {
10025            Self(value)
10026        }
10027
10028        /// Gets the enum value.
10029        pub fn value(&self) -> i32 {
10030            self.0
10031        }
10032
10033        /// Gets the enum value as a string.
10034        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
10035            match self.0 {
10036                0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
10037                1 => std::borrow::Cow::Borrowed("NOT_STARTED"),
10038                2 => std::borrow::Cow::Borrowed("PENDING"),
10039                3 => std::borrow::Cow::Borrowed("ACTIVE"),
10040                4 => std::borrow::Cow::Borrowed("STOPPED"),
10041                5 => std::borrow::Cow::Borrowed("FAILED"),
10042                6 => std::borrow::Cow::Borrowed("COMPLETED"),
10043                7 => std::borrow::Cow::Borrowed("UNSUPPORTED"),
10044                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
10045            }
10046        }
10047
10048        /// Creates an enum value from the value name.
10049        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
10050            match name {
10051                "STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
10052                "NOT_STARTED" => std::option::Option::Some(Self::NOT_STARTED),
10053                "PENDING" => std::option::Option::Some(Self::PENDING),
10054                "ACTIVE" => std::option::Option::Some(Self::ACTIVE),
10055                "STOPPED" => std::option::Option::Some(Self::STOPPED),
10056                "FAILED" => std::option::Option::Some(Self::FAILED),
10057                "COMPLETED" => std::option::Option::Some(Self::COMPLETED),
10058                "UNSUPPORTED" => std::option::Option::Some(Self::UNSUPPORTED),
10059                _ => std::option::Option::None,
10060            }
10061        }
10062    }
10063
10064    impl std::convert::From<i32> for State {
10065        fn from(value: i32) -> Self {
10066            Self::new(value)
10067        }
10068    }
10069
10070    impl std::default::Default for State {
10071        fn default() -> Self {
10072            Self::new(0)
10073        }
10074    }
10075
10076    /// Triggering reason for a backfill job.
10077    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
10078    pub struct Trigger(i32);
10079
10080    impl Trigger {
10081        /// Default value.
10082        pub const TRIGGER_UNSPECIFIED: Trigger = Trigger::new(0);
10083
10084        /// Object backfill job was triggered automatically according to the stream's
10085        /// backfill strategy.
10086        pub const AUTOMATIC: Trigger = Trigger::new(1);
10087
10088        /// Object backfill job was triggered manually using the dedicated API.
10089        pub const MANUAL: Trigger = Trigger::new(2);
10090
10091        /// Creates a new Trigger instance.
10092        pub(crate) const fn new(value: i32) -> Self {
10093            Self(value)
10094        }
10095
10096        /// Gets the enum value.
10097        pub fn value(&self) -> i32 {
10098            self.0
10099        }
10100
10101        /// Gets the enum value as a string.
10102        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
10103            match self.0 {
10104                0 => std::borrow::Cow::Borrowed("TRIGGER_UNSPECIFIED"),
10105                1 => std::borrow::Cow::Borrowed("AUTOMATIC"),
10106                2 => std::borrow::Cow::Borrowed("MANUAL"),
10107                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
10108            }
10109        }
10110
10111        /// Creates an enum value from the value name.
10112        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
10113            match name {
10114                "TRIGGER_UNSPECIFIED" => std::option::Option::Some(Self::TRIGGER_UNSPECIFIED),
10115                "AUTOMATIC" => std::option::Option::Some(Self::AUTOMATIC),
10116                "MANUAL" => std::option::Option::Some(Self::MANUAL),
10117                _ => std::option::Option::None,
10118            }
10119        }
10120    }
10121
10122    impl std::convert::From<i32> for Trigger {
10123        fn from(value: i32) -> Self {
10124            Self::new(value)
10125        }
10126    }
10127
10128    impl std::default::Default for Trigger {
10129        fn default() -> Self {
10130            Self::new(0)
10131        }
10132    }
10133}
10134
10135/// Represent a user-facing Error.
10136#[serde_with::serde_as]
10137#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10138#[serde(default, rename_all = "camelCase")]
10139#[non_exhaustive]
10140pub struct Error {
10141    /// A title that explains the reason for the error.
10142    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10143    pub reason: std::string::String,
10144
10145    /// A unique identifier for this specific error,
10146    /// allowing it to be traced throughout the system in logs and API responses.
10147    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10148    pub error_uuid: std::string::String,
10149
10150    /// A message containing more information about the error that occurred.
10151    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10152    pub message: std::string::String,
10153
10154    /// The time when the error occurred.
10155    #[serde(skip_serializing_if = "std::option::Option::is_none")]
10156    pub error_time: std::option::Option<wkt::Timestamp>,
10157
10158    /// Additional information about the error.
10159    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
10160    pub details: std::collections::HashMap<std::string::String, std::string::String>,
10161
10162    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10163    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10164}
10165
10166impl Error {
10167    pub fn new() -> Self {
10168        std::default::Default::default()
10169    }
10170
10171    /// Sets the value of [reason][crate::model::Error::reason].
10172    pub fn set_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10173        self.reason = v.into();
10174        self
10175    }
10176
10177    /// Sets the value of [error_uuid][crate::model::Error::error_uuid].
10178    pub fn set_error_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10179        self.error_uuid = v.into();
10180        self
10181    }
10182
10183    /// Sets the value of [message][crate::model::Error::message].
10184    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10185        self.message = v.into();
10186        self
10187    }
10188
10189    /// Sets the value of [error_time][crate::model::Error::error_time].
10190    pub fn set_error_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
10191        mut self,
10192        v: T,
10193    ) -> Self {
10194        self.error_time = v.into();
10195        self
10196    }
10197
10198    /// Sets the value of [details][crate::model::Error::details].
10199    pub fn set_details<T, K, V>(mut self, v: T) -> Self
10200    where
10201        T: std::iter::IntoIterator<Item = (K, V)>,
10202        K: std::convert::Into<std::string::String>,
10203        V: std::convert::Into<std::string::String>,
10204    {
10205        use std::iter::Iterator;
10206        self.details = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10207        self
10208    }
10209}
10210
10211impl wkt::message::Message for Error {
10212    fn typename() -> &'static str {
10213        "type.googleapis.com/google.cloud.datastream.v1.Error"
10214    }
10215}
10216
10217/// Contains the current validation results.
10218#[serde_with::serde_as]
10219#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10220#[serde(default, rename_all = "camelCase")]
10221#[non_exhaustive]
10222pub struct ValidationResult {
10223    /// A list of validations (includes both executed as well as not executed
10224    /// validations).
10225    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
10226    pub validations: std::vec::Vec<crate::model::Validation>,
10227
10228    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10229    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10230}
10231
10232impl ValidationResult {
10233    pub fn new() -> Self {
10234        std::default::Default::default()
10235    }
10236
10237    /// Sets the value of [validations][crate::model::ValidationResult::validations].
10238    pub fn set_validations<T, V>(mut self, v: T) -> Self
10239    where
10240        T: std::iter::IntoIterator<Item = V>,
10241        V: std::convert::Into<crate::model::Validation>,
10242    {
10243        use std::iter::Iterator;
10244        self.validations = v.into_iter().map(|i| i.into()).collect();
10245        self
10246    }
10247}
10248
10249impl wkt::message::Message for ValidationResult {
10250    fn typename() -> &'static str {
10251        "type.googleapis.com/google.cloud.datastream.v1.ValidationResult"
10252    }
10253}
10254
10255/// A validation to perform on a stream.
10256#[serde_with::serde_as]
10257#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10258#[serde(default, rename_all = "camelCase")]
10259#[non_exhaustive]
10260pub struct Validation {
10261    /// A short description of the validation.
10262    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10263    pub description: std::string::String,
10264
10265    /// Output only. Validation execution status.
10266    pub state: crate::model::validation::State,
10267
10268    /// Messages reflecting the validation results.
10269    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
10270    pub message: std::vec::Vec<crate::model::ValidationMessage>,
10271
10272    /// A custom code identifying this validation.
10273    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10274    pub code: std::string::String,
10275
10276    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10277    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10278}
10279
10280impl Validation {
10281    pub fn new() -> Self {
10282        std::default::Default::default()
10283    }
10284
10285    /// Sets the value of [description][crate::model::Validation::description].
10286    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10287        self.description = v.into();
10288        self
10289    }
10290
10291    /// Sets the value of [state][crate::model::Validation::state].
10292    pub fn set_state<T: std::convert::Into<crate::model::validation::State>>(
10293        mut self,
10294        v: T,
10295    ) -> Self {
10296        self.state = v.into();
10297        self
10298    }
10299
10300    /// Sets the value of [code][crate::model::Validation::code].
10301    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10302        self.code = v.into();
10303        self
10304    }
10305
10306    /// Sets the value of [message][crate::model::Validation::message].
10307    pub fn set_message<T, V>(mut self, v: T) -> Self
10308    where
10309        T: std::iter::IntoIterator<Item = V>,
10310        V: std::convert::Into<crate::model::ValidationMessage>,
10311    {
10312        use std::iter::Iterator;
10313        self.message = v.into_iter().map(|i| i.into()).collect();
10314        self
10315    }
10316}
10317
10318impl wkt::message::Message for Validation {
10319    fn typename() -> &'static str {
10320        "type.googleapis.com/google.cloud.datastream.v1.Validation"
10321    }
10322}
10323
10324/// Defines additional types related to [Validation].
10325pub mod validation {
10326    #[allow(unused_imports)]
10327    use super::*;
10328
10329    /// Validation execution state.
10330    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
10331    pub struct State(i32);
10332
10333    impl State {
10334        /// Unspecified state.
10335        pub const STATE_UNSPECIFIED: State = State::new(0);
10336
10337        /// Validation did not execute.
10338        pub const NOT_EXECUTED: State = State::new(1);
10339
10340        /// Validation failed.
10341        pub const FAILED: State = State::new(2);
10342
10343        /// Validation passed.
10344        pub const PASSED: State = State::new(3);
10345
10346        /// Validation executed with warnings.
10347        pub const WARNING: State = State::new(4);
10348
10349        /// Creates a new State instance.
10350        pub(crate) const fn new(value: i32) -> Self {
10351            Self(value)
10352        }
10353
10354        /// Gets the enum value.
10355        pub fn value(&self) -> i32 {
10356            self.0
10357        }
10358
10359        /// Gets the enum value as a string.
10360        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
10361            match self.0 {
10362                0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
10363                1 => std::borrow::Cow::Borrowed("NOT_EXECUTED"),
10364                2 => std::borrow::Cow::Borrowed("FAILED"),
10365                3 => std::borrow::Cow::Borrowed("PASSED"),
10366                4 => std::borrow::Cow::Borrowed("WARNING"),
10367                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
10368            }
10369        }
10370
10371        /// Creates an enum value from the value name.
10372        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
10373            match name {
10374                "STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
10375                "NOT_EXECUTED" => std::option::Option::Some(Self::NOT_EXECUTED),
10376                "FAILED" => std::option::Option::Some(Self::FAILED),
10377                "PASSED" => std::option::Option::Some(Self::PASSED),
10378                "WARNING" => std::option::Option::Some(Self::WARNING),
10379                _ => std::option::Option::None,
10380            }
10381        }
10382    }
10383
10384    impl std::convert::From<i32> for State {
10385        fn from(value: i32) -> Self {
10386            Self::new(value)
10387        }
10388    }
10389
10390    impl std::default::Default for State {
10391        fn default() -> Self {
10392            Self::new(0)
10393        }
10394    }
10395}
10396
10397/// Represent user-facing validation result message.
10398#[serde_with::serde_as]
10399#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10400#[serde(default, rename_all = "camelCase")]
10401#[non_exhaustive]
10402pub struct ValidationMessage {
10403    /// The result of the validation.
10404    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10405    pub message: std::string::String,
10406
10407    /// Message severity level (warning or error).
10408    pub level: crate::model::validation_message::Level,
10409
10410    /// Additional metadata related to the result.
10411    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
10412    pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
10413
10414    /// A custom code identifying this specific message.
10415    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10416    pub code: std::string::String,
10417
10418    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10419    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10420}
10421
10422impl ValidationMessage {
10423    pub fn new() -> Self {
10424        std::default::Default::default()
10425    }
10426
10427    /// Sets the value of [message][crate::model::ValidationMessage::message].
10428    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10429        self.message = v.into();
10430        self
10431    }
10432
10433    /// Sets the value of [level][crate::model::ValidationMessage::level].
10434    pub fn set_level<T: std::convert::Into<crate::model::validation_message::Level>>(
10435        mut self,
10436        v: T,
10437    ) -> Self {
10438        self.level = v.into();
10439        self
10440    }
10441
10442    /// Sets the value of [code][crate::model::ValidationMessage::code].
10443    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10444        self.code = v.into();
10445        self
10446    }
10447
10448    /// Sets the value of [metadata][crate::model::ValidationMessage::metadata].
10449    pub fn set_metadata<T, K, V>(mut self, v: T) -> Self
10450    where
10451        T: std::iter::IntoIterator<Item = (K, V)>,
10452        K: std::convert::Into<std::string::String>,
10453        V: std::convert::Into<std::string::String>,
10454    {
10455        use std::iter::Iterator;
10456        self.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10457        self
10458    }
10459}
10460
10461impl wkt::message::Message for ValidationMessage {
10462    fn typename() -> &'static str {
10463        "type.googleapis.com/google.cloud.datastream.v1.ValidationMessage"
10464    }
10465}
10466
10467/// Defines additional types related to [ValidationMessage].
10468pub mod validation_message {
10469    #[allow(unused_imports)]
10470    use super::*;
10471
10472    /// Validation message level.
10473    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
10474    pub struct Level(i32);
10475
10476    impl Level {
10477        /// Unspecified level.
10478        pub const LEVEL_UNSPECIFIED: Level = Level::new(0);
10479
10480        /// Potentially cause issues with the Stream.
10481        pub const WARNING: Level = Level::new(1);
10482
10483        /// Definitely cause issues with the Stream.
10484        pub const ERROR: Level = Level::new(2);
10485
10486        /// Creates a new Level instance.
10487        pub(crate) const fn new(value: i32) -> Self {
10488            Self(value)
10489        }
10490
10491        /// Gets the enum value.
10492        pub fn value(&self) -> i32 {
10493            self.0
10494        }
10495
10496        /// Gets the enum value as a string.
10497        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
10498            match self.0 {
10499                0 => std::borrow::Cow::Borrowed("LEVEL_UNSPECIFIED"),
10500                1 => std::borrow::Cow::Borrowed("WARNING"),
10501                2 => std::borrow::Cow::Borrowed("ERROR"),
10502                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
10503            }
10504        }
10505
10506        /// Creates an enum value from the value name.
10507        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
10508            match name {
10509                "LEVEL_UNSPECIFIED" => std::option::Option::Some(Self::LEVEL_UNSPECIFIED),
10510                "WARNING" => std::option::Option::Some(Self::WARNING),
10511                "ERROR" => std::option::Option::Some(Self::ERROR),
10512                _ => std::option::Option::None,
10513            }
10514        }
10515    }
10516
10517    impl std::convert::From<i32> for Level {
10518        fn from(value: i32) -> Self {
10519            Self::new(value)
10520        }
10521    }
10522
10523    impl std::default::Default for Level {
10524        fn default() -> Self {
10525            Self::new(0)
10526        }
10527    }
10528}
10529
10530/// The strategy that the stream uses for CDC replication.
10531#[serde_with::serde_as]
10532#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10533#[serde(default, rename_all = "camelCase")]
10534#[non_exhaustive]
10535pub struct CdcStrategy {
10536    /// The position to start reading from when starting, resuming, or recovering
10537    /// the stream.
10538    /// If not set, the system's default value will be used.
10539    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
10540    pub start_position: std::option::Option<crate::model::cdc_strategy::StartPosition>,
10541
10542    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10543    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10544}
10545
10546impl CdcStrategy {
10547    pub fn new() -> Self {
10548        std::default::Default::default()
10549    }
10550
10551    /// Sets the value of [start_position][crate::model::CdcStrategy::start_position].
10552    ///
10553    /// Note that all the setters affecting `start_position` are mutually
10554    /// exclusive.
10555    pub fn set_start_position<
10556        T: std::convert::Into<std::option::Option<crate::model::cdc_strategy::StartPosition>>,
10557    >(
10558        mut self,
10559        v: T,
10560    ) -> Self {
10561        self.start_position = v.into();
10562        self
10563    }
10564
10565    /// The value of [start_position][crate::model::CdcStrategy::start_position]
10566    /// if it holds a `MostRecentStartPosition`, `None` if the field is not set or
10567    /// holds a different branch.
10568    pub fn most_recent_start_position(
10569        &self,
10570    ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>>
10571    {
10572        #[allow(unreachable_patterns)]
10573        self.start_position.as_ref().and_then(|v| match v {
10574            crate::model::cdc_strategy::StartPosition::MostRecentStartPosition(v) => {
10575                std::option::Option::Some(v)
10576            }
10577            _ => std::option::Option::None,
10578        })
10579    }
10580
10581    /// The value of [start_position][crate::model::CdcStrategy::start_position]
10582    /// if it holds a `NextAvailableStartPosition`, `None` if the field is not set or
10583    /// holds a different branch.
10584    pub fn next_available_start_position(
10585        &self,
10586    ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>>
10587    {
10588        #[allow(unreachable_patterns)]
10589        self.start_position.as_ref().and_then(|v| match v {
10590            crate::model::cdc_strategy::StartPosition::NextAvailableStartPosition(v) => {
10591                std::option::Option::Some(v)
10592            }
10593            _ => std::option::Option::None,
10594        })
10595    }
10596
10597    /// The value of [start_position][crate::model::CdcStrategy::start_position]
10598    /// if it holds a `SpecificStartPosition`, `None` if the field is not set or
10599    /// holds a different branch.
10600    pub fn specific_start_position(
10601        &self,
10602    ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>>
10603    {
10604        #[allow(unreachable_patterns)]
10605        self.start_position.as_ref().and_then(|v| match v {
10606            crate::model::cdc_strategy::StartPosition::SpecificStartPosition(v) => {
10607                std::option::Option::Some(v)
10608            }
10609            _ => std::option::Option::None,
10610        })
10611    }
10612
10613    /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
10614    /// to hold a `MostRecentStartPosition`.
10615    ///
10616    /// Note that all the setters affecting `start_position` are
10617    /// mutually exclusive.
10618    pub fn set_most_recent_start_position<
10619        T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>>,
10620    >(
10621        mut self,
10622        v: T,
10623    ) -> Self {
10624        self.start_position = std::option::Option::Some(
10625            crate::model::cdc_strategy::StartPosition::MostRecentStartPosition(v.into()),
10626        );
10627        self
10628    }
10629
10630    /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
10631    /// to hold a `NextAvailableStartPosition`.
10632    ///
10633    /// Note that all the setters affecting `start_position` are
10634    /// mutually exclusive.
10635    pub fn set_next_available_start_position<
10636        T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>>,
10637    >(
10638        mut self,
10639        v: T,
10640    ) -> Self {
10641        self.start_position = std::option::Option::Some(
10642            crate::model::cdc_strategy::StartPosition::NextAvailableStartPosition(v.into()),
10643        );
10644        self
10645    }
10646
10647    /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
10648    /// to hold a `SpecificStartPosition`.
10649    ///
10650    /// Note that all the setters affecting `start_position` are
10651    /// mutually exclusive.
10652    pub fn set_specific_start_position<
10653        T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>>,
10654    >(
10655        mut self,
10656        v: T,
10657    ) -> Self {
10658        self.start_position = std::option::Option::Some(
10659            crate::model::cdc_strategy::StartPosition::SpecificStartPosition(v.into()),
10660        );
10661        self
10662    }
10663}
10664
10665impl wkt::message::Message for CdcStrategy {
10666    fn typename() -> &'static str {
10667        "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy"
10668    }
10669}
10670
10671/// Defines additional types related to [CdcStrategy].
10672pub mod cdc_strategy {
10673    #[allow(unused_imports)]
10674    use super::*;
10675
10676    /// CDC strategy to start replicating from the most recent position in the
10677    /// source.
10678    #[serde_with::serde_as]
10679    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10680    #[serde(default, rename_all = "camelCase")]
10681    #[non_exhaustive]
10682    pub struct MostRecentStartPosition {
10683        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10684        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10685    }
10686
10687    impl MostRecentStartPosition {
10688        pub fn new() -> Self {
10689            std::default::Default::default()
10690        }
10691    }
10692
10693    impl wkt::message::Message for MostRecentStartPosition {
10694        fn typename() -> &'static str {
10695            "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.MostRecentStartPosition"
10696        }
10697    }
10698
10699    /// CDC strategy to resume replication from the next available position in the
10700    /// source.
10701    #[serde_with::serde_as]
10702    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10703    #[serde(default, rename_all = "camelCase")]
10704    #[non_exhaustive]
10705    pub struct NextAvailableStartPosition {
10706        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10707        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10708    }
10709
10710    impl NextAvailableStartPosition {
10711        pub fn new() -> Self {
10712            std::default::Default::default()
10713        }
10714    }
10715
10716    impl wkt::message::Message for NextAvailableStartPosition {
10717        fn typename() -> &'static str {
10718            "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.NextAvailableStartPosition"
10719        }
10720    }
10721
10722    /// CDC strategy to start replicating from a specific position in the source.
10723    #[serde_with::serde_as]
10724    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10725    #[serde(default, rename_all = "camelCase")]
10726    #[non_exhaustive]
10727    pub struct SpecificStartPosition {
10728        #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
10729        pub position:
10730            std::option::Option<crate::model::cdc_strategy::specific_start_position::Position>,
10731
10732        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10733        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10734    }
10735
10736    impl SpecificStartPosition {
10737        pub fn new() -> Self {
10738            std::default::Default::default()
10739        }
10740
10741        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position].
10742        ///
10743        /// Note that all the setters affecting `position` are mutually
10744        /// exclusive.
10745        pub fn set_position<
10746            T: std::convert::Into<
10747                    std::option::Option<
10748                        crate::model::cdc_strategy::specific_start_position::Position,
10749                    >,
10750                >,
10751        >(
10752            mut self,
10753            v: T,
10754        ) -> Self {
10755            self.position = v.into();
10756            self
10757        }
10758
10759        /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
10760        /// if it holds a `MysqlLogPosition`, `None` if the field is not set or
10761        /// holds a different branch.
10762        pub fn mysql_log_position(
10763            &self,
10764        ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlLogPosition>> {
10765            #[allow(unreachable_patterns)]
10766            self.position.as_ref().and_then(|v| match v {
10767                crate::model::cdc_strategy::specific_start_position::Position::MysqlLogPosition(
10768                    v,
10769                ) => std::option::Option::Some(v),
10770                _ => std::option::Option::None,
10771            })
10772        }
10773
10774        /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
10775        /// if it holds a `OracleScnPosition`, `None` if the field is not set or
10776        /// holds a different branch.
10777        pub fn oracle_scn_position(
10778            &self,
10779        ) -> std::option::Option<&std::boxed::Box<crate::model::OracleScnPosition>> {
10780            #[allow(unreachable_patterns)]
10781            self.position.as_ref().and_then(|v| match v {
10782                crate::model::cdc_strategy::specific_start_position::Position::OracleScnPosition(v) => std::option::Option::Some(v),
10783                _ => std::option::Option::None,
10784            })
10785        }
10786
10787        /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
10788        /// if it holds a `SqlServerLsnPosition`, `None` if the field is not set or
10789        /// holds a different branch.
10790        pub fn sql_server_lsn_position(
10791            &self,
10792        ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerLsnPosition>> {
10793            #[allow(unreachable_patterns)]
10794            self.position.as_ref().and_then(|v| match v {
10795                crate::model::cdc_strategy::specific_start_position::Position::SqlServerLsnPosition(v) => std::option::Option::Some(v),
10796                _ => std::option::Option::None,
10797            })
10798        }
10799
10800        /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
10801        /// if it holds a `MysqlGtidPosition`, `None` if the field is not set or
10802        /// holds a different branch.
10803        pub fn mysql_gtid_position(
10804            &self,
10805        ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlGtidPosition>> {
10806            #[allow(unreachable_patterns)]
10807            self.position.as_ref().and_then(|v| match v {
10808                crate::model::cdc_strategy::specific_start_position::Position::MysqlGtidPosition(v) => std::option::Option::Some(v),
10809                _ => std::option::Option::None,
10810            })
10811        }
10812
10813        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
10814        /// to hold a `MysqlLogPosition`.
10815        ///
10816        /// Note that all the setters affecting `position` are
10817        /// mutually exclusive.
10818        pub fn set_mysql_log_position<
10819            T: std::convert::Into<std::boxed::Box<crate::model::MysqlLogPosition>>,
10820        >(
10821            mut self,
10822            v: T,
10823        ) -> Self {
10824            self.position = std::option::Option::Some(
10825                crate::model::cdc_strategy::specific_start_position::Position::MysqlLogPosition(
10826                    v.into(),
10827                ),
10828            );
10829            self
10830        }
10831
10832        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
10833        /// to hold a `OracleScnPosition`.
10834        ///
10835        /// Note that all the setters affecting `position` are
10836        /// mutually exclusive.
10837        pub fn set_oracle_scn_position<
10838            T: std::convert::Into<std::boxed::Box<crate::model::OracleScnPosition>>,
10839        >(
10840            mut self,
10841            v: T,
10842        ) -> Self {
10843            self.position = std::option::Option::Some(
10844                crate::model::cdc_strategy::specific_start_position::Position::OracleScnPosition(
10845                    v.into(),
10846                ),
10847            );
10848            self
10849        }
10850
10851        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
10852        /// to hold a `SqlServerLsnPosition`.
10853        ///
10854        /// Note that all the setters affecting `position` are
10855        /// mutually exclusive.
10856        pub fn set_sql_server_lsn_position<
10857            T: std::convert::Into<std::boxed::Box<crate::model::SqlServerLsnPosition>>,
10858        >(
10859            mut self,
10860            v: T,
10861        ) -> Self {
10862            self.position = std::option::Option::Some(
10863                crate::model::cdc_strategy::specific_start_position::Position::SqlServerLsnPosition(
10864                    v.into(),
10865                ),
10866            );
10867            self
10868        }
10869
10870        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
10871        /// to hold a `MysqlGtidPosition`.
10872        ///
10873        /// Note that all the setters affecting `position` are
10874        /// mutually exclusive.
10875        pub fn set_mysql_gtid_position<
10876            T: std::convert::Into<std::boxed::Box<crate::model::MysqlGtidPosition>>,
10877        >(
10878            mut self,
10879            v: T,
10880        ) -> Self {
10881            self.position = std::option::Option::Some(
10882                crate::model::cdc_strategy::specific_start_position::Position::MysqlGtidPosition(
10883                    v.into(),
10884                ),
10885            );
10886            self
10887        }
10888    }
10889
10890    impl wkt::message::Message for SpecificStartPosition {
10891        fn typename() -> &'static str {
10892            "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.SpecificStartPosition"
10893        }
10894    }
10895
10896    /// Defines additional types related to [SpecificStartPosition].
10897    pub mod specific_start_position {
10898        #[allow(unused_imports)]
10899        use super::*;
10900
10901        #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
10902        #[serde(rename_all = "camelCase")]
10903        #[non_exhaustive]
10904        pub enum Position {
10905            /// MySQL specific log position to start replicating from.
10906            MysqlLogPosition(std::boxed::Box<crate::model::MysqlLogPosition>),
10907            /// Oracle SCN to start replicating from.
10908            OracleScnPosition(std::boxed::Box<crate::model::OracleScnPosition>),
10909            /// SqlServer LSN to start replicating from.
10910            SqlServerLsnPosition(std::boxed::Box<crate::model::SqlServerLsnPosition>),
10911            /// MySQL GTID set to start replicating from.
10912            MysqlGtidPosition(std::boxed::Box<crate::model::MysqlGtidPosition>),
10913        }
10914    }
10915
10916    /// The position to start reading from when starting, resuming, or recovering
10917    /// the stream.
10918    /// If not set, the system's default value will be used.
10919    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
10920    #[serde(rename_all = "camelCase")]
10921    #[non_exhaustive]
10922    pub enum StartPosition {
10923        /// Optional. Start replicating from the most recent position in the source.
10924        MostRecentStartPosition(
10925            std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>,
10926        ),
10927        /// Optional. Resume replication from the next available position in the
10928        /// source.
10929        NextAvailableStartPosition(
10930            std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>,
10931        ),
10932        /// Optional. Start replicating from a specific position in the source.
10933        SpecificStartPosition(std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>),
10934    }
10935}
10936
10937/// SQL Server LSN position
10938#[serde_with::serde_as]
10939#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10940#[serde(default, rename_all = "camelCase")]
10941#[non_exhaustive]
10942pub struct SqlServerLsnPosition {
10943    /// Required. Log sequence number (LSN) from where Logs will be read
10944    #[serde(skip_serializing_if = "std::string::String::is_empty")]
10945    pub lsn: std::string::String,
10946
10947    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10948    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10949}
10950
10951impl SqlServerLsnPosition {
10952    pub fn new() -> Self {
10953        std::default::Default::default()
10954    }
10955
10956    /// Sets the value of [lsn][crate::model::SqlServerLsnPosition::lsn].
10957    pub fn set_lsn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10958        self.lsn = v.into();
10959        self
10960    }
10961}
10962
10963impl wkt::message::Message for SqlServerLsnPosition {
10964    fn typename() -> &'static str {
10965        "type.googleapis.com/google.cloud.datastream.v1.SqlServerLsnPosition"
10966    }
10967}
10968
10969/// Oracle SCN position
10970#[serde_with::serde_as]
10971#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10972#[serde(default, rename_all = "camelCase")]
10973#[non_exhaustive]
10974pub struct OracleScnPosition {
10975    /// Required. SCN number from where Logs will be read
10976    #[serde_as(as = "serde_with::DisplayFromStr")]
10977    pub scn: i64,
10978
10979    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10980    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10981}
10982
10983impl OracleScnPosition {
10984    pub fn new() -> Self {
10985        std::default::Default::default()
10986    }
10987
10988    /// Sets the value of [scn][crate::model::OracleScnPosition::scn].
10989    pub fn set_scn<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10990        self.scn = v.into();
10991        self
10992    }
10993}
10994
10995impl wkt::message::Message for OracleScnPosition {
10996    fn typename() -> &'static str {
10997        "type.googleapis.com/google.cloud.datastream.v1.OracleScnPosition"
10998    }
10999}
11000
11001/// MySQL log position
11002#[serde_with::serde_as]
11003#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11004#[serde(default, rename_all = "camelCase")]
11005#[non_exhaustive]
11006pub struct MysqlLogPosition {
11007    /// Required. The binary log file name.
11008    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11009    pub log_file: std::string::String,
11010
11011    /// Optional. The position within the binary log file. Default is head of file.
11012    #[serde(skip_serializing_if = "std::option::Option::is_none")]
11013    pub log_position: std::option::Option<i32>,
11014
11015    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11016    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11017}
11018
11019impl MysqlLogPosition {
11020    pub fn new() -> Self {
11021        std::default::Default::default()
11022    }
11023
11024    /// Sets the value of [log_file][crate::model::MysqlLogPosition::log_file].
11025    pub fn set_log_file<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11026        self.log_file = v.into();
11027        self
11028    }
11029
11030    /// Sets the value of [log_position][crate::model::MysqlLogPosition::log_position].
11031    pub fn set_log_position<T: std::convert::Into<std::option::Option<i32>>>(
11032        mut self,
11033        v: T,
11034    ) -> Self {
11035        self.log_position = v.into();
11036        self
11037    }
11038}
11039
11040impl wkt::message::Message for MysqlLogPosition {
11041    fn typename() -> &'static str {
11042        "type.googleapis.com/google.cloud.datastream.v1.MysqlLogPosition"
11043    }
11044}
11045
11046/// MySQL GTID position
11047#[serde_with::serde_as]
11048#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11049#[serde(default, rename_all = "camelCase")]
11050#[non_exhaustive]
11051pub struct MysqlGtidPosition {
11052    /// Required. The gtid set to start replication from.
11053    #[serde(skip_serializing_if = "std::string::String::is_empty")]
11054    pub gtid_set: std::string::String,
11055
11056    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11057    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11058}
11059
11060impl MysqlGtidPosition {
11061    pub fn new() -> Self {
11062        std::default::Default::default()
11063    }
11064
11065    /// Sets the value of [gtid_set][crate::model::MysqlGtidPosition::gtid_set].
11066    pub fn set_gtid_set<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11067        self.gtid_set = v.into();
11068        self
11069    }
11070}
11071
11072impl wkt::message::Message for MysqlGtidPosition {
11073    fn typename() -> &'static str {
11074        "type.googleapis.com/google.cloud.datastream.v1.MysqlGtidPosition"
11075    }
11076}