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 lazy_static;
24extern crate location;
25extern crate longrunning;
26extern crate lro;
27extern crate reqwest;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35/// Request message for 'discover' ConnectionProfile request.
36#[serde_with::serde_as]
37#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
38#[serde(default, rename_all = "camelCase")]
39#[non_exhaustive]
40pub struct DiscoverConnectionProfileRequest {
41    /// Required. The parent resource of the connection profile type. Must be in
42    /// the format `projects/*/locations/*`.
43    #[serde(skip_serializing_if = "std::string::String::is_empty")]
44    pub parent: std::string::String,
45
46    /// The connection profile on which to run discover.
47    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
48    pub target: std::option::Option<crate::model::discover_connection_profile_request::Target>,
49
50    /// The depth of the retrieved hierarchy of data objects.
51    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
52    pub hierarchy:
53        std::option::Option<crate::model::discover_connection_profile_request::Hierarchy>,
54
55    /// The data object to populate with child data objects and metadata.
56    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
57    pub data_object:
58        std::option::Option<crate::model::discover_connection_profile_request::DataObject>,
59}
60
61impl DiscoverConnectionProfileRequest {
62    pub fn new() -> Self {
63        std::default::Default::default()
64    }
65
66    /// Sets the value of [parent][crate::model::DiscoverConnectionProfileRequest::parent].
67    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
68        self.parent = v.into();
69        self
70    }
71
72    /// Sets the value of `target`.
73    pub fn set_target<
74        T: std::convert::Into<
75            std::option::Option<crate::model::discover_connection_profile_request::Target>,
76        >,
77    >(
78        mut self,
79        v: T,
80    ) -> Self {
81        self.target = v.into();
82        self
83    }
84
85    /// The value of [target][crate::model::DiscoverConnectionProfileRequest::target]
86    /// if it holds a `ConnectionProfile`, `None` if the field is not set or
87    /// holds a different branch.
88    pub fn get_connection_profile(
89        &self,
90    ) -> std::option::Option<&std::boxed::Box<crate::model::ConnectionProfile>> {
91        #[allow(unreachable_patterns)]
92        self.target.as_ref().and_then(|v| match v {
93            crate::model::discover_connection_profile_request::Target::ConnectionProfile(v) => {
94                std::option::Option::Some(v)
95            }
96            _ => std::option::Option::None,
97        })
98    }
99
100    /// The value of [target][crate::model::DiscoverConnectionProfileRequest::target]
101    /// if it holds a `ConnectionProfileName`, `None` if the field is not set or
102    /// holds a different branch.
103    pub fn get_connection_profile_name(&self) -> std::option::Option<&std::string::String> {
104        #[allow(unreachable_patterns)]
105        self.target.as_ref().and_then(|v| match v {
106            crate::model::discover_connection_profile_request::Target::ConnectionProfileName(v) => {
107                std::option::Option::Some(v)
108            }
109            _ => std::option::Option::None,
110        })
111    }
112
113    /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target]
114    /// to hold a `ConnectionProfile`.
115    ///
116    /// Note that all the setters affecting `target` are
117    /// mutually exclusive.
118    pub fn set_connection_profile<
119        T: std::convert::Into<std::boxed::Box<crate::model::ConnectionProfile>>,
120    >(
121        mut self,
122        v: T,
123    ) -> Self {
124        self.target = std::option::Option::Some(
125            crate::model::discover_connection_profile_request::Target::ConnectionProfile(v.into()),
126        );
127        self
128    }
129
130    /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target]
131    /// to hold a `ConnectionProfileName`.
132    ///
133    /// Note that all the setters affecting `target` are
134    /// mutually exclusive.
135    pub fn set_connection_profile_name<T: std::convert::Into<std::string::String>>(
136        mut self,
137        v: T,
138    ) -> Self {
139        self.target = std::option::Option::Some(
140            crate::model::discover_connection_profile_request::Target::ConnectionProfileName(
141                v.into(),
142            ),
143        );
144        self
145    }
146
147    /// Sets the value of `hierarchy`.
148    pub fn set_hierarchy<
149        T: std::convert::Into<
150            std::option::Option<crate::model::discover_connection_profile_request::Hierarchy>,
151        >,
152    >(
153        mut self,
154        v: T,
155    ) -> Self {
156        self.hierarchy = v.into();
157        self
158    }
159
160    /// The value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
161    /// if it holds a `FullHierarchy`, `None` if the field is not set or
162    /// holds a different branch.
163    pub fn get_full_hierarchy(&self) -> std::option::Option<&bool> {
164        #[allow(unreachable_patterns)]
165        self.hierarchy.as_ref().and_then(|v| match v {
166            crate::model::discover_connection_profile_request::Hierarchy::FullHierarchy(v) => {
167                std::option::Option::Some(v)
168            }
169            _ => std::option::Option::None,
170        })
171    }
172
173    /// The value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
174    /// if it holds a `HierarchyDepth`, `None` if the field is not set or
175    /// holds a different branch.
176    pub fn get_hierarchy_depth(&self) -> std::option::Option<&i32> {
177        #[allow(unreachable_patterns)]
178        self.hierarchy.as_ref().and_then(|v| match v {
179            crate::model::discover_connection_profile_request::Hierarchy::HierarchyDepth(v) => {
180                std::option::Option::Some(v)
181            }
182            _ => std::option::Option::None,
183        })
184    }
185
186    /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
187    /// to hold a `FullHierarchy`.
188    ///
189    /// Note that all the setters affecting `hierarchy` are
190    /// mutually exclusive.
191    pub fn set_full_hierarchy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
192        self.hierarchy = std::option::Option::Some(
193            crate::model::discover_connection_profile_request::Hierarchy::FullHierarchy(v.into()),
194        );
195        self
196    }
197
198    /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
199    /// to hold a `HierarchyDepth`.
200    ///
201    /// Note that all the setters affecting `hierarchy` are
202    /// mutually exclusive.
203    pub fn set_hierarchy_depth<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
204        self.hierarchy = std::option::Option::Some(
205            crate::model::discover_connection_profile_request::Hierarchy::HierarchyDepth(v.into()),
206        );
207        self
208    }
209
210    /// Sets the value of `data_object`.
211    pub fn set_data_object<
212        T: std::convert::Into<
213            std::option::Option<crate::model::discover_connection_profile_request::DataObject>,
214        >,
215    >(
216        mut self,
217        v: T,
218    ) -> Self {
219        self.data_object = v.into();
220        self
221    }
222
223    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
224    /// if it holds a `OracleRdbms`, `None` if the field is not set or
225    /// holds a different branch.
226    pub fn get_oracle_rdbms(
227        &self,
228    ) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
229        #[allow(unreachable_patterns)]
230        self.data_object.as_ref().and_then(|v| match v {
231            crate::model::discover_connection_profile_request::DataObject::OracleRdbms(v) => {
232                std::option::Option::Some(v)
233            }
234            _ => std::option::Option::None,
235        })
236    }
237
238    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
239    /// if it holds a `MysqlRdbms`, `None` if the field is not set or
240    /// holds a different branch.
241    pub fn get_mysql_rdbms(
242        &self,
243    ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
244        #[allow(unreachable_patterns)]
245        self.data_object.as_ref().and_then(|v| match v {
246            crate::model::discover_connection_profile_request::DataObject::MysqlRdbms(v) => {
247                std::option::Option::Some(v)
248            }
249            _ => std::option::Option::None,
250        })
251    }
252
253    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
254    /// if it holds a `PostgresqlRdbms`, `None` if the field is not set or
255    /// holds a different branch.
256    pub fn get_postgresql_rdbms(
257        &self,
258    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
259        #[allow(unreachable_patterns)]
260        self.data_object.as_ref().and_then(|v| match v {
261            crate::model::discover_connection_profile_request::DataObject::PostgresqlRdbms(v) => {
262                std::option::Option::Some(v)
263            }
264            _ => std::option::Option::None,
265        })
266    }
267
268    /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
269    /// if it holds a `SqlServerRdbms`, `None` if the field is not set or
270    /// holds a different branch.
271    pub fn get_sql_server_rdbms(
272        &self,
273    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
274        #[allow(unreachable_patterns)]
275        self.data_object.as_ref().and_then(|v| match v {
276            crate::model::discover_connection_profile_request::DataObject::SqlServerRdbms(v) => {
277                std::option::Option::Some(v)
278            }
279            _ => std::option::Option::None,
280        })
281    }
282
283    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
284    /// to hold a `OracleRdbms`.
285    ///
286    /// Note that all the setters affecting `data_object` are
287    /// mutually exclusive.
288    pub fn set_oracle_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>>(
289        mut self,
290        v: T,
291    ) -> Self {
292        self.data_object = std::option::Option::Some(
293            crate::model::discover_connection_profile_request::DataObject::OracleRdbms(v.into()),
294        );
295        self
296    }
297
298    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
299    /// to hold a `MysqlRdbms`.
300    ///
301    /// Note that all the setters affecting `data_object` are
302    /// mutually exclusive.
303    pub fn set_mysql_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>>(
304        mut self,
305        v: T,
306    ) -> Self {
307        self.data_object = std::option::Option::Some(
308            crate::model::discover_connection_profile_request::DataObject::MysqlRdbms(v.into()),
309        );
310        self
311    }
312
313    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
314    /// to hold a `PostgresqlRdbms`.
315    ///
316    /// Note that all the setters affecting `data_object` are
317    /// mutually exclusive.
318    pub fn set_postgresql_rdbms<
319        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
320    >(
321        mut self,
322        v: T,
323    ) -> Self {
324        self.data_object = std::option::Option::Some(
325            crate::model::discover_connection_profile_request::DataObject::PostgresqlRdbms(
326                v.into(),
327            ),
328        );
329        self
330    }
331
332    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
333    /// to hold a `SqlServerRdbms`.
334    ///
335    /// Note that all the setters affecting `data_object` are
336    /// mutually exclusive.
337    pub fn set_sql_server_rdbms<
338        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
339    >(
340        mut self,
341        v: T,
342    ) -> Self {
343        self.data_object = std::option::Option::Some(
344            crate::model::discover_connection_profile_request::DataObject::SqlServerRdbms(v.into()),
345        );
346        self
347    }
348}
349
350impl wkt::message::Message for DiscoverConnectionProfileRequest {
351    fn typename() -> &'static str {
352        "type.googleapis.com/google.cloud.datastream.v1.DiscoverConnectionProfileRequest"
353    }
354}
355
356/// Defines additional types related to DiscoverConnectionProfileRequest
357pub mod discover_connection_profile_request {
358    #[allow(unused_imports)]
359    use super::*;
360
361    /// The connection profile on which to run discover.
362    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
363    #[serde(rename_all = "camelCase")]
364    #[non_exhaustive]
365    pub enum Target {
366        /// An ad-hoc connection profile configuration.
367        ConnectionProfile(std::boxed::Box<crate::model::ConnectionProfile>),
368        /// A reference to an existing connection profile.
369        ConnectionProfileName(std::string::String),
370    }
371
372    /// The depth of the retrieved hierarchy of data objects.
373    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
374    #[serde(rename_all = "camelCase")]
375    #[non_exhaustive]
376    pub enum Hierarchy {
377        /// Whether to retrieve the full hierarchy of data objects (TRUE) or only the
378        /// current level (FALSE).
379        FullHierarchy(bool),
380        /// The number of hierarchy levels below the current level to be retrieved.
381        HierarchyDepth(i32),
382    }
383
384    /// The data object to populate with child data objects and metadata.
385    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
386    #[serde(rename_all = "camelCase")]
387    #[non_exhaustive]
388    pub enum DataObject {
389        /// Oracle RDBMS to enrich with child data objects and metadata.
390        OracleRdbms(std::boxed::Box<crate::model::OracleRdbms>),
391        /// MySQL RDBMS to enrich with child data objects and metadata.
392        MysqlRdbms(std::boxed::Box<crate::model::MysqlRdbms>),
393        /// PostgreSQL RDBMS to enrich with child data objects and metadata.
394        PostgresqlRdbms(std::boxed::Box<crate::model::PostgresqlRdbms>),
395        /// SQLServer RDBMS to enrich with child data objects and metadata.
396        SqlServerRdbms(std::boxed::Box<crate::model::SqlServerRdbms>),
397    }
398}
399
400/// Response from a discover request.
401#[serde_with::serde_as]
402#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
403#[serde(default, rename_all = "camelCase")]
404#[non_exhaustive]
405pub struct DiscoverConnectionProfileResponse {
406    /// The data object that has been enriched by the discover API call.
407    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
408    pub data_object:
409        std::option::Option<crate::model::discover_connection_profile_response::DataObject>,
410}
411
412impl DiscoverConnectionProfileResponse {
413    pub fn new() -> Self {
414        std::default::Default::default()
415    }
416
417    /// Sets the value of `data_object`.
418    pub fn set_data_object<
419        T: std::convert::Into<
420            std::option::Option<crate::model::discover_connection_profile_response::DataObject>,
421        >,
422    >(
423        mut self,
424        v: T,
425    ) -> Self {
426        self.data_object = v.into();
427        self
428    }
429
430    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
431    /// if it holds a `OracleRdbms`, `None` if the field is not set or
432    /// holds a different branch.
433    pub fn get_oracle_rdbms(
434        &self,
435    ) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
436        #[allow(unreachable_patterns)]
437        self.data_object.as_ref().and_then(|v| match v {
438            crate::model::discover_connection_profile_response::DataObject::OracleRdbms(v) => {
439                std::option::Option::Some(v)
440            }
441            _ => std::option::Option::None,
442        })
443    }
444
445    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
446    /// if it holds a `MysqlRdbms`, `None` if the field is not set or
447    /// holds a different branch.
448    pub fn get_mysql_rdbms(
449        &self,
450    ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
451        #[allow(unreachable_patterns)]
452        self.data_object.as_ref().and_then(|v| match v {
453            crate::model::discover_connection_profile_response::DataObject::MysqlRdbms(v) => {
454                std::option::Option::Some(v)
455            }
456            _ => std::option::Option::None,
457        })
458    }
459
460    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
461    /// if it holds a `PostgresqlRdbms`, `None` if the field is not set or
462    /// holds a different branch.
463    pub fn get_postgresql_rdbms(
464        &self,
465    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
466        #[allow(unreachable_patterns)]
467        self.data_object.as_ref().and_then(|v| match v {
468            crate::model::discover_connection_profile_response::DataObject::PostgresqlRdbms(v) => {
469                std::option::Option::Some(v)
470            }
471            _ => std::option::Option::None,
472        })
473    }
474
475    /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
476    /// if it holds a `SqlServerRdbms`, `None` if the field is not set or
477    /// holds a different branch.
478    pub fn get_sql_server_rdbms(
479        &self,
480    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
481        #[allow(unreachable_patterns)]
482        self.data_object.as_ref().and_then(|v| match v {
483            crate::model::discover_connection_profile_response::DataObject::SqlServerRdbms(v) => {
484                std::option::Option::Some(v)
485            }
486            _ => std::option::Option::None,
487        })
488    }
489
490    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
491    /// to hold a `OracleRdbms`.
492    ///
493    /// Note that all the setters affecting `data_object` are
494    /// mutually exclusive.
495    pub fn set_oracle_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>>(
496        mut self,
497        v: T,
498    ) -> Self {
499        self.data_object = std::option::Option::Some(
500            crate::model::discover_connection_profile_response::DataObject::OracleRdbms(v.into()),
501        );
502        self
503    }
504
505    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
506    /// to hold a `MysqlRdbms`.
507    ///
508    /// Note that all the setters affecting `data_object` are
509    /// mutually exclusive.
510    pub fn set_mysql_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>>(
511        mut self,
512        v: T,
513    ) -> Self {
514        self.data_object = std::option::Option::Some(
515            crate::model::discover_connection_profile_response::DataObject::MysqlRdbms(v.into()),
516        );
517        self
518    }
519
520    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
521    /// to hold a `PostgresqlRdbms`.
522    ///
523    /// Note that all the setters affecting `data_object` are
524    /// mutually exclusive.
525    pub fn set_postgresql_rdbms<
526        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
527    >(
528        mut self,
529        v: T,
530    ) -> Self {
531        self.data_object = std::option::Option::Some(
532            crate::model::discover_connection_profile_response::DataObject::PostgresqlRdbms(
533                v.into(),
534            ),
535        );
536        self
537    }
538
539    /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
540    /// to hold a `SqlServerRdbms`.
541    ///
542    /// Note that all the setters affecting `data_object` are
543    /// mutually exclusive.
544    pub fn set_sql_server_rdbms<
545        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
546    >(
547        mut self,
548        v: T,
549    ) -> Self {
550        self.data_object = std::option::Option::Some(
551            crate::model::discover_connection_profile_response::DataObject::SqlServerRdbms(
552                v.into(),
553            ),
554        );
555        self
556    }
557}
558
559impl wkt::message::Message for DiscoverConnectionProfileResponse {
560    fn typename() -> &'static str {
561        "type.googleapis.com/google.cloud.datastream.v1.DiscoverConnectionProfileResponse"
562    }
563}
564
565/// Defines additional types related to DiscoverConnectionProfileResponse
566pub mod discover_connection_profile_response {
567    #[allow(unused_imports)]
568    use super::*;
569
570    /// The data object that has been enriched by the discover API call.
571    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
572    #[serde(rename_all = "camelCase")]
573    #[non_exhaustive]
574    pub enum DataObject {
575        /// Enriched Oracle RDBMS object.
576        OracleRdbms(std::boxed::Box<crate::model::OracleRdbms>),
577        /// Enriched MySQL RDBMS object.
578        MysqlRdbms(std::boxed::Box<crate::model::MysqlRdbms>),
579        /// Enriched PostgreSQL RDBMS object.
580        PostgresqlRdbms(std::boxed::Box<crate::model::PostgresqlRdbms>),
581        /// Enriched SQLServer RDBMS object.
582        SqlServerRdbms(std::boxed::Box<crate::model::SqlServerRdbms>),
583    }
584}
585
586/// Request message for 'FetchStaticIps' request.
587#[serde_with::serde_as]
588#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
589#[serde(default, rename_all = "camelCase")]
590#[non_exhaustive]
591pub struct FetchStaticIpsRequest {
592    /// Required. The resource name for the location for which static IPs should be
593    /// returned. Must be in the format `projects/*/locations/*`.
594    #[serde(skip_serializing_if = "std::string::String::is_empty")]
595    pub name: std::string::String,
596
597    /// Maximum number of Ips to return, will likely not be specified.
598    pub page_size: i32,
599
600    /// A page token, received from a previous `ListStaticIps` call.
601    /// will likely not be specified.
602    #[serde(skip_serializing_if = "std::string::String::is_empty")]
603    pub page_token: std::string::String,
604}
605
606impl FetchStaticIpsRequest {
607    pub fn new() -> Self {
608        std::default::Default::default()
609    }
610
611    /// Sets the value of [name][crate::model::FetchStaticIpsRequest::name].
612    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
613        self.name = v.into();
614        self
615    }
616
617    /// Sets the value of [page_size][crate::model::FetchStaticIpsRequest::page_size].
618    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
619        self.page_size = v.into();
620        self
621    }
622
623    /// Sets the value of [page_token][crate::model::FetchStaticIpsRequest::page_token].
624    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
625        self.page_token = v.into();
626        self
627    }
628}
629
630impl wkt::message::Message for FetchStaticIpsRequest {
631    fn typename() -> &'static str {
632        "type.googleapis.com/google.cloud.datastream.v1.FetchStaticIpsRequest"
633    }
634}
635
636/// Response message for a 'FetchStaticIps' response.
637#[serde_with::serde_as]
638#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
639#[serde(default, rename_all = "camelCase")]
640#[non_exhaustive]
641pub struct FetchStaticIpsResponse {
642    /// list of static ips by account
643    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
644    pub static_ips: std::vec::Vec<std::string::String>,
645
646    /// A token that can be sent as `page_token` to retrieve the next page.
647    /// If this field is omitted, there are no subsequent pages.
648    #[serde(skip_serializing_if = "std::string::String::is_empty")]
649    pub next_page_token: std::string::String,
650}
651
652impl FetchStaticIpsResponse {
653    pub fn new() -> Self {
654        std::default::Default::default()
655    }
656
657    /// Sets the value of [next_page_token][crate::model::FetchStaticIpsResponse::next_page_token].
658    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
659        self.next_page_token = v.into();
660        self
661    }
662
663    /// Sets the value of [static_ips][crate::model::FetchStaticIpsResponse::static_ips].
664    pub fn set_static_ips<T, V>(mut self, v: T) -> Self
665    where
666        T: std::iter::IntoIterator<Item = V>,
667        V: std::convert::Into<std::string::String>,
668    {
669        use std::iter::Iterator;
670        self.static_ips = v.into_iter().map(|i| i.into()).collect();
671        self
672    }
673}
674
675impl wkt::message::Message for FetchStaticIpsResponse {
676    fn typename() -> &'static str {
677        "type.googleapis.com/google.cloud.datastream.v1.FetchStaticIpsResponse"
678    }
679}
680
681/// Request message for listing connection profiles.
682#[serde_with::serde_as]
683#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
684#[serde(default, rename_all = "camelCase")]
685#[non_exhaustive]
686pub struct ListConnectionProfilesRequest {
687    /// Required. The parent that owns the collection of connection profiles.
688    #[serde(skip_serializing_if = "std::string::String::is_empty")]
689    pub parent: std::string::String,
690
691    /// Maximum number of connection profiles to return.
692    /// If unspecified, at most 50 connection profiles will be returned.
693    /// The maximum value is 1000; values above 1000 will be coerced to 1000.
694    pub page_size: i32,
695
696    /// Page token received from a previous `ListConnectionProfiles` call.
697    /// Provide this to retrieve the subsequent page.
698    ///
699    /// When paginating, all other parameters provided to `ListConnectionProfiles`
700    /// must match the call that provided the page token.
701    #[serde(skip_serializing_if = "std::string::String::is_empty")]
702    pub page_token: std::string::String,
703
704    /// Filter request.
705    #[serde(skip_serializing_if = "std::string::String::is_empty")]
706    pub filter: std::string::String,
707
708    /// Order by fields for the result.
709    #[serde(skip_serializing_if = "std::string::String::is_empty")]
710    pub order_by: std::string::String,
711}
712
713impl ListConnectionProfilesRequest {
714    pub fn new() -> Self {
715        std::default::Default::default()
716    }
717
718    /// Sets the value of [parent][crate::model::ListConnectionProfilesRequest::parent].
719    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
720        self.parent = v.into();
721        self
722    }
723
724    /// Sets the value of [page_size][crate::model::ListConnectionProfilesRequest::page_size].
725    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
726        self.page_size = v.into();
727        self
728    }
729
730    /// Sets the value of [page_token][crate::model::ListConnectionProfilesRequest::page_token].
731    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
732        self.page_token = v.into();
733        self
734    }
735
736    /// Sets the value of [filter][crate::model::ListConnectionProfilesRequest::filter].
737    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
738        self.filter = v.into();
739        self
740    }
741
742    /// Sets the value of [order_by][crate::model::ListConnectionProfilesRequest::order_by].
743    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
744        self.order_by = v.into();
745        self
746    }
747}
748
749impl wkt::message::Message for ListConnectionProfilesRequest {
750    fn typename() -> &'static str {
751        "type.googleapis.com/google.cloud.datastream.v1.ListConnectionProfilesRequest"
752    }
753}
754
755/// Response message for listing connection profiles.
756#[serde_with::serde_as]
757#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
758#[serde(default, rename_all = "camelCase")]
759#[non_exhaustive]
760pub struct ListConnectionProfilesResponse {
761    /// List of connection profiles.
762    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
763    pub connection_profiles: std::vec::Vec<crate::model::ConnectionProfile>,
764
765    /// A token, which can be sent as `page_token` to retrieve the next page.
766    /// If this field is omitted, there are no subsequent pages.
767    #[serde(skip_serializing_if = "std::string::String::is_empty")]
768    pub next_page_token: std::string::String,
769
770    /// Locations that could not be reached.
771    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
772    pub unreachable: std::vec::Vec<std::string::String>,
773}
774
775impl ListConnectionProfilesResponse {
776    pub fn new() -> Self {
777        std::default::Default::default()
778    }
779
780    /// Sets the value of [next_page_token][crate::model::ListConnectionProfilesResponse::next_page_token].
781    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
782        self.next_page_token = v.into();
783        self
784    }
785
786    /// Sets the value of [connection_profiles][crate::model::ListConnectionProfilesResponse::connection_profiles].
787    pub fn set_connection_profiles<T, V>(mut self, v: T) -> Self
788    where
789        T: std::iter::IntoIterator<Item = V>,
790        V: std::convert::Into<crate::model::ConnectionProfile>,
791    {
792        use std::iter::Iterator;
793        self.connection_profiles = v.into_iter().map(|i| i.into()).collect();
794        self
795    }
796
797    /// Sets the value of [unreachable][crate::model::ListConnectionProfilesResponse::unreachable].
798    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
799    where
800        T: std::iter::IntoIterator<Item = V>,
801        V: std::convert::Into<std::string::String>,
802    {
803        use std::iter::Iterator;
804        self.unreachable = v.into_iter().map(|i| i.into()).collect();
805        self
806    }
807}
808
809impl wkt::message::Message for ListConnectionProfilesResponse {
810    fn typename() -> &'static str {
811        "type.googleapis.com/google.cloud.datastream.v1.ListConnectionProfilesResponse"
812    }
813}
814
815#[cfg(feature = "unstable-stream")]
816impl gax::paginator::PageableResponse for ListConnectionProfilesResponse {
817    type PageItem = crate::model::ConnectionProfile;
818
819    fn items(self) -> std::vec::Vec<Self::PageItem> {
820        self.connection_profiles
821    }
822
823    fn next_page_token(&self) -> std::string::String {
824        gax::paginator::extract_token(&self.next_page_token)
825    }
826}
827
828/// Request message for getting a connection profile.
829#[serde_with::serde_as]
830#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
831#[serde(default, rename_all = "camelCase")]
832#[non_exhaustive]
833pub struct GetConnectionProfileRequest {
834    /// Required. The name of the connection profile resource to get.
835    #[serde(skip_serializing_if = "std::string::String::is_empty")]
836    pub name: std::string::String,
837}
838
839impl GetConnectionProfileRequest {
840    pub fn new() -> Self {
841        std::default::Default::default()
842    }
843
844    /// Sets the value of [name][crate::model::GetConnectionProfileRequest::name].
845    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
846        self.name = v.into();
847        self
848    }
849}
850
851impl wkt::message::Message for GetConnectionProfileRequest {
852    fn typename() -> &'static str {
853        "type.googleapis.com/google.cloud.datastream.v1.GetConnectionProfileRequest"
854    }
855}
856
857/// Request message for creating a connection profile.
858#[serde_with::serde_as]
859#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
860#[serde(default, rename_all = "camelCase")]
861#[non_exhaustive]
862pub struct CreateConnectionProfileRequest {
863    /// Required. The parent that owns the collection of ConnectionProfiles.
864    #[serde(skip_serializing_if = "std::string::String::is_empty")]
865    pub parent: std::string::String,
866
867    /// Required. The connection profile identifier.
868    #[serde(skip_serializing_if = "std::string::String::is_empty")]
869    pub connection_profile_id: std::string::String,
870
871    /// Required. The connection profile resource to create.
872    #[serde(skip_serializing_if = "std::option::Option::is_none")]
873    pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
874
875    /// Optional. A request ID to identify requests. Specify a unique request ID
876    /// so that if you must retry your request, the server will know to ignore
877    /// the request if it has already been completed. The server will guarantee
878    /// that for at least 60 minutes since the first request.
879    ///
880    /// For example, consider a situation where you make an initial request and the
881    /// request times out. If you make the request again with the same request ID,
882    /// the server can check if original operation with the same request ID was
883    /// received, and if so, will ignore the second request. This prevents clients
884    /// from accidentally creating duplicate commitments.
885    ///
886    /// The request ID must be a valid UUID with the exception that zero UUID is
887    /// not supported (00000000-0000-0000-0000-000000000000).
888    #[serde(skip_serializing_if = "std::string::String::is_empty")]
889    pub request_id: std::string::String,
890
891    /// Optional. Only validate the connection profile, but don't create any
892    /// resources. The default is false.
893    pub validate_only: bool,
894
895    /// Optional. Create the connection profile without validating it.
896    pub force: bool,
897}
898
899impl CreateConnectionProfileRequest {
900    pub fn new() -> Self {
901        std::default::Default::default()
902    }
903
904    /// Sets the value of [parent][crate::model::CreateConnectionProfileRequest::parent].
905    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
906        self.parent = v.into();
907        self
908    }
909
910    /// Sets the value of [connection_profile_id][crate::model::CreateConnectionProfileRequest::connection_profile_id].
911    pub fn set_connection_profile_id<T: std::convert::Into<std::string::String>>(
912        mut self,
913        v: T,
914    ) -> Self {
915        self.connection_profile_id = v.into();
916        self
917    }
918
919    /// Sets the value of [connection_profile][crate::model::CreateConnectionProfileRequest::connection_profile].
920    pub fn set_connection_profile<
921        T: std::convert::Into<std::option::Option<crate::model::ConnectionProfile>>,
922    >(
923        mut self,
924        v: T,
925    ) -> Self {
926        self.connection_profile = v.into();
927        self
928    }
929
930    /// Sets the value of [request_id][crate::model::CreateConnectionProfileRequest::request_id].
931    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
932        self.request_id = v.into();
933        self
934    }
935
936    /// Sets the value of [validate_only][crate::model::CreateConnectionProfileRequest::validate_only].
937    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
938        self.validate_only = v.into();
939        self
940    }
941
942    /// Sets the value of [force][crate::model::CreateConnectionProfileRequest::force].
943    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
944        self.force = v.into();
945        self
946    }
947}
948
949impl wkt::message::Message for CreateConnectionProfileRequest {
950    fn typename() -> &'static str {
951        "type.googleapis.com/google.cloud.datastream.v1.CreateConnectionProfileRequest"
952    }
953}
954
955/// Connection profile update message.
956#[serde_with::serde_as]
957#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
958#[serde(default, rename_all = "camelCase")]
959#[non_exhaustive]
960pub struct UpdateConnectionProfileRequest {
961    /// Optional. Field mask is used to specify the fields to be overwritten in the
962    /// ConnectionProfile resource by the update.
963    /// The fields specified in the update_mask are relative to the resource, not
964    /// the full request. A field will be overwritten if it is in the mask. If the
965    /// user does not provide a mask then all fields will be overwritten.
966    #[serde(skip_serializing_if = "std::option::Option::is_none")]
967    pub update_mask: std::option::Option<wkt::FieldMask>,
968
969    /// Required. The connection profile to update.
970    #[serde(skip_serializing_if = "std::option::Option::is_none")]
971    pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
972
973    /// Optional. A request ID to identify requests. Specify a unique request ID
974    /// so that if you must retry your request, the server will know to ignore
975    /// the request if it has already been completed. The server will guarantee
976    /// that for at least 60 minutes since the first request.
977    ///
978    /// For example, consider a situation where you make an initial request and the
979    /// request times out. If you make the request again with the same request ID,
980    /// the server can check if original operation with the same request ID was
981    /// received, and if so, will ignore the second request. This prevents clients
982    /// from accidentally creating duplicate commitments.
983    ///
984    /// The request ID must be a valid UUID with the exception that zero UUID is
985    /// not supported (00000000-0000-0000-0000-000000000000).
986    #[serde(skip_serializing_if = "std::string::String::is_empty")]
987    pub request_id: std::string::String,
988
989    /// Optional. Only validate the connection profile, but don't update any
990    /// resources. The default is false.
991    pub validate_only: bool,
992
993    /// Optional. Update the connection profile without validating it.
994    pub force: bool,
995}
996
997impl UpdateConnectionProfileRequest {
998    pub fn new() -> Self {
999        std::default::Default::default()
1000    }
1001
1002    /// Sets the value of [update_mask][crate::model::UpdateConnectionProfileRequest::update_mask].
1003    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
1004        mut self,
1005        v: T,
1006    ) -> Self {
1007        self.update_mask = v.into();
1008        self
1009    }
1010
1011    /// Sets the value of [connection_profile][crate::model::UpdateConnectionProfileRequest::connection_profile].
1012    pub fn set_connection_profile<
1013        T: std::convert::Into<std::option::Option<crate::model::ConnectionProfile>>,
1014    >(
1015        mut self,
1016        v: T,
1017    ) -> Self {
1018        self.connection_profile = v.into();
1019        self
1020    }
1021
1022    /// Sets the value of [request_id][crate::model::UpdateConnectionProfileRequest::request_id].
1023    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1024        self.request_id = v.into();
1025        self
1026    }
1027
1028    /// Sets the value of [validate_only][crate::model::UpdateConnectionProfileRequest::validate_only].
1029    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1030        self.validate_only = v.into();
1031        self
1032    }
1033
1034    /// Sets the value of [force][crate::model::UpdateConnectionProfileRequest::force].
1035    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1036        self.force = v.into();
1037        self
1038    }
1039}
1040
1041impl wkt::message::Message for UpdateConnectionProfileRequest {
1042    fn typename() -> &'static str {
1043        "type.googleapis.com/google.cloud.datastream.v1.UpdateConnectionProfileRequest"
1044    }
1045}
1046
1047/// Request message for deleting a connection profile.
1048#[serde_with::serde_as]
1049#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1050#[serde(default, rename_all = "camelCase")]
1051#[non_exhaustive]
1052pub struct DeleteConnectionProfileRequest {
1053    /// Required. The name of the connection profile resource to delete.
1054    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1055    pub name: std::string::String,
1056
1057    /// Optional. A request ID to identify requests. Specify a unique request ID
1058    /// so that if you must retry your request, the server will know to ignore
1059    /// the request if it has already been completed. The server will guarantee
1060    /// that for at least 60 minutes after the first request.
1061    ///
1062    /// For example, consider a situation where you make an initial request and the
1063    /// request times out. If you make the request again with the same request ID,
1064    /// the server can check if original operation with the same request ID was
1065    /// received, and if so, will ignore the second request. This prevents clients
1066    /// from accidentally creating duplicate commitments.
1067    ///
1068    /// The request ID must be a valid UUID with the exception that zero UUID is
1069    /// not supported (00000000-0000-0000-0000-000000000000).
1070    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1071    pub request_id: std::string::String,
1072}
1073
1074impl DeleteConnectionProfileRequest {
1075    pub fn new() -> Self {
1076        std::default::Default::default()
1077    }
1078
1079    /// Sets the value of [name][crate::model::DeleteConnectionProfileRequest::name].
1080    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1081        self.name = v.into();
1082        self
1083    }
1084
1085    /// Sets the value of [request_id][crate::model::DeleteConnectionProfileRequest::request_id].
1086    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1087        self.request_id = v.into();
1088        self
1089    }
1090}
1091
1092impl wkt::message::Message for DeleteConnectionProfileRequest {
1093    fn typename() -> &'static str {
1094        "type.googleapis.com/google.cloud.datastream.v1.DeleteConnectionProfileRequest"
1095    }
1096}
1097
1098/// Request message for listing streams.
1099#[serde_with::serde_as]
1100#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1101#[serde(default, rename_all = "camelCase")]
1102#[non_exhaustive]
1103pub struct ListStreamsRequest {
1104    /// Required. The parent that owns the collection of streams.
1105    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1106    pub parent: std::string::String,
1107
1108    /// Maximum number of streams to return.
1109    /// If unspecified, at most 50 streams will  be returned. The maximum
1110    /// value is 1000; values above 1000 will be coerced to 1000.
1111    pub page_size: i32,
1112
1113    /// Page token received from a previous `ListStreams` call.
1114    /// Provide this to retrieve the subsequent page.
1115    ///
1116    /// When paginating, all other parameters provided to `ListStreams`
1117    /// must match the call that provided the page token.
1118    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1119    pub page_token: std::string::String,
1120
1121    /// Filter request.
1122    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1123    pub filter: std::string::String,
1124
1125    /// Order by fields for the result.
1126    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1127    pub order_by: std::string::String,
1128}
1129
1130impl ListStreamsRequest {
1131    pub fn new() -> Self {
1132        std::default::Default::default()
1133    }
1134
1135    /// Sets the value of [parent][crate::model::ListStreamsRequest::parent].
1136    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1137        self.parent = v.into();
1138        self
1139    }
1140
1141    /// Sets the value of [page_size][crate::model::ListStreamsRequest::page_size].
1142    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1143        self.page_size = v.into();
1144        self
1145    }
1146
1147    /// Sets the value of [page_token][crate::model::ListStreamsRequest::page_token].
1148    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1149        self.page_token = v.into();
1150        self
1151    }
1152
1153    /// Sets the value of [filter][crate::model::ListStreamsRequest::filter].
1154    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1155        self.filter = v.into();
1156        self
1157    }
1158
1159    /// Sets the value of [order_by][crate::model::ListStreamsRequest::order_by].
1160    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1161        self.order_by = v.into();
1162        self
1163    }
1164}
1165
1166impl wkt::message::Message for ListStreamsRequest {
1167    fn typename() -> &'static str {
1168        "type.googleapis.com/google.cloud.datastream.v1.ListStreamsRequest"
1169    }
1170}
1171
1172/// Response message for listing streams.
1173#[serde_with::serde_as]
1174#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1175#[serde(default, rename_all = "camelCase")]
1176#[non_exhaustive]
1177pub struct ListStreamsResponse {
1178    /// List of streams
1179    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1180    pub streams: std::vec::Vec<crate::model::Stream>,
1181
1182    /// A token, which can be sent as `page_token` to retrieve the next page.
1183    /// If this field is omitted, there are no subsequent pages.
1184    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1185    pub next_page_token: std::string::String,
1186
1187    /// Locations that could not be reached.
1188    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1189    pub unreachable: std::vec::Vec<std::string::String>,
1190}
1191
1192impl ListStreamsResponse {
1193    pub fn new() -> Self {
1194        std::default::Default::default()
1195    }
1196
1197    /// Sets the value of [next_page_token][crate::model::ListStreamsResponse::next_page_token].
1198    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1199        self.next_page_token = v.into();
1200        self
1201    }
1202
1203    /// Sets the value of [streams][crate::model::ListStreamsResponse::streams].
1204    pub fn set_streams<T, V>(mut self, v: T) -> Self
1205    where
1206        T: std::iter::IntoIterator<Item = V>,
1207        V: std::convert::Into<crate::model::Stream>,
1208    {
1209        use std::iter::Iterator;
1210        self.streams = v.into_iter().map(|i| i.into()).collect();
1211        self
1212    }
1213
1214    /// Sets the value of [unreachable][crate::model::ListStreamsResponse::unreachable].
1215    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1216    where
1217        T: std::iter::IntoIterator<Item = V>,
1218        V: std::convert::Into<std::string::String>,
1219    {
1220        use std::iter::Iterator;
1221        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1222        self
1223    }
1224}
1225
1226impl wkt::message::Message for ListStreamsResponse {
1227    fn typename() -> &'static str {
1228        "type.googleapis.com/google.cloud.datastream.v1.ListStreamsResponse"
1229    }
1230}
1231
1232#[cfg(feature = "unstable-stream")]
1233impl gax::paginator::PageableResponse for ListStreamsResponse {
1234    type PageItem = crate::model::Stream;
1235
1236    fn items(self) -> std::vec::Vec<Self::PageItem> {
1237        self.streams
1238    }
1239
1240    fn next_page_token(&self) -> std::string::String {
1241        gax::paginator::extract_token(&self.next_page_token)
1242    }
1243}
1244
1245/// Request message for getting a stream.
1246#[serde_with::serde_as]
1247#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1248#[serde(default, rename_all = "camelCase")]
1249#[non_exhaustive]
1250pub struct GetStreamRequest {
1251    /// Required. The name of the stream resource to get.
1252    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1253    pub name: std::string::String,
1254}
1255
1256impl GetStreamRequest {
1257    pub fn new() -> Self {
1258        std::default::Default::default()
1259    }
1260
1261    /// Sets the value of [name][crate::model::GetStreamRequest::name].
1262    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1263        self.name = v.into();
1264        self
1265    }
1266}
1267
1268impl wkt::message::Message for GetStreamRequest {
1269    fn typename() -> &'static str {
1270        "type.googleapis.com/google.cloud.datastream.v1.GetStreamRequest"
1271    }
1272}
1273
1274/// Request message for creating a stream.
1275#[serde_with::serde_as]
1276#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1277#[serde(default, rename_all = "camelCase")]
1278#[non_exhaustive]
1279pub struct CreateStreamRequest {
1280    /// Required. The parent that owns the collection of streams.
1281    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1282    pub parent: std::string::String,
1283
1284    /// Required. The stream identifier.
1285    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1286    pub stream_id: std::string::String,
1287
1288    /// Required. The stream resource to create.
1289    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1290    pub stream: std::option::Option<crate::model::Stream>,
1291
1292    /// Optional. A request ID to identify requests. Specify a unique request ID
1293    /// so that if you must retry your request, the server will know to ignore
1294    /// the request if it has already been completed. The server will guarantee
1295    /// that for at least 60 minutes since the first request.
1296    ///
1297    /// For example, consider a situation where you make an initial request and the
1298    /// request times out. If you make the request again with the same request ID,
1299    /// the server can check if original operation with the same request ID was
1300    /// received, and if so, will ignore the second request. This prevents clients
1301    /// from accidentally creating duplicate commitments.
1302    ///
1303    /// The request ID must be a valid UUID with the exception that zero UUID is
1304    /// not supported (00000000-0000-0000-0000-000000000000).
1305    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1306    pub request_id: std::string::String,
1307
1308    /// Optional. Only validate the stream, but don't create any resources.
1309    /// The default is false.
1310    pub validate_only: bool,
1311
1312    /// Optional. Create the stream without validating it.
1313    pub force: bool,
1314}
1315
1316impl CreateStreamRequest {
1317    pub fn new() -> Self {
1318        std::default::Default::default()
1319    }
1320
1321    /// Sets the value of [parent][crate::model::CreateStreamRequest::parent].
1322    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1323        self.parent = v.into();
1324        self
1325    }
1326
1327    /// Sets the value of [stream_id][crate::model::CreateStreamRequest::stream_id].
1328    pub fn set_stream_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1329        self.stream_id = v.into();
1330        self
1331    }
1332
1333    /// Sets the value of [stream][crate::model::CreateStreamRequest::stream].
1334    pub fn set_stream<T: std::convert::Into<std::option::Option<crate::model::Stream>>>(
1335        mut self,
1336        v: T,
1337    ) -> Self {
1338        self.stream = v.into();
1339        self
1340    }
1341
1342    /// Sets the value of [request_id][crate::model::CreateStreamRequest::request_id].
1343    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1344        self.request_id = v.into();
1345        self
1346    }
1347
1348    /// Sets the value of [validate_only][crate::model::CreateStreamRequest::validate_only].
1349    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1350        self.validate_only = v.into();
1351        self
1352    }
1353
1354    /// Sets the value of [force][crate::model::CreateStreamRequest::force].
1355    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1356        self.force = v.into();
1357        self
1358    }
1359}
1360
1361impl wkt::message::Message for CreateStreamRequest {
1362    fn typename() -> &'static str {
1363        "type.googleapis.com/google.cloud.datastream.v1.CreateStreamRequest"
1364    }
1365}
1366
1367/// Request message for updating a stream.
1368#[serde_with::serde_as]
1369#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1370#[serde(default, rename_all = "camelCase")]
1371#[non_exhaustive]
1372pub struct UpdateStreamRequest {
1373    /// Optional. Field mask is used to specify the fields to be overwritten in the
1374    /// stream resource by the update.
1375    /// The fields specified in the update_mask are relative to the resource, not
1376    /// the full request. A field will be overwritten if it is in the mask. If the
1377    /// user does not provide a mask then all fields will be overwritten.
1378    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1379    pub update_mask: std::option::Option<wkt::FieldMask>,
1380
1381    /// Required. The stream resource to update.
1382    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1383    pub stream: std::option::Option<crate::model::Stream>,
1384
1385    /// Optional. A request ID to identify requests. Specify a unique request ID
1386    /// so that if you must retry your request, the server will know to ignore
1387    /// the request if it has already been completed. The server will guarantee
1388    /// that for at least 60 minutes since the first request.
1389    ///
1390    /// For example, consider a situation where you make an initial request and the
1391    /// request times out. If you make the request again with the same request ID,
1392    /// the server can check if original operation with the same request ID was
1393    /// received, and if so, will ignore the second request. This prevents clients
1394    /// from accidentally creating duplicate commitments.
1395    ///
1396    /// The request ID must be a valid UUID with the exception that zero UUID is
1397    /// not supported (00000000-0000-0000-0000-000000000000).
1398    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1399    pub request_id: std::string::String,
1400
1401    /// Optional. Only validate the stream with the changes, without actually
1402    /// updating it. The default is false.
1403    pub validate_only: bool,
1404
1405    /// Optional. Update the stream without validating it.
1406    pub force: bool,
1407}
1408
1409impl UpdateStreamRequest {
1410    pub fn new() -> Self {
1411        std::default::Default::default()
1412    }
1413
1414    /// Sets the value of [update_mask][crate::model::UpdateStreamRequest::update_mask].
1415    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
1416        mut self,
1417        v: T,
1418    ) -> Self {
1419        self.update_mask = v.into();
1420        self
1421    }
1422
1423    /// Sets the value of [stream][crate::model::UpdateStreamRequest::stream].
1424    pub fn set_stream<T: std::convert::Into<std::option::Option<crate::model::Stream>>>(
1425        mut self,
1426        v: T,
1427    ) -> Self {
1428        self.stream = v.into();
1429        self
1430    }
1431
1432    /// Sets the value of [request_id][crate::model::UpdateStreamRequest::request_id].
1433    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1434        self.request_id = v.into();
1435        self
1436    }
1437
1438    /// Sets the value of [validate_only][crate::model::UpdateStreamRequest::validate_only].
1439    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1440        self.validate_only = v.into();
1441        self
1442    }
1443
1444    /// Sets the value of [force][crate::model::UpdateStreamRequest::force].
1445    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1446        self.force = v.into();
1447        self
1448    }
1449}
1450
1451impl wkt::message::Message for UpdateStreamRequest {
1452    fn typename() -> &'static str {
1453        "type.googleapis.com/google.cloud.datastream.v1.UpdateStreamRequest"
1454    }
1455}
1456
1457/// Request message for deleting a stream.
1458#[serde_with::serde_as]
1459#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1460#[serde(default, rename_all = "camelCase")]
1461#[non_exhaustive]
1462pub struct DeleteStreamRequest {
1463    /// Required. The name of the stream resource to delete.
1464    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1465    pub name: std::string::String,
1466
1467    /// Optional. A request ID to identify requests. Specify a unique request ID
1468    /// so that if you must retry your request, the server will know to ignore
1469    /// the request if it has already been completed. The server will guarantee
1470    /// that for at least 60 minutes after the first request.
1471    ///
1472    /// For example, consider a situation where you make an initial request and the
1473    /// request times out. If you make the request again with the same request ID,
1474    /// the server can check if original operation with the same request ID was
1475    /// received, and if so, will ignore the second request. This prevents clients
1476    /// from accidentally creating duplicate commitments.
1477    ///
1478    /// The request ID must be a valid UUID with the exception that zero UUID is
1479    /// not supported (00000000-0000-0000-0000-000000000000).
1480    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1481    pub request_id: std::string::String,
1482}
1483
1484impl DeleteStreamRequest {
1485    pub fn new() -> Self {
1486        std::default::Default::default()
1487    }
1488
1489    /// Sets the value of [name][crate::model::DeleteStreamRequest::name].
1490    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1491        self.name = v.into();
1492        self
1493    }
1494
1495    /// Sets the value of [request_id][crate::model::DeleteStreamRequest::request_id].
1496    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1497        self.request_id = v.into();
1498        self
1499    }
1500}
1501
1502impl wkt::message::Message for DeleteStreamRequest {
1503    fn typename() -> &'static str {
1504        "type.googleapis.com/google.cloud.datastream.v1.DeleteStreamRequest"
1505    }
1506}
1507
1508/// Request message for running a stream.
1509#[serde_with::serde_as]
1510#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1511#[serde(default, rename_all = "camelCase")]
1512#[non_exhaustive]
1513pub struct RunStreamRequest {
1514    /// Required. Name of the stream resource to start, in the format:
1515    /// projects/{project_id}/locations/{location}/streams/{stream_name}
1516    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1517    pub name: std::string::String,
1518
1519    /// Optional. The CDC strategy of the stream. If not set, the system's default
1520    /// value will be used.
1521    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1522    pub cdc_strategy: std::option::Option<crate::model::CdcStrategy>,
1523
1524    /// Optional. Update the stream without validating it.
1525    pub force: bool,
1526}
1527
1528impl RunStreamRequest {
1529    pub fn new() -> Self {
1530        std::default::Default::default()
1531    }
1532
1533    /// Sets the value of [name][crate::model::RunStreamRequest::name].
1534    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1535        self.name = v.into();
1536        self
1537    }
1538
1539    /// Sets the value of [cdc_strategy][crate::model::RunStreamRequest::cdc_strategy].
1540    pub fn set_cdc_strategy<
1541        T: std::convert::Into<std::option::Option<crate::model::CdcStrategy>>,
1542    >(
1543        mut self,
1544        v: T,
1545    ) -> Self {
1546        self.cdc_strategy = v.into();
1547        self
1548    }
1549
1550    /// Sets the value of [force][crate::model::RunStreamRequest::force].
1551    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1552        self.force = v.into();
1553        self
1554    }
1555}
1556
1557impl wkt::message::Message for RunStreamRequest {
1558    fn typename() -> &'static str {
1559        "type.googleapis.com/google.cloud.datastream.v1.RunStreamRequest"
1560    }
1561}
1562
1563/// Request for fetching a specific stream object.
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 GetStreamObjectRequest {
1569    /// Required. The name of the stream object resource to get.
1570    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1571    pub name: std::string::String,
1572}
1573
1574impl GetStreamObjectRequest {
1575    pub fn new() -> Self {
1576        std::default::Default::default()
1577    }
1578
1579    /// Sets the value of [name][crate::model::GetStreamObjectRequest::name].
1580    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1581        self.name = v.into();
1582        self
1583    }
1584}
1585
1586impl wkt::message::Message for GetStreamObjectRequest {
1587    fn typename() -> &'static str {
1588        "type.googleapis.com/google.cloud.datastream.v1.GetStreamObjectRequest"
1589    }
1590}
1591
1592/// Request for looking up a specific stream object by its source object
1593/// identifier.
1594#[serde_with::serde_as]
1595#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1596#[serde(default, rename_all = "camelCase")]
1597#[non_exhaustive]
1598pub struct LookupStreamObjectRequest {
1599    /// Required. The parent stream that owns the collection of objects.
1600    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1601    pub parent: std::string::String,
1602
1603    /// Required. The source object identifier which maps to the stream object.
1604    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1605    pub source_object_identifier: std::option::Option<crate::model::SourceObjectIdentifier>,
1606}
1607
1608impl LookupStreamObjectRequest {
1609    pub fn new() -> Self {
1610        std::default::Default::default()
1611    }
1612
1613    /// Sets the value of [parent][crate::model::LookupStreamObjectRequest::parent].
1614    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1615        self.parent = v.into();
1616        self
1617    }
1618
1619    /// Sets the value of [source_object_identifier][crate::model::LookupStreamObjectRequest::source_object_identifier].
1620    pub fn set_source_object_identifier<
1621        T: std::convert::Into<std::option::Option<crate::model::SourceObjectIdentifier>>,
1622    >(
1623        mut self,
1624        v: T,
1625    ) -> Self {
1626        self.source_object_identifier = v.into();
1627        self
1628    }
1629}
1630
1631impl wkt::message::Message for LookupStreamObjectRequest {
1632    fn typename() -> &'static str {
1633        "type.googleapis.com/google.cloud.datastream.v1.LookupStreamObjectRequest"
1634    }
1635}
1636
1637/// Request for manually initiating a backfill job for a specific stream object.
1638#[serde_with::serde_as]
1639#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1640#[serde(default, rename_all = "camelCase")]
1641#[non_exhaustive]
1642pub struct StartBackfillJobRequest {
1643    /// Required. The name of the stream object resource to start a backfill job
1644    /// for.
1645    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1646    pub object: std::string::String,
1647}
1648
1649impl StartBackfillJobRequest {
1650    pub fn new() -> Self {
1651        std::default::Default::default()
1652    }
1653
1654    /// Sets the value of [object][crate::model::StartBackfillJobRequest::object].
1655    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1656        self.object = v.into();
1657        self
1658    }
1659}
1660
1661impl wkt::message::Message for StartBackfillJobRequest {
1662    fn typename() -> &'static str {
1663        "type.googleapis.com/google.cloud.datastream.v1.StartBackfillJobRequest"
1664    }
1665}
1666
1667/// Response for manually initiating a backfill job for a specific stream object.
1668#[serde_with::serde_as]
1669#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1670#[serde(default, rename_all = "camelCase")]
1671#[non_exhaustive]
1672pub struct StartBackfillJobResponse {
1673    /// The stream object resource a backfill job was started for.
1674    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1675    pub object: std::option::Option<crate::model::StreamObject>,
1676}
1677
1678impl StartBackfillJobResponse {
1679    pub fn new() -> Self {
1680        std::default::Default::default()
1681    }
1682
1683    /// Sets the value of [object][crate::model::StartBackfillJobResponse::object].
1684    pub fn set_object<T: std::convert::Into<std::option::Option<crate::model::StreamObject>>>(
1685        mut self,
1686        v: T,
1687    ) -> Self {
1688        self.object = v.into();
1689        self
1690    }
1691}
1692
1693impl wkt::message::Message for StartBackfillJobResponse {
1694    fn typename() -> &'static str {
1695        "type.googleapis.com/google.cloud.datastream.v1.StartBackfillJobResponse"
1696    }
1697}
1698
1699/// Request for manually stopping a running backfill job for a specific stream
1700/// object.
1701#[serde_with::serde_as]
1702#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1703#[serde(default, rename_all = "camelCase")]
1704#[non_exhaustive]
1705pub struct StopBackfillJobRequest {
1706    /// Required. The name of the stream object resource to stop the backfill job
1707    /// for.
1708    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1709    pub object: std::string::String,
1710}
1711
1712impl StopBackfillJobRequest {
1713    pub fn new() -> Self {
1714        std::default::Default::default()
1715    }
1716
1717    /// Sets the value of [object][crate::model::StopBackfillJobRequest::object].
1718    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1719        self.object = v.into();
1720        self
1721    }
1722}
1723
1724impl wkt::message::Message for StopBackfillJobRequest {
1725    fn typename() -> &'static str {
1726        "type.googleapis.com/google.cloud.datastream.v1.StopBackfillJobRequest"
1727    }
1728}
1729
1730/// Response for manually stop a backfill job for a specific stream object.
1731#[serde_with::serde_as]
1732#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1733#[serde(default, rename_all = "camelCase")]
1734#[non_exhaustive]
1735pub struct StopBackfillJobResponse {
1736    /// The stream object resource the backfill job was stopped for.
1737    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1738    pub object: std::option::Option<crate::model::StreamObject>,
1739}
1740
1741impl StopBackfillJobResponse {
1742    pub fn new() -> Self {
1743        std::default::Default::default()
1744    }
1745
1746    /// Sets the value of [object][crate::model::StopBackfillJobResponse::object].
1747    pub fn set_object<T: std::convert::Into<std::option::Option<crate::model::StreamObject>>>(
1748        mut self,
1749        v: T,
1750    ) -> Self {
1751        self.object = v.into();
1752        self
1753    }
1754}
1755
1756impl wkt::message::Message for StopBackfillJobResponse {
1757    fn typename() -> &'static str {
1758        "type.googleapis.com/google.cloud.datastream.v1.StopBackfillJobResponse"
1759    }
1760}
1761
1762/// Request for listing all objects for a specific stream.
1763#[serde_with::serde_as]
1764#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1765#[serde(default, rename_all = "camelCase")]
1766#[non_exhaustive]
1767pub struct ListStreamObjectsRequest {
1768    /// Required. The parent stream that owns the collection of objects.
1769    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1770    pub parent: std::string::String,
1771
1772    /// Maximum number of objects to return. Default is 50.
1773    /// The maximum value is 1000; values above 1000 will be coerced to 1000.
1774    pub page_size: i32,
1775
1776    /// Page token received from a previous `ListStreamObjectsRequest` call.
1777    /// Provide this to retrieve the subsequent page.
1778    ///
1779    /// When paginating, all other parameters provided to
1780    /// `ListStreamObjectsRequest` must match the call that provided the page
1781    /// token.
1782    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1783    pub page_token: std::string::String,
1784}
1785
1786impl ListStreamObjectsRequest {
1787    pub fn new() -> Self {
1788        std::default::Default::default()
1789    }
1790
1791    /// Sets the value of [parent][crate::model::ListStreamObjectsRequest::parent].
1792    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1793        self.parent = v.into();
1794        self
1795    }
1796
1797    /// Sets the value of [page_size][crate::model::ListStreamObjectsRequest::page_size].
1798    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1799        self.page_size = v.into();
1800        self
1801    }
1802
1803    /// Sets the value of [page_token][crate::model::ListStreamObjectsRequest::page_token].
1804    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1805        self.page_token = v.into();
1806        self
1807    }
1808}
1809
1810impl wkt::message::Message for ListStreamObjectsRequest {
1811    fn typename() -> &'static str {
1812        "type.googleapis.com/google.cloud.datastream.v1.ListStreamObjectsRequest"
1813    }
1814}
1815
1816/// Response containing the objects for a stream.
1817#[serde_with::serde_as]
1818#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1819#[serde(default, rename_all = "camelCase")]
1820#[non_exhaustive]
1821pub struct ListStreamObjectsResponse {
1822    /// List of stream objects.
1823    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1824    pub stream_objects: std::vec::Vec<crate::model::StreamObject>,
1825
1826    /// A token, which can be sent as `page_token` to retrieve the next page.
1827    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1828    pub next_page_token: std::string::String,
1829}
1830
1831impl ListStreamObjectsResponse {
1832    pub fn new() -> Self {
1833        std::default::Default::default()
1834    }
1835
1836    /// Sets the value of [next_page_token][crate::model::ListStreamObjectsResponse::next_page_token].
1837    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1838        self.next_page_token = v.into();
1839        self
1840    }
1841
1842    /// Sets the value of [stream_objects][crate::model::ListStreamObjectsResponse::stream_objects].
1843    pub fn set_stream_objects<T, V>(mut self, v: T) -> Self
1844    where
1845        T: std::iter::IntoIterator<Item = V>,
1846        V: std::convert::Into<crate::model::StreamObject>,
1847    {
1848        use std::iter::Iterator;
1849        self.stream_objects = v.into_iter().map(|i| i.into()).collect();
1850        self
1851    }
1852}
1853
1854impl wkt::message::Message for ListStreamObjectsResponse {
1855    fn typename() -> &'static str {
1856        "type.googleapis.com/google.cloud.datastream.v1.ListStreamObjectsResponse"
1857    }
1858}
1859
1860#[cfg(feature = "unstable-stream")]
1861impl gax::paginator::PageableResponse for ListStreamObjectsResponse {
1862    type PageItem = crate::model::StreamObject;
1863
1864    fn items(self) -> std::vec::Vec<Self::PageItem> {
1865        self.stream_objects
1866    }
1867
1868    fn next_page_token(&self) -> std::string::String {
1869        gax::paginator::extract_token(&self.next_page_token)
1870    }
1871}
1872
1873/// Represents the metadata of the long-running operation.
1874#[serde_with::serde_as]
1875#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1876#[serde(default, rename_all = "camelCase")]
1877#[non_exhaustive]
1878pub struct OperationMetadata {
1879    /// Output only. The time the operation was created.
1880    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1881    pub create_time: std::option::Option<wkt::Timestamp>,
1882
1883    /// Output only. The time the operation finished running.
1884    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1885    pub end_time: std::option::Option<wkt::Timestamp>,
1886
1887    /// Output only. Server-defined resource path for the target of the operation.
1888    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1889    pub target: std::string::String,
1890
1891    /// Output only. Name of the verb executed by the operation.
1892    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1893    pub verb: std::string::String,
1894
1895    /// Output only. Human-readable status of the operation, if any.
1896    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1897    pub status_message: std::string::String,
1898
1899    /// Output only. Identifies whether the user has requested cancellation
1900    /// of the operation. Operations that have successfully been cancelled
1901    /// have
1902    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
1903    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
1904    /// corresponding to `Code.CANCELLED`.
1905    ///
1906    /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
1907    /// [google.rpc.Status.code]: rpc::model::Status::code
1908    pub requested_cancellation: bool,
1909
1910    /// Output only. API version used to start the operation.
1911    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1912    pub api_version: std::string::String,
1913
1914    /// Output only. Results of executed validations if there are any.
1915    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1916    pub validation_result: std::option::Option<crate::model::ValidationResult>,
1917}
1918
1919impl OperationMetadata {
1920    pub fn new() -> Self {
1921        std::default::Default::default()
1922    }
1923
1924    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
1925    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1926        mut self,
1927        v: T,
1928    ) -> Self {
1929        self.create_time = v.into();
1930        self
1931    }
1932
1933    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
1934    pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1935        mut self,
1936        v: T,
1937    ) -> Self {
1938        self.end_time = v.into();
1939        self
1940    }
1941
1942    /// Sets the value of [target][crate::model::OperationMetadata::target].
1943    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1944        self.target = v.into();
1945        self
1946    }
1947
1948    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
1949    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1950        self.verb = v.into();
1951        self
1952    }
1953
1954    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
1955    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1956        self.status_message = v.into();
1957        self
1958    }
1959
1960    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
1961    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1962        self.requested_cancellation = v.into();
1963        self
1964    }
1965
1966    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
1967    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1968        self.api_version = v.into();
1969        self
1970    }
1971
1972    /// Sets the value of [validation_result][crate::model::OperationMetadata::validation_result].
1973    pub fn set_validation_result<
1974        T: std::convert::Into<std::option::Option<crate::model::ValidationResult>>,
1975    >(
1976        mut self,
1977        v: T,
1978    ) -> Self {
1979        self.validation_result = v.into();
1980        self
1981    }
1982}
1983
1984impl wkt::message::Message for OperationMetadata {
1985    fn typename() -> &'static str {
1986        "type.googleapis.com/google.cloud.datastream.v1.OperationMetadata"
1987    }
1988}
1989
1990/// Request for creating a private connection.
1991#[serde_with::serde_as]
1992#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1993#[serde(default, rename_all = "camelCase")]
1994#[non_exhaustive]
1995pub struct CreatePrivateConnectionRequest {
1996    /// Required. The parent that owns the collection of PrivateConnections.
1997    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1998    pub parent: std::string::String,
1999
2000    /// Required. The private connectivity identifier.
2001    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2002    pub private_connection_id: std::string::String,
2003
2004    /// Required. The Private Connectivity resource to create.
2005    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2006    pub private_connection: std::option::Option<crate::model::PrivateConnection>,
2007
2008    /// Optional. A request ID to identify requests. Specify a unique request ID
2009    /// so that if you must retry your request, the server will know to ignore
2010    /// the request if it has already been completed. The server will guarantee
2011    /// that for at least 60 minutes since the first request.
2012    ///
2013    /// For example, consider a situation where you make an initial request and the
2014    /// request times out. If you make the request again with the same request ID,
2015    /// the server can check if original operation with the same request ID was
2016    /// received, and if so, will ignore the second request. This prevents clients
2017    /// from accidentally creating duplicate commitments.
2018    ///
2019    /// The request ID must be a valid UUID with the exception that zero UUID is
2020    /// not supported (00000000-0000-0000-0000-000000000000).
2021    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2022    pub request_id: std::string::String,
2023
2024    /// Optional. If set to true, will skip validations.
2025    pub force: bool,
2026}
2027
2028impl CreatePrivateConnectionRequest {
2029    pub fn new() -> Self {
2030        std::default::Default::default()
2031    }
2032
2033    /// Sets the value of [parent][crate::model::CreatePrivateConnectionRequest::parent].
2034    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2035        self.parent = v.into();
2036        self
2037    }
2038
2039    /// Sets the value of [private_connection_id][crate::model::CreatePrivateConnectionRequest::private_connection_id].
2040    pub fn set_private_connection_id<T: std::convert::Into<std::string::String>>(
2041        mut self,
2042        v: T,
2043    ) -> Self {
2044        self.private_connection_id = v.into();
2045        self
2046    }
2047
2048    /// Sets the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
2049    pub fn set_private_connection<
2050        T: std::convert::Into<std::option::Option<crate::model::PrivateConnection>>,
2051    >(
2052        mut self,
2053        v: T,
2054    ) -> Self {
2055        self.private_connection = v.into();
2056        self
2057    }
2058
2059    /// Sets the value of [request_id][crate::model::CreatePrivateConnectionRequest::request_id].
2060    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2061        self.request_id = v.into();
2062        self
2063    }
2064
2065    /// Sets the value of [force][crate::model::CreatePrivateConnectionRequest::force].
2066    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2067        self.force = v.into();
2068        self
2069    }
2070}
2071
2072impl wkt::message::Message for CreatePrivateConnectionRequest {
2073    fn typename() -> &'static str {
2074        "type.googleapis.com/google.cloud.datastream.v1.CreatePrivateConnectionRequest"
2075    }
2076}
2077
2078/// Request for listing private connections.
2079#[serde_with::serde_as]
2080#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2081#[serde(default, rename_all = "camelCase")]
2082#[non_exhaustive]
2083pub struct ListPrivateConnectionsRequest {
2084    /// Required. The parent that owns the collection of private connectivity
2085    /// configurations.
2086    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2087    pub parent: std::string::String,
2088
2089    /// Maximum number of private connectivity configurations to return.
2090    /// If unspecified, at most 50 private connectivity configurations that will be
2091    /// returned. The maximum value is 1000; values above 1000 will be coerced to
2092    /// 1000.
2093    pub page_size: i32,
2094
2095    /// Page token received from a previous `ListPrivateConnections` call.
2096    /// Provide this to retrieve the subsequent page.
2097    ///
2098    /// When paginating, all other parameters provided to
2099    /// `ListPrivateConnections` must match the call that provided the page
2100    /// token.
2101    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2102    pub page_token: std::string::String,
2103
2104    /// Filter request.
2105    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2106    pub filter: std::string::String,
2107
2108    /// Order by fields for the result.
2109    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2110    pub order_by: std::string::String,
2111}
2112
2113impl ListPrivateConnectionsRequest {
2114    pub fn new() -> Self {
2115        std::default::Default::default()
2116    }
2117
2118    /// Sets the value of [parent][crate::model::ListPrivateConnectionsRequest::parent].
2119    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2120        self.parent = v.into();
2121        self
2122    }
2123
2124    /// Sets the value of [page_size][crate::model::ListPrivateConnectionsRequest::page_size].
2125    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2126        self.page_size = v.into();
2127        self
2128    }
2129
2130    /// Sets the value of [page_token][crate::model::ListPrivateConnectionsRequest::page_token].
2131    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2132        self.page_token = v.into();
2133        self
2134    }
2135
2136    /// Sets the value of [filter][crate::model::ListPrivateConnectionsRequest::filter].
2137    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2138        self.filter = v.into();
2139        self
2140    }
2141
2142    /// Sets the value of [order_by][crate::model::ListPrivateConnectionsRequest::order_by].
2143    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2144        self.order_by = v.into();
2145        self
2146    }
2147}
2148
2149impl wkt::message::Message for ListPrivateConnectionsRequest {
2150    fn typename() -> &'static str {
2151        "type.googleapis.com/google.cloud.datastream.v1.ListPrivateConnectionsRequest"
2152    }
2153}
2154
2155/// Response containing a list of private connection configurations.
2156#[serde_with::serde_as]
2157#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2158#[serde(default, rename_all = "camelCase")]
2159#[non_exhaustive]
2160pub struct ListPrivateConnectionsResponse {
2161    /// List of private connectivity configurations.
2162    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2163    pub private_connections: std::vec::Vec<crate::model::PrivateConnection>,
2164
2165    /// A token, which can be sent as `page_token` to retrieve the next page.
2166    /// If this field is omitted, there are no subsequent pages.
2167    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2168    pub next_page_token: std::string::String,
2169
2170    /// Locations that could not be reached.
2171    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2172    pub unreachable: std::vec::Vec<std::string::String>,
2173}
2174
2175impl ListPrivateConnectionsResponse {
2176    pub fn new() -> Self {
2177        std::default::Default::default()
2178    }
2179
2180    /// Sets the value of [next_page_token][crate::model::ListPrivateConnectionsResponse::next_page_token].
2181    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2182        self.next_page_token = v.into();
2183        self
2184    }
2185
2186    /// Sets the value of [private_connections][crate::model::ListPrivateConnectionsResponse::private_connections].
2187    pub fn set_private_connections<T, V>(mut self, v: T) -> Self
2188    where
2189        T: std::iter::IntoIterator<Item = V>,
2190        V: std::convert::Into<crate::model::PrivateConnection>,
2191    {
2192        use std::iter::Iterator;
2193        self.private_connections = v.into_iter().map(|i| i.into()).collect();
2194        self
2195    }
2196
2197    /// Sets the value of [unreachable][crate::model::ListPrivateConnectionsResponse::unreachable].
2198    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2199    where
2200        T: std::iter::IntoIterator<Item = V>,
2201        V: std::convert::Into<std::string::String>,
2202    {
2203        use std::iter::Iterator;
2204        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2205        self
2206    }
2207}
2208
2209impl wkt::message::Message for ListPrivateConnectionsResponse {
2210    fn typename() -> &'static str {
2211        "type.googleapis.com/google.cloud.datastream.v1.ListPrivateConnectionsResponse"
2212    }
2213}
2214
2215#[cfg(feature = "unstable-stream")]
2216impl gax::paginator::PageableResponse for ListPrivateConnectionsResponse {
2217    type PageItem = crate::model::PrivateConnection;
2218
2219    fn items(self) -> std::vec::Vec<Self::PageItem> {
2220        self.private_connections
2221    }
2222
2223    fn next_page_token(&self) -> std::string::String {
2224        gax::paginator::extract_token(&self.next_page_token)
2225    }
2226}
2227
2228/// Request to delete a private connection.
2229#[serde_with::serde_as]
2230#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2231#[serde(default, rename_all = "camelCase")]
2232#[non_exhaustive]
2233pub struct DeletePrivateConnectionRequest {
2234    /// Required. The name of the private connectivity configuration to delete.
2235    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2236    pub name: std::string::String,
2237
2238    /// Optional. A request ID to identify requests. Specify a unique request ID
2239    /// so that if you must retry your request, the server will know to ignore
2240    /// the request if it has already been completed. The server will guarantee
2241    /// that for at least 60 minutes after the first request.
2242    ///
2243    /// For example, consider a situation where you make an initial request and the
2244    /// request times out. If you make the request again with the same request ID,
2245    /// the server can check if original operation with the same request ID was
2246    /// received, and if so, will ignore the second request. This prevents clients
2247    /// from accidentally creating duplicate commitments.
2248    ///
2249    /// The request ID must be a valid UUID with the exception that zero UUID is
2250    /// not supported (00000000-0000-0000-0000-000000000000).
2251    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2252    pub request_id: std::string::String,
2253
2254    /// Optional. If set to true, any child routes that belong to this
2255    /// PrivateConnection will also be deleted.
2256    pub force: bool,
2257}
2258
2259impl DeletePrivateConnectionRequest {
2260    pub fn new() -> Self {
2261        std::default::Default::default()
2262    }
2263
2264    /// Sets the value of [name][crate::model::DeletePrivateConnectionRequest::name].
2265    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2266        self.name = v.into();
2267        self
2268    }
2269
2270    /// Sets the value of [request_id][crate::model::DeletePrivateConnectionRequest::request_id].
2271    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2272        self.request_id = v.into();
2273        self
2274    }
2275
2276    /// Sets the value of [force][crate::model::DeletePrivateConnectionRequest::force].
2277    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2278        self.force = v.into();
2279        self
2280    }
2281}
2282
2283impl wkt::message::Message for DeletePrivateConnectionRequest {
2284    fn typename() -> &'static str {
2285        "type.googleapis.com/google.cloud.datastream.v1.DeletePrivateConnectionRequest"
2286    }
2287}
2288
2289/// Request to get a private connection configuration.
2290#[serde_with::serde_as]
2291#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2292#[serde(default, rename_all = "camelCase")]
2293#[non_exhaustive]
2294pub struct GetPrivateConnectionRequest {
2295    /// Required. The name of the  private connectivity configuration to get.
2296    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2297    pub name: std::string::String,
2298}
2299
2300impl GetPrivateConnectionRequest {
2301    pub fn new() -> Self {
2302        std::default::Default::default()
2303    }
2304
2305    /// Sets the value of [name][crate::model::GetPrivateConnectionRequest::name].
2306    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2307        self.name = v.into();
2308        self
2309    }
2310}
2311
2312impl wkt::message::Message for GetPrivateConnectionRequest {
2313    fn typename() -> &'static str {
2314        "type.googleapis.com/google.cloud.datastream.v1.GetPrivateConnectionRequest"
2315    }
2316}
2317
2318/// Route creation request.
2319#[serde_with::serde_as]
2320#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2321#[serde(default, rename_all = "camelCase")]
2322#[non_exhaustive]
2323pub struct CreateRouteRequest {
2324    /// Required. The parent that owns the collection of Routes.
2325    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2326    pub parent: std::string::String,
2327
2328    /// Required. The Route identifier.
2329    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2330    pub route_id: std::string::String,
2331
2332    /// Required. The Route resource to create.
2333    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2334    pub route: std::option::Option<crate::model::Route>,
2335
2336    /// Optional. A request ID to identify requests. Specify a unique request ID
2337    /// so that if you must retry your request, the server will know to ignore
2338    /// the request if it has already been completed. The server will guarantee
2339    /// that for at least 60 minutes since the first request.
2340    ///
2341    /// For example, consider a situation where you make an initial request and the
2342    /// request times out. If you make the request again with the same request ID,
2343    /// the server can check if original operation with the same request ID was
2344    /// received, and if so, will ignore the second request. This prevents clients
2345    /// from accidentally creating duplicate commitments.
2346    ///
2347    /// The request ID must be a valid UUID with the exception that zero UUID is
2348    /// not supported (00000000-0000-0000-0000-000000000000).
2349    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2350    pub request_id: std::string::String,
2351}
2352
2353impl CreateRouteRequest {
2354    pub fn new() -> Self {
2355        std::default::Default::default()
2356    }
2357
2358    /// Sets the value of [parent][crate::model::CreateRouteRequest::parent].
2359    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2360        self.parent = v.into();
2361        self
2362    }
2363
2364    /// Sets the value of [route_id][crate::model::CreateRouteRequest::route_id].
2365    pub fn set_route_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2366        self.route_id = v.into();
2367        self
2368    }
2369
2370    /// Sets the value of [route][crate::model::CreateRouteRequest::route].
2371    pub fn set_route<T: std::convert::Into<std::option::Option<crate::model::Route>>>(
2372        mut self,
2373        v: T,
2374    ) -> Self {
2375        self.route = v.into();
2376        self
2377    }
2378
2379    /// Sets the value of [request_id][crate::model::CreateRouteRequest::request_id].
2380    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2381        self.request_id = v.into();
2382        self
2383    }
2384}
2385
2386impl wkt::message::Message for CreateRouteRequest {
2387    fn typename() -> &'static str {
2388        "type.googleapis.com/google.cloud.datastream.v1.CreateRouteRequest"
2389    }
2390}
2391
2392/// Route list request.
2393#[serde_with::serde_as]
2394#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2395#[serde(default, rename_all = "camelCase")]
2396#[non_exhaustive]
2397pub struct ListRoutesRequest {
2398    /// Required. The parent that owns the collection of Routess.
2399    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2400    pub parent: std::string::String,
2401
2402    /// Maximum number of Routes to return. The service may return
2403    /// fewer than this value. If unspecified, at most 50 Routes
2404    /// will be returned. The maximum value is 1000; values above 1000 will be
2405    /// coerced to 1000.
2406    pub page_size: i32,
2407
2408    /// Page token received from a previous `ListRoutes` call.
2409    /// Provide this to retrieve the subsequent page.
2410    ///
2411    /// When paginating, all other parameters provided to
2412    /// `ListRoutes` must match the call that provided the page
2413    /// token.
2414    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2415    pub page_token: std::string::String,
2416
2417    /// Filter request.
2418    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2419    pub filter: std::string::String,
2420
2421    /// Order by fields for the result.
2422    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2423    pub order_by: std::string::String,
2424}
2425
2426impl ListRoutesRequest {
2427    pub fn new() -> Self {
2428        std::default::Default::default()
2429    }
2430
2431    /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
2432    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2433        self.parent = v.into();
2434        self
2435    }
2436
2437    /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
2438    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2439        self.page_size = v.into();
2440        self
2441    }
2442
2443    /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
2444    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2445        self.page_token = v.into();
2446        self
2447    }
2448
2449    /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
2450    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2451        self.filter = v.into();
2452        self
2453    }
2454
2455    /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
2456    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2457        self.order_by = v.into();
2458        self
2459    }
2460}
2461
2462impl wkt::message::Message for ListRoutesRequest {
2463    fn typename() -> &'static str {
2464        "type.googleapis.com/google.cloud.datastream.v1.ListRoutesRequest"
2465    }
2466}
2467
2468/// Route list response.
2469#[serde_with::serde_as]
2470#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2471#[serde(default, rename_all = "camelCase")]
2472#[non_exhaustive]
2473pub struct ListRoutesResponse {
2474    /// List of Routes.
2475    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2476    pub routes: std::vec::Vec<crate::model::Route>,
2477
2478    /// A token, which can be sent as `page_token` to retrieve the next page.
2479    /// If this field is omitted, there are no subsequent pages.
2480    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2481    pub next_page_token: std::string::String,
2482
2483    /// Locations that could not be reached.
2484    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2485    pub unreachable: std::vec::Vec<std::string::String>,
2486}
2487
2488impl ListRoutesResponse {
2489    pub fn new() -> Self {
2490        std::default::Default::default()
2491    }
2492
2493    /// Sets the value of [next_page_token][crate::model::ListRoutesResponse::next_page_token].
2494    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2495        self.next_page_token = v.into();
2496        self
2497    }
2498
2499    /// Sets the value of [routes][crate::model::ListRoutesResponse::routes].
2500    pub fn set_routes<T, V>(mut self, v: T) -> Self
2501    where
2502        T: std::iter::IntoIterator<Item = V>,
2503        V: std::convert::Into<crate::model::Route>,
2504    {
2505        use std::iter::Iterator;
2506        self.routes = v.into_iter().map(|i| i.into()).collect();
2507        self
2508    }
2509
2510    /// Sets the value of [unreachable][crate::model::ListRoutesResponse::unreachable].
2511    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2512    where
2513        T: std::iter::IntoIterator<Item = V>,
2514        V: std::convert::Into<std::string::String>,
2515    {
2516        use std::iter::Iterator;
2517        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2518        self
2519    }
2520}
2521
2522impl wkt::message::Message for ListRoutesResponse {
2523    fn typename() -> &'static str {
2524        "type.googleapis.com/google.cloud.datastream.v1.ListRoutesResponse"
2525    }
2526}
2527
2528#[cfg(feature = "unstable-stream")]
2529impl gax::paginator::PageableResponse for ListRoutesResponse {
2530    type PageItem = crate::model::Route;
2531
2532    fn items(self) -> std::vec::Vec<Self::PageItem> {
2533        self.routes
2534    }
2535
2536    fn next_page_token(&self) -> std::string::String {
2537        gax::paginator::extract_token(&self.next_page_token)
2538    }
2539}
2540
2541/// Route deletion request.
2542#[serde_with::serde_as]
2543#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2544#[serde(default, rename_all = "camelCase")]
2545#[non_exhaustive]
2546pub struct DeleteRouteRequest {
2547    /// Required. The name of the Route resource to delete.
2548    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2549    pub name: std::string::String,
2550
2551    /// Optional. A request ID to identify requests. Specify a unique request ID
2552    /// so that if you must retry your request, the server will know to ignore
2553    /// the request if it has already been completed. The server will guarantee
2554    /// that for at least 60 minutes after the first request.
2555    ///
2556    /// For example, consider a situation where you make an initial request and the
2557    /// request times out. If you make the request again with the same request ID,
2558    /// the server can check if original operation with the same request ID was
2559    /// received, and if so, will ignore the second request. This prevents clients
2560    /// from accidentally creating duplicate commitments.
2561    ///
2562    /// The request ID must be a valid UUID with the exception that zero UUID is
2563    /// not supported (00000000-0000-0000-0000-000000000000).
2564    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2565    pub request_id: std::string::String,
2566}
2567
2568impl DeleteRouteRequest {
2569    pub fn new() -> Self {
2570        std::default::Default::default()
2571    }
2572
2573    /// Sets the value of [name][crate::model::DeleteRouteRequest::name].
2574    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2575        self.name = v.into();
2576        self
2577    }
2578
2579    /// Sets the value of [request_id][crate::model::DeleteRouteRequest::request_id].
2580    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2581        self.request_id = v.into();
2582        self
2583    }
2584}
2585
2586impl wkt::message::Message for DeleteRouteRequest {
2587    fn typename() -> &'static str {
2588        "type.googleapis.com/google.cloud.datastream.v1.DeleteRouteRequest"
2589    }
2590}
2591
2592/// Route get request.
2593#[serde_with::serde_as]
2594#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2595#[serde(default, rename_all = "camelCase")]
2596#[non_exhaustive]
2597pub struct GetRouteRequest {
2598    /// Required. The name of the Route resource to get.
2599    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2600    pub name: std::string::String,
2601}
2602
2603impl GetRouteRequest {
2604    pub fn new() -> Self {
2605        std::default::Default::default()
2606    }
2607
2608    /// Sets the value of [name][crate::model::GetRouteRequest::name].
2609    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2610        self.name = v.into();
2611        self
2612    }
2613}
2614
2615impl wkt::message::Message for GetRouteRequest {
2616    fn typename() -> &'static str {
2617        "type.googleapis.com/google.cloud.datastream.v1.GetRouteRequest"
2618    }
2619}
2620
2621/// Oracle database profile.
2622/// Next ID: 10.
2623#[serde_with::serde_as]
2624#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2625#[serde(default, rename_all = "camelCase")]
2626#[non_exhaustive]
2627pub struct OracleProfile {
2628    /// Required. Hostname for the Oracle connection.
2629    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2630    pub hostname: std::string::String,
2631
2632    /// Port for the Oracle connection, default value is 1521.
2633    pub port: i32,
2634
2635    /// Required. Username for the Oracle connection.
2636    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2637    pub username: std::string::String,
2638
2639    /// Optional. Password for the Oracle connection. Mutually exclusive with the
2640    /// `secret_manager_stored_password` field.
2641    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2642    pub password: std::string::String,
2643
2644    /// Required. Database for the Oracle connection.
2645    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2646    pub database_service: std::string::String,
2647
2648    /// Connection string attributes
2649    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
2650    pub connection_attributes: std::collections::HashMap<std::string::String, std::string::String>,
2651
2652    /// Optional. SSL configuration for the Oracle connection.
2653    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2654    pub oracle_ssl_config: std::option::Option<crate::model::OracleSslConfig>,
2655
2656    /// Optional. Configuration for Oracle ASM connection.
2657    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2658    pub oracle_asm_config: std::option::Option<crate::model::OracleAsmConfig>,
2659
2660    /// Optional. A reference to a Secret Manager resource name storing the Oracle
2661    /// connection password. Mutually exclusive with the `password` field.
2662    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2663    pub secret_manager_stored_password: std::string::String,
2664}
2665
2666impl OracleProfile {
2667    pub fn new() -> Self {
2668        std::default::Default::default()
2669    }
2670
2671    /// Sets the value of [hostname][crate::model::OracleProfile::hostname].
2672    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2673        self.hostname = v.into();
2674        self
2675    }
2676
2677    /// Sets the value of [port][crate::model::OracleProfile::port].
2678    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2679        self.port = v.into();
2680        self
2681    }
2682
2683    /// Sets the value of [username][crate::model::OracleProfile::username].
2684    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2685        self.username = v.into();
2686        self
2687    }
2688
2689    /// Sets the value of [password][crate::model::OracleProfile::password].
2690    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2691        self.password = v.into();
2692        self
2693    }
2694
2695    /// Sets the value of [database_service][crate::model::OracleProfile::database_service].
2696    pub fn set_database_service<T: std::convert::Into<std::string::String>>(
2697        mut self,
2698        v: T,
2699    ) -> Self {
2700        self.database_service = v.into();
2701        self
2702    }
2703
2704    /// Sets the value of [oracle_ssl_config][crate::model::OracleProfile::oracle_ssl_config].
2705    pub fn set_oracle_ssl_config<
2706        T: std::convert::Into<std::option::Option<crate::model::OracleSslConfig>>,
2707    >(
2708        mut self,
2709        v: T,
2710    ) -> Self {
2711        self.oracle_ssl_config = v.into();
2712        self
2713    }
2714
2715    /// Sets the value of [oracle_asm_config][crate::model::OracleProfile::oracle_asm_config].
2716    pub fn set_oracle_asm_config<
2717        T: std::convert::Into<std::option::Option<crate::model::OracleAsmConfig>>,
2718    >(
2719        mut self,
2720        v: T,
2721    ) -> Self {
2722        self.oracle_asm_config = v.into();
2723        self
2724    }
2725
2726    /// Sets the value of [secret_manager_stored_password][crate::model::OracleProfile::secret_manager_stored_password].
2727    pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
2728        mut self,
2729        v: T,
2730    ) -> Self {
2731        self.secret_manager_stored_password = v.into();
2732        self
2733    }
2734
2735    /// Sets the value of [connection_attributes][crate::model::OracleProfile::connection_attributes].
2736    pub fn set_connection_attributes<T, K, V>(mut self, v: T) -> Self
2737    where
2738        T: std::iter::IntoIterator<Item = (K, V)>,
2739        K: std::convert::Into<std::string::String>,
2740        V: std::convert::Into<std::string::String>,
2741    {
2742        use std::iter::Iterator;
2743        self.connection_attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2744        self
2745    }
2746}
2747
2748impl wkt::message::Message for OracleProfile {
2749    fn typename() -> &'static str {
2750        "type.googleapis.com/google.cloud.datastream.v1.OracleProfile"
2751    }
2752}
2753
2754/// Configuration for Oracle Automatic Storage Management (ASM) connection.
2755/// .
2756#[serde_with::serde_as]
2757#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2758#[serde(default, rename_all = "camelCase")]
2759#[non_exhaustive]
2760pub struct OracleAsmConfig {
2761    /// Required. Hostname for the Oracle ASM connection.
2762    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2763    pub hostname: std::string::String,
2764
2765    /// Required. Port for the Oracle ASM connection.
2766    pub port: i32,
2767
2768    /// Required. Username for the Oracle ASM connection.
2769    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2770    pub username: std::string::String,
2771
2772    /// Optional. Password for the Oracle ASM connection.
2773    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2774    pub password: std::string::String,
2775
2776    /// Required. ASM service name for the Oracle ASM connection.
2777    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2778    pub asm_service: std::string::String,
2779
2780    /// Optional. Connection string attributes
2781    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
2782    pub connection_attributes: std::collections::HashMap<std::string::String, std::string::String>,
2783
2784    /// Optional. SSL configuration for the Oracle connection.
2785    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2786    pub oracle_ssl_config: std::option::Option<crate::model::OracleSslConfig>,
2787}
2788
2789impl OracleAsmConfig {
2790    pub fn new() -> Self {
2791        std::default::Default::default()
2792    }
2793
2794    /// Sets the value of [hostname][crate::model::OracleAsmConfig::hostname].
2795    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2796        self.hostname = v.into();
2797        self
2798    }
2799
2800    /// Sets the value of [port][crate::model::OracleAsmConfig::port].
2801    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2802        self.port = v.into();
2803        self
2804    }
2805
2806    /// Sets the value of [username][crate::model::OracleAsmConfig::username].
2807    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2808        self.username = v.into();
2809        self
2810    }
2811
2812    /// Sets the value of [password][crate::model::OracleAsmConfig::password].
2813    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2814        self.password = v.into();
2815        self
2816    }
2817
2818    /// Sets the value of [asm_service][crate::model::OracleAsmConfig::asm_service].
2819    pub fn set_asm_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2820        self.asm_service = v.into();
2821        self
2822    }
2823
2824    /// Sets the value of [oracle_ssl_config][crate::model::OracleAsmConfig::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 [connection_attributes][crate::model::OracleAsmConfig::connection_attributes].
2836    pub fn set_connection_attributes<T, K, V>(mut self, v: T) -> Self
2837    where
2838        T: std::iter::IntoIterator<Item = (K, V)>,
2839        K: std::convert::Into<std::string::String>,
2840        V: std::convert::Into<std::string::String>,
2841    {
2842        use std::iter::Iterator;
2843        self.connection_attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2844        self
2845    }
2846}
2847
2848impl wkt::message::Message for OracleAsmConfig {
2849    fn typename() -> &'static str {
2850        "type.googleapis.com/google.cloud.datastream.v1.OracleAsmConfig"
2851    }
2852}
2853
2854/// MySQL database profile.
2855/// Next ID: 7.
2856#[serde_with::serde_as]
2857#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2858#[serde(default, rename_all = "camelCase")]
2859#[non_exhaustive]
2860pub struct MysqlProfile {
2861    /// Required. Hostname for the MySQL connection.
2862    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2863    pub hostname: std::string::String,
2864
2865    /// Port for the MySQL connection, default value is 3306.
2866    pub port: i32,
2867
2868    /// Required. Username for the MySQL connection.
2869    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2870    pub username: std::string::String,
2871
2872    /// Optional. Input only. Password for the MySQL connection. Mutually exclusive
2873    /// with the `secret_manager_stored_password` field.
2874    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2875    pub password: std::string::String,
2876
2877    /// SSL configuration for the MySQL connection.
2878    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2879    pub ssl_config: std::option::Option<crate::model::MysqlSslConfig>,
2880}
2881
2882impl MysqlProfile {
2883    pub fn new() -> Self {
2884        std::default::Default::default()
2885    }
2886
2887    /// Sets the value of [hostname][crate::model::MysqlProfile::hostname].
2888    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2889        self.hostname = v.into();
2890        self
2891    }
2892
2893    /// Sets the value of [port][crate::model::MysqlProfile::port].
2894    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2895        self.port = v.into();
2896        self
2897    }
2898
2899    /// Sets the value of [username][crate::model::MysqlProfile::username].
2900    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2901        self.username = v.into();
2902        self
2903    }
2904
2905    /// Sets the value of [password][crate::model::MysqlProfile::password].
2906    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2907        self.password = v.into();
2908        self
2909    }
2910
2911    /// Sets the value of [ssl_config][crate::model::MysqlProfile::ssl_config].
2912    pub fn set_ssl_config<
2913        T: std::convert::Into<std::option::Option<crate::model::MysqlSslConfig>>,
2914    >(
2915        mut self,
2916        v: T,
2917    ) -> Self {
2918        self.ssl_config = v.into();
2919        self
2920    }
2921}
2922
2923impl wkt::message::Message for MysqlProfile {
2924    fn typename() -> &'static str {
2925        "type.googleapis.com/google.cloud.datastream.v1.MysqlProfile"
2926    }
2927}
2928
2929/// PostgreSQL database profile.
2930#[serde_with::serde_as]
2931#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2932#[serde(default, rename_all = "camelCase")]
2933#[non_exhaustive]
2934pub struct PostgresqlProfile {
2935    /// Required. Hostname for the PostgreSQL connection.
2936    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2937    pub hostname: std::string::String,
2938
2939    /// Port for the PostgreSQL connection, default value is 5432.
2940    pub port: i32,
2941
2942    /// Required. Username for the PostgreSQL connection.
2943    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2944    pub username: std::string::String,
2945
2946    /// Optional. Password for the PostgreSQL connection. Mutually exclusive with
2947    /// the `secret_manager_stored_password` field.
2948    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2949    pub password: std::string::String,
2950
2951    /// Required. Database for the PostgreSQL connection.
2952    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2953    pub database: std::string::String,
2954
2955    /// Optional. SSL configuration for the PostgreSQL connection.
2956    /// In case PostgresqlSslConfig is not set, the connection will use the default
2957    /// SSL mode, which is `prefer` (i.e. this mode will only use encryption if
2958    /// enabled from database side, otherwise will use unencrypted communication)
2959    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2960    pub ssl_config: std::option::Option<crate::model::PostgresqlSslConfig>,
2961}
2962
2963impl PostgresqlProfile {
2964    pub fn new() -> Self {
2965        std::default::Default::default()
2966    }
2967
2968    /// Sets the value of [hostname][crate::model::PostgresqlProfile::hostname].
2969    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2970        self.hostname = v.into();
2971        self
2972    }
2973
2974    /// Sets the value of [port][crate::model::PostgresqlProfile::port].
2975    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2976        self.port = v.into();
2977        self
2978    }
2979
2980    /// Sets the value of [username][crate::model::PostgresqlProfile::username].
2981    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2982        self.username = v.into();
2983        self
2984    }
2985
2986    /// Sets the value of [password][crate::model::PostgresqlProfile::password].
2987    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2988        self.password = v.into();
2989        self
2990    }
2991
2992    /// Sets the value of [database][crate::model::PostgresqlProfile::database].
2993    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2994        self.database = v.into();
2995        self
2996    }
2997
2998    /// Sets the value of [ssl_config][crate::model::PostgresqlProfile::ssl_config].
2999    pub fn set_ssl_config<
3000        T: std::convert::Into<std::option::Option<crate::model::PostgresqlSslConfig>>,
3001    >(
3002        mut self,
3003        v: T,
3004    ) -> Self {
3005        self.ssl_config = v.into();
3006        self
3007    }
3008}
3009
3010impl wkt::message::Message for PostgresqlProfile {
3011    fn typename() -> &'static str {
3012        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlProfile"
3013    }
3014}
3015
3016/// SQLServer database profile.
3017/// Next ID: 8.
3018#[serde_with::serde_as]
3019#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3020#[serde(default, rename_all = "camelCase")]
3021#[non_exhaustive]
3022pub struct SqlServerProfile {
3023    /// Required. Hostname for the SQLServer connection.
3024    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3025    pub hostname: std::string::String,
3026
3027    /// Port for the SQLServer connection, default value is 1433.
3028    pub port: i32,
3029
3030    /// Required. Username for the SQLServer connection.
3031    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3032    pub username: std::string::String,
3033
3034    /// Optional. Password for the SQLServer connection. Mutually exclusive with
3035    /// the `secret_manager_stored_password` field.
3036    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3037    pub password: std::string::String,
3038
3039    /// Required. Database for the SQLServer connection.
3040    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3041    pub database: std::string::String,
3042}
3043
3044impl SqlServerProfile {
3045    pub fn new() -> Self {
3046        std::default::Default::default()
3047    }
3048
3049    /// Sets the value of [hostname][crate::model::SqlServerProfile::hostname].
3050    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3051        self.hostname = v.into();
3052        self
3053    }
3054
3055    /// Sets the value of [port][crate::model::SqlServerProfile::port].
3056    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3057        self.port = v.into();
3058        self
3059    }
3060
3061    /// Sets the value of [username][crate::model::SqlServerProfile::username].
3062    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3063        self.username = v.into();
3064        self
3065    }
3066
3067    /// Sets the value of [password][crate::model::SqlServerProfile::password].
3068    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3069        self.password = v.into();
3070        self
3071    }
3072
3073    /// Sets the value of [database][crate::model::SqlServerProfile::database].
3074    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3075        self.database = v.into();
3076        self
3077    }
3078}
3079
3080impl wkt::message::Message for SqlServerProfile {
3081    fn typename() -> &'static str {
3082        "type.googleapis.com/google.cloud.datastream.v1.SqlServerProfile"
3083    }
3084}
3085
3086/// Cloud Storage bucket profile.
3087#[serde_with::serde_as]
3088#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3089#[serde(default, rename_all = "camelCase")]
3090#[non_exhaustive]
3091pub struct GcsProfile {
3092    /// Required. The Cloud Storage bucket name.
3093    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3094    pub bucket: std::string::String,
3095
3096    /// The root path inside the Cloud Storage bucket.
3097    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3098    pub root_path: std::string::String,
3099}
3100
3101impl GcsProfile {
3102    pub fn new() -> Self {
3103        std::default::Default::default()
3104    }
3105
3106    /// Sets the value of [bucket][crate::model::GcsProfile::bucket].
3107    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3108        self.bucket = v.into();
3109        self
3110    }
3111
3112    /// Sets the value of [root_path][crate::model::GcsProfile::root_path].
3113    pub fn set_root_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3114        self.root_path = v.into();
3115        self
3116    }
3117}
3118
3119impl wkt::message::Message for GcsProfile {
3120    fn typename() -> &'static str {
3121        "type.googleapis.com/google.cloud.datastream.v1.GcsProfile"
3122    }
3123}
3124
3125/// BigQuery warehouse profile.
3126#[serde_with::serde_as]
3127#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3128#[serde(default, rename_all = "camelCase")]
3129#[non_exhaustive]
3130pub struct BigQueryProfile {}
3131
3132impl BigQueryProfile {
3133    pub fn new() -> Self {
3134        std::default::Default::default()
3135    }
3136}
3137
3138impl wkt::message::Message for BigQueryProfile {
3139    fn typename() -> &'static str {
3140        "type.googleapis.com/google.cloud.datastream.v1.BigQueryProfile"
3141    }
3142}
3143
3144/// Static IP address connectivity. Used when the source database is configured
3145/// to allow incoming connections from the Datastream public IP addresses
3146/// for the region specified in the connection profile.
3147#[serde_with::serde_as]
3148#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3149#[serde(default, rename_all = "camelCase")]
3150#[non_exhaustive]
3151pub struct StaticServiceIpConnectivity {}
3152
3153impl StaticServiceIpConnectivity {
3154    pub fn new() -> Self {
3155        std::default::Default::default()
3156    }
3157}
3158
3159impl wkt::message::Message for StaticServiceIpConnectivity {
3160    fn typename() -> &'static str {
3161        "type.googleapis.com/google.cloud.datastream.v1.StaticServiceIpConnectivity"
3162    }
3163}
3164
3165/// Forward SSH Tunnel connectivity.
3166#[serde_with::serde_as]
3167#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3168#[serde(default, rename_all = "camelCase")]
3169#[non_exhaustive]
3170pub struct ForwardSshTunnelConnectivity {
3171    /// Required. Hostname for the SSH tunnel.
3172    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3173    pub hostname: std::string::String,
3174
3175    /// Required. Username for the SSH tunnel.
3176    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3177    pub username: std::string::String,
3178
3179    /// Port for the SSH tunnel, default value is 22.
3180    pub port: i32,
3181
3182    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
3183    pub authentication_method:
3184        std::option::Option<crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod>,
3185}
3186
3187impl ForwardSshTunnelConnectivity {
3188    pub fn new() -> Self {
3189        std::default::Default::default()
3190    }
3191
3192    /// Sets the value of [hostname][crate::model::ForwardSshTunnelConnectivity::hostname].
3193    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3194        self.hostname = v.into();
3195        self
3196    }
3197
3198    /// Sets the value of [username][crate::model::ForwardSshTunnelConnectivity::username].
3199    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3200        self.username = v.into();
3201        self
3202    }
3203
3204    /// Sets the value of [port][crate::model::ForwardSshTunnelConnectivity::port].
3205    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3206        self.port = v.into();
3207        self
3208    }
3209
3210    /// Sets the value of `authentication_method`.
3211    pub fn set_authentication_method<
3212        T: std::convert::Into<
3213            std::option::Option<
3214                crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod,
3215            >,
3216        >,
3217    >(
3218        mut self,
3219        v: T,
3220    ) -> Self {
3221        self.authentication_method = v.into();
3222        self
3223    }
3224
3225    /// The value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
3226    /// if it holds a `Password`, `None` if the field is not set or
3227    /// holds a different branch.
3228    pub fn get_password(&self) -> std::option::Option<&std::string::String> {
3229        #[allow(unreachable_patterns)]
3230        self.authentication_method.as_ref().and_then(|v| match v {
3231            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::Password(v) => {
3232                std::option::Option::Some(v)
3233            }
3234            _ => std::option::Option::None,
3235        })
3236    }
3237
3238    /// The value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
3239    /// if it holds a `PrivateKey`, `None` if the field is not set or
3240    /// holds a different branch.
3241    pub fn get_private_key(&self) -> std::option::Option<&std::string::String> {
3242        #[allow(unreachable_patterns)]
3243        self.authentication_method.as_ref().and_then(|v| match v {
3244            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::PrivateKey(v) => {
3245                std::option::Option::Some(v)
3246            }
3247            _ => std::option::Option::None,
3248        })
3249    }
3250
3251    /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
3252    /// to hold a `Password`.
3253    ///
3254    /// Note that all the setters affecting `authentication_method` are
3255    /// mutually exclusive.
3256    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3257        self.authentication_method = std::option::Option::Some(
3258            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::Password(v.into()),
3259        );
3260        self
3261    }
3262
3263    /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
3264    /// to hold a `PrivateKey`.
3265    ///
3266    /// Note that all the setters affecting `authentication_method` are
3267    /// mutually exclusive.
3268    pub fn set_private_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3269        self.authentication_method = std::option::Option::Some(
3270            crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::PrivateKey(
3271                v.into(),
3272            ),
3273        );
3274        self
3275    }
3276}
3277
3278impl wkt::message::Message for ForwardSshTunnelConnectivity {
3279    fn typename() -> &'static str {
3280        "type.googleapis.com/google.cloud.datastream.v1.ForwardSshTunnelConnectivity"
3281    }
3282}
3283
3284/// Defines additional types related to ForwardSshTunnelConnectivity
3285pub mod forward_ssh_tunnel_connectivity {
3286    #[allow(unused_imports)]
3287    use super::*;
3288
3289    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3290    #[serde(rename_all = "camelCase")]
3291    #[non_exhaustive]
3292    pub enum AuthenticationMethod {
3293        /// Input only. SSH password.
3294        Password(std::string::String),
3295        /// Input only. SSH private key.
3296        PrivateKey(std::string::String),
3297    }
3298}
3299
3300/// The VPC Peering configuration is used to create VPC peering between
3301/// Datastream and the consumer's VPC.
3302#[serde_with::serde_as]
3303#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3304#[serde(default, rename_all = "camelCase")]
3305#[non_exhaustive]
3306pub struct VpcPeeringConfig {
3307    /// Required. Fully qualified name of the VPC that Datastream will peer to.
3308    /// Format: `projects/{project}/global/{networks}/{name}`
3309    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3310    pub vpc: std::string::String,
3311
3312    /// Required. A free subnet for peering. (CIDR of /29)
3313    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3314    pub subnet: std::string::String,
3315}
3316
3317impl VpcPeeringConfig {
3318    pub fn new() -> Self {
3319        std::default::Default::default()
3320    }
3321
3322    /// Sets the value of [vpc][crate::model::VpcPeeringConfig::vpc].
3323    pub fn set_vpc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3324        self.vpc = v.into();
3325        self
3326    }
3327
3328    /// Sets the value of [subnet][crate::model::VpcPeeringConfig::subnet].
3329    pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3330        self.subnet = v.into();
3331        self
3332    }
3333}
3334
3335impl wkt::message::Message for VpcPeeringConfig {
3336    fn typename() -> &'static str {
3337        "type.googleapis.com/google.cloud.datastream.v1.VpcPeeringConfig"
3338    }
3339}
3340
3341/// The PrivateConnection resource is used to establish private connectivity
3342/// between Datastream and a customer's network.
3343#[serde_with::serde_as]
3344#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3345#[serde(default, rename_all = "camelCase")]
3346#[non_exhaustive]
3347pub struct PrivateConnection {
3348    /// Output only. Identifier. The resource's name.
3349    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3350    pub name: std::string::String,
3351
3352    /// Output only. The create time of the resource.
3353    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3354    pub create_time: std::option::Option<wkt::Timestamp>,
3355
3356    /// Output only. The update time of the resource.
3357    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3358    pub update_time: std::option::Option<wkt::Timestamp>,
3359
3360    /// Labels.
3361    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
3362    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3363
3364    /// Required. Display name.
3365    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3366    pub display_name: std::string::String,
3367
3368    /// Output only. The state of the Private Connection.
3369    pub state: crate::model::private_connection::State,
3370
3371    /// Output only. In case of error, the details of the error in a user-friendly
3372    /// format.
3373    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3374    pub error: std::option::Option<crate::model::Error>,
3375
3376    /// VPC Peering Config.
3377    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3378    pub vpc_peering_config: std::option::Option<crate::model::VpcPeeringConfig>,
3379}
3380
3381impl PrivateConnection {
3382    pub fn new() -> Self {
3383        std::default::Default::default()
3384    }
3385
3386    /// Sets the value of [name][crate::model::PrivateConnection::name].
3387    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3388        self.name = v.into();
3389        self
3390    }
3391
3392    /// Sets the value of [create_time][crate::model::PrivateConnection::create_time].
3393    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3394        mut self,
3395        v: T,
3396    ) -> Self {
3397        self.create_time = v.into();
3398        self
3399    }
3400
3401    /// Sets the value of [update_time][crate::model::PrivateConnection::update_time].
3402    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3403        mut self,
3404        v: T,
3405    ) -> Self {
3406        self.update_time = v.into();
3407        self
3408    }
3409
3410    /// Sets the value of [display_name][crate::model::PrivateConnection::display_name].
3411    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3412        self.display_name = v.into();
3413        self
3414    }
3415
3416    /// Sets the value of [state][crate::model::PrivateConnection::state].
3417    pub fn set_state<T: std::convert::Into<crate::model::private_connection::State>>(
3418        mut self,
3419        v: T,
3420    ) -> Self {
3421        self.state = v.into();
3422        self
3423    }
3424
3425    /// Sets the value of [error][crate::model::PrivateConnection::error].
3426    pub fn set_error<T: std::convert::Into<std::option::Option<crate::model::Error>>>(
3427        mut self,
3428        v: T,
3429    ) -> Self {
3430        self.error = v.into();
3431        self
3432    }
3433
3434    /// Sets the value of [vpc_peering_config][crate::model::PrivateConnection::vpc_peering_config].
3435    pub fn set_vpc_peering_config<
3436        T: std::convert::Into<std::option::Option<crate::model::VpcPeeringConfig>>,
3437    >(
3438        mut self,
3439        v: T,
3440    ) -> Self {
3441        self.vpc_peering_config = v.into();
3442        self
3443    }
3444
3445    /// Sets the value of [labels][crate::model::PrivateConnection::labels].
3446    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3447    where
3448        T: std::iter::IntoIterator<Item = (K, V)>,
3449        K: std::convert::Into<std::string::String>,
3450        V: std::convert::Into<std::string::String>,
3451    {
3452        use std::iter::Iterator;
3453        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3454        self
3455    }
3456}
3457
3458impl wkt::message::Message for PrivateConnection {
3459    fn typename() -> &'static str {
3460        "type.googleapis.com/google.cloud.datastream.v1.PrivateConnection"
3461    }
3462}
3463
3464/// Defines additional types related to PrivateConnection
3465pub mod private_connection {
3466    #[allow(unused_imports)]
3467    use super::*;
3468
3469    /// Private Connection state.
3470    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3471    pub struct State(std::borrow::Cow<'static, str>);
3472
3473    impl State {
3474        /// Creates a new State instance.
3475        pub const fn new(v: &'static str) -> Self {
3476            Self(std::borrow::Cow::Borrowed(v))
3477        }
3478
3479        /// Gets the enum value.
3480        pub fn value(&self) -> &str {
3481            &self.0
3482        }
3483    }
3484
3485    /// Useful constants to work with [State](State)
3486    pub mod state {
3487        use super::State;
3488
3489        /// Unspecified state.
3490        pub const STATE_UNSPECIFIED: State = State::new("STATE_UNSPECIFIED");
3491
3492        /// The private connection is in creation state - creating resources.
3493        pub const CREATING: State = State::new("CREATING");
3494
3495        /// The private connection has been created with all of its resources.
3496        pub const CREATED: State = State::new("CREATED");
3497
3498        /// The private connection creation has failed.
3499        pub const FAILED: State = State::new("FAILED");
3500
3501        /// The private connection is being deleted.
3502        pub const DELETING: State = State::new("DELETING");
3503
3504        /// Delete request has failed, resource is in invalid state.
3505        pub const FAILED_TO_DELETE: State = State::new("FAILED_TO_DELETE");
3506    }
3507
3508    impl std::convert::From<std::string::String> for State {
3509        fn from(value: std::string::String) -> Self {
3510            Self(std::borrow::Cow::Owned(value))
3511        }
3512    }
3513}
3514
3515/// Private Connectivity
3516#[serde_with::serde_as]
3517#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3518#[serde(default, rename_all = "camelCase")]
3519#[non_exhaustive]
3520pub struct PrivateConnectivity {
3521    /// Required. A reference to a private connection resource.
3522    /// Format: `projects/{project}/locations/{location}/privateConnections/{name}`
3523    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3524    pub private_connection: std::string::String,
3525}
3526
3527impl PrivateConnectivity {
3528    pub fn new() -> Self {
3529        std::default::Default::default()
3530    }
3531
3532    /// Sets the value of [private_connection][crate::model::PrivateConnectivity::private_connection].
3533    pub fn set_private_connection<T: std::convert::Into<std::string::String>>(
3534        mut self,
3535        v: T,
3536    ) -> Self {
3537        self.private_connection = v.into();
3538        self
3539    }
3540}
3541
3542impl wkt::message::Message for PrivateConnectivity {
3543    fn typename() -> &'static str {
3544        "type.googleapis.com/google.cloud.datastream.v1.PrivateConnectivity"
3545    }
3546}
3547
3548/// The route resource is the child of the private connection resource,
3549/// used for defining a route for a private connection.
3550#[serde_with::serde_as]
3551#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3552#[serde(default, rename_all = "camelCase")]
3553#[non_exhaustive]
3554pub struct Route {
3555    /// Output only. Identifier. The resource's name.
3556    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3557    pub name: std::string::String,
3558
3559    /// Output only. The create time of the resource.
3560    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3561    pub create_time: std::option::Option<wkt::Timestamp>,
3562
3563    /// Output only. The update time of the resource.
3564    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3565    pub update_time: std::option::Option<wkt::Timestamp>,
3566
3567    /// Labels.
3568    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
3569    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3570
3571    /// Required. Display name.
3572    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3573    pub display_name: std::string::String,
3574
3575    /// Required. Destination address for connection
3576    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3577    pub destination_address: std::string::String,
3578
3579    /// Destination port for connection
3580    pub destination_port: i32,
3581}
3582
3583impl Route {
3584    pub fn new() -> Self {
3585        std::default::Default::default()
3586    }
3587
3588    /// Sets the value of [name][crate::model::Route::name].
3589    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3590        self.name = v.into();
3591        self
3592    }
3593
3594    /// Sets the value of [create_time][crate::model::Route::create_time].
3595    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3596        mut self,
3597        v: T,
3598    ) -> Self {
3599        self.create_time = v.into();
3600        self
3601    }
3602
3603    /// Sets the value of [update_time][crate::model::Route::update_time].
3604    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3605        mut self,
3606        v: T,
3607    ) -> Self {
3608        self.update_time = v.into();
3609        self
3610    }
3611
3612    /// Sets the value of [display_name][crate::model::Route::display_name].
3613    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3614        self.display_name = v.into();
3615        self
3616    }
3617
3618    /// Sets the value of [destination_address][crate::model::Route::destination_address].
3619    pub fn set_destination_address<T: std::convert::Into<std::string::String>>(
3620        mut self,
3621        v: T,
3622    ) -> Self {
3623        self.destination_address = v.into();
3624        self
3625    }
3626
3627    /// Sets the value of [destination_port][crate::model::Route::destination_port].
3628    pub fn set_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3629        self.destination_port = v.into();
3630        self
3631    }
3632
3633    /// Sets the value of [labels][crate::model::Route::labels].
3634    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3635    where
3636        T: std::iter::IntoIterator<Item = (K, V)>,
3637        K: std::convert::Into<std::string::String>,
3638        V: std::convert::Into<std::string::String>,
3639    {
3640        use std::iter::Iterator;
3641        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3642        self
3643    }
3644}
3645
3646impl wkt::message::Message for Route {
3647    fn typename() -> &'static str {
3648        "type.googleapis.com/google.cloud.datastream.v1.Route"
3649    }
3650}
3651
3652/// MySQL SSL configuration information.
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 MysqlSslConfig {
3658    /// Input only. PEM-encoded private key associated with the Client Certificate.
3659    /// If this field is used then the 'client_certificate' and the
3660    /// 'ca_certificate' fields are mandatory.
3661    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3662    pub client_key: std::string::String,
3663
3664    /// Output only. Indicates whether the client_key field is set.
3665    pub client_key_set: bool,
3666
3667    /// Input only. PEM-encoded certificate that will be used by the replica to
3668    /// authenticate against the source database server. If this field is used
3669    /// then the 'client_key' and the 'ca_certificate' fields are mandatory.
3670    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3671    pub client_certificate: std::string::String,
3672
3673    /// Output only. Indicates whether the client_certificate field is set.
3674    pub client_certificate_set: bool,
3675
3676    /// Input only. PEM-encoded certificate of the CA that signed the source
3677    /// database server's certificate.
3678    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3679    pub ca_certificate: std::string::String,
3680
3681    /// Output only. Indicates whether the ca_certificate field is set.
3682    pub ca_certificate_set: bool,
3683}
3684
3685impl MysqlSslConfig {
3686    pub fn new() -> Self {
3687        std::default::Default::default()
3688    }
3689
3690    /// Sets the value of [client_key][crate::model::MysqlSslConfig::client_key].
3691    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3692        self.client_key = v.into();
3693        self
3694    }
3695
3696    /// Sets the value of [client_key_set][crate::model::MysqlSslConfig::client_key_set].
3697    pub fn set_client_key_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3698        self.client_key_set = v.into();
3699        self
3700    }
3701
3702    /// Sets the value of [client_certificate][crate::model::MysqlSslConfig::client_certificate].
3703    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
3704        mut self,
3705        v: T,
3706    ) -> Self {
3707        self.client_certificate = v.into();
3708        self
3709    }
3710
3711    /// Sets the value of [client_certificate_set][crate::model::MysqlSslConfig::client_certificate_set].
3712    pub fn set_client_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3713        self.client_certificate_set = v.into();
3714        self
3715    }
3716
3717    /// Sets the value of [ca_certificate][crate::model::MysqlSslConfig::ca_certificate].
3718    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3719        self.ca_certificate = v.into();
3720        self
3721    }
3722
3723    /// Sets the value of [ca_certificate_set][crate::model::MysqlSslConfig::ca_certificate_set].
3724    pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3725        self.ca_certificate_set = v.into();
3726        self
3727    }
3728}
3729
3730impl wkt::message::Message for MysqlSslConfig {
3731    fn typename() -> &'static str {
3732        "type.googleapis.com/google.cloud.datastream.v1.MysqlSslConfig"
3733    }
3734}
3735
3736/// Oracle SSL configuration information.
3737#[serde_with::serde_as]
3738#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3739#[serde(default, rename_all = "camelCase")]
3740#[non_exhaustive]
3741pub struct OracleSslConfig {
3742    /// Input only. PEM-encoded certificate of the CA that signed the source
3743    /// database server's certificate.
3744    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3745    pub ca_certificate: std::string::String,
3746
3747    /// Output only. Indicates whether the ca_certificate field has been set for
3748    /// this Connection-Profile.
3749    pub ca_certificate_set: bool,
3750}
3751
3752impl OracleSslConfig {
3753    pub fn new() -> Self {
3754        std::default::Default::default()
3755    }
3756
3757    /// Sets the value of [ca_certificate][crate::model::OracleSslConfig::ca_certificate].
3758    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3759        self.ca_certificate = v.into();
3760        self
3761    }
3762
3763    /// Sets the value of [ca_certificate_set][crate::model::OracleSslConfig::ca_certificate_set].
3764    pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3765        self.ca_certificate_set = v.into();
3766        self
3767    }
3768}
3769
3770impl wkt::message::Message for OracleSslConfig {
3771    fn typename() -> &'static str {
3772        "type.googleapis.com/google.cloud.datastream.v1.OracleSslConfig"
3773    }
3774}
3775
3776/// PostgreSQL SSL configuration information.
3777#[serde_with::serde_as]
3778#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3779#[serde(default, rename_all = "camelCase")]
3780#[non_exhaustive]
3781pub struct PostgresqlSslConfig {
3782    /// The encryption settings available for PostgreSQL connection profiles.
3783    /// This captures various SSL mode supported by PostgreSQL, which includes
3784    /// TLS encryption with server verification, TLS encryption with both server
3785    /// and client verification and no TLS encryption.
3786    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
3787    pub encryption_setting:
3788        std::option::Option<crate::model::postgresql_ssl_config::EncryptionSetting>,
3789}
3790
3791impl PostgresqlSslConfig {
3792    pub fn new() -> Self {
3793        std::default::Default::default()
3794    }
3795
3796    /// Sets the value of `encryption_setting`.
3797    pub fn set_encryption_setting<
3798        T: std::convert::Into<
3799            std::option::Option<crate::model::postgresql_ssl_config::EncryptionSetting>,
3800        >,
3801    >(
3802        mut self,
3803        v: T,
3804    ) -> Self {
3805        self.encryption_setting = v.into();
3806        self
3807    }
3808
3809    /// The value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
3810    /// if it holds a `ServerVerification`, `None` if the field is not set or
3811    /// holds a different branch.
3812    pub fn get_server_verification(
3813        &self,
3814    ) -> std::option::Option<
3815        &std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
3816    > {
3817        #[allow(unreachable_patterns)]
3818        self.encryption_setting.as_ref().and_then(|v| match v {
3819            crate::model::postgresql_ssl_config::EncryptionSetting::ServerVerification(v) => {
3820                std::option::Option::Some(v)
3821            }
3822            _ => std::option::Option::None,
3823        })
3824    }
3825
3826    /// The value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
3827    /// if it holds a `ServerAndClientVerification`, `None` if the field is not set or
3828    /// holds a different branch.
3829    pub fn get_server_and_client_verification(
3830        &self,
3831    ) -> std::option::Option<
3832        &std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
3833    > {
3834        #[allow(unreachable_patterns)]
3835        self.encryption_setting.as_ref().and_then(|v| match v {
3836            crate::model::postgresql_ssl_config::EncryptionSetting::ServerAndClientVerification(
3837                v,
3838            ) => std::option::Option::Some(v),
3839            _ => std::option::Option::None,
3840        })
3841    }
3842
3843    /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
3844    /// to hold a `ServerVerification`.
3845    ///
3846    /// Note that all the setters affecting `encryption_setting` are
3847    /// mutually exclusive.
3848    pub fn set_server_verification<
3849        T: std::convert::Into<
3850            std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
3851        >,
3852    >(
3853        mut self,
3854        v: T,
3855    ) -> Self {
3856        self.encryption_setting = std::option::Option::Some(
3857            crate::model::postgresql_ssl_config::EncryptionSetting::ServerVerification(v.into()),
3858        );
3859        self
3860    }
3861
3862    /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
3863    /// to hold a `ServerAndClientVerification`.
3864    ///
3865    /// Note that all the setters affecting `encryption_setting` are
3866    /// mutually exclusive.
3867    pub fn set_server_and_client_verification<
3868        T: std::convert::Into<
3869            std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
3870        >,
3871    >(
3872        mut self,
3873        v: T,
3874    ) -> Self {
3875        self.encryption_setting = std::option::Option::Some(
3876            crate::model::postgresql_ssl_config::EncryptionSetting::ServerAndClientVerification(
3877                v.into(),
3878            ),
3879        );
3880        self
3881    }
3882}
3883
3884impl wkt::message::Message for PostgresqlSslConfig {
3885    fn typename() -> &'static str {
3886        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig"
3887    }
3888}
3889
3890/// Defines additional types related to PostgresqlSslConfig
3891pub mod postgresql_ssl_config {
3892    #[allow(unused_imports)]
3893    use super::*;
3894
3895    /// Message represents the option where Datastream will enforce the encryption
3896    /// and authenticate the server identity. ca_certificate must be set if user
3897    /// selects this option.
3898    #[serde_with::serde_as]
3899    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3900    #[serde(default, rename_all = "camelCase")]
3901    #[non_exhaustive]
3902    pub struct ServerVerification {
3903        /// Required. Input only. PEM-encoded server root CA certificate.
3904        #[serde(skip_serializing_if = "std::string::String::is_empty")]
3905        pub ca_certificate: std::string::String,
3906    }
3907
3908    impl ServerVerification {
3909        pub fn new() -> Self {
3910            std::default::Default::default()
3911        }
3912
3913        /// Sets the value of [ca_certificate][crate::model::postgresql_ssl_config::ServerVerification::ca_certificate].
3914        pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(
3915            mut self,
3916            v: T,
3917        ) -> Self {
3918            self.ca_certificate = v.into();
3919            self
3920        }
3921    }
3922
3923    impl wkt::message::Message for ServerVerification {
3924        fn typename() -> &'static str {
3925            "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig.ServerVerification"
3926        }
3927    }
3928
3929    /// Message represents the option where Datastream will enforce the encryption
3930    /// and authenticate the server identity as well as the client identity.
3931    /// ca_certificate, client_certificate and client_key must be set if user
3932    /// selects this option.
3933    #[serde_with::serde_as]
3934    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3935    #[serde(default, rename_all = "camelCase")]
3936    #[non_exhaustive]
3937    pub struct ServerAndClientVerification {
3938        /// Required. Input only. PEM-encoded certificate used by the source database
3939        /// to authenticate the client identity (i.e., the Datastream's identity).
3940        /// This certificate is signed by either a root certificate trusted by the
3941        /// server or one or more intermediate certificates (which is stored with the
3942        /// leaf certificate) to link the this certificate to the trusted root
3943        /// certificate.
3944        #[serde(skip_serializing_if = "std::string::String::is_empty")]
3945        pub client_certificate: std::string::String,
3946
3947        /// Required. Input only. PEM-encoded private key associated with the client
3948        /// certificate. This value will be used during the SSL/TLS handshake,
3949        /// allowing the PostgreSQL server to authenticate the client's identity,
3950        /// i.e. identity of the Datastream.
3951        #[serde(skip_serializing_if = "std::string::String::is_empty")]
3952        pub client_key: std::string::String,
3953
3954        /// Required. Input only. PEM-encoded server root CA certificate.
3955        #[serde(skip_serializing_if = "std::string::String::is_empty")]
3956        pub ca_certificate: std::string::String,
3957    }
3958
3959    impl ServerAndClientVerification {
3960        pub fn new() -> Self {
3961            std::default::Default::default()
3962        }
3963
3964        /// Sets the value of [client_certificate][crate::model::postgresql_ssl_config::ServerAndClientVerification::client_certificate].
3965        pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
3966            mut self,
3967            v: T,
3968        ) -> Self {
3969            self.client_certificate = v.into();
3970            self
3971        }
3972
3973        /// Sets the value of [client_key][crate::model::postgresql_ssl_config::ServerAndClientVerification::client_key].
3974        pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3975            self.client_key = v.into();
3976            self
3977        }
3978
3979        /// Sets the value of [ca_certificate][crate::model::postgresql_ssl_config::ServerAndClientVerification::ca_certificate].
3980        pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(
3981            mut self,
3982            v: T,
3983        ) -> Self {
3984            self.ca_certificate = v.into();
3985            self
3986        }
3987    }
3988
3989    impl wkt::message::Message for ServerAndClientVerification {
3990        fn typename() -> &'static str {
3991            "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig.ServerAndClientVerification"
3992        }
3993    }
3994
3995    /// The encryption settings available for PostgreSQL connection profiles.
3996    /// This captures various SSL mode supported by PostgreSQL, which includes
3997    /// TLS encryption with server verification, TLS encryption with both server
3998    /// and client verification and no TLS encryption.
3999    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
4000    #[serde(rename_all = "camelCase")]
4001    #[non_exhaustive]
4002    pub enum EncryptionSetting {
4003        ///  If this field is set, the communication will be encrypted with TLS
4004        /// encryption and the server identity will be authenticated.
4005        ServerVerification(
4006            std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
4007        ),
4008        /// If this field is set, the communication will be encrypted with TLS
4009        /// encryption and both the server identity and the client identity will be
4010        /// authenticated.
4011        ServerAndClientVerification(
4012            std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
4013        ),
4014    }
4015}
4016
4017/// A set of reusable connection configurations to be used as a source or
4018/// destination for a stream.
4019#[serde_with::serde_as]
4020#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4021#[serde(default, rename_all = "camelCase")]
4022#[non_exhaustive]
4023pub struct ConnectionProfile {
4024    /// Output only. Identifier. The resource's name.
4025    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4026    pub name: std::string::String,
4027
4028    /// Output only. The create time of the resource.
4029    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4030    pub create_time: std::option::Option<wkt::Timestamp>,
4031
4032    /// Output only. The update time of the resource.
4033    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4034    pub update_time: std::option::Option<wkt::Timestamp>,
4035
4036    /// Labels.
4037    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
4038    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4039
4040    /// Required. Display name.
4041    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4042    pub display_name: std::string::String,
4043
4044    /// Connection configuration for the ConnectionProfile.
4045    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
4046    pub profile: std::option::Option<crate::model::connection_profile::Profile>,
4047
4048    /// Connectivity options used to establish a connection to the profile.
4049    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
4050    pub connectivity: std::option::Option<crate::model::connection_profile::Connectivity>,
4051}
4052
4053impl ConnectionProfile {
4054    pub fn new() -> Self {
4055        std::default::Default::default()
4056    }
4057
4058    /// Sets the value of [name][crate::model::ConnectionProfile::name].
4059    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4060        self.name = v.into();
4061        self
4062    }
4063
4064    /// Sets the value of [create_time][crate::model::ConnectionProfile::create_time].
4065    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4066        mut self,
4067        v: T,
4068    ) -> Self {
4069        self.create_time = v.into();
4070        self
4071    }
4072
4073    /// Sets the value of [update_time][crate::model::ConnectionProfile::update_time].
4074    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4075        mut self,
4076        v: T,
4077    ) -> Self {
4078        self.update_time = v.into();
4079        self
4080    }
4081
4082    /// Sets the value of [display_name][crate::model::ConnectionProfile::display_name].
4083    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4084        self.display_name = v.into();
4085        self
4086    }
4087
4088    /// Sets the value of [labels][crate::model::ConnectionProfile::labels].
4089    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4090    where
4091        T: std::iter::IntoIterator<Item = (K, V)>,
4092        K: std::convert::Into<std::string::String>,
4093        V: std::convert::Into<std::string::String>,
4094    {
4095        use std::iter::Iterator;
4096        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4097        self
4098    }
4099
4100    /// Sets the value of `profile`.
4101    pub fn set_profile<
4102        T: std::convert::Into<std::option::Option<crate::model::connection_profile::Profile>>,
4103    >(
4104        mut self,
4105        v: T,
4106    ) -> Self {
4107        self.profile = v.into();
4108        self
4109    }
4110
4111    /// The value of [profile][crate::model::ConnectionProfile::profile]
4112    /// if it holds a `OracleProfile`, `None` if the field is not set or
4113    /// holds a different branch.
4114    pub fn get_oracle_profile(
4115        &self,
4116    ) -> std::option::Option<&std::boxed::Box<crate::model::OracleProfile>> {
4117        #[allow(unreachable_patterns)]
4118        self.profile.as_ref().and_then(|v| match v {
4119            crate::model::connection_profile::Profile::OracleProfile(v) => {
4120                std::option::Option::Some(v)
4121            }
4122            _ => std::option::Option::None,
4123        })
4124    }
4125
4126    /// The value of [profile][crate::model::ConnectionProfile::profile]
4127    /// if it holds a `GcsProfile`, `None` if the field is not set or
4128    /// holds a different branch.
4129    pub fn get_gcs_profile(
4130        &self,
4131    ) -> std::option::Option<&std::boxed::Box<crate::model::GcsProfile>> {
4132        #[allow(unreachable_patterns)]
4133        self.profile.as_ref().and_then(|v| match v {
4134            crate::model::connection_profile::Profile::GcsProfile(v) => {
4135                std::option::Option::Some(v)
4136            }
4137            _ => std::option::Option::None,
4138        })
4139    }
4140
4141    /// The value of [profile][crate::model::ConnectionProfile::profile]
4142    /// if it holds a `MysqlProfile`, `None` if the field is not set or
4143    /// holds a different branch.
4144    pub fn get_mysql_profile(
4145        &self,
4146    ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlProfile>> {
4147        #[allow(unreachable_patterns)]
4148        self.profile.as_ref().and_then(|v| match v {
4149            crate::model::connection_profile::Profile::MysqlProfile(v) => {
4150                std::option::Option::Some(v)
4151            }
4152            _ => std::option::Option::None,
4153        })
4154    }
4155
4156    /// The value of [profile][crate::model::ConnectionProfile::profile]
4157    /// if it holds a `BigqueryProfile`, `None` if the field is not set or
4158    /// holds a different branch.
4159    pub fn get_bigquery_profile(
4160        &self,
4161    ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryProfile>> {
4162        #[allow(unreachable_patterns)]
4163        self.profile.as_ref().and_then(|v| match v {
4164            crate::model::connection_profile::Profile::BigqueryProfile(v) => {
4165                std::option::Option::Some(v)
4166            }
4167            _ => std::option::Option::None,
4168        })
4169    }
4170
4171    /// The value of [profile][crate::model::ConnectionProfile::profile]
4172    /// if it holds a `PostgresqlProfile`, `None` if the field is not set or
4173    /// holds a different branch.
4174    pub fn get_postgresql_profile(
4175        &self,
4176    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlProfile>> {
4177        #[allow(unreachable_patterns)]
4178        self.profile.as_ref().and_then(|v| match v {
4179            crate::model::connection_profile::Profile::PostgresqlProfile(v) => {
4180                std::option::Option::Some(v)
4181            }
4182            _ => std::option::Option::None,
4183        })
4184    }
4185
4186    /// The value of [profile][crate::model::ConnectionProfile::profile]
4187    /// if it holds a `SqlServerProfile`, `None` if the field is not set or
4188    /// holds a different branch.
4189    pub fn get_sql_server_profile(
4190        &self,
4191    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerProfile>> {
4192        #[allow(unreachable_patterns)]
4193        self.profile.as_ref().and_then(|v| match v {
4194            crate::model::connection_profile::Profile::SqlServerProfile(v) => {
4195                std::option::Option::Some(v)
4196            }
4197            _ => std::option::Option::None,
4198        })
4199    }
4200
4201    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
4202    /// to hold a `OracleProfile`.
4203    ///
4204    /// Note that all the setters affecting `profile` are
4205    /// mutually exclusive.
4206    pub fn set_oracle_profile<
4207        T: std::convert::Into<std::boxed::Box<crate::model::OracleProfile>>,
4208    >(
4209        mut self,
4210        v: T,
4211    ) -> Self {
4212        self.profile = std::option::Option::Some(
4213            crate::model::connection_profile::Profile::OracleProfile(v.into()),
4214        );
4215        self
4216    }
4217
4218    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
4219    /// to hold a `GcsProfile`.
4220    ///
4221    /// Note that all the setters affecting `profile` are
4222    /// mutually exclusive.
4223    pub fn set_gcs_profile<T: std::convert::Into<std::boxed::Box<crate::model::GcsProfile>>>(
4224        mut self,
4225        v: T,
4226    ) -> Self {
4227        self.profile = std::option::Option::Some(
4228            crate::model::connection_profile::Profile::GcsProfile(v.into()),
4229        );
4230        self
4231    }
4232
4233    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
4234    /// to hold a `MysqlProfile`.
4235    ///
4236    /// Note that all the setters affecting `profile` are
4237    /// mutually exclusive.
4238    pub fn set_mysql_profile<T: std::convert::Into<std::boxed::Box<crate::model::MysqlProfile>>>(
4239        mut self,
4240        v: T,
4241    ) -> Self {
4242        self.profile = std::option::Option::Some(
4243            crate::model::connection_profile::Profile::MysqlProfile(v.into()),
4244        );
4245        self
4246    }
4247
4248    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
4249    /// to hold a `BigqueryProfile`.
4250    ///
4251    /// Note that all the setters affecting `profile` are
4252    /// mutually exclusive.
4253    pub fn set_bigquery_profile<
4254        T: std::convert::Into<std::boxed::Box<crate::model::BigQueryProfile>>,
4255    >(
4256        mut self,
4257        v: T,
4258    ) -> Self {
4259        self.profile = std::option::Option::Some(
4260            crate::model::connection_profile::Profile::BigqueryProfile(v.into()),
4261        );
4262        self
4263    }
4264
4265    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
4266    /// to hold a `PostgresqlProfile`.
4267    ///
4268    /// Note that all the setters affecting `profile` are
4269    /// mutually exclusive.
4270    pub fn set_postgresql_profile<
4271        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlProfile>>,
4272    >(
4273        mut self,
4274        v: T,
4275    ) -> Self {
4276        self.profile = std::option::Option::Some(
4277            crate::model::connection_profile::Profile::PostgresqlProfile(v.into()),
4278        );
4279        self
4280    }
4281
4282    /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
4283    /// to hold a `SqlServerProfile`.
4284    ///
4285    /// Note that all the setters affecting `profile` are
4286    /// mutually exclusive.
4287    pub fn set_sql_server_profile<
4288        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerProfile>>,
4289    >(
4290        mut self,
4291        v: T,
4292    ) -> Self {
4293        self.profile = std::option::Option::Some(
4294            crate::model::connection_profile::Profile::SqlServerProfile(v.into()),
4295        );
4296        self
4297    }
4298
4299    /// Sets the value of `connectivity`.
4300    pub fn set_connectivity<
4301        T: std::convert::Into<std::option::Option<crate::model::connection_profile::Connectivity>>,
4302    >(
4303        mut self,
4304        v: T,
4305    ) -> Self {
4306        self.connectivity = v.into();
4307        self
4308    }
4309
4310    /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
4311    /// if it holds a `StaticServiceIpConnectivity`, `None` if the field is not set or
4312    /// holds a different branch.
4313    pub fn get_static_service_ip_connectivity(
4314        &self,
4315    ) -> std::option::Option<&std::boxed::Box<crate::model::StaticServiceIpConnectivity>> {
4316        #[allow(unreachable_patterns)]
4317        self.connectivity.as_ref().and_then(|v| match v {
4318            crate::model::connection_profile::Connectivity::StaticServiceIpConnectivity(v) => {
4319                std::option::Option::Some(v)
4320            }
4321            _ => std::option::Option::None,
4322        })
4323    }
4324
4325    /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
4326    /// if it holds a `ForwardSshConnectivity`, `None` if the field is not set or
4327    /// holds a different branch.
4328    pub fn get_forward_ssh_connectivity(
4329        &self,
4330    ) -> std::option::Option<&std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>> {
4331        #[allow(unreachable_patterns)]
4332        self.connectivity.as_ref().and_then(|v| match v {
4333            crate::model::connection_profile::Connectivity::ForwardSshConnectivity(v) => {
4334                std::option::Option::Some(v)
4335            }
4336            _ => std::option::Option::None,
4337        })
4338    }
4339
4340    /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
4341    /// if it holds a `PrivateConnectivity`, `None` if the field is not set or
4342    /// holds a different branch.
4343    pub fn get_private_connectivity(
4344        &self,
4345    ) -> std::option::Option<&std::boxed::Box<crate::model::PrivateConnectivity>> {
4346        #[allow(unreachable_patterns)]
4347        self.connectivity.as_ref().and_then(|v| match v {
4348            crate::model::connection_profile::Connectivity::PrivateConnectivity(v) => {
4349                std::option::Option::Some(v)
4350            }
4351            _ => std::option::Option::None,
4352        })
4353    }
4354
4355    /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
4356    /// to hold a `StaticServiceIpConnectivity`.
4357    ///
4358    /// Note that all the setters affecting `connectivity` are
4359    /// mutually exclusive.
4360    pub fn set_static_service_ip_connectivity<
4361        T: std::convert::Into<std::boxed::Box<crate::model::StaticServiceIpConnectivity>>,
4362    >(
4363        mut self,
4364        v: T,
4365    ) -> Self {
4366        self.connectivity = std::option::Option::Some(
4367            crate::model::connection_profile::Connectivity::StaticServiceIpConnectivity(v.into()),
4368        );
4369        self
4370    }
4371
4372    /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
4373    /// to hold a `ForwardSshConnectivity`.
4374    ///
4375    /// Note that all the setters affecting `connectivity` are
4376    /// mutually exclusive.
4377    pub fn set_forward_ssh_connectivity<
4378        T: std::convert::Into<std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>>,
4379    >(
4380        mut self,
4381        v: T,
4382    ) -> Self {
4383        self.connectivity = std::option::Option::Some(
4384            crate::model::connection_profile::Connectivity::ForwardSshConnectivity(v.into()),
4385        );
4386        self
4387    }
4388
4389    /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
4390    /// to hold a `PrivateConnectivity`.
4391    ///
4392    /// Note that all the setters affecting `connectivity` are
4393    /// mutually exclusive.
4394    pub fn set_private_connectivity<
4395        T: std::convert::Into<std::boxed::Box<crate::model::PrivateConnectivity>>,
4396    >(
4397        mut self,
4398        v: T,
4399    ) -> Self {
4400        self.connectivity = std::option::Option::Some(
4401            crate::model::connection_profile::Connectivity::PrivateConnectivity(v.into()),
4402        );
4403        self
4404    }
4405}
4406
4407impl wkt::message::Message for ConnectionProfile {
4408    fn typename() -> &'static str {
4409        "type.googleapis.com/google.cloud.datastream.v1.ConnectionProfile"
4410    }
4411}
4412
4413/// Defines additional types related to ConnectionProfile
4414pub mod connection_profile {
4415    #[allow(unused_imports)]
4416    use super::*;
4417
4418    /// Connection configuration for the ConnectionProfile.
4419    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
4420    #[serde(rename_all = "camelCase")]
4421    #[non_exhaustive]
4422    pub enum Profile {
4423        /// Oracle ConnectionProfile configuration.
4424        OracleProfile(std::boxed::Box<crate::model::OracleProfile>),
4425        /// Cloud Storage ConnectionProfile configuration.
4426        GcsProfile(std::boxed::Box<crate::model::GcsProfile>),
4427        /// MySQL ConnectionProfile configuration.
4428        MysqlProfile(std::boxed::Box<crate::model::MysqlProfile>),
4429        /// BigQuery Connection Profile configuration.
4430        BigqueryProfile(std::boxed::Box<crate::model::BigQueryProfile>),
4431        /// PostgreSQL Connection Profile configuration.
4432        PostgresqlProfile(std::boxed::Box<crate::model::PostgresqlProfile>),
4433        /// SQLServer Connection Profile configuration.
4434        SqlServerProfile(std::boxed::Box<crate::model::SqlServerProfile>),
4435    }
4436
4437    /// Connectivity options used to establish a connection to the profile.
4438    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
4439    #[serde(rename_all = "camelCase")]
4440    #[non_exhaustive]
4441    pub enum Connectivity {
4442        /// Static Service IP connectivity.
4443        StaticServiceIpConnectivity(std::boxed::Box<crate::model::StaticServiceIpConnectivity>),
4444        /// Forward SSH tunnel connectivity.
4445        ForwardSshConnectivity(std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>),
4446        /// Private connectivity.
4447        PrivateConnectivity(std::boxed::Box<crate::model::PrivateConnectivity>),
4448    }
4449}
4450
4451/// Oracle Column.
4452#[serde_with::serde_as]
4453#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4454#[serde(default, rename_all = "camelCase")]
4455#[non_exhaustive]
4456pub struct OracleColumn {
4457    /// Column name.
4458    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4459    pub column: std::string::String,
4460
4461    /// The Oracle data type.
4462    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4463    pub data_type: std::string::String,
4464
4465    /// Column length.
4466    pub length: i32,
4467
4468    /// Column precision.
4469    pub precision: i32,
4470
4471    /// Column scale.
4472    pub scale: i32,
4473
4474    /// Column encoding.
4475    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4476    pub encoding: std::string::String,
4477
4478    /// Whether or not the column represents a primary key.
4479    pub primary_key: bool,
4480
4481    /// Whether or not the column can accept a null value.
4482    pub nullable: bool,
4483
4484    /// The ordinal position of the column in the table.
4485    pub ordinal_position: i32,
4486}
4487
4488impl OracleColumn {
4489    pub fn new() -> Self {
4490        std::default::Default::default()
4491    }
4492
4493    /// Sets the value of [column][crate::model::OracleColumn::column].
4494    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4495        self.column = v.into();
4496        self
4497    }
4498
4499    /// Sets the value of [data_type][crate::model::OracleColumn::data_type].
4500    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4501        self.data_type = v.into();
4502        self
4503    }
4504
4505    /// Sets the value of [length][crate::model::OracleColumn::length].
4506    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4507        self.length = v.into();
4508        self
4509    }
4510
4511    /// Sets the value of [precision][crate::model::OracleColumn::precision].
4512    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4513        self.precision = v.into();
4514        self
4515    }
4516
4517    /// Sets the value of [scale][crate::model::OracleColumn::scale].
4518    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4519        self.scale = v.into();
4520        self
4521    }
4522
4523    /// Sets the value of [encoding][crate::model::OracleColumn::encoding].
4524    pub fn set_encoding<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4525        self.encoding = v.into();
4526        self
4527    }
4528
4529    /// Sets the value of [primary_key][crate::model::OracleColumn::primary_key].
4530    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4531        self.primary_key = v.into();
4532        self
4533    }
4534
4535    /// Sets the value of [nullable][crate::model::OracleColumn::nullable].
4536    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4537        self.nullable = v.into();
4538        self
4539    }
4540
4541    /// Sets the value of [ordinal_position][crate::model::OracleColumn::ordinal_position].
4542    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4543        self.ordinal_position = v.into();
4544        self
4545    }
4546}
4547
4548impl wkt::message::Message for OracleColumn {
4549    fn typename() -> &'static str {
4550        "type.googleapis.com/google.cloud.datastream.v1.OracleColumn"
4551    }
4552}
4553
4554/// Oracle table.
4555#[serde_with::serde_as]
4556#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4557#[serde(default, rename_all = "camelCase")]
4558#[non_exhaustive]
4559pub struct OracleTable {
4560    /// Table name.
4561    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4562    pub table: std::string::String,
4563
4564    /// Oracle columns in the schema.
4565    /// When unspecified as part of include/exclude objects, includes/excludes
4566    /// everything.
4567    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4568    pub oracle_columns: std::vec::Vec<crate::model::OracleColumn>,
4569}
4570
4571impl OracleTable {
4572    pub fn new() -> Self {
4573        std::default::Default::default()
4574    }
4575
4576    /// Sets the value of [table][crate::model::OracleTable::table].
4577    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4578        self.table = v.into();
4579        self
4580    }
4581
4582    /// Sets the value of [oracle_columns][crate::model::OracleTable::oracle_columns].
4583    pub fn set_oracle_columns<T, V>(mut self, v: T) -> Self
4584    where
4585        T: std::iter::IntoIterator<Item = V>,
4586        V: std::convert::Into<crate::model::OracleColumn>,
4587    {
4588        use std::iter::Iterator;
4589        self.oracle_columns = v.into_iter().map(|i| i.into()).collect();
4590        self
4591    }
4592}
4593
4594impl wkt::message::Message for OracleTable {
4595    fn typename() -> &'static str {
4596        "type.googleapis.com/google.cloud.datastream.v1.OracleTable"
4597    }
4598}
4599
4600/// Oracle schema.
4601#[serde_with::serde_as]
4602#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4603#[serde(default, rename_all = "camelCase")]
4604#[non_exhaustive]
4605pub struct OracleSchema {
4606    /// Schema name.
4607    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4608    pub schema: std::string::String,
4609
4610    /// Tables in the schema.
4611    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4612    pub oracle_tables: std::vec::Vec<crate::model::OracleTable>,
4613}
4614
4615impl OracleSchema {
4616    pub fn new() -> Self {
4617        std::default::Default::default()
4618    }
4619
4620    /// Sets the value of [schema][crate::model::OracleSchema::schema].
4621    pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4622        self.schema = v.into();
4623        self
4624    }
4625
4626    /// Sets the value of [oracle_tables][crate::model::OracleSchema::oracle_tables].
4627    pub fn set_oracle_tables<T, V>(mut self, v: T) -> Self
4628    where
4629        T: std::iter::IntoIterator<Item = V>,
4630        V: std::convert::Into<crate::model::OracleTable>,
4631    {
4632        use std::iter::Iterator;
4633        self.oracle_tables = v.into_iter().map(|i| i.into()).collect();
4634        self
4635    }
4636}
4637
4638impl wkt::message::Message for OracleSchema {
4639    fn typename() -> &'static str {
4640        "type.googleapis.com/google.cloud.datastream.v1.OracleSchema"
4641    }
4642}
4643
4644/// Oracle database structure.
4645#[serde_with::serde_as]
4646#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4647#[serde(default, rename_all = "camelCase")]
4648#[non_exhaustive]
4649pub struct OracleRdbms {
4650    /// Oracle schemas/databases in the database server.
4651    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4652    pub oracle_schemas: std::vec::Vec<crate::model::OracleSchema>,
4653}
4654
4655impl OracleRdbms {
4656    pub fn new() -> Self {
4657        std::default::Default::default()
4658    }
4659
4660    /// Sets the value of [oracle_schemas][crate::model::OracleRdbms::oracle_schemas].
4661    pub fn set_oracle_schemas<T, V>(mut self, v: T) -> Self
4662    where
4663        T: std::iter::IntoIterator<Item = V>,
4664        V: std::convert::Into<crate::model::OracleSchema>,
4665    {
4666        use std::iter::Iterator;
4667        self.oracle_schemas = v.into_iter().map(|i| i.into()).collect();
4668        self
4669    }
4670}
4671
4672impl wkt::message::Message for OracleRdbms {
4673    fn typename() -> &'static str {
4674        "type.googleapis.com/google.cloud.datastream.v1.OracleRdbms"
4675    }
4676}
4677
4678/// Oracle data source configuration
4679#[serde_with::serde_as]
4680#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4681#[serde(default, rename_all = "camelCase")]
4682#[non_exhaustive]
4683pub struct OracleSourceConfig {
4684    /// Oracle objects to include in the stream.
4685    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4686    pub include_objects: std::option::Option<crate::model::OracleRdbms>,
4687
4688    /// Oracle objects to exclude from the stream.
4689    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4690    pub exclude_objects: std::option::Option<crate::model::OracleRdbms>,
4691
4692    /// Maximum number of concurrent CDC tasks. The number should be non-negative.
4693    /// If not set (or set to 0), the system's default value is used.
4694    pub max_concurrent_cdc_tasks: i32,
4695
4696    /// Maximum number of concurrent backfill tasks. The number should be
4697    /// non-negative. If not set (or set to 0), the system's default value is used.
4698    pub max_concurrent_backfill_tasks: i32,
4699
4700    /// The configuration for handle Oracle large objects.
4701    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
4702    pub large_objects_handling:
4703        std::option::Option<crate::model::oracle_source_config::LargeObjectsHandling>,
4704
4705    /// Configuration to select the CDC method.
4706    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
4707    pub cdc_method: std::option::Option<crate::model::oracle_source_config::CdcMethod>,
4708}
4709
4710impl OracleSourceConfig {
4711    pub fn new() -> Self {
4712        std::default::Default::default()
4713    }
4714
4715    /// Sets the value of [include_objects][crate::model::OracleSourceConfig::include_objects].
4716    pub fn set_include_objects<
4717        T: std::convert::Into<std::option::Option<crate::model::OracleRdbms>>,
4718    >(
4719        mut self,
4720        v: T,
4721    ) -> Self {
4722        self.include_objects = v.into();
4723        self
4724    }
4725
4726    /// Sets the value of [exclude_objects][crate::model::OracleSourceConfig::exclude_objects].
4727    pub fn set_exclude_objects<
4728        T: std::convert::Into<std::option::Option<crate::model::OracleRdbms>>,
4729    >(
4730        mut self,
4731        v: T,
4732    ) -> Self {
4733        self.exclude_objects = v.into();
4734        self
4735    }
4736
4737    /// Sets the value of [max_concurrent_cdc_tasks][crate::model::OracleSourceConfig::max_concurrent_cdc_tasks].
4738    pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4739        self.max_concurrent_cdc_tasks = v.into();
4740        self
4741    }
4742
4743    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::OracleSourceConfig::max_concurrent_backfill_tasks].
4744    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4745        self.max_concurrent_backfill_tasks = v.into();
4746        self
4747    }
4748
4749    /// Sets the value of `large_objects_handling`.
4750    pub fn set_large_objects_handling<
4751        T: std::convert::Into<
4752            std::option::Option<crate::model::oracle_source_config::LargeObjectsHandling>,
4753        >,
4754    >(
4755        mut self,
4756        v: T,
4757    ) -> Self {
4758        self.large_objects_handling = v.into();
4759        self
4760    }
4761
4762    /// The value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
4763    /// if it holds a `DropLargeObjects`, `None` if the field is not set or
4764    /// holds a different branch.
4765    pub fn get_drop_large_objects(
4766        &self,
4767    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>>
4768    {
4769        #[allow(unreachable_patterns)]
4770        self.large_objects_handling.as_ref().and_then(|v| match v {
4771            crate::model::oracle_source_config::LargeObjectsHandling::DropLargeObjects(v) => {
4772                std::option::Option::Some(v)
4773            }
4774            _ => std::option::Option::None,
4775        })
4776    }
4777
4778    /// The value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
4779    /// if it holds a `StreamLargeObjects`, `None` if the field is not set or
4780    /// holds a different branch.
4781    pub fn get_stream_large_objects(
4782        &self,
4783    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>>
4784    {
4785        #[allow(unreachable_patterns)]
4786        self.large_objects_handling.as_ref().and_then(|v| match v {
4787            crate::model::oracle_source_config::LargeObjectsHandling::StreamLargeObjects(v) => {
4788                std::option::Option::Some(v)
4789            }
4790            _ => std::option::Option::None,
4791        })
4792    }
4793
4794    /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
4795    /// to hold a `DropLargeObjects`.
4796    ///
4797    /// Note that all the setters affecting `large_objects_handling` are
4798    /// mutually exclusive.
4799    pub fn set_drop_large_objects<
4800        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>>,
4801    >(
4802        mut self,
4803        v: T,
4804    ) -> Self {
4805        self.large_objects_handling = std::option::Option::Some(
4806            crate::model::oracle_source_config::LargeObjectsHandling::DropLargeObjects(v.into()),
4807        );
4808        self
4809    }
4810
4811    /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
4812    /// to hold a `StreamLargeObjects`.
4813    ///
4814    /// Note that all the setters affecting `large_objects_handling` are
4815    /// mutually exclusive.
4816    pub fn set_stream_large_objects<
4817        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>>,
4818    >(
4819        mut self,
4820        v: T,
4821    ) -> Self {
4822        self.large_objects_handling = std::option::Option::Some(
4823            crate::model::oracle_source_config::LargeObjectsHandling::StreamLargeObjects(v.into()),
4824        );
4825        self
4826    }
4827
4828    /// Sets the value of `cdc_method`.
4829    pub fn set_cdc_method<
4830        T: std::convert::Into<std::option::Option<crate::model::oracle_source_config::CdcMethod>>,
4831    >(
4832        mut self,
4833        v: T,
4834    ) -> Self {
4835        self.cdc_method = v.into();
4836        self
4837    }
4838
4839    /// The value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
4840    /// if it holds a `LogMiner`, `None` if the field is not set or
4841    /// holds a different branch.
4842    pub fn get_log_miner(
4843        &self,
4844    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::LogMiner>> {
4845        #[allow(unreachable_patterns)]
4846        self.cdc_method.as_ref().and_then(|v| match v {
4847            crate::model::oracle_source_config::CdcMethod::LogMiner(v) => {
4848                std::option::Option::Some(v)
4849            }
4850            _ => std::option::Option::None,
4851        })
4852    }
4853
4854    /// The value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
4855    /// if it holds a `BinaryLogParser`, `None` if the field is not set or
4856    /// holds a different branch.
4857    pub fn get_binary_log_parser(
4858        &self,
4859    ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>>
4860    {
4861        #[allow(unreachable_patterns)]
4862        self.cdc_method.as_ref().and_then(|v| match v {
4863            crate::model::oracle_source_config::CdcMethod::BinaryLogParser(v) => {
4864                std::option::Option::Some(v)
4865            }
4866            _ => std::option::Option::None,
4867        })
4868    }
4869
4870    /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
4871    /// to hold a `LogMiner`.
4872    ///
4873    /// Note that all the setters affecting `cdc_method` are
4874    /// mutually exclusive.
4875    pub fn set_log_miner<
4876        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::LogMiner>>,
4877    >(
4878        mut self,
4879        v: T,
4880    ) -> Self {
4881        self.cdc_method = std::option::Option::Some(
4882            crate::model::oracle_source_config::CdcMethod::LogMiner(v.into()),
4883        );
4884        self
4885    }
4886
4887    /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
4888    /// to hold a `BinaryLogParser`.
4889    ///
4890    /// Note that all the setters affecting `cdc_method` are
4891    /// mutually exclusive.
4892    pub fn set_binary_log_parser<
4893        T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>>,
4894    >(
4895        mut self,
4896        v: T,
4897    ) -> Self {
4898        self.cdc_method = std::option::Option::Some(
4899            crate::model::oracle_source_config::CdcMethod::BinaryLogParser(v.into()),
4900        );
4901        self
4902    }
4903}
4904
4905impl wkt::message::Message for OracleSourceConfig {
4906    fn typename() -> &'static str {
4907        "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig"
4908    }
4909}
4910
4911/// Defines additional types related to OracleSourceConfig
4912pub mod oracle_source_config {
4913    #[allow(unused_imports)]
4914    use super::*;
4915
4916    /// Configuration to drop large object values.
4917    #[serde_with::serde_as]
4918    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4919    #[serde(default, rename_all = "camelCase")]
4920    #[non_exhaustive]
4921    pub struct DropLargeObjects {}
4922
4923    impl DropLargeObjects {
4924        pub fn new() -> Self {
4925            std::default::Default::default()
4926        }
4927    }
4928
4929    impl wkt::message::Message for DropLargeObjects {
4930        fn typename() -> &'static str {
4931            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.DropLargeObjects"
4932        }
4933    }
4934
4935    /// Configuration to stream large object values.
4936    #[serde_with::serde_as]
4937    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4938    #[serde(default, rename_all = "camelCase")]
4939    #[non_exhaustive]
4940    pub struct StreamLargeObjects {}
4941
4942    impl StreamLargeObjects {
4943        pub fn new() -> Self {
4944            std::default::Default::default()
4945        }
4946    }
4947
4948    impl wkt::message::Message for StreamLargeObjects {
4949        fn typename() -> &'static str {
4950            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.StreamLargeObjects"
4951        }
4952    }
4953
4954    /// Configuration to use LogMiner CDC method.
4955    #[serde_with::serde_as]
4956    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4957    #[serde(default, rename_all = "camelCase")]
4958    #[non_exhaustive]
4959    pub struct LogMiner {}
4960
4961    impl LogMiner {
4962        pub fn new() -> Self {
4963            std::default::Default::default()
4964        }
4965    }
4966
4967    impl wkt::message::Message for LogMiner {
4968        fn typename() -> &'static str {
4969            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.LogMiner"
4970        }
4971    }
4972
4973    /// Configuration to use Binary Log Parser CDC technique.
4974    #[serde_with::serde_as]
4975    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4976    #[serde(default, rename_all = "camelCase")]
4977    #[non_exhaustive]
4978    pub struct BinaryLogParser {
4979        /// Configuration to specify how the log file should be accessed.
4980        #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
4981        pub log_file_access: std::option::Option<
4982            crate::model::oracle_source_config::binary_log_parser::LogFileAccess,
4983        >,
4984    }
4985
4986    impl BinaryLogParser {
4987        pub fn new() -> Self {
4988            std::default::Default::default()
4989        }
4990
4991        /// Sets the value of `log_file_access`.
4992        pub fn set_log_file_access<
4993            T: std::convert::Into<
4994                std::option::Option<
4995                    crate::model::oracle_source_config::binary_log_parser::LogFileAccess,
4996                >,
4997            >,
4998        >(
4999            mut self,
5000            v: T,
5001        ) -> Self {
5002            self.log_file_access = v.into();
5003            self
5004        }
5005
5006        /// The value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
5007        /// if it holds a `OracleAsmLogFileAccess`, `None` if the field is not set or
5008        /// holds a different branch.
5009        pub fn get_oracle_asm_log_file_access(
5010            &self,
5011        ) -> std::option::Option<
5012            &std::boxed::Box<
5013                crate::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess,
5014            >,
5015        > {
5016            #[allow(unreachable_patterns)]
5017            self.log_file_access.as_ref().and_then(|v| match v {
5018                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::OracleAsmLogFileAccess(v) => std::option::Option::Some(v),
5019                _ => std::option::Option::None,
5020            })
5021        }
5022
5023        /// The value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
5024        /// if it holds a `LogFileDirectories`, `None` if the field is not set or
5025        /// holds a different branch.
5026        pub fn get_log_file_directories(
5027            &self,
5028        ) -> std::option::Option<
5029            &std::boxed::Box<
5030                crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
5031            >,
5032        > {
5033            #[allow(unreachable_patterns)]
5034            self.log_file_access.as_ref().and_then(|v| match v {
5035                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::LogFileDirectories(v) => std::option::Option::Some(v),
5036                _ => std::option::Option::None,
5037            })
5038        }
5039
5040        /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
5041        /// to hold a `OracleAsmLogFileAccess`.
5042        ///
5043        /// Note that all the setters affecting `log_file_access` are
5044        /// mutually exclusive.
5045        pub fn set_oracle_asm_log_file_access<
5046            T: std::convert::Into<
5047                std::boxed::Box<
5048                    crate::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess,
5049                >,
5050            >,
5051        >(
5052            mut self,
5053            v: T,
5054        ) -> Self {
5055            self.log_file_access = std::option::Option::Some(
5056                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::OracleAsmLogFileAccess(
5057                    v.into()
5058                )
5059            );
5060            self
5061        }
5062
5063        /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
5064        /// to hold a `LogFileDirectories`.
5065        ///
5066        /// Note that all the setters affecting `log_file_access` are
5067        /// mutually exclusive.
5068        pub fn set_log_file_directories<
5069            T: std::convert::Into<
5070                std::boxed::Box<
5071                    crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
5072                >,
5073            >,
5074        >(
5075            mut self,
5076            v: T,
5077        ) -> Self {
5078            self.log_file_access = std::option::Option::Some(
5079                crate::model::oracle_source_config::binary_log_parser::LogFileAccess::LogFileDirectories(
5080                    v.into()
5081                )
5082            );
5083            self
5084        }
5085    }
5086
5087    impl wkt::message::Message for BinaryLogParser {
5088        fn typename() -> &'static str {
5089            "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser"
5090        }
5091    }
5092
5093    /// Defines additional types related to BinaryLogParser
5094    pub mod binary_log_parser {
5095        #[allow(unused_imports)]
5096        use super::*;
5097
5098        /// Configuration to use Oracle ASM to access the log files.
5099        #[serde_with::serde_as]
5100        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5101        #[serde(default, rename_all = "camelCase")]
5102        #[non_exhaustive]
5103        pub struct OracleAsmLogFileAccess {}
5104
5105        impl OracleAsmLogFileAccess {
5106            pub fn new() -> Self {
5107                std::default::Default::default()
5108            }
5109        }
5110
5111        impl wkt::message::Message for OracleAsmLogFileAccess {
5112            fn typename() -> &'static str {
5113                "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser.OracleAsmLogFileAccess"
5114            }
5115        }
5116
5117        /// Configuration to specify the Oracle directories to access the log files.
5118        #[serde_with::serde_as]
5119        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5120        #[serde(default, rename_all = "camelCase")]
5121        #[non_exhaustive]
5122        pub struct LogFileDirectories {
5123            /// Required. Oracle directory for online logs.
5124            #[serde(skip_serializing_if = "std::string::String::is_empty")]
5125            pub online_log_directory: std::string::String,
5126
5127            /// Required. Oracle directory for archived logs.
5128            #[serde(skip_serializing_if = "std::string::String::is_empty")]
5129            pub archived_log_directory: std::string::String,
5130        }
5131
5132        impl LogFileDirectories {
5133            pub fn new() -> Self {
5134                std::default::Default::default()
5135            }
5136
5137            /// Sets the value of [online_log_directory][crate::model::oracle_source_config::binary_log_parser::LogFileDirectories::online_log_directory].
5138            pub fn set_online_log_directory<T: std::convert::Into<std::string::String>>(
5139                mut self,
5140                v: T,
5141            ) -> Self {
5142                self.online_log_directory = v.into();
5143                self
5144            }
5145
5146            /// Sets the value of [archived_log_directory][crate::model::oracle_source_config::binary_log_parser::LogFileDirectories::archived_log_directory].
5147            pub fn set_archived_log_directory<T: std::convert::Into<std::string::String>>(
5148                mut self,
5149                v: T,
5150            ) -> Self {
5151                self.archived_log_directory = v.into();
5152                self
5153            }
5154        }
5155
5156        impl wkt::message::Message for LogFileDirectories {
5157            fn typename() -> &'static str {
5158                "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser.LogFileDirectories"
5159            }
5160        }
5161
5162        /// Configuration to specify how the log file should be accessed.
5163        #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
5164        #[serde(rename_all = "camelCase")]
5165        #[non_exhaustive]
5166        pub enum LogFileAccess {
5167            /// Use Oracle ASM.
5168            OracleAsmLogFileAccess(
5169                std::boxed::Box<
5170                    crate::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess,
5171                >,
5172            ),
5173            /// Use Oracle directories.
5174            LogFileDirectories(
5175                std::boxed::Box<
5176                    crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
5177                >,
5178            ),
5179        }
5180    }
5181
5182    /// The configuration for handle Oracle large objects.
5183    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
5184    #[serde(rename_all = "camelCase")]
5185    #[non_exhaustive]
5186    pub enum LargeObjectsHandling {
5187        /// Drop large object values.
5188        DropLargeObjects(std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>),
5189        /// Stream large object values.
5190        StreamLargeObjects(std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>),
5191    }
5192
5193    /// Configuration to select the CDC method.
5194    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
5195    #[serde(rename_all = "camelCase")]
5196    #[non_exhaustive]
5197    pub enum CdcMethod {
5198        /// Use LogMiner.
5199        LogMiner(std::boxed::Box<crate::model::oracle_source_config::LogMiner>),
5200        /// Use Binary Log Parser.
5201        BinaryLogParser(std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>),
5202    }
5203}
5204
5205/// PostgreSQL Column.
5206#[serde_with::serde_as]
5207#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5208#[serde(default, rename_all = "camelCase")]
5209#[non_exhaustive]
5210pub struct PostgresqlColumn {
5211    /// Column name.
5212    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5213    pub column: std::string::String,
5214
5215    /// The PostgreSQL data type.
5216    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5217    pub data_type: std::string::String,
5218
5219    /// Column length.
5220    pub length: i32,
5221
5222    /// Column precision.
5223    pub precision: i32,
5224
5225    /// Column scale.
5226    pub scale: i32,
5227
5228    /// Whether or not the column represents a primary key.
5229    pub primary_key: bool,
5230
5231    /// Whether or not the column can accept a null value.
5232    pub nullable: bool,
5233
5234    /// The ordinal position of the column in the table.
5235    pub ordinal_position: i32,
5236}
5237
5238impl PostgresqlColumn {
5239    pub fn new() -> Self {
5240        std::default::Default::default()
5241    }
5242
5243    /// Sets the value of [column][crate::model::PostgresqlColumn::column].
5244    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5245        self.column = v.into();
5246        self
5247    }
5248
5249    /// Sets the value of [data_type][crate::model::PostgresqlColumn::data_type].
5250    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5251        self.data_type = v.into();
5252        self
5253    }
5254
5255    /// Sets the value of [length][crate::model::PostgresqlColumn::length].
5256    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5257        self.length = v.into();
5258        self
5259    }
5260
5261    /// Sets the value of [precision][crate::model::PostgresqlColumn::precision].
5262    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5263        self.precision = v.into();
5264        self
5265    }
5266
5267    /// Sets the value of [scale][crate::model::PostgresqlColumn::scale].
5268    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5269        self.scale = v.into();
5270        self
5271    }
5272
5273    /// Sets the value of [primary_key][crate::model::PostgresqlColumn::primary_key].
5274    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5275        self.primary_key = v.into();
5276        self
5277    }
5278
5279    /// Sets the value of [nullable][crate::model::PostgresqlColumn::nullable].
5280    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5281        self.nullable = v.into();
5282        self
5283    }
5284
5285    /// Sets the value of [ordinal_position][crate::model::PostgresqlColumn::ordinal_position].
5286    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5287        self.ordinal_position = v.into();
5288        self
5289    }
5290}
5291
5292impl wkt::message::Message for PostgresqlColumn {
5293    fn typename() -> &'static str {
5294        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlColumn"
5295    }
5296}
5297
5298/// PostgreSQL table.
5299#[serde_with::serde_as]
5300#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5301#[serde(default, rename_all = "camelCase")]
5302#[non_exhaustive]
5303pub struct PostgresqlTable {
5304    /// Table name.
5305    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5306    pub table: std::string::String,
5307
5308    /// PostgreSQL columns in the schema.
5309    /// When unspecified as part of include/exclude objects,
5310    /// includes/excludes everything.
5311    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5312    pub postgresql_columns: std::vec::Vec<crate::model::PostgresqlColumn>,
5313}
5314
5315impl PostgresqlTable {
5316    pub fn new() -> Self {
5317        std::default::Default::default()
5318    }
5319
5320    /// Sets the value of [table][crate::model::PostgresqlTable::table].
5321    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5322        self.table = v.into();
5323        self
5324    }
5325
5326    /// Sets the value of [postgresql_columns][crate::model::PostgresqlTable::postgresql_columns].
5327    pub fn set_postgresql_columns<T, V>(mut self, v: T) -> Self
5328    where
5329        T: std::iter::IntoIterator<Item = V>,
5330        V: std::convert::Into<crate::model::PostgresqlColumn>,
5331    {
5332        use std::iter::Iterator;
5333        self.postgresql_columns = v.into_iter().map(|i| i.into()).collect();
5334        self
5335    }
5336}
5337
5338impl wkt::message::Message for PostgresqlTable {
5339    fn typename() -> &'static str {
5340        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlTable"
5341    }
5342}
5343
5344/// PostgreSQL schema.
5345#[serde_with::serde_as]
5346#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5347#[serde(default, rename_all = "camelCase")]
5348#[non_exhaustive]
5349pub struct PostgresqlSchema {
5350    /// Schema name.
5351    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5352    pub schema: std::string::String,
5353
5354    /// Tables in the schema.
5355    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5356    pub postgresql_tables: std::vec::Vec<crate::model::PostgresqlTable>,
5357}
5358
5359impl PostgresqlSchema {
5360    pub fn new() -> Self {
5361        std::default::Default::default()
5362    }
5363
5364    /// Sets the value of [schema][crate::model::PostgresqlSchema::schema].
5365    pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5366        self.schema = v.into();
5367        self
5368    }
5369
5370    /// Sets the value of [postgresql_tables][crate::model::PostgresqlSchema::postgresql_tables].
5371    pub fn set_postgresql_tables<T, V>(mut self, v: T) -> Self
5372    where
5373        T: std::iter::IntoIterator<Item = V>,
5374        V: std::convert::Into<crate::model::PostgresqlTable>,
5375    {
5376        use std::iter::Iterator;
5377        self.postgresql_tables = v.into_iter().map(|i| i.into()).collect();
5378        self
5379    }
5380}
5381
5382impl wkt::message::Message for PostgresqlSchema {
5383    fn typename() -> &'static str {
5384        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSchema"
5385    }
5386}
5387
5388/// PostgreSQL database structure.
5389#[serde_with::serde_as]
5390#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5391#[serde(default, rename_all = "camelCase")]
5392#[non_exhaustive]
5393pub struct PostgresqlRdbms {
5394    /// PostgreSQL schemas in the database server.
5395    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5396    pub postgresql_schemas: std::vec::Vec<crate::model::PostgresqlSchema>,
5397}
5398
5399impl PostgresqlRdbms {
5400    pub fn new() -> Self {
5401        std::default::Default::default()
5402    }
5403
5404    /// Sets the value of [postgresql_schemas][crate::model::PostgresqlRdbms::postgresql_schemas].
5405    pub fn set_postgresql_schemas<T, V>(mut self, v: T) -> Self
5406    where
5407        T: std::iter::IntoIterator<Item = V>,
5408        V: std::convert::Into<crate::model::PostgresqlSchema>,
5409    {
5410        use std::iter::Iterator;
5411        self.postgresql_schemas = v.into_iter().map(|i| i.into()).collect();
5412        self
5413    }
5414}
5415
5416impl wkt::message::Message for PostgresqlRdbms {
5417    fn typename() -> &'static str {
5418        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlRdbms"
5419    }
5420}
5421
5422/// PostgreSQL data source configuration
5423#[serde_with::serde_as]
5424#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5425#[serde(default, rename_all = "camelCase")]
5426#[non_exhaustive]
5427pub struct PostgresqlSourceConfig {
5428    /// PostgreSQL objects to include in the stream.
5429    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5430    pub include_objects: std::option::Option<crate::model::PostgresqlRdbms>,
5431
5432    /// PostgreSQL objects to exclude from the stream.
5433    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5434    pub exclude_objects: std::option::Option<crate::model::PostgresqlRdbms>,
5435
5436    /// Required. Immutable. The name of the logical replication slot that's
5437    /// configured with the pgoutput plugin.
5438    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5439    pub replication_slot: std::string::String,
5440
5441    /// Required. The name of the publication that includes the set of all tables
5442    /// that are defined in the stream's include_objects.
5443    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5444    pub publication: std::string::String,
5445
5446    /// Maximum number of concurrent backfill tasks. The number should be non
5447    /// negative. If not set (or set to 0), the system's default value will be
5448    /// used.
5449    pub max_concurrent_backfill_tasks: i32,
5450}
5451
5452impl PostgresqlSourceConfig {
5453    pub fn new() -> Self {
5454        std::default::Default::default()
5455    }
5456
5457    /// Sets the value of [include_objects][crate::model::PostgresqlSourceConfig::include_objects].
5458    pub fn set_include_objects<
5459        T: std::convert::Into<std::option::Option<crate::model::PostgresqlRdbms>>,
5460    >(
5461        mut self,
5462        v: T,
5463    ) -> Self {
5464        self.include_objects = v.into();
5465        self
5466    }
5467
5468    /// Sets the value of [exclude_objects][crate::model::PostgresqlSourceConfig::exclude_objects].
5469    pub fn set_exclude_objects<
5470        T: std::convert::Into<std::option::Option<crate::model::PostgresqlRdbms>>,
5471    >(
5472        mut self,
5473        v: T,
5474    ) -> Self {
5475        self.exclude_objects = v.into();
5476        self
5477    }
5478
5479    /// Sets the value of [replication_slot][crate::model::PostgresqlSourceConfig::replication_slot].
5480    pub fn set_replication_slot<T: std::convert::Into<std::string::String>>(
5481        mut self,
5482        v: T,
5483    ) -> Self {
5484        self.replication_slot = v.into();
5485        self
5486    }
5487
5488    /// Sets the value of [publication][crate::model::PostgresqlSourceConfig::publication].
5489    pub fn set_publication<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5490        self.publication = v.into();
5491        self
5492    }
5493
5494    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::PostgresqlSourceConfig::max_concurrent_backfill_tasks].
5495    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5496        self.max_concurrent_backfill_tasks = v.into();
5497        self
5498    }
5499}
5500
5501impl wkt::message::Message for PostgresqlSourceConfig {
5502    fn typename() -> &'static str {
5503        "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSourceConfig"
5504    }
5505}
5506
5507/// SQLServer Column.
5508#[serde_with::serde_as]
5509#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5510#[serde(default, rename_all = "camelCase")]
5511#[non_exhaustive]
5512pub struct SqlServerColumn {
5513    /// Column name.
5514    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5515    pub column: std::string::String,
5516
5517    /// The SQLServer data type.
5518    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5519    pub data_type: std::string::String,
5520
5521    /// Column length.
5522    pub length: i32,
5523
5524    /// Column precision.
5525    pub precision: i32,
5526
5527    /// Column scale.
5528    pub scale: i32,
5529
5530    /// Whether or not the column represents a primary key.
5531    pub primary_key: bool,
5532
5533    /// Whether or not the column can accept a null value.
5534    pub nullable: bool,
5535
5536    /// The ordinal position of the column in the table.
5537    pub ordinal_position: i32,
5538}
5539
5540impl SqlServerColumn {
5541    pub fn new() -> Self {
5542        std::default::Default::default()
5543    }
5544
5545    /// Sets the value of [column][crate::model::SqlServerColumn::column].
5546    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5547        self.column = v.into();
5548        self
5549    }
5550
5551    /// Sets the value of [data_type][crate::model::SqlServerColumn::data_type].
5552    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5553        self.data_type = v.into();
5554        self
5555    }
5556
5557    /// Sets the value of [length][crate::model::SqlServerColumn::length].
5558    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5559        self.length = v.into();
5560        self
5561    }
5562
5563    /// Sets the value of [precision][crate::model::SqlServerColumn::precision].
5564    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5565        self.precision = v.into();
5566        self
5567    }
5568
5569    /// Sets the value of [scale][crate::model::SqlServerColumn::scale].
5570    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5571        self.scale = v.into();
5572        self
5573    }
5574
5575    /// Sets the value of [primary_key][crate::model::SqlServerColumn::primary_key].
5576    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5577        self.primary_key = v.into();
5578        self
5579    }
5580
5581    /// Sets the value of [nullable][crate::model::SqlServerColumn::nullable].
5582    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5583        self.nullable = v.into();
5584        self
5585    }
5586
5587    /// Sets the value of [ordinal_position][crate::model::SqlServerColumn::ordinal_position].
5588    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5589        self.ordinal_position = v.into();
5590        self
5591    }
5592}
5593
5594impl wkt::message::Message for SqlServerColumn {
5595    fn typename() -> &'static str {
5596        "type.googleapis.com/google.cloud.datastream.v1.SqlServerColumn"
5597    }
5598}
5599
5600/// SQLServer table.
5601#[serde_with::serde_as]
5602#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5603#[serde(default, rename_all = "camelCase")]
5604#[non_exhaustive]
5605pub struct SqlServerTable {
5606    /// Table name.
5607    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5608    pub table: std::string::String,
5609
5610    /// SQLServer columns in the schema.
5611    /// When unspecified as part of include/exclude objects,
5612    /// includes/excludes everything.
5613    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5614    pub columns: std::vec::Vec<crate::model::SqlServerColumn>,
5615}
5616
5617impl SqlServerTable {
5618    pub fn new() -> Self {
5619        std::default::Default::default()
5620    }
5621
5622    /// Sets the value of [table][crate::model::SqlServerTable::table].
5623    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5624        self.table = v.into();
5625        self
5626    }
5627
5628    /// Sets the value of [columns][crate::model::SqlServerTable::columns].
5629    pub fn set_columns<T, V>(mut self, v: T) -> Self
5630    where
5631        T: std::iter::IntoIterator<Item = V>,
5632        V: std::convert::Into<crate::model::SqlServerColumn>,
5633    {
5634        use std::iter::Iterator;
5635        self.columns = v.into_iter().map(|i| i.into()).collect();
5636        self
5637    }
5638}
5639
5640impl wkt::message::Message for SqlServerTable {
5641    fn typename() -> &'static str {
5642        "type.googleapis.com/google.cloud.datastream.v1.SqlServerTable"
5643    }
5644}
5645
5646/// SQLServer schema.
5647#[serde_with::serde_as]
5648#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5649#[serde(default, rename_all = "camelCase")]
5650#[non_exhaustive]
5651pub struct SqlServerSchema {
5652    /// Schema name.
5653    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5654    pub schema: std::string::String,
5655
5656    /// Tables in the schema.
5657    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5658    pub tables: std::vec::Vec<crate::model::SqlServerTable>,
5659}
5660
5661impl SqlServerSchema {
5662    pub fn new() -> Self {
5663        std::default::Default::default()
5664    }
5665
5666    /// Sets the value of [schema][crate::model::SqlServerSchema::schema].
5667    pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5668        self.schema = v.into();
5669        self
5670    }
5671
5672    /// Sets the value of [tables][crate::model::SqlServerSchema::tables].
5673    pub fn set_tables<T, V>(mut self, v: T) -> Self
5674    where
5675        T: std::iter::IntoIterator<Item = V>,
5676        V: std::convert::Into<crate::model::SqlServerTable>,
5677    {
5678        use std::iter::Iterator;
5679        self.tables = v.into_iter().map(|i| i.into()).collect();
5680        self
5681    }
5682}
5683
5684impl wkt::message::Message for SqlServerSchema {
5685    fn typename() -> &'static str {
5686        "type.googleapis.com/google.cloud.datastream.v1.SqlServerSchema"
5687    }
5688}
5689
5690/// SQLServer database structure.
5691#[serde_with::serde_as]
5692#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5693#[serde(default, rename_all = "camelCase")]
5694#[non_exhaustive]
5695pub struct SqlServerRdbms {
5696    /// SQLServer schemas in the database server.
5697    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5698    pub schemas: std::vec::Vec<crate::model::SqlServerSchema>,
5699}
5700
5701impl SqlServerRdbms {
5702    pub fn new() -> Self {
5703        std::default::Default::default()
5704    }
5705
5706    /// Sets the value of [schemas][crate::model::SqlServerRdbms::schemas].
5707    pub fn set_schemas<T, V>(mut self, v: T) -> Self
5708    where
5709        T: std::iter::IntoIterator<Item = V>,
5710        V: std::convert::Into<crate::model::SqlServerSchema>,
5711    {
5712        use std::iter::Iterator;
5713        self.schemas = v.into_iter().map(|i| i.into()).collect();
5714        self
5715    }
5716}
5717
5718impl wkt::message::Message for SqlServerRdbms {
5719    fn typename() -> &'static str {
5720        "type.googleapis.com/google.cloud.datastream.v1.SqlServerRdbms"
5721    }
5722}
5723
5724/// SQLServer data source configuration
5725#[serde_with::serde_as]
5726#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5727#[serde(default, rename_all = "camelCase")]
5728#[non_exhaustive]
5729pub struct SqlServerSourceConfig {
5730    /// SQLServer objects to include in the stream.
5731    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5732    pub include_objects: std::option::Option<crate::model::SqlServerRdbms>,
5733
5734    /// SQLServer objects to exclude from the stream.
5735    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5736    pub exclude_objects: std::option::Option<crate::model::SqlServerRdbms>,
5737
5738    /// Max concurrent CDC tasks.
5739    pub max_concurrent_cdc_tasks: i32,
5740
5741    /// Max concurrent backfill tasks.
5742    pub max_concurrent_backfill_tasks: i32,
5743
5744    /// Configuration to select the CDC read method for the stream.
5745    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
5746    pub cdc_method: std::option::Option<crate::model::sql_server_source_config::CdcMethod>,
5747}
5748
5749impl SqlServerSourceConfig {
5750    pub fn new() -> Self {
5751        std::default::Default::default()
5752    }
5753
5754    /// Sets the value of [include_objects][crate::model::SqlServerSourceConfig::include_objects].
5755    pub fn set_include_objects<
5756        T: std::convert::Into<std::option::Option<crate::model::SqlServerRdbms>>,
5757    >(
5758        mut self,
5759        v: T,
5760    ) -> Self {
5761        self.include_objects = v.into();
5762        self
5763    }
5764
5765    /// Sets the value of [exclude_objects][crate::model::SqlServerSourceConfig::exclude_objects].
5766    pub fn set_exclude_objects<
5767        T: std::convert::Into<std::option::Option<crate::model::SqlServerRdbms>>,
5768    >(
5769        mut self,
5770        v: T,
5771    ) -> Self {
5772        self.exclude_objects = v.into();
5773        self
5774    }
5775
5776    /// Sets the value of [max_concurrent_cdc_tasks][crate::model::SqlServerSourceConfig::max_concurrent_cdc_tasks].
5777    pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5778        self.max_concurrent_cdc_tasks = v.into();
5779        self
5780    }
5781
5782    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::SqlServerSourceConfig::max_concurrent_backfill_tasks].
5783    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5784        self.max_concurrent_backfill_tasks = v.into();
5785        self
5786    }
5787
5788    /// Sets the value of `cdc_method`.
5789    pub fn set_cdc_method<
5790        T: std::convert::Into<std::option::Option<crate::model::sql_server_source_config::CdcMethod>>,
5791    >(
5792        mut self,
5793        v: T,
5794    ) -> Self {
5795        self.cdc_method = v.into();
5796        self
5797    }
5798
5799    /// The value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
5800    /// if it holds a `TransactionLogs`, `None` if the field is not set or
5801    /// holds a different branch.
5802    pub fn get_transaction_logs(
5803        &self,
5804    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerTransactionLogs>> {
5805        #[allow(unreachable_patterns)]
5806        self.cdc_method.as_ref().and_then(|v| match v {
5807            crate::model::sql_server_source_config::CdcMethod::TransactionLogs(v) => {
5808                std::option::Option::Some(v)
5809            }
5810            _ => std::option::Option::None,
5811        })
5812    }
5813
5814    /// The value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
5815    /// if it holds a `ChangeTables`, `None` if the field is not set or
5816    /// holds a different branch.
5817    pub fn get_change_tables(
5818        &self,
5819    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerChangeTables>> {
5820        #[allow(unreachable_patterns)]
5821        self.cdc_method.as_ref().and_then(|v| match v {
5822            crate::model::sql_server_source_config::CdcMethod::ChangeTables(v) => {
5823                std::option::Option::Some(v)
5824            }
5825            _ => std::option::Option::None,
5826        })
5827    }
5828
5829    /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
5830    /// to hold a `TransactionLogs`.
5831    ///
5832    /// Note that all the setters affecting `cdc_method` are
5833    /// mutually exclusive.
5834    pub fn set_transaction_logs<
5835        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerTransactionLogs>>,
5836    >(
5837        mut self,
5838        v: T,
5839    ) -> Self {
5840        self.cdc_method = std::option::Option::Some(
5841            crate::model::sql_server_source_config::CdcMethod::TransactionLogs(v.into()),
5842        );
5843        self
5844    }
5845
5846    /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
5847    /// to hold a `ChangeTables`.
5848    ///
5849    /// Note that all the setters affecting `cdc_method` are
5850    /// mutually exclusive.
5851    pub fn set_change_tables<
5852        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerChangeTables>>,
5853    >(
5854        mut self,
5855        v: T,
5856    ) -> Self {
5857        self.cdc_method = std::option::Option::Some(
5858            crate::model::sql_server_source_config::CdcMethod::ChangeTables(v.into()),
5859        );
5860        self
5861    }
5862}
5863
5864impl wkt::message::Message for SqlServerSourceConfig {
5865    fn typename() -> &'static str {
5866        "type.googleapis.com/google.cloud.datastream.v1.SqlServerSourceConfig"
5867    }
5868}
5869
5870/// Defines additional types related to SqlServerSourceConfig
5871pub mod sql_server_source_config {
5872    #[allow(unused_imports)]
5873    use super::*;
5874
5875    /// Configuration to select the CDC read method for the stream.
5876    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
5877    #[serde(rename_all = "camelCase")]
5878    #[non_exhaustive]
5879    pub enum CdcMethod {
5880        /// CDC reader reads from transaction logs.
5881        TransactionLogs(std::boxed::Box<crate::model::SqlServerTransactionLogs>),
5882        /// CDC reader reads from change tables.
5883        ChangeTables(std::boxed::Box<crate::model::SqlServerChangeTables>),
5884    }
5885}
5886
5887/// Configuration to use Transaction Logs CDC read method.
5888#[serde_with::serde_as]
5889#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5890#[serde(default, rename_all = "camelCase")]
5891#[non_exhaustive]
5892pub struct SqlServerTransactionLogs {}
5893
5894impl SqlServerTransactionLogs {
5895    pub fn new() -> Self {
5896        std::default::Default::default()
5897    }
5898}
5899
5900impl wkt::message::Message for SqlServerTransactionLogs {
5901    fn typename() -> &'static str {
5902        "type.googleapis.com/google.cloud.datastream.v1.SqlServerTransactionLogs"
5903    }
5904}
5905
5906/// Configuration to use Change Tables CDC read method.
5907#[serde_with::serde_as]
5908#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5909#[serde(default, rename_all = "camelCase")]
5910#[non_exhaustive]
5911pub struct SqlServerChangeTables {}
5912
5913impl SqlServerChangeTables {
5914    pub fn new() -> Self {
5915        std::default::Default::default()
5916    }
5917}
5918
5919impl wkt::message::Message for SqlServerChangeTables {
5920    fn typename() -> &'static str {
5921        "type.googleapis.com/google.cloud.datastream.v1.SqlServerChangeTables"
5922    }
5923}
5924
5925/// MySQL Column.
5926#[serde_with::serde_as]
5927#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5928#[serde(default, rename_all = "camelCase")]
5929#[non_exhaustive]
5930pub struct MysqlColumn {
5931    /// Column name.
5932    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5933    pub column: std::string::String,
5934
5935    /// The MySQL data type. Full data types list can be found here:
5936    /// <https://dev.mysql.com/doc/refman/8.0/en/data-types.html>
5937    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5938    pub data_type: std::string::String,
5939
5940    /// Column length.
5941    pub length: i32,
5942
5943    /// Column collation.
5944    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5945    pub collation: std::string::String,
5946
5947    /// Whether or not the column represents a primary key.
5948    pub primary_key: bool,
5949
5950    /// Whether or not the column can accept a null value.
5951    pub nullable: bool,
5952
5953    /// The ordinal position of the column in the table.
5954    pub ordinal_position: i32,
5955
5956    /// Column precision.
5957    pub precision: i32,
5958
5959    /// Column scale.
5960    pub scale: i32,
5961}
5962
5963impl MysqlColumn {
5964    pub fn new() -> Self {
5965        std::default::Default::default()
5966    }
5967
5968    /// Sets the value of [column][crate::model::MysqlColumn::column].
5969    pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5970        self.column = v.into();
5971        self
5972    }
5973
5974    /// Sets the value of [data_type][crate::model::MysqlColumn::data_type].
5975    pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5976        self.data_type = v.into();
5977        self
5978    }
5979
5980    /// Sets the value of [length][crate::model::MysqlColumn::length].
5981    pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5982        self.length = v.into();
5983        self
5984    }
5985
5986    /// Sets the value of [collation][crate::model::MysqlColumn::collation].
5987    pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5988        self.collation = v.into();
5989        self
5990    }
5991
5992    /// Sets the value of [primary_key][crate::model::MysqlColumn::primary_key].
5993    pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5994        self.primary_key = v.into();
5995        self
5996    }
5997
5998    /// Sets the value of [nullable][crate::model::MysqlColumn::nullable].
5999    pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6000        self.nullable = v.into();
6001        self
6002    }
6003
6004    /// Sets the value of [ordinal_position][crate::model::MysqlColumn::ordinal_position].
6005    pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6006        self.ordinal_position = v.into();
6007        self
6008    }
6009
6010    /// Sets the value of [precision][crate::model::MysqlColumn::precision].
6011    pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6012        self.precision = v.into();
6013        self
6014    }
6015
6016    /// Sets the value of [scale][crate::model::MysqlColumn::scale].
6017    pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6018        self.scale = v.into();
6019        self
6020    }
6021}
6022
6023impl wkt::message::Message for MysqlColumn {
6024    fn typename() -> &'static str {
6025        "type.googleapis.com/google.cloud.datastream.v1.MysqlColumn"
6026    }
6027}
6028
6029/// MySQL table.
6030#[serde_with::serde_as]
6031#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6032#[serde(default, rename_all = "camelCase")]
6033#[non_exhaustive]
6034pub struct MysqlTable {
6035    /// Table name.
6036    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6037    pub table: std::string::String,
6038
6039    /// MySQL columns in the database.
6040    /// When unspecified as part of include/exclude objects, includes/excludes
6041    /// everything.
6042    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6043    pub mysql_columns: std::vec::Vec<crate::model::MysqlColumn>,
6044}
6045
6046impl MysqlTable {
6047    pub fn new() -> Self {
6048        std::default::Default::default()
6049    }
6050
6051    /// Sets the value of [table][crate::model::MysqlTable::table].
6052    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6053        self.table = v.into();
6054        self
6055    }
6056
6057    /// Sets the value of [mysql_columns][crate::model::MysqlTable::mysql_columns].
6058    pub fn set_mysql_columns<T, V>(mut self, v: T) -> Self
6059    where
6060        T: std::iter::IntoIterator<Item = V>,
6061        V: std::convert::Into<crate::model::MysqlColumn>,
6062    {
6063        use std::iter::Iterator;
6064        self.mysql_columns = v.into_iter().map(|i| i.into()).collect();
6065        self
6066    }
6067}
6068
6069impl wkt::message::Message for MysqlTable {
6070    fn typename() -> &'static str {
6071        "type.googleapis.com/google.cloud.datastream.v1.MysqlTable"
6072    }
6073}
6074
6075/// MySQL database.
6076#[serde_with::serde_as]
6077#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6078#[serde(default, rename_all = "camelCase")]
6079#[non_exhaustive]
6080pub struct MysqlDatabase {
6081    /// Database name.
6082    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6083    pub database: std::string::String,
6084
6085    /// Tables in the database.
6086    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6087    pub mysql_tables: std::vec::Vec<crate::model::MysqlTable>,
6088}
6089
6090impl MysqlDatabase {
6091    pub fn new() -> Self {
6092        std::default::Default::default()
6093    }
6094
6095    /// Sets the value of [database][crate::model::MysqlDatabase::database].
6096    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6097        self.database = v.into();
6098        self
6099    }
6100
6101    /// Sets the value of [mysql_tables][crate::model::MysqlDatabase::mysql_tables].
6102    pub fn set_mysql_tables<T, V>(mut self, v: T) -> Self
6103    where
6104        T: std::iter::IntoIterator<Item = V>,
6105        V: std::convert::Into<crate::model::MysqlTable>,
6106    {
6107        use std::iter::Iterator;
6108        self.mysql_tables = v.into_iter().map(|i| i.into()).collect();
6109        self
6110    }
6111}
6112
6113impl wkt::message::Message for MysqlDatabase {
6114    fn typename() -> &'static str {
6115        "type.googleapis.com/google.cloud.datastream.v1.MysqlDatabase"
6116    }
6117}
6118
6119/// MySQL database structure
6120#[serde_with::serde_as]
6121#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6122#[serde(default, rename_all = "camelCase")]
6123#[non_exhaustive]
6124pub struct MysqlRdbms {
6125    /// Mysql databases on the server
6126    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6127    pub mysql_databases: std::vec::Vec<crate::model::MysqlDatabase>,
6128}
6129
6130impl MysqlRdbms {
6131    pub fn new() -> Self {
6132        std::default::Default::default()
6133    }
6134
6135    /// Sets the value of [mysql_databases][crate::model::MysqlRdbms::mysql_databases].
6136    pub fn set_mysql_databases<T, V>(mut self, v: T) -> Self
6137    where
6138        T: std::iter::IntoIterator<Item = V>,
6139        V: std::convert::Into<crate::model::MysqlDatabase>,
6140    {
6141        use std::iter::Iterator;
6142        self.mysql_databases = v.into_iter().map(|i| i.into()).collect();
6143        self
6144    }
6145}
6146
6147impl wkt::message::Message for MysqlRdbms {
6148    fn typename() -> &'static str {
6149        "type.googleapis.com/google.cloud.datastream.v1.MysqlRdbms"
6150    }
6151}
6152
6153/// MySQL source configuration
6154#[serde_with::serde_as]
6155#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6156#[serde(default, rename_all = "camelCase")]
6157#[non_exhaustive]
6158pub struct MysqlSourceConfig {
6159    /// MySQL objects to retrieve from the source.
6160    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6161    pub include_objects: std::option::Option<crate::model::MysqlRdbms>,
6162
6163    /// MySQL objects to exclude from the stream.
6164    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6165    pub exclude_objects: std::option::Option<crate::model::MysqlRdbms>,
6166
6167    /// Maximum number of concurrent CDC tasks. The number should be non negative.
6168    /// If not set (or set to 0), the system's default value will be used.
6169    pub max_concurrent_cdc_tasks: i32,
6170
6171    /// Maximum number of concurrent backfill tasks. The number should be non
6172    /// negative. If not set (or set to 0), the system's default value will be
6173    /// used.
6174    pub max_concurrent_backfill_tasks: i32,
6175
6176    /// The CDC method to use for the stream.
6177    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
6178    pub cdc_method: std::option::Option<crate::model::mysql_source_config::CdcMethod>,
6179}
6180
6181impl MysqlSourceConfig {
6182    pub fn new() -> Self {
6183        std::default::Default::default()
6184    }
6185
6186    /// Sets the value of [include_objects][crate::model::MysqlSourceConfig::include_objects].
6187    pub fn set_include_objects<
6188        T: std::convert::Into<std::option::Option<crate::model::MysqlRdbms>>,
6189    >(
6190        mut self,
6191        v: T,
6192    ) -> Self {
6193        self.include_objects = v.into();
6194        self
6195    }
6196
6197    /// Sets the value of [exclude_objects][crate::model::MysqlSourceConfig::exclude_objects].
6198    pub fn set_exclude_objects<
6199        T: std::convert::Into<std::option::Option<crate::model::MysqlRdbms>>,
6200    >(
6201        mut self,
6202        v: T,
6203    ) -> Self {
6204        self.exclude_objects = v.into();
6205        self
6206    }
6207
6208    /// Sets the value of [max_concurrent_cdc_tasks][crate::model::MysqlSourceConfig::max_concurrent_cdc_tasks].
6209    pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6210        self.max_concurrent_cdc_tasks = v.into();
6211        self
6212    }
6213
6214    /// Sets the value of [max_concurrent_backfill_tasks][crate::model::MysqlSourceConfig::max_concurrent_backfill_tasks].
6215    pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6216        self.max_concurrent_backfill_tasks = v.into();
6217        self
6218    }
6219
6220    /// Sets the value of `cdc_method`.
6221    pub fn set_cdc_method<
6222        T: std::convert::Into<std::option::Option<crate::model::mysql_source_config::CdcMethod>>,
6223    >(
6224        mut self,
6225        v: T,
6226    ) -> Self {
6227        self.cdc_method = v.into();
6228        self
6229    }
6230
6231    /// The value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
6232    /// if it holds a `BinaryLogPosition`, `None` if the field is not set or
6233    /// holds a different branch.
6234    pub fn get_binary_log_position(
6235        &self,
6236    ) -> std::option::Option<&std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>>
6237    {
6238        #[allow(unreachable_patterns)]
6239        self.cdc_method.as_ref().and_then(|v| match v {
6240            crate::model::mysql_source_config::CdcMethod::BinaryLogPosition(v) => {
6241                std::option::Option::Some(v)
6242            }
6243            _ => std::option::Option::None,
6244        })
6245    }
6246
6247    /// The value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
6248    /// if it holds a `Gtid`, `None` if the field is not set or
6249    /// holds a different branch.
6250    pub fn get_gtid(
6251        &self,
6252    ) -> std::option::Option<&std::boxed::Box<crate::model::mysql_source_config::Gtid>> {
6253        #[allow(unreachable_patterns)]
6254        self.cdc_method.as_ref().and_then(|v| match v {
6255            crate::model::mysql_source_config::CdcMethod::Gtid(v) => std::option::Option::Some(v),
6256            _ => std::option::Option::None,
6257        })
6258    }
6259
6260    /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
6261    /// to hold a `BinaryLogPosition`.
6262    ///
6263    /// Note that all the setters affecting `cdc_method` are
6264    /// mutually exclusive.
6265    pub fn set_binary_log_position<
6266        T: std::convert::Into<std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>>,
6267    >(
6268        mut self,
6269        v: T,
6270    ) -> Self {
6271        self.cdc_method = std::option::Option::Some(
6272            crate::model::mysql_source_config::CdcMethod::BinaryLogPosition(v.into()),
6273        );
6274        self
6275    }
6276
6277    /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
6278    /// to hold a `Gtid`.
6279    ///
6280    /// Note that all the setters affecting `cdc_method` are
6281    /// mutually exclusive.
6282    pub fn set_gtid<
6283        T: std::convert::Into<std::boxed::Box<crate::model::mysql_source_config::Gtid>>,
6284    >(
6285        mut self,
6286        v: T,
6287    ) -> Self {
6288        self.cdc_method =
6289            std::option::Option::Some(crate::model::mysql_source_config::CdcMethod::Gtid(v.into()));
6290        self
6291    }
6292}
6293
6294impl wkt::message::Message for MysqlSourceConfig {
6295    fn typename() -> &'static str {
6296        "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig"
6297    }
6298}
6299
6300/// Defines additional types related to MysqlSourceConfig
6301pub mod mysql_source_config {
6302    #[allow(unused_imports)]
6303    use super::*;
6304
6305    /// Use Binary log position based replication.
6306    #[serde_with::serde_as]
6307    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6308    #[serde(default, rename_all = "camelCase")]
6309    #[non_exhaustive]
6310    pub struct BinaryLogPosition {}
6311
6312    impl BinaryLogPosition {
6313        pub fn new() -> Self {
6314            std::default::Default::default()
6315        }
6316    }
6317
6318    impl wkt::message::Message for BinaryLogPosition {
6319        fn typename() -> &'static str {
6320            "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig.BinaryLogPosition"
6321        }
6322    }
6323
6324    /// Use GTID based replication.
6325    #[serde_with::serde_as]
6326    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6327    #[serde(default, rename_all = "camelCase")]
6328    #[non_exhaustive]
6329    pub struct Gtid {}
6330
6331    impl Gtid {
6332        pub fn new() -> Self {
6333            std::default::Default::default()
6334        }
6335    }
6336
6337    impl wkt::message::Message for Gtid {
6338        fn typename() -> &'static str {
6339            "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig.Gtid"
6340        }
6341    }
6342
6343    /// The CDC method to use for the stream.
6344    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
6345    #[serde(rename_all = "camelCase")]
6346    #[non_exhaustive]
6347    pub enum CdcMethod {
6348        /// Use Binary log position based replication.
6349        BinaryLogPosition(std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>),
6350        /// Use GTID based replication.
6351        Gtid(std::boxed::Box<crate::model::mysql_source_config::Gtid>),
6352    }
6353}
6354
6355/// The configuration of the stream source.
6356#[serde_with::serde_as]
6357#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6358#[serde(default, rename_all = "camelCase")]
6359#[non_exhaustive]
6360pub struct SourceConfig {
6361    /// Required. Source connection profile resoource.
6362    /// Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
6363    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6364    pub source_connection_profile: std::string::String,
6365
6366    /// Stream configuration that is specific to the data source type.
6367    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
6368    pub source_stream_config: std::option::Option<crate::model::source_config::SourceStreamConfig>,
6369}
6370
6371impl SourceConfig {
6372    pub fn new() -> Self {
6373        std::default::Default::default()
6374    }
6375
6376    /// Sets the value of [source_connection_profile][crate::model::SourceConfig::source_connection_profile].
6377    pub fn set_source_connection_profile<T: std::convert::Into<std::string::String>>(
6378        mut self,
6379        v: T,
6380    ) -> Self {
6381        self.source_connection_profile = v.into();
6382        self
6383    }
6384
6385    /// Sets the value of `source_stream_config`.
6386    pub fn set_source_stream_config<
6387        T: std::convert::Into<std::option::Option<crate::model::source_config::SourceStreamConfig>>,
6388    >(
6389        mut self,
6390        v: T,
6391    ) -> Self {
6392        self.source_stream_config = v.into();
6393        self
6394    }
6395
6396    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
6397    /// if it holds a `OracleSourceConfig`, `None` if the field is not set or
6398    /// holds a different branch.
6399    pub fn get_oracle_source_config(
6400        &self,
6401    ) -> std::option::Option<&std::boxed::Box<crate::model::OracleSourceConfig>> {
6402        #[allow(unreachable_patterns)]
6403        self.source_stream_config.as_ref().and_then(|v| match v {
6404            crate::model::source_config::SourceStreamConfig::OracleSourceConfig(v) => {
6405                std::option::Option::Some(v)
6406            }
6407            _ => std::option::Option::None,
6408        })
6409    }
6410
6411    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
6412    /// if it holds a `MysqlSourceConfig`, `None` if the field is not set or
6413    /// holds a different branch.
6414    pub fn get_mysql_source_config(
6415        &self,
6416    ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlSourceConfig>> {
6417        #[allow(unreachable_patterns)]
6418        self.source_stream_config.as_ref().and_then(|v| match v {
6419            crate::model::source_config::SourceStreamConfig::MysqlSourceConfig(v) => {
6420                std::option::Option::Some(v)
6421            }
6422            _ => std::option::Option::None,
6423        })
6424    }
6425
6426    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
6427    /// if it holds a `PostgresqlSourceConfig`, `None` if the field is not set or
6428    /// holds a different branch.
6429    pub fn get_postgresql_source_config(
6430        &self,
6431    ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlSourceConfig>> {
6432        #[allow(unreachable_patterns)]
6433        self.source_stream_config.as_ref().and_then(|v| match v {
6434            crate::model::source_config::SourceStreamConfig::PostgresqlSourceConfig(v) => {
6435                std::option::Option::Some(v)
6436            }
6437            _ => std::option::Option::None,
6438        })
6439    }
6440
6441    /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
6442    /// if it holds a `SqlServerSourceConfig`, `None` if the field is not set or
6443    /// holds a different branch.
6444    pub fn get_sql_server_source_config(
6445        &self,
6446    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerSourceConfig>> {
6447        #[allow(unreachable_patterns)]
6448        self.source_stream_config.as_ref().and_then(|v| match v {
6449            crate::model::source_config::SourceStreamConfig::SqlServerSourceConfig(v) => {
6450                std::option::Option::Some(v)
6451            }
6452            _ => std::option::Option::None,
6453        })
6454    }
6455
6456    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
6457    /// to hold a `OracleSourceConfig`.
6458    ///
6459    /// Note that all the setters affecting `source_stream_config` are
6460    /// mutually exclusive.
6461    pub fn set_oracle_source_config<
6462        T: std::convert::Into<std::boxed::Box<crate::model::OracleSourceConfig>>,
6463    >(
6464        mut self,
6465        v: T,
6466    ) -> Self {
6467        self.source_stream_config = std::option::Option::Some(
6468            crate::model::source_config::SourceStreamConfig::OracleSourceConfig(v.into()),
6469        );
6470        self
6471    }
6472
6473    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
6474    /// to hold a `MysqlSourceConfig`.
6475    ///
6476    /// Note that all the setters affecting `source_stream_config` are
6477    /// mutually exclusive.
6478    pub fn set_mysql_source_config<
6479        T: std::convert::Into<std::boxed::Box<crate::model::MysqlSourceConfig>>,
6480    >(
6481        mut self,
6482        v: T,
6483    ) -> Self {
6484        self.source_stream_config = std::option::Option::Some(
6485            crate::model::source_config::SourceStreamConfig::MysqlSourceConfig(v.into()),
6486        );
6487        self
6488    }
6489
6490    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
6491    /// to hold a `PostgresqlSourceConfig`.
6492    ///
6493    /// Note that all the setters affecting `source_stream_config` are
6494    /// mutually exclusive.
6495    pub fn set_postgresql_source_config<
6496        T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlSourceConfig>>,
6497    >(
6498        mut self,
6499        v: T,
6500    ) -> Self {
6501        self.source_stream_config = std::option::Option::Some(
6502            crate::model::source_config::SourceStreamConfig::PostgresqlSourceConfig(v.into()),
6503        );
6504        self
6505    }
6506
6507    /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
6508    /// to hold a `SqlServerSourceConfig`.
6509    ///
6510    /// Note that all the setters affecting `source_stream_config` are
6511    /// mutually exclusive.
6512    pub fn set_sql_server_source_config<
6513        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerSourceConfig>>,
6514    >(
6515        mut self,
6516        v: T,
6517    ) -> Self {
6518        self.source_stream_config = std::option::Option::Some(
6519            crate::model::source_config::SourceStreamConfig::SqlServerSourceConfig(v.into()),
6520        );
6521        self
6522    }
6523}
6524
6525impl wkt::message::Message for SourceConfig {
6526    fn typename() -> &'static str {
6527        "type.googleapis.com/google.cloud.datastream.v1.SourceConfig"
6528    }
6529}
6530
6531/// Defines additional types related to SourceConfig
6532pub mod source_config {
6533    #[allow(unused_imports)]
6534    use super::*;
6535
6536    /// Stream configuration that is specific to the data source type.
6537    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
6538    #[serde(rename_all = "camelCase")]
6539    #[non_exhaustive]
6540    pub enum SourceStreamConfig {
6541        /// Oracle data source configuration.
6542        OracleSourceConfig(std::boxed::Box<crate::model::OracleSourceConfig>),
6543        /// MySQL data source configuration.
6544        MysqlSourceConfig(std::boxed::Box<crate::model::MysqlSourceConfig>),
6545        /// PostgreSQL data source configuration.
6546        PostgresqlSourceConfig(std::boxed::Box<crate::model::PostgresqlSourceConfig>),
6547        /// SQLServer data source configuration.
6548        SqlServerSourceConfig(std::boxed::Box<crate::model::SqlServerSourceConfig>),
6549    }
6550}
6551
6552/// AVRO file format configuration.
6553#[serde_with::serde_as]
6554#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6555#[serde(default, rename_all = "camelCase")]
6556#[non_exhaustive]
6557pub struct AvroFileFormat {}
6558
6559impl AvroFileFormat {
6560    pub fn new() -> Self {
6561        std::default::Default::default()
6562    }
6563}
6564
6565impl wkt::message::Message for AvroFileFormat {
6566    fn typename() -> &'static str {
6567        "type.googleapis.com/google.cloud.datastream.v1.AvroFileFormat"
6568    }
6569}
6570
6571/// JSON file format configuration.
6572#[serde_with::serde_as]
6573#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6574#[serde(default, rename_all = "camelCase")]
6575#[non_exhaustive]
6576pub struct JsonFileFormat {
6577    /// The schema file format along JSON data files.
6578    pub schema_file_format: crate::model::json_file_format::SchemaFileFormat,
6579
6580    /// Compression of the loaded JSON file.
6581    pub compression: crate::model::json_file_format::JsonCompression,
6582}
6583
6584impl JsonFileFormat {
6585    pub fn new() -> Self {
6586        std::default::Default::default()
6587    }
6588
6589    /// Sets the value of [schema_file_format][crate::model::JsonFileFormat::schema_file_format].
6590    pub fn set_schema_file_format<
6591        T: std::convert::Into<crate::model::json_file_format::SchemaFileFormat>,
6592    >(
6593        mut self,
6594        v: T,
6595    ) -> Self {
6596        self.schema_file_format = v.into();
6597        self
6598    }
6599
6600    /// Sets the value of [compression][crate::model::JsonFileFormat::compression].
6601    pub fn set_compression<
6602        T: std::convert::Into<crate::model::json_file_format::JsonCompression>,
6603    >(
6604        mut self,
6605        v: T,
6606    ) -> Self {
6607        self.compression = v.into();
6608        self
6609    }
6610}
6611
6612impl wkt::message::Message for JsonFileFormat {
6613    fn typename() -> &'static str {
6614        "type.googleapis.com/google.cloud.datastream.v1.JsonFileFormat"
6615    }
6616}
6617
6618/// Defines additional types related to JsonFileFormat
6619pub mod json_file_format {
6620    #[allow(unused_imports)]
6621    use super::*;
6622
6623    /// Schema file format.
6624    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6625    pub struct SchemaFileFormat(std::borrow::Cow<'static, str>);
6626
6627    impl SchemaFileFormat {
6628        /// Creates a new SchemaFileFormat instance.
6629        pub const fn new(v: &'static str) -> Self {
6630            Self(std::borrow::Cow::Borrowed(v))
6631        }
6632
6633        /// Gets the enum value.
6634        pub fn value(&self) -> &str {
6635            &self.0
6636        }
6637    }
6638
6639    /// Useful constants to work with [SchemaFileFormat](SchemaFileFormat)
6640    pub mod schema_file_format {
6641        use super::SchemaFileFormat;
6642
6643        /// Unspecified schema file format.
6644        pub const SCHEMA_FILE_FORMAT_UNSPECIFIED: SchemaFileFormat =
6645            SchemaFileFormat::new("SCHEMA_FILE_FORMAT_UNSPECIFIED");
6646
6647        /// Do not attach schema file.
6648        pub const NO_SCHEMA_FILE: SchemaFileFormat = SchemaFileFormat::new("NO_SCHEMA_FILE");
6649
6650        /// Avro schema format.
6651        pub const AVRO_SCHEMA_FILE: SchemaFileFormat = SchemaFileFormat::new("AVRO_SCHEMA_FILE");
6652    }
6653
6654    impl std::convert::From<std::string::String> for SchemaFileFormat {
6655        fn from(value: std::string::String) -> Self {
6656            Self(std::borrow::Cow::Owned(value))
6657        }
6658    }
6659
6660    /// Json file compression.
6661    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6662    pub struct JsonCompression(std::borrow::Cow<'static, str>);
6663
6664    impl JsonCompression {
6665        /// Creates a new JsonCompression instance.
6666        pub const fn new(v: &'static str) -> Self {
6667            Self(std::borrow::Cow::Borrowed(v))
6668        }
6669
6670        /// Gets the enum value.
6671        pub fn value(&self) -> &str {
6672            &self.0
6673        }
6674    }
6675
6676    /// Useful constants to work with [JsonCompression](JsonCompression)
6677    pub mod json_compression {
6678        use super::JsonCompression;
6679
6680        /// Unspecified json file compression.
6681        pub const JSON_COMPRESSION_UNSPECIFIED: JsonCompression =
6682            JsonCompression::new("JSON_COMPRESSION_UNSPECIFIED");
6683
6684        /// Do not compress JSON file.
6685        pub const NO_COMPRESSION: JsonCompression = JsonCompression::new("NO_COMPRESSION");
6686
6687        /// Gzip compression.
6688        pub const GZIP: JsonCompression = JsonCompression::new("GZIP");
6689    }
6690
6691    impl std::convert::From<std::string::String> for JsonCompression {
6692        fn from(value: std::string::String) -> Self {
6693            Self(std::borrow::Cow::Owned(value))
6694        }
6695    }
6696}
6697
6698/// Google Cloud Storage destination configuration
6699#[serde_with::serde_as]
6700#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6701#[serde(default, rename_all = "camelCase")]
6702#[non_exhaustive]
6703pub struct GcsDestinationConfig {
6704    /// Path inside the Cloud Storage bucket to write data to.
6705    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6706    pub path: std::string::String,
6707
6708    /// The maximum file size to be saved in the bucket.
6709    pub file_rotation_mb: i32,
6710
6711    /// The maximum duration for which new events are added before a file is
6712    /// closed and a new file is created. Values within the range of 15-60 seconds
6713    /// are allowed.
6714    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6715    pub file_rotation_interval: std::option::Option<wkt::Duration>,
6716
6717    /// File Format that the data should be written in.
6718    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
6719    pub file_format: std::option::Option<crate::model::gcs_destination_config::FileFormat>,
6720}
6721
6722impl GcsDestinationConfig {
6723    pub fn new() -> Self {
6724        std::default::Default::default()
6725    }
6726
6727    /// Sets the value of [path][crate::model::GcsDestinationConfig::path].
6728    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6729        self.path = v.into();
6730        self
6731    }
6732
6733    /// Sets the value of [file_rotation_mb][crate::model::GcsDestinationConfig::file_rotation_mb].
6734    pub fn set_file_rotation_mb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6735        self.file_rotation_mb = v.into();
6736        self
6737    }
6738
6739    /// Sets the value of [file_rotation_interval][crate::model::GcsDestinationConfig::file_rotation_interval].
6740    pub fn set_file_rotation_interval<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
6741        mut self,
6742        v: T,
6743    ) -> Self {
6744        self.file_rotation_interval = v.into();
6745        self
6746    }
6747
6748    /// Sets the value of `file_format`.
6749    pub fn set_file_format<
6750        T: std::convert::Into<std::option::Option<crate::model::gcs_destination_config::FileFormat>>,
6751    >(
6752        mut self,
6753        v: T,
6754    ) -> Self {
6755        self.file_format = v.into();
6756        self
6757    }
6758
6759    /// The value of [file_format][crate::model::GcsDestinationConfig::file_format]
6760    /// if it holds a `AvroFileFormat`, `None` if the field is not set or
6761    /// holds a different branch.
6762    pub fn get_avro_file_format(
6763        &self,
6764    ) -> std::option::Option<&std::boxed::Box<crate::model::AvroFileFormat>> {
6765        #[allow(unreachable_patterns)]
6766        self.file_format.as_ref().and_then(|v| match v {
6767            crate::model::gcs_destination_config::FileFormat::AvroFileFormat(v) => {
6768                std::option::Option::Some(v)
6769            }
6770            _ => std::option::Option::None,
6771        })
6772    }
6773
6774    /// The value of [file_format][crate::model::GcsDestinationConfig::file_format]
6775    /// if it holds a `JsonFileFormat`, `None` if the field is not set or
6776    /// holds a different branch.
6777    pub fn get_json_file_format(
6778        &self,
6779    ) -> std::option::Option<&std::boxed::Box<crate::model::JsonFileFormat>> {
6780        #[allow(unreachable_patterns)]
6781        self.file_format.as_ref().and_then(|v| match v {
6782            crate::model::gcs_destination_config::FileFormat::JsonFileFormat(v) => {
6783                std::option::Option::Some(v)
6784            }
6785            _ => std::option::Option::None,
6786        })
6787    }
6788
6789    /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format]
6790    /// to hold a `AvroFileFormat`.
6791    ///
6792    /// Note that all the setters affecting `file_format` are
6793    /// mutually exclusive.
6794    pub fn set_avro_file_format<
6795        T: std::convert::Into<std::boxed::Box<crate::model::AvroFileFormat>>,
6796    >(
6797        mut self,
6798        v: T,
6799    ) -> Self {
6800        self.file_format = std::option::Option::Some(
6801            crate::model::gcs_destination_config::FileFormat::AvroFileFormat(v.into()),
6802        );
6803        self
6804    }
6805
6806    /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format]
6807    /// to hold a `JsonFileFormat`.
6808    ///
6809    /// Note that all the setters affecting `file_format` are
6810    /// mutually exclusive.
6811    pub fn set_json_file_format<
6812        T: std::convert::Into<std::boxed::Box<crate::model::JsonFileFormat>>,
6813    >(
6814        mut self,
6815        v: T,
6816    ) -> Self {
6817        self.file_format = std::option::Option::Some(
6818            crate::model::gcs_destination_config::FileFormat::JsonFileFormat(v.into()),
6819        );
6820        self
6821    }
6822}
6823
6824impl wkt::message::Message for GcsDestinationConfig {
6825    fn typename() -> &'static str {
6826        "type.googleapis.com/google.cloud.datastream.v1.GcsDestinationConfig"
6827    }
6828}
6829
6830/// Defines additional types related to GcsDestinationConfig
6831pub mod gcs_destination_config {
6832    #[allow(unused_imports)]
6833    use super::*;
6834
6835    /// File Format that the data should be written in.
6836    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
6837    #[serde(rename_all = "camelCase")]
6838    #[non_exhaustive]
6839    pub enum FileFormat {
6840        /// AVRO file format configuration.
6841        AvroFileFormat(std::boxed::Box<crate::model::AvroFileFormat>),
6842        /// JSON file format configuration.
6843        JsonFileFormat(std::boxed::Box<crate::model::JsonFileFormat>),
6844    }
6845}
6846
6847/// BigQuery destination configuration
6848#[serde_with::serde_as]
6849#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6850#[serde(default, rename_all = "camelCase")]
6851#[non_exhaustive]
6852pub struct BigQueryDestinationConfig {
6853    /// The guaranteed data freshness (in seconds) when querying tables created by
6854    /// the stream. Editing this field will only affect new tables created in the
6855    /// future, but existing tables will not be impacted. Lower values mean that
6856    /// queries will return fresher data, but may result in higher cost.
6857    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6858    pub data_freshness: std::option::Option<wkt::Duration>,
6859
6860    /// Target dataset(s) configuration.
6861    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
6862    pub dataset_config:
6863        std::option::Option<crate::model::big_query_destination_config::DatasetConfig>,
6864
6865    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
6866    pub write_mode: std::option::Option<crate::model::big_query_destination_config::WriteMode>,
6867}
6868
6869impl BigQueryDestinationConfig {
6870    pub fn new() -> Self {
6871        std::default::Default::default()
6872    }
6873
6874    /// Sets the value of [data_freshness][crate::model::BigQueryDestinationConfig::data_freshness].
6875    pub fn set_data_freshness<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
6876        mut self,
6877        v: T,
6878    ) -> Self {
6879        self.data_freshness = v.into();
6880        self
6881    }
6882
6883    /// Sets the value of `dataset_config`.
6884    pub fn set_dataset_config<
6885        T: std::convert::Into<
6886            std::option::Option<crate::model::big_query_destination_config::DatasetConfig>,
6887        >,
6888    >(
6889        mut self,
6890        v: T,
6891    ) -> Self {
6892        self.dataset_config = v.into();
6893        self
6894    }
6895
6896    /// The value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
6897    /// if it holds a `SingleTargetDataset`, `None` if the field is not set or
6898    /// holds a different branch.
6899    pub fn get_single_target_dataset(
6900        &self,
6901    ) -> std::option::Option<
6902        &std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
6903    > {
6904        #[allow(unreachable_patterns)]
6905        self.dataset_config.as_ref().and_then(|v| match v {
6906            crate::model::big_query_destination_config::DatasetConfig::SingleTargetDataset(v) => {
6907                std::option::Option::Some(v)
6908            }
6909            _ => std::option::Option::None,
6910        })
6911    }
6912
6913    /// The value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
6914    /// if it holds a `SourceHierarchyDatasets`, `None` if the field is not set or
6915    /// holds a different branch.
6916    pub fn get_source_hierarchy_datasets(
6917        &self,
6918    ) -> std::option::Option<
6919        &std::boxed::Box<crate::model::big_query_destination_config::SourceHierarchyDatasets>,
6920    > {
6921        #[allow(unreachable_patterns)]
6922        self.dataset_config.as_ref().and_then(|v| match v {
6923            crate::model::big_query_destination_config::DatasetConfig::SourceHierarchyDatasets(
6924                v,
6925            ) => std::option::Option::Some(v),
6926            _ => std::option::Option::None,
6927        })
6928    }
6929
6930    /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
6931    /// to hold a `SingleTargetDataset`.
6932    ///
6933    /// Note that all the setters affecting `dataset_config` are
6934    /// mutually exclusive.
6935    pub fn set_single_target_dataset<
6936        T: std::convert::Into<
6937            std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
6938        >,
6939    >(
6940        mut self,
6941        v: T,
6942    ) -> Self {
6943        self.dataset_config = std::option::Option::Some(
6944            crate::model::big_query_destination_config::DatasetConfig::SingleTargetDataset(
6945                v.into(),
6946            ),
6947        );
6948        self
6949    }
6950
6951    /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
6952    /// to hold a `SourceHierarchyDatasets`.
6953    ///
6954    /// Note that all the setters affecting `dataset_config` are
6955    /// mutually exclusive.
6956    pub fn set_source_hierarchy_datasets<
6957        T: std::convert::Into<
6958            std::boxed::Box<crate::model::big_query_destination_config::SourceHierarchyDatasets>,
6959        >,
6960    >(
6961        mut self,
6962        v: T,
6963    ) -> Self {
6964        self.dataset_config = std::option::Option::Some(
6965            crate::model::big_query_destination_config::DatasetConfig::SourceHierarchyDatasets(
6966                v.into(),
6967            ),
6968        );
6969        self
6970    }
6971
6972    /// Sets the value of `write_mode`.
6973    pub fn set_write_mode<
6974        T: std::convert::Into<
6975            std::option::Option<crate::model::big_query_destination_config::WriteMode>,
6976        >,
6977    >(
6978        mut self,
6979        v: T,
6980    ) -> Self {
6981        self.write_mode = v.into();
6982        self
6983    }
6984
6985    /// The value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
6986    /// if it holds a `Merge`, `None` if the field is not set or
6987    /// holds a different branch.
6988    pub fn get_merge(
6989        &self,
6990    ) -> std::option::Option<&std::boxed::Box<crate::model::big_query_destination_config::Merge>>
6991    {
6992        #[allow(unreachable_patterns)]
6993        self.write_mode.as_ref().and_then(|v| match v {
6994            crate::model::big_query_destination_config::WriteMode::Merge(v) => {
6995                std::option::Option::Some(v)
6996            }
6997            _ => std::option::Option::None,
6998        })
6999    }
7000
7001    /// The value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
7002    /// if it holds a `AppendOnly`, `None` if the field is not set or
7003    /// holds a different branch.
7004    pub fn get_append_only(
7005        &self,
7006    ) -> std::option::Option<&std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>>
7007    {
7008        #[allow(unreachable_patterns)]
7009        self.write_mode.as_ref().and_then(|v| match v {
7010            crate::model::big_query_destination_config::WriteMode::AppendOnly(v) => {
7011                std::option::Option::Some(v)
7012            }
7013            _ => std::option::Option::None,
7014        })
7015    }
7016
7017    /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
7018    /// to hold a `Merge`.
7019    ///
7020    /// Note that all the setters affecting `write_mode` are
7021    /// mutually exclusive.
7022    pub fn set_merge<
7023        T: std::convert::Into<std::boxed::Box<crate::model::big_query_destination_config::Merge>>,
7024    >(
7025        mut self,
7026        v: T,
7027    ) -> Self {
7028        self.write_mode = std::option::Option::Some(
7029            crate::model::big_query_destination_config::WriteMode::Merge(v.into()),
7030        );
7031        self
7032    }
7033
7034    /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
7035    /// to hold a `AppendOnly`.
7036    ///
7037    /// Note that all the setters affecting `write_mode` are
7038    /// mutually exclusive.
7039    pub fn set_append_only<
7040        T: std::convert::Into<std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>>,
7041    >(
7042        mut self,
7043        v: T,
7044    ) -> Self {
7045        self.write_mode = std::option::Option::Some(
7046            crate::model::big_query_destination_config::WriteMode::AppendOnly(v.into()),
7047        );
7048        self
7049    }
7050}
7051
7052impl wkt::message::Message for BigQueryDestinationConfig {
7053    fn typename() -> &'static str {
7054        "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig"
7055    }
7056}
7057
7058/// Defines additional types related to BigQueryDestinationConfig
7059pub mod big_query_destination_config {
7060    #[allow(unused_imports)]
7061    use super::*;
7062
7063    /// A single target dataset to which all data will be streamed.
7064    #[serde_with::serde_as]
7065    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7066    #[serde(default, rename_all = "camelCase")]
7067    #[non_exhaustive]
7068    pub struct SingleTargetDataset {
7069        /// The dataset ID of the target dataset.
7070        /// DatasetIds allowed characters:
7071        /// <https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets#datasetreference>.
7072        #[serde(skip_serializing_if = "std::string::String::is_empty")]
7073        pub dataset_id: std::string::String,
7074    }
7075
7076    impl SingleTargetDataset {
7077        pub fn new() -> Self {
7078            std::default::Default::default()
7079        }
7080
7081        /// Sets the value of [dataset_id][crate::model::big_query_destination_config::SingleTargetDataset::dataset_id].
7082        pub fn set_dataset_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7083            self.dataset_id = v.into();
7084            self
7085        }
7086    }
7087
7088    impl wkt::message::Message for SingleTargetDataset {
7089        fn typename() -> &'static str {
7090            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SingleTargetDataset"
7091        }
7092    }
7093
7094    /// Destination datasets are created so that hierarchy of the destination data
7095    /// objects matches the source hierarchy.
7096    #[serde_with::serde_as]
7097    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7098    #[serde(default, rename_all = "camelCase")]
7099    #[non_exhaustive]
7100    pub struct SourceHierarchyDatasets {
7101        /// The dataset template to use for dynamic dataset creation.
7102        #[serde(skip_serializing_if = "std::option::Option::is_none")]
7103        pub dataset_template: std::option::Option<
7104            crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate,
7105        >,
7106    }
7107
7108    impl SourceHierarchyDatasets {
7109        pub fn new() -> Self {
7110            std::default::Default::default()
7111        }
7112
7113        /// Sets the value of [dataset_template][crate::model::big_query_destination_config::SourceHierarchyDatasets::dataset_template].
7114        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{
7115            self.dataset_template = v.into();
7116            self
7117        }
7118    }
7119
7120    impl wkt::message::Message for SourceHierarchyDatasets {
7121        fn typename() -> &'static str {
7122            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SourceHierarchyDatasets"
7123        }
7124    }
7125
7126    /// Defines additional types related to SourceHierarchyDatasets
7127    pub mod source_hierarchy_datasets {
7128        #[allow(unused_imports)]
7129        use super::*;
7130
7131        /// Dataset template used for dynamic dataset creation.
7132        #[serde_with::serde_as]
7133        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7134        #[serde(default, rename_all = "camelCase")]
7135        #[non_exhaustive]
7136        pub struct DatasetTemplate {
7137            /// Required. The geographic location where the dataset should reside. See
7138            /// <https://cloud.google.com/bigquery/docs/locations> for supported
7139            /// locations.
7140            #[serde(skip_serializing_if = "std::string::String::is_empty")]
7141            pub location: std::string::String,
7142
7143            /// If supplied, every created dataset will have its name prefixed by the
7144            /// provided value. The prefix and name will be separated by an underscore.
7145            /// i.e. \<prefix\>_<dataset_name>.
7146            #[serde(skip_serializing_if = "std::string::String::is_empty")]
7147            pub dataset_id_prefix: std::string::String,
7148
7149            /// Describes the Cloud KMS encryption key that will be used to
7150            /// protect destination BigQuery table. The BigQuery Service Account
7151            /// associated with your project requires access to this encryption key.
7152            /// i.e.
7153            /// projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{cryptoKey}.
7154            /// See <https://cloud.google.com/bigquery/docs/customer-managed-encryption>
7155            /// for more information.
7156            #[serde(skip_serializing_if = "std::string::String::is_empty")]
7157            pub kms_key_name: std::string::String,
7158        }
7159
7160        impl DatasetTemplate {
7161            pub fn new() -> Self {
7162                std::default::Default::default()
7163            }
7164
7165            /// Sets the value of [location][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::location].
7166            pub fn set_location<T: std::convert::Into<std::string::String>>(
7167                mut self,
7168                v: T,
7169            ) -> Self {
7170                self.location = v.into();
7171                self
7172            }
7173
7174            /// Sets the value of [dataset_id_prefix][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::dataset_id_prefix].
7175            pub fn set_dataset_id_prefix<T: std::convert::Into<std::string::String>>(
7176                mut self,
7177                v: T,
7178            ) -> Self {
7179                self.dataset_id_prefix = v.into();
7180                self
7181            }
7182
7183            /// Sets the value of [kms_key_name][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::kms_key_name].
7184            pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(
7185                mut self,
7186                v: T,
7187            ) -> Self {
7188                self.kms_key_name = v.into();
7189                self
7190            }
7191        }
7192
7193        impl wkt::message::Message for DatasetTemplate {
7194            fn typename() -> &'static str {
7195                "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SourceHierarchyDatasets.DatasetTemplate"
7196            }
7197        }
7198    }
7199
7200    /// AppendOnly mode defines that all changes to a table will be written to the
7201    /// destination table.
7202    #[serde_with::serde_as]
7203    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7204    #[serde(default, rename_all = "camelCase")]
7205    #[non_exhaustive]
7206    pub struct AppendOnly {}
7207
7208    impl AppendOnly {
7209        pub fn new() -> Self {
7210            std::default::Default::default()
7211        }
7212    }
7213
7214    impl wkt::message::Message for AppendOnly {
7215        fn typename() -> &'static str {
7216            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.AppendOnly"
7217        }
7218    }
7219
7220    /// Merge mode defines that all changes to a table will be merged at the
7221    /// destination table.
7222    #[serde_with::serde_as]
7223    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7224    #[serde(default, rename_all = "camelCase")]
7225    #[non_exhaustive]
7226    pub struct Merge {}
7227
7228    impl Merge {
7229        pub fn new() -> Self {
7230            std::default::Default::default()
7231        }
7232    }
7233
7234    impl wkt::message::Message for Merge {
7235        fn typename() -> &'static str {
7236            "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.Merge"
7237        }
7238    }
7239
7240    /// Target dataset(s) configuration.
7241    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
7242    #[serde(rename_all = "camelCase")]
7243    #[non_exhaustive]
7244    pub enum DatasetConfig {
7245        /// Single destination dataset.
7246        SingleTargetDataset(
7247            std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
7248        ),
7249        /// Source hierarchy datasets.
7250        SourceHierarchyDatasets(
7251            std::boxed::Box<crate::model::big_query_destination_config::SourceHierarchyDatasets>,
7252        ),
7253    }
7254
7255    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
7256    #[serde(rename_all = "camelCase")]
7257    #[non_exhaustive]
7258    pub enum WriteMode {
7259        /// The standard mode
7260        Merge(std::boxed::Box<crate::model::big_query_destination_config::Merge>),
7261        /// Append only mode
7262        AppendOnly(std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>),
7263    }
7264}
7265
7266/// The configuration of the stream destination.
7267#[serde_with::serde_as]
7268#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7269#[serde(default, rename_all = "camelCase")]
7270#[non_exhaustive]
7271pub struct DestinationConfig {
7272    /// Required. Destination connection profile resource.
7273    /// Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
7274    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7275    pub destination_connection_profile: std::string::String,
7276
7277    /// Stream configuration that is specific to the data destination type.
7278    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
7279    pub destination_stream_config:
7280        std::option::Option<crate::model::destination_config::DestinationStreamConfig>,
7281}
7282
7283impl DestinationConfig {
7284    pub fn new() -> Self {
7285        std::default::Default::default()
7286    }
7287
7288    /// Sets the value of [destination_connection_profile][crate::model::DestinationConfig::destination_connection_profile].
7289    pub fn set_destination_connection_profile<T: std::convert::Into<std::string::String>>(
7290        mut self,
7291        v: T,
7292    ) -> Self {
7293        self.destination_connection_profile = v.into();
7294        self
7295    }
7296
7297    /// Sets the value of `destination_stream_config`.
7298    pub fn set_destination_stream_config<
7299        T: std::convert::Into<
7300            std::option::Option<crate::model::destination_config::DestinationStreamConfig>,
7301        >,
7302    >(
7303        mut self,
7304        v: T,
7305    ) -> Self {
7306        self.destination_stream_config = v.into();
7307        self
7308    }
7309
7310    /// The value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
7311    /// if it holds a `GcsDestinationConfig`, `None` if the field is not set or
7312    /// holds a different branch.
7313    pub fn get_gcs_destination_config(
7314        &self,
7315    ) -> std::option::Option<&std::boxed::Box<crate::model::GcsDestinationConfig>> {
7316        #[allow(unreachable_patterns)]
7317        self.destination_stream_config
7318            .as_ref()
7319            .and_then(|v| match v {
7320                crate::model::destination_config::DestinationStreamConfig::GcsDestinationConfig(
7321                    v,
7322                ) => std::option::Option::Some(v),
7323                _ => std::option::Option::None,
7324            })
7325    }
7326
7327    /// The value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
7328    /// if it holds a `BigqueryDestinationConfig`, `None` if the field is not set or
7329    /// holds a different branch.
7330    pub fn get_bigquery_destination_config(
7331        &self,
7332    ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryDestinationConfig>> {
7333        #[allow(unreachable_patterns)]
7334        self.destination_stream_config.as_ref().and_then(|v| match v {
7335            crate::model::destination_config::DestinationStreamConfig::BigqueryDestinationConfig(v) => std::option::Option::Some(v),
7336            _ => std::option::Option::None,
7337        })
7338    }
7339
7340    /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
7341    /// to hold a `GcsDestinationConfig`.
7342    ///
7343    /// Note that all the setters affecting `destination_stream_config` are
7344    /// mutually exclusive.
7345    pub fn set_gcs_destination_config<
7346        T: std::convert::Into<std::boxed::Box<crate::model::GcsDestinationConfig>>,
7347    >(
7348        mut self,
7349        v: T,
7350    ) -> Self {
7351        self.destination_stream_config = std::option::Option::Some(
7352            crate::model::destination_config::DestinationStreamConfig::GcsDestinationConfig(
7353                v.into(),
7354            ),
7355        );
7356        self
7357    }
7358
7359    /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
7360    /// to hold a `BigqueryDestinationConfig`.
7361    ///
7362    /// Note that all the setters affecting `destination_stream_config` are
7363    /// mutually exclusive.
7364    pub fn set_bigquery_destination_config<
7365        T: std::convert::Into<std::boxed::Box<crate::model::BigQueryDestinationConfig>>,
7366    >(
7367        mut self,
7368        v: T,
7369    ) -> Self {
7370        self.destination_stream_config = std::option::Option::Some(
7371            crate::model::destination_config::DestinationStreamConfig::BigqueryDestinationConfig(
7372                v.into(),
7373            ),
7374        );
7375        self
7376    }
7377}
7378
7379impl wkt::message::Message for DestinationConfig {
7380    fn typename() -> &'static str {
7381        "type.googleapis.com/google.cloud.datastream.v1.DestinationConfig"
7382    }
7383}
7384
7385/// Defines additional types related to DestinationConfig
7386pub mod destination_config {
7387    #[allow(unused_imports)]
7388    use super::*;
7389
7390    /// Stream configuration that is specific to the data destination type.
7391    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
7392    #[serde(rename_all = "camelCase")]
7393    #[non_exhaustive]
7394    pub enum DestinationStreamConfig {
7395        /// A configuration for how data should be loaded to Cloud Storage.
7396        GcsDestinationConfig(std::boxed::Box<crate::model::GcsDestinationConfig>),
7397        /// BigQuery destination configuration.
7398        BigqueryDestinationConfig(std::boxed::Box<crate::model::BigQueryDestinationConfig>),
7399    }
7400}
7401
7402/// A resource representing streaming data from a source to a destination.
7403#[serde_with::serde_as]
7404#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7405#[serde(default, rename_all = "camelCase")]
7406#[non_exhaustive]
7407pub struct Stream {
7408    /// Output only. Identifier. The stream's name.
7409    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7410    pub name: std::string::String,
7411
7412    /// Output only. The creation time of the stream.
7413    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7414    pub create_time: std::option::Option<wkt::Timestamp>,
7415
7416    /// Output only. The last update time of the stream.
7417    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7418    pub update_time: std::option::Option<wkt::Timestamp>,
7419
7420    /// Labels.
7421    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
7422    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7423
7424    /// Required. Display name.
7425    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7426    pub display_name: std::string::String,
7427
7428    /// Required. Source connection profile configuration.
7429    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7430    pub source_config: std::option::Option<crate::model::SourceConfig>,
7431
7432    /// Required. Destination connection profile configuration.
7433    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7434    pub destination_config: std::option::Option<crate::model::DestinationConfig>,
7435
7436    /// The state of the stream.
7437    pub state: crate::model::stream::State,
7438
7439    /// Output only. Errors on the Stream.
7440    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7441    pub errors: std::vec::Vec<crate::model::Error>,
7442
7443    /// Immutable. A reference to a KMS encryption key.
7444    /// If provided, it will be used to encrypt the data.
7445    /// If left blank, data will be encrypted using an internal Stream-specific
7446    /// encryption key provisioned through KMS.
7447    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7448    pub customer_managed_encryption_key: std::option::Option<std::string::String>,
7449
7450    /// Output only. If the stream was recovered, the time of the last recovery.
7451    /// Note: This field is currently experimental.
7452    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7453    pub last_recovery_time: std::option::Option<wkt::Timestamp>,
7454
7455    /// Stream backfill strategy.
7456    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
7457    pub backfill_strategy: std::option::Option<crate::model::stream::BackfillStrategy>,
7458}
7459
7460impl Stream {
7461    pub fn new() -> Self {
7462        std::default::Default::default()
7463    }
7464
7465    /// Sets the value of [name][crate::model::Stream::name].
7466    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7467        self.name = v.into();
7468        self
7469    }
7470
7471    /// Sets the value of [create_time][crate::model::Stream::create_time].
7472    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
7473        mut self,
7474        v: T,
7475    ) -> Self {
7476        self.create_time = v.into();
7477        self
7478    }
7479
7480    /// Sets the value of [update_time][crate::model::Stream::update_time].
7481    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
7482        mut self,
7483        v: T,
7484    ) -> Self {
7485        self.update_time = v.into();
7486        self
7487    }
7488
7489    /// Sets the value of [display_name][crate::model::Stream::display_name].
7490    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7491        self.display_name = v.into();
7492        self
7493    }
7494
7495    /// Sets the value of [source_config][crate::model::Stream::source_config].
7496    pub fn set_source_config<
7497        T: std::convert::Into<std::option::Option<crate::model::SourceConfig>>,
7498    >(
7499        mut self,
7500        v: T,
7501    ) -> Self {
7502        self.source_config = v.into();
7503        self
7504    }
7505
7506    /// Sets the value of [destination_config][crate::model::Stream::destination_config].
7507    pub fn set_destination_config<
7508        T: std::convert::Into<std::option::Option<crate::model::DestinationConfig>>,
7509    >(
7510        mut self,
7511        v: T,
7512    ) -> Self {
7513        self.destination_config = v.into();
7514        self
7515    }
7516
7517    /// Sets the value of [state][crate::model::Stream::state].
7518    pub fn set_state<T: std::convert::Into<crate::model::stream::State>>(mut self, v: T) -> Self {
7519        self.state = v.into();
7520        self
7521    }
7522
7523    /// Sets the value of [customer_managed_encryption_key][crate::model::Stream::customer_managed_encryption_key].
7524    pub fn set_customer_managed_encryption_key<
7525        T: std::convert::Into<std::option::Option<std::string::String>>,
7526    >(
7527        mut self,
7528        v: T,
7529    ) -> Self {
7530        self.customer_managed_encryption_key = v.into();
7531        self
7532    }
7533
7534    /// Sets the value of [last_recovery_time][crate::model::Stream::last_recovery_time].
7535    pub fn set_last_recovery_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
7536        mut self,
7537        v: T,
7538    ) -> Self {
7539        self.last_recovery_time = v.into();
7540        self
7541    }
7542
7543    /// Sets the value of [errors][crate::model::Stream::errors].
7544    pub fn set_errors<T, V>(mut self, v: T) -> Self
7545    where
7546        T: std::iter::IntoIterator<Item = V>,
7547        V: std::convert::Into<crate::model::Error>,
7548    {
7549        use std::iter::Iterator;
7550        self.errors = v.into_iter().map(|i| i.into()).collect();
7551        self
7552    }
7553
7554    /// Sets the value of [labels][crate::model::Stream::labels].
7555    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7556    where
7557        T: std::iter::IntoIterator<Item = (K, V)>,
7558        K: std::convert::Into<std::string::String>,
7559        V: std::convert::Into<std::string::String>,
7560    {
7561        use std::iter::Iterator;
7562        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7563        self
7564    }
7565
7566    /// Sets the value of `backfill_strategy`.
7567    pub fn set_backfill_strategy<
7568        T: std::convert::Into<std::option::Option<crate::model::stream::BackfillStrategy>>,
7569    >(
7570        mut self,
7571        v: T,
7572    ) -> Self {
7573        self.backfill_strategy = v.into();
7574        self
7575    }
7576
7577    /// The value of [backfill_strategy][crate::model::Stream::backfill_strategy]
7578    /// if it holds a `BackfillAll`, `None` if the field is not set or
7579    /// holds a different branch.
7580    pub fn get_backfill_all(
7581        &self,
7582    ) -> std::option::Option<&std::boxed::Box<crate::model::stream::BackfillAllStrategy>> {
7583        #[allow(unreachable_patterns)]
7584        self.backfill_strategy.as_ref().and_then(|v| match v {
7585            crate::model::stream::BackfillStrategy::BackfillAll(v) => std::option::Option::Some(v),
7586            _ => std::option::Option::None,
7587        })
7588    }
7589
7590    /// The value of [backfill_strategy][crate::model::Stream::backfill_strategy]
7591    /// if it holds a `BackfillNone`, `None` if the field is not set or
7592    /// holds a different branch.
7593    pub fn get_backfill_none(
7594        &self,
7595    ) -> std::option::Option<&std::boxed::Box<crate::model::stream::BackfillNoneStrategy>> {
7596        #[allow(unreachable_patterns)]
7597        self.backfill_strategy.as_ref().and_then(|v| match v {
7598            crate::model::stream::BackfillStrategy::BackfillNone(v) => std::option::Option::Some(v),
7599            _ => std::option::Option::None,
7600        })
7601    }
7602
7603    /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy]
7604    /// to hold a `BackfillAll`.
7605    ///
7606    /// Note that all the setters affecting `backfill_strategy` are
7607    /// mutually exclusive.
7608    pub fn set_backfill_all<
7609        T: std::convert::Into<std::boxed::Box<crate::model::stream::BackfillAllStrategy>>,
7610    >(
7611        mut self,
7612        v: T,
7613    ) -> Self {
7614        self.backfill_strategy = std::option::Option::Some(
7615            crate::model::stream::BackfillStrategy::BackfillAll(v.into()),
7616        );
7617        self
7618    }
7619
7620    /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy]
7621    /// to hold a `BackfillNone`.
7622    ///
7623    /// Note that all the setters affecting `backfill_strategy` are
7624    /// mutually exclusive.
7625    pub fn set_backfill_none<
7626        T: std::convert::Into<std::boxed::Box<crate::model::stream::BackfillNoneStrategy>>,
7627    >(
7628        mut self,
7629        v: T,
7630    ) -> Self {
7631        self.backfill_strategy = std::option::Option::Some(
7632            crate::model::stream::BackfillStrategy::BackfillNone(v.into()),
7633        );
7634        self
7635    }
7636}
7637
7638impl wkt::message::Message for Stream {
7639    fn typename() -> &'static str {
7640        "type.googleapis.com/google.cloud.datastream.v1.Stream"
7641    }
7642}
7643
7644/// Defines additional types related to Stream
7645pub mod stream {
7646    #[allow(unused_imports)]
7647    use super::*;
7648
7649    /// Backfill strategy to automatically backfill the Stream's objects.
7650    /// Specific objects can be excluded.
7651    #[serde_with::serde_as]
7652    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7653    #[serde(default, rename_all = "camelCase")]
7654    #[non_exhaustive]
7655    pub struct BackfillAllStrategy {
7656        /// List of objects to exclude.
7657        #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
7658        pub excluded_objects:
7659            std::option::Option<crate::model::stream::backfill_all_strategy::ExcludedObjects>,
7660    }
7661
7662    impl BackfillAllStrategy {
7663        pub fn new() -> Self {
7664            std::default::Default::default()
7665        }
7666
7667        /// Sets the value of `excluded_objects`.
7668        pub fn set_excluded_objects<
7669            T: std::convert::Into<
7670                std::option::Option<crate::model::stream::backfill_all_strategy::ExcludedObjects>,
7671            >,
7672        >(
7673            mut self,
7674            v: T,
7675        ) -> Self {
7676            self.excluded_objects = v.into();
7677            self
7678        }
7679
7680        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
7681        /// if it holds a `OracleExcludedObjects`, `None` if the field is not set or
7682        /// holds a different branch.
7683        pub fn get_oracle_excluded_objects(
7684            &self,
7685        ) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
7686            #[allow(unreachable_patterns)]
7687            self.excluded_objects.as_ref().and_then(|v| match v {
7688                crate::model::stream::backfill_all_strategy::ExcludedObjects::OracleExcludedObjects(v) => std::option::Option::Some(v),
7689                _ => std::option::Option::None,
7690            })
7691        }
7692
7693        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
7694        /// if it holds a `MysqlExcludedObjects`, `None` if the field is not set or
7695        /// holds a different branch.
7696        pub fn get_mysql_excluded_objects(
7697            &self,
7698        ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
7699            #[allow(unreachable_patterns)]
7700            self.excluded_objects.as_ref().and_then(|v| match v {
7701                crate::model::stream::backfill_all_strategy::ExcludedObjects::MysqlExcludedObjects(v) => std::option::Option::Some(v),
7702                _ => std::option::Option::None,
7703            })
7704        }
7705
7706        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
7707        /// if it holds a `PostgresqlExcludedObjects`, `None` if the field is not set or
7708        /// holds a different branch.
7709        pub fn get_postgresql_excluded_objects(
7710            &self,
7711        ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
7712            #[allow(unreachable_patterns)]
7713            self.excluded_objects.as_ref().and_then(|v| match v {
7714                crate::model::stream::backfill_all_strategy::ExcludedObjects::PostgresqlExcludedObjects(v) => std::option::Option::Some(v),
7715                _ => std::option::Option::None,
7716            })
7717        }
7718
7719        /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
7720        /// if it holds a `SqlServerExcludedObjects`, `None` if the field is not set or
7721        /// holds a different branch.
7722        pub fn get_sql_server_excluded_objects(
7723            &self,
7724        ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
7725            #[allow(unreachable_patterns)]
7726            self.excluded_objects.as_ref().and_then(|v| match v {
7727                crate::model::stream::backfill_all_strategy::ExcludedObjects::SqlServerExcludedObjects(v) => std::option::Option::Some(v),
7728                _ => std::option::Option::None,
7729            })
7730        }
7731
7732        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
7733        /// to hold a `OracleExcludedObjects`.
7734        ///
7735        /// Note that all the setters affecting `excluded_objects` are
7736        /// mutually exclusive.
7737        pub fn set_oracle_excluded_objects<
7738            T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>,
7739        >(
7740            mut self,
7741            v: T,
7742        ) -> Self {
7743            self.excluded_objects = std::option::Option::Some(
7744                crate::model::stream::backfill_all_strategy::ExcludedObjects::OracleExcludedObjects(
7745                    v.into(),
7746                ),
7747            );
7748            self
7749        }
7750
7751        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
7752        /// to hold a `MysqlExcludedObjects`.
7753        ///
7754        /// Note that all the setters affecting `excluded_objects` are
7755        /// mutually exclusive.
7756        pub fn set_mysql_excluded_objects<
7757            T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>,
7758        >(
7759            mut self,
7760            v: T,
7761        ) -> Self {
7762            self.excluded_objects = std::option::Option::Some(
7763                crate::model::stream::backfill_all_strategy::ExcludedObjects::MysqlExcludedObjects(
7764                    v.into(),
7765                ),
7766            );
7767            self
7768        }
7769
7770        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
7771        /// to hold a `PostgresqlExcludedObjects`.
7772        ///
7773        /// Note that all the setters affecting `excluded_objects` are
7774        /// mutually exclusive.
7775        pub fn set_postgresql_excluded_objects<
7776            T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
7777        >(
7778            mut self,
7779            v: T,
7780        ) -> Self {
7781            self.excluded_objects = std::option::Option::Some(
7782                crate::model::stream::backfill_all_strategy::ExcludedObjects::PostgresqlExcludedObjects(
7783                    v.into()
7784                )
7785            );
7786            self
7787        }
7788
7789        /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
7790        /// to hold a `SqlServerExcludedObjects`.
7791        ///
7792        /// Note that all the setters affecting `excluded_objects` are
7793        /// mutually exclusive.
7794        pub fn set_sql_server_excluded_objects<
7795            T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
7796        >(
7797            mut self,
7798            v: T,
7799        ) -> Self {
7800            self.excluded_objects = std::option::Option::Some(
7801                crate::model::stream::backfill_all_strategy::ExcludedObjects::SqlServerExcludedObjects(
7802                    v.into()
7803                )
7804            );
7805            self
7806        }
7807    }
7808
7809    impl wkt::message::Message for BackfillAllStrategy {
7810        fn typename() -> &'static str {
7811            "type.googleapis.com/google.cloud.datastream.v1.Stream.BackfillAllStrategy"
7812        }
7813    }
7814
7815    /// Defines additional types related to BackfillAllStrategy
7816    pub mod backfill_all_strategy {
7817        #[allow(unused_imports)]
7818        use super::*;
7819
7820        /// List of objects to exclude.
7821        #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
7822        #[serde(rename_all = "camelCase")]
7823        #[non_exhaustive]
7824        pub enum ExcludedObjects {
7825            /// Oracle data source objects to avoid backfilling.
7826            OracleExcludedObjects(std::boxed::Box<crate::model::OracleRdbms>),
7827            /// MySQL data source objects to avoid backfilling.
7828            MysqlExcludedObjects(std::boxed::Box<crate::model::MysqlRdbms>),
7829            /// PostgreSQL data source objects to avoid backfilling.
7830            PostgresqlExcludedObjects(std::boxed::Box<crate::model::PostgresqlRdbms>),
7831            /// SQLServer data source objects to avoid backfilling
7832            SqlServerExcludedObjects(std::boxed::Box<crate::model::SqlServerRdbms>),
7833        }
7834    }
7835
7836    /// Backfill strategy to disable automatic backfill for the Stream's objects.
7837    #[serde_with::serde_as]
7838    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7839    #[serde(default, rename_all = "camelCase")]
7840    #[non_exhaustive]
7841    pub struct BackfillNoneStrategy {}
7842
7843    impl BackfillNoneStrategy {
7844        pub fn new() -> Self {
7845            std::default::Default::default()
7846        }
7847    }
7848
7849    impl wkt::message::Message for BackfillNoneStrategy {
7850        fn typename() -> &'static str {
7851            "type.googleapis.com/google.cloud.datastream.v1.Stream.BackfillNoneStrategy"
7852        }
7853    }
7854
7855    /// Stream state.
7856    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7857    pub struct State(std::borrow::Cow<'static, str>);
7858
7859    impl State {
7860        /// Creates a new State instance.
7861        pub const fn new(v: &'static str) -> Self {
7862            Self(std::borrow::Cow::Borrowed(v))
7863        }
7864
7865        /// Gets the enum value.
7866        pub fn value(&self) -> &str {
7867            &self.0
7868        }
7869    }
7870
7871    /// Useful constants to work with [State](State)
7872    pub mod state {
7873        use super::State;
7874
7875        /// Unspecified stream state.
7876        pub const STATE_UNSPECIFIED: State = State::new("STATE_UNSPECIFIED");
7877
7878        /// The stream has been created but has not yet started streaming data.
7879        pub const NOT_STARTED: State = State::new("NOT_STARTED");
7880
7881        /// The stream is running.
7882        pub const RUNNING: State = State::new("RUNNING");
7883
7884        /// The stream is paused.
7885        pub const PAUSED: State = State::new("PAUSED");
7886
7887        /// The stream is in maintenance mode.
7888        ///
7889        /// Updates are rejected on the resource in this state.
7890        pub const MAINTENANCE: State = State::new("MAINTENANCE");
7891
7892        /// The stream is experiencing an error that is preventing data from being
7893        /// streamed.
7894        pub const FAILED: State = State::new("FAILED");
7895
7896        /// The stream has experienced a terminal failure.
7897        pub const FAILED_PERMANENTLY: State = State::new("FAILED_PERMANENTLY");
7898
7899        /// The stream is starting, but not yet running.
7900        pub const STARTING: State = State::new("STARTING");
7901
7902        /// The Stream is no longer reading new events, but still writing events in
7903        /// the buffer.
7904        pub const DRAINING: State = State::new("DRAINING");
7905    }
7906
7907    impl std::convert::From<std::string::String> for State {
7908        fn from(value: std::string::String) -> Self {
7909            Self(std::borrow::Cow::Owned(value))
7910        }
7911    }
7912
7913    /// Stream backfill strategy.
7914    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
7915    #[serde(rename_all = "camelCase")]
7916    #[non_exhaustive]
7917    pub enum BackfillStrategy {
7918        /// Automatically backfill objects included in the stream source
7919        /// configuration. Specific objects can be excluded.
7920        BackfillAll(std::boxed::Box<crate::model::stream::BackfillAllStrategy>),
7921        /// Do not automatically backfill any objects.
7922        BackfillNone(std::boxed::Box<crate::model::stream::BackfillNoneStrategy>),
7923    }
7924}
7925
7926/// A specific stream object (e.g a specific DB table).
7927#[serde_with::serde_as]
7928#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7929#[serde(default, rename_all = "camelCase")]
7930#[non_exhaustive]
7931pub struct StreamObject {
7932    /// Output only. Identifier. The object resource's name.
7933    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7934    pub name: std::string::String,
7935
7936    /// Output only. The creation time of the object.
7937    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7938    pub create_time: std::option::Option<wkt::Timestamp>,
7939
7940    /// Output only. The last update time of the object.
7941    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7942    pub update_time: std::option::Option<wkt::Timestamp>,
7943
7944    /// Required. Display name.
7945    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7946    pub display_name: std::string::String,
7947
7948    /// Output only. Active errors on the object.
7949    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7950    pub errors: std::vec::Vec<crate::model::Error>,
7951
7952    /// The latest backfill job that was initiated for the stream object.
7953    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7954    pub backfill_job: std::option::Option<crate::model::BackfillJob>,
7955
7956    /// The object identifier in the data source.
7957    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7958    pub source_object: std::option::Option<crate::model::SourceObjectIdentifier>,
7959}
7960
7961impl StreamObject {
7962    pub fn new() -> Self {
7963        std::default::Default::default()
7964    }
7965
7966    /// Sets the value of [name][crate::model::StreamObject::name].
7967    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7968        self.name = v.into();
7969        self
7970    }
7971
7972    /// Sets the value of [create_time][crate::model::StreamObject::create_time].
7973    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
7974        mut self,
7975        v: T,
7976    ) -> Self {
7977        self.create_time = v.into();
7978        self
7979    }
7980
7981    /// Sets the value of [update_time][crate::model::StreamObject::update_time].
7982    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
7983        mut self,
7984        v: T,
7985    ) -> Self {
7986        self.update_time = v.into();
7987        self
7988    }
7989
7990    /// Sets the value of [display_name][crate::model::StreamObject::display_name].
7991    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7992        self.display_name = v.into();
7993        self
7994    }
7995
7996    /// Sets the value of [backfill_job][crate::model::StreamObject::backfill_job].
7997    pub fn set_backfill_job<
7998        T: std::convert::Into<std::option::Option<crate::model::BackfillJob>>,
7999    >(
8000        mut self,
8001        v: T,
8002    ) -> Self {
8003        self.backfill_job = v.into();
8004        self
8005    }
8006
8007    /// Sets the value of [source_object][crate::model::StreamObject::source_object].
8008    pub fn set_source_object<
8009        T: std::convert::Into<std::option::Option<crate::model::SourceObjectIdentifier>>,
8010    >(
8011        mut self,
8012        v: T,
8013    ) -> Self {
8014        self.source_object = v.into();
8015        self
8016    }
8017
8018    /// Sets the value of [errors][crate::model::StreamObject::errors].
8019    pub fn set_errors<T, V>(mut self, v: T) -> Self
8020    where
8021        T: std::iter::IntoIterator<Item = V>,
8022        V: std::convert::Into<crate::model::Error>,
8023    {
8024        use std::iter::Iterator;
8025        self.errors = v.into_iter().map(|i| i.into()).collect();
8026        self
8027    }
8028}
8029
8030impl wkt::message::Message for StreamObject {
8031    fn typename() -> &'static str {
8032        "type.googleapis.com/google.cloud.datastream.v1.StreamObject"
8033    }
8034}
8035
8036/// Represents an identifier of an object in the data source.
8037#[serde_with::serde_as]
8038#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8039#[serde(default, rename_all = "camelCase")]
8040#[non_exhaustive]
8041pub struct SourceObjectIdentifier {
8042    /// The identifier for an object in the data source.
8043    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
8044    pub source_identifier:
8045        std::option::Option<crate::model::source_object_identifier::SourceIdentifier>,
8046}
8047
8048impl SourceObjectIdentifier {
8049    pub fn new() -> Self {
8050        std::default::Default::default()
8051    }
8052
8053    /// Sets the value of `source_identifier`.
8054    pub fn set_source_identifier<
8055        T: std::convert::Into<
8056            std::option::Option<crate::model::source_object_identifier::SourceIdentifier>,
8057        >,
8058    >(
8059        mut self,
8060        v: T,
8061    ) -> Self {
8062        self.source_identifier = v.into();
8063        self
8064    }
8065
8066    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
8067    /// if it holds a `OracleIdentifier`, `None` if the field is not set or
8068    /// holds a different branch.
8069    pub fn get_oracle_identifier(
8070        &self,
8071    ) -> std::option::Option<
8072        &std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
8073    > {
8074        #[allow(unreachable_patterns)]
8075        self.source_identifier.as_ref().and_then(|v| match v {
8076            crate::model::source_object_identifier::SourceIdentifier::OracleIdentifier(v) => {
8077                std::option::Option::Some(v)
8078            }
8079            _ => std::option::Option::None,
8080        })
8081    }
8082
8083    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
8084    /// if it holds a `MysqlIdentifier`, `None` if the field is not set or
8085    /// holds a different branch.
8086    pub fn get_mysql_identifier(
8087        &self,
8088    ) -> std::option::Option<
8089        &std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
8090    > {
8091        #[allow(unreachable_patterns)]
8092        self.source_identifier.as_ref().and_then(|v| match v {
8093            crate::model::source_object_identifier::SourceIdentifier::MysqlIdentifier(v) => {
8094                std::option::Option::Some(v)
8095            }
8096            _ => std::option::Option::None,
8097        })
8098    }
8099
8100    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
8101    /// if it holds a `PostgresqlIdentifier`, `None` if the field is not set or
8102    /// holds a different branch.
8103    pub fn get_postgresql_identifier(
8104        &self,
8105    ) -> std::option::Option<
8106        &std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
8107    > {
8108        #[allow(unreachable_patterns)]
8109        self.source_identifier.as_ref().and_then(|v| match v {
8110            crate::model::source_object_identifier::SourceIdentifier::PostgresqlIdentifier(v) => {
8111                std::option::Option::Some(v)
8112            }
8113            _ => std::option::Option::None,
8114        })
8115    }
8116
8117    /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
8118    /// if it holds a `SqlServerIdentifier`, `None` if the field is not set or
8119    /// holds a different branch.
8120    pub fn get_sql_server_identifier(
8121        &self,
8122    ) -> std::option::Option<
8123        &std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
8124    > {
8125        #[allow(unreachable_patterns)]
8126        self.source_identifier.as_ref().and_then(|v| match v {
8127            crate::model::source_object_identifier::SourceIdentifier::SqlServerIdentifier(v) => {
8128                std::option::Option::Some(v)
8129            }
8130            _ => std::option::Option::None,
8131        })
8132    }
8133
8134    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
8135    /// to hold a `OracleIdentifier`.
8136    ///
8137    /// Note that all the setters affecting `source_identifier` are
8138    /// mutually exclusive.
8139    pub fn set_oracle_identifier<
8140        T: std::convert::Into<
8141            std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
8142        >,
8143    >(
8144        mut self,
8145        v: T,
8146    ) -> Self {
8147        self.source_identifier = std::option::Option::Some(
8148            crate::model::source_object_identifier::SourceIdentifier::OracleIdentifier(v.into()),
8149        );
8150        self
8151    }
8152
8153    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
8154    /// to hold a `MysqlIdentifier`.
8155    ///
8156    /// Note that all the setters affecting `source_identifier` are
8157    /// mutually exclusive.
8158    pub fn set_mysql_identifier<
8159        T: std::convert::Into<
8160            std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
8161        >,
8162    >(
8163        mut self,
8164        v: T,
8165    ) -> Self {
8166        self.source_identifier = std::option::Option::Some(
8167            crate::model::source_object_identifier::SourceIdentifier::MysqlIdentifier(v.into()),
8168        );
8169        self
8170    }
8171
8172    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
8173    /// to hold a `PostgresqlIdentifier`.
8174    ///
8175    /// Note that all the setters affecting `source_identifier` are
8176    /// mutually exclusive.
8177    pub fn set_postgresql_identifier<
8178        T: std::convert::Into<
8179            std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
8180        >,
8181    >(
8182        mut self,
8183        v: T,
8184    ) -> Self {
8185        self.source_identifier = std::option::Option::Some(
8186            crate::model::source_object_identifier::SourceIdentifier::PostgresqlIdentifier(
8187                v.into(),
8188            ),
8189        );
8190        self
8191    }
8192
8193    /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
8194    /// to hold a `SqlServerIdentifier`.
8195    ///
8196    /// Note that all the setters affecting `source_identifier` are
8197    /// mutually exclusive.
8198    pub fn set_sql_server_identifier<
8199        T: std::convert::Into<
8200            std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
8201        >,
8202    >(
8203        mut self,
8204        v: T,
8205    ) -> Self {
8206        self.source_identifier = std::option::Option::Some(
8207            crate::model::source_object_identifier::SourceIdentifier::SqlServerIdentifier(v.into()),
8208        );
8209        self
8210    }
8211}
8212
8213impl wkt::message::Message for SourceObjectIdentifier {
8214    fn typename() -> &'static str {
8215        "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier"
8216    }
8217}
8218
8219/// Defines additional types related to SourceObjectIdentifier
8220pub mod source_object_identifier {
8221    #[allow(unused_imports)]
8222    use super::*;
8223
8224    /// Oracle data source object identifier.
8225    #[serde_with::serde_as]
8226    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8227    #[serde(default, rename_all = "camelCase")]
8228    #[non_exhaustive]
8229    pub struct OracleObjectIdentifier {
8230        /// Required. The schema name.
8231        #[serde(skip_serializing_if = "std::string::String::is_empty")]
8232        pub schema: std::string::String,
8233
8234        /// Required. The table name.
8235        #[serde(skip_serializing_if = "std::string::String::is_empty")]
8236        pub table: std::string::String,
8237    }
8238
8239    impl OracleObjectIdentifier {
8240        pub fn new() -> Self {
8241            std::default::Default::default()
8242        }
8243
8244        /// Sets the value of [schema][crate::model::source_object_identifier::OracleObjectIdentifier::schema].
8245        pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8246            self.schema = v.into();
8247            self
8248        }
8249
8250        /// Sets the value of [table][crate::model::source_object_identifier::OracleObjectIdentifier::table].
8251        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8252            self.table = v.into();
8253            self
8254        }
8255    }
8256
8257    impl wkt::message::Message for OracleObjectIdentifier {
8258        fn typename() -> &'static str {
8259            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.OracleObjectIdentifier"
8260        }
8261    }
8262
8263    /// PostgreSQL data source object identifier.
8264    #[serde_with::serde_as]
8265    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8266    #[serde(default, rename_all = "camelCase")]
8267    #[non_exhaustive]
8268    pub struct PostgresqlObjectIdentifier {
8269        /// Required. The schema name.
8270        #[serde(skip_serializing_if = "std::string::String::is_empty")]
8271        pub schema: std::string::String,
8272
8273        /// Required. The table name.
8274        #[serde(skip_serializing_if = "std::string::String::is_empty")]
8275        pub table: std::string::String,
8276    }
8277
8278    impl PostgresqlObjectIdentifier {
8279        pub fn new() -> Self {
8280            std::default::Default::default()
8281        }
8282
8283        /// Sets the value of [schema][crate::model::source_object_identifier::PostgresqlObjectIdentifier::schema].
8284        pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8285            self.schema = v.into();
8286            self
8287        }
8288
8289        /// Sets the value of [table][crate::model::source_object_identifier::PostgresqlObjectIdentifier::table].
8290        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8291            self.table = v.into();
8292            self
8293        }
8294    }
8295
8296    impl wkt::message::Message for PostgresqlObjectIdentifier {
8297        fn typename() -> &'static str {
8298            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.PostgresqlObjectIdentifier"
8299        }
8300    }
8301
8302    /// Mysql data source object identifier.
8303    #[serde_with::serde_as]
8304    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8305    #[serde(default, rename_all = "camelCase")]
8306    #[non_exhaustive]
8307    pub struct MysqlObjectIdentifier {
8308        /// Required. The database name.
8309        #[serde(skip_serializing_if = "std::string::String::is_empty")]
8310        pub database: std::string::String,
8311
8312        /// Required. The table name.
8313        #[serde(skip_serializing_if = "std::string::String::is_empty")]
8314        pub table: std::string::String,
8315    }
8316
8317    impl MysqlObjectIdentifier {
8318        pub fn new() -> Self {
8319            std::default::Default::default()
8320        }
8321
8322        /// Sets the value of [database][crate::model::source_object_identifier::MysqlObjectIdentifier::database].
8323        pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8324            self.database = v.into();
8325            self
8326        }
8327
8328        /// Sets the value of [table][crate::model::source_object_identifier::MysqlObjectIdentifier::table].
8329        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8330            self.table = v.into();
8331            self
8332        }
8333    }
8334
8335    impl wkt::message::Message for MysqlObjectIdentifier {
8336        fn typename() -> &'static str {
8337            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.MysqlObjectIdentifier"
8338        }
8339    }
8340
8341    /// SQLServer data source object identifier.
8342    #[serde_with::serde_as]
8343    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8344    #[serde(default, rename_all = "camelCase")]
8345    #[non_exhaustive]
8346    pub struct SqlServerObjectIdentifier {
8347        /// Required. The schema name.
8348        #[serde(skip_serializing_if = "std::string::String::is_empty")]
8349        pub schema: std::string::String,
8350
8351        /// Required. The table name.
8352        #[serde(skip_serializing_if = "std::string::String::is_empty")]
8353        pub table: std::string::String,
8354    }
8355
8356    impl SqlServerObjectIdentifier {
8357        pub fn new() -> Self {
8358            std::default::Default::default()
8359        }
8360
8361        /// Sets the value of [schema][crate::model::source_object_identifier::SqlServerObjectIdentifier::schema].
8362        pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8363            self.schema = v.into();
8364            self
8365        }
8366
8367        /// Sets the value of [table][crate::model::source_object_identifier::SqlServerObjectIdentifier::table].
8368        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8369            self.table = v.into();
8370            self
8371        }
8372    }
8373
8374    impl wkt::message::Message for SqlServerObjectIdentifier {
8375        fn typename() -> &'static str {
8376            "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.SqlServerObjectIdentifier"
8377        }
8378    }
8379
8380    /// The identifier for an object in the data source.
8381    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8382    #[serde(rename_all = "camelCase")]
8383    #[non_exhaustive]
8384    pub enum SourceIdentifier {
8385        /// Oracle data source object identifier.
8386        OracleIdentifier(
8387            std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
8388        ),
8389        /// Mysql data source object identifier.
8390        MysqlIdentifier(
8391            std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
8392        ),
8393        /// PostgreSQL data source object identifier.
8394        PostgresqlIdentifier(
8395            std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
8396        ),
8397        /// SQLServer data source object identifier.
8398        SqlServerIdentifier(
8399            std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
8400        ),
8401    }
8402}
8403
8404/// Represents a backfill job on a specific stream object.
8405#[serde_with::serde_as]
8406#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8407#[serde(default, rename_all = "camelCase")]
8408#[non_exhaustive]
8409pub struct BackfillJob {
8410    /// Output only. Backfill job state.
8411    pub state: crate::model::backfill_job::State,
8412
8413    /// Backfill job's triggering reason.
8414    pub trigger: crate::model::backfill_job::Trigger,
8415
8416    /// Output only. Backfill job's start time.
8417    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8418    pub last_start_time: std::option::Option<wkt::Timestamp>,
8419
8420    /// Output only. Backfill job's end time.
8421    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8422    pub last_end_time: std::option::Option<wkt::Timestamp>,
8423
8424    /// Output only. Errors which caused the backfill job to fail.
8425    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8426    pub errors: std::vec::Vec<crate::model::Error>,
8427}
8428
8429impl BackfillJob {
8430    pub fn new() -> Self {
8431        std::default::Default::default()
8432    }
8433
8434    /// Sets the value of [state][crate::model::BackfillJob::state].
8435    pub fn set_state<T: std::convert::Into<crate::model::backfill_job::State>>(
8436        mut self,
8437        v: T,
8438    ) -> Self {
8439        self.state = v.into();
8440        self
8441    }
8442
8443    /// Sets the value of [trigger][crate::model::BackfillJob::trigger].
8444    pub fn set_trigger<T: std::convert::Into<crate::model::backfill_job::Trigger>>(
8445        mut self,
8446        v: T,
8447    ) -> Self {
8448        self.trigger = v.into();
8449        self
8450    }
8451
8452    /// Sets the value of [last_start_time][crate::model::BackfillJob::last_start_time].
8453    pub fn set_last_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
8454        mut self,
8455        v: T,
8456    ) -> Self {
8457        self.last_start_time = v.into();
8458        self
8459    }
8460
8461    /// Sets the value of [last_end_time][crate::model::BackfillJob::last_end_time].
8462    pub fn set_last_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
8463        mut self,
8464        v: T,
8465    ) -> Self {
8466        self.last_end_time = v.into();
8467        self
8468    }
8469
8470    /// Sets the value of [errors][crate::model::BackfillJob::errors].
8471    pub fn set_errors<T, V>(mut self, v: T) -> Self
8472    where
8473        T: std::iter::IntoIterator<Item = V>,
8474        V: std::convert::Into<crate::model::Error>,
8475    {
8476        use std::iter::Iterator;
8477        self.errors = v.into_iter().map(|i| i.into()).collect();
8478        self
8479    }
8480}
8481
8482impl wkt::message::Message for BackfillJob {
8483    fn typename() -> &'static str {
8484        "type.googleapis.com/google.cloud.datastream.v1.BackfillJob"
8485    }
8486}
8487
8488/// Defines additional types related to BackfillJob
8489pub mod backfill_job {
8490    #[allow(unused_imports)]
8491    use super::*;
8492
8493    /// State of the stream object's backfill job.
8494    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8495    pub struct State(std::borrow::Cow<'static, str>);
8496
8497    impl State {
8498        /// Creates a new State instance.
8499        pub const fn new(v: &'static str) -> Self {
8500            Self(std::borrow::Cow::Borrowed(v))
8501        }
8502
8503        /// Gets the enum value.
8504        pub fn value(&self) -> &str {
8505            &self.0
8506        }
8507    }
8508
8509    /// Useful constants to work with [State](State)
8510    pub mod state {
8511        use super::State;
8512
8513        /// Default value.
8514        pub const STATE_UNSPECIFIED: State = State::new("STATE_UNSPECIFIED");
8515
8516        /// Backfill job was never started for the stream object (stream has backfill
8517        /// strategy defined as manual or object was explicitly excluded from
8518        /// automatic backfill).
8519        pub const NOT_STARTED: State = State::new("NOT_STARTED");
8520
8521        /// Backfill job will start pending available resources.
8522        pub const PENDING: State = State::new("PENDING");
8523
8524        /// Backfill job is running.
8525        pub const ACTIVE: State = State::new("ACTIVE");
8526
8527        /// Backfill job stopped (next job run will start from beginning).
8528        pub const STOPPED: State = State::new("STOPPED");
8529
8530        /// Backfill job failed (due to an error).
8531        pub const FAILED: State = State::new("FAILED");
8532
8533        /// Backfill completed successfully.
8534        pub const COMPLETED: State = State::new("COMPLETED");
8535
8536        /// Backfill job failed since the table structure is currently unsupported
8537        /// for backfill.
8538        pub const UNSUPPORTED: State = State::new("UNSUPPORTED");
8539    }
8540
8541    impl std::convert::From<std::string::String> for State {
8542        fn from(value: std::string::String) -> Self {
8543            Self(std::borrow::Cow::Owned(value))
8544        }
8545    }
8546
8547    /// Triggering reason for a backfill job.
8548    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8549    pub struct Trigger(std::borrow::Cow<'static, str>);
8550
8551    impl Trigger {
8552        /// Creates a new Trigger instance.
8553        pub const fn new(v: &'static str) -> Self {
8554            Self(std::borrow::Cow::Borrowed(v))
8555        }
8556
8557        /// Gets the enum value.
8558        pub fn value(&self) -> &str {
8559            &self.0
8560        }
8561    }
8562
8563    /// Useful constants to work with [Trigger](Trigger)
8564    pub mod trigger {
8565        use super::Trigger;
8566
8567        /// Default value.
8568        pub const TRIGGER_UNSPECIFIED: Trigger = Trigger::new("TRIGGER_UNSPECIFIED");
8569
8570        /// Object backfill job was triggered automatically according to the stream's
8571        /// backfill strategy.
8572        pub const AUTOMATIC: Trigger = Trigger::new("AUTOMATIC");
8573
8574        /// Object backfill job was triggered manually using the dedicated API.
8575        pub const MANUAL: Trigger = Trigger::new("MANUAL");
8576    }
8577
8578    impl std::convert::From<std::string::String> for Trigger {
8579        fn from(value: std::string::String) -> Self {
8580            Self(std::borrow::Cow::Owned(value))
8581        }
8582    }
8583}
8584
8585/// Represent a user-facing Error.
8586#[serde_with::serde_as]
8587#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8588#[serde(default, rename_all = "camelCase")]
8589#[non_exhaustive]
8590pub struct Error {
8591    /// A title that explains the reason for the error.
8592    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8593    pub reason: std::string::String,
8594
8595    /// A unique identifier for this specific error,
8596    /// allowing it to be traced throughout the system in logs and API responses.
8597    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8598    pub error_uuid: std::string::String,
8599
8600    /// A message containing more information about the error that occurred.
8601    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8602    pub message: std::string::String,
8603
8604    /// The time when the error occurred.
8605    #[serde(skip_serializing_if = "std::option::Option::is_none")]
8606    pub error_time: std::option::Option<wkt::Timestamp>,
8607
8608    /// Additional information about the error.
8609    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
8610    pub details: std::collections::HashMap<std::string::String, std::string::String>,
8611}
8612
8613impl Error {
8614    pub fn new() -> Self {
8615        std::default::Default::default()
8616    }
8617
8618    /// Sets the value of [reason][crate::model::Error::reason].
8619    pub fn set_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8620        self.reason = v.into();
8621        self
8622    }
8623
8624    /// Sets the value of [error_uuid][crate::model::Error::error_uuid].
8625    pub fn set_error_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8626        self.error_uuid = v.into();
8627        self
8628    }
8629
8630    /// Sets the value of [message][crate::model::Error::message].
8631    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8632        self.message = v.into();
8633        self
8634    }
8635
8636    /// Sets the value of [error_time][crate::model::Error::error_time].
8637    pub fn set_error_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
8638        mut self,
8639        v: T,
8640    ) -> Self {
8641        self.error_time = v.into();
8642        self
8643    }
8644
8645    /// Sets the value of [details][crate::model::Error::details].
8646    pub fn set_details<T, K, V>(mut self, v: T) -> Self
8647    where
8648        T: std::iter::IntoIterator<Item = (K, V)>,
8649        K: std::convert::Into<std::string::String>,
8650        V: std::convert::Into<std::string::String>,
8651    {
8652        use std::iter::Iterator;
8653        self.details = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8654        self
8655    }
8656}
8657
8658impl wkt::message::Message for Error {
8659    fn typename() -> &'static str {
8660        "type.googleapis.com/google.cloud.datastream.v1.Error"
8661    }
8662}
8663
8664/// Contains the current validation results.
8665#[serde_with::serde_as]
8666#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8667#[serde(default, rename_all = "camelCase")]
8668#[non_exhaustive]
8669pub struct ValidationResult {
8670    /// A list of validations (includes both executed as well as not executed
8671    /// validations).
8672    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8673    pub validations: std::vec::Vec<crate::model::Validation>,
8674}
8675
8676impl ValidationResult {
8677    pub fn new() -> Self {
8678        std::default::Default::default()
8679    }
8680
8681    /// Sets the value of [validations][crate::model::ValidationResult::validations].
8682    pub fn set_validations<T, V>(mut self, v: T) -> Self
8683    where
8684        T: std::iter::IntoIterator<Item = V>,
8685        V: std::convert::Into<crate::model::Validation>,
8686    {
8687        use std::iter::Iterator;
8688        self.validations = v.into_iter().map(|i| i.into()).collect();
8689        self
8690    }
8691}
8692
8693impl wkt::message::Message for ValidationResult {
8694    fn typename() -> &'static str {
8695        "type.googleapis.com/google.cloud.datastream.v1.ValidationResult"
8696    }
8697}
8698
8699/// A validation to perform on a stream.
8700#[serde_with::serde_as]
8701#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8702#[serde(default, rename_all = "camelCase")]
8703#[non_exhaustive]
8704pub struct Validation {
8705    /// A short description of the validation.
8706    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8707    pub description: std::string::String,
8708
8709    /// Output only. Validation execution status.
8710    pub state: crate::model::validation::State,
8711
8712    /// Messages reflecting the validation results.
8713    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8714    pub message: std::vec::Vec<crate::model::ValidationMessage>,
8715
8716    /// A custom code identifying this validation.
8717    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8718    pub code: std::string::String,
8719}
8720
8721impl Validation {
8722    pub fn new() -> Self {
8723        std::default::Default::default()
8724    }
8725
8726    /// Sets the value of [description][crate::model::Validation::description].
8727    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8728        self.description = v.into();
8729        self
8730    }
8731
8732    /// Sets the value of [state][crate::model::Validation::state].
8733    pub fn set_state<T: std::convert::Into<crate::model::validation::State>>(
8734        mut self,
8735        v: T,
8736    ) -> Self {
8737        self.state = v.into();
8738        self
8739    }
8740
8741    /// Sets the value of [code][crate::model::Validation::code].
8742    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8743        self.code = v.into();
8744        self
8745    }
8746
8747    /// Sets the value of [message][crate::model::Validation::message].
8748    pub fn set_message<T, V>(mut self, v: T) -> Self
8749    where
8750        T: std::iter::IntoIterator<Item = V>,
8751        V: std::convert::Into<crate::model::ValidationMessage>,
8752    {
8753        use std::iter::Iterator;
8754        self.message = v.into_iter().map(|i| i.into()).collect();
8755        self
8756    }
8757}
8758
8759impl wkt::message::Message for Validation {
8760    fn typename() -> &'static str {
8761        "type.googleapis.com/google.cloud.datastream.v1.Validation"
8762    }
8763}
8764
8765/// Defines additional types related to Validation
8766pub mod validation {
8767    #[allow(unused_imports)]
8768    use super::*;
8769
8770    /// Validation execution state.
8771    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8772    pub struct State(std::borrow::Cow<'static, str>);
8773
8774    impl State {
8775        /// Creates a new State instance.
8776        pub const fn new(v: &'static str) -> Self {
8777            Self(std::borrow::Cow::Borrowed(v))
8778        }
8779
8780        /// Gets the enum value.
8781        pub fn value(&self) -> &str {
8782            &self.0
8783        }
8784    }
8785
8786    /// Useful constants to work with [State](State)
8787    pub mod state {
8788        use super::State;
8789
8790        /// Unspecified state.
8791        pub const STATE_UNSPECIFIED: State = State::new("STATE_UNSPECIFIED");
8792
8793        /// Validation did not execute.
8794        pub const NOT_EXECUTED: State = State::new("NOT_EXECUTED");
8795
8796        /// Validation failed.
8797        pub const FAILED: State = State::new("FAILED");
8798
8799        /// Validation passed.
8800        pub const PASSED: State = State::new("PASSED");
8801
8802        /// Validation executed with warnings.
8803        pub const WARNING: State = State::new("WARNING");
8804    }
8805
8806    impl std::convert::From<std::string::String> for State {
8807        fn from(value: std::string::String) -> Self {
8808            Self(std::borrow::Cow::Owned(value))
8809        }
8810    }
8811}
8812
8813/// Represent user-facing validation result message.
8814#[serde_with::serde_as]
8815#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8816#[serde(default, rename_all = "camelCase")]
8817#[non_exhaustive]
8818pub struct ValidationMessage {
8819    /// The result of the validation.
8820    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8821    pub message: std::string::String,
8822
8823    /// Message severity level (warning or error).
8824    pub level: crate::model::validation_message::Level,
8825
8826    /// Additional metadata related to the result.
8827    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
8828    pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
8829
8830    /// A custom code identifying this specific message.
8831    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8832    pub code: std::string::String,
8833}
8834
8835impl ValidationMessage {
8836    pub fn new() -> Self {
8837        std::default::Default::default()
8838    }
8839
8840    /// Sets the value of [message][crate::model::ValidationMessage::message].
8841    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8842        self.message = v.into();
8843        self
8844    }
8845
8846    /// Sets the value of [level][crate::model::ValidationMessage::level].
8847    pub fn set_level<T: std::convert::Into<crate::model::validation_message::Level>>(
8848        mut self,
8849        v: T,
8850    ) -> Self {
8851        self.level = v.into();
8852        self
8853    }
8854
8855    /// Sets the value of [code][crate::model::ValidationMessage::code].
8856    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8857        self.code = v.into();
8858        self
8859    }
8860
8861    /// Sets the value of [metadata][crate::model::ValidationMessage::metadata].
8862    pub fn set_metadata<T, K, V>(mut self, v: T) -> Self
8863    where
8864        T: std::iter::IntoIterator<Item = (K, V)>,
8865        K: std::convert::Into<std::string::String>,
8866        V: std::convert::Into<std::string::String>,
8867    {
8868        use std::iter::Iterator;
8869        self.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8870        self
8871    }
8872}
8873
8874impl wkt::message::Message for ValidationMessage {
8875    fn typename() -> &'static str {
8876        "type.googleapis.com/google.cloud.datastream.v1.ValidationMessage"
8877    }
8878}
8879
8880/// Defines additional types related to ValidationMessage
8881pub mod validation_message {
8882    #[allow(unused_imports)]
8883    use super::*;
8884
8885    /// Validation message level.
8886    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8887    pub struct Level(std::borrow::Cow<'static, str>);
8888
8889    impl Level {
8890        /// Creates a new Level instance.
8891        pub const fn new(v: &'static str) -> Self {
8892            Self(std::borrow::Cow::Borrowed(v))
8893        }
8894
8895        /// Gets the enum value.
8896        pub fn value(&self) -> &str {
8897            &self.0
8898        }
8899    }
8900
8901    /// Useful constants to work with [Level](Level)
8902    pub mod level {
8903        use super::Level;
8904
8905        /// Unspecified level.
8906        pub const LEVEL_UNSPECIFIED: Level = Level::new("LEVEL_UNSPECIFIED");
8907
8908        /// Potentially cause issues with the Stream.
8909        pub const WARNING: Level = Level::new("WARNING");
8910
8911        /// Definitely cause issues with the Stream.
8912        pub const ERROR: Level = Level::new("ERROR");
8913    }
8914
8915    impl std::convert::From<std::string::String> for Level {
8916        fn from(value: std::string::String) -> Self {
8917            Self(std::borrow::Cow::Owned(value))
8918        }
8919    }
8920}
8921
8922/// The strategy that the stream uses for CDC replication.
8923#[serde_with::serde_as]
8924#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8925#[serde(default, rename_all = "camelCase")]
8926#[non_exhaustive]
8927pub struct CdcStrategy {
8928    /// The position to start reading from when starting, resuming, or recovering
8929    /// the stream.
8930    /// If not set, the system's default value will be used.
8931    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
8932    pub start_position: std::option::Option<crate::model::cdc_strategy::StartPosition>,
8933}
8934
8935impl CdcStrategy {
8936    pub fn new() -> Self {
8937        std::default::Default::default()
8938    }
8939
8940    /// Sets the value of `start_position`.
8941    pub fn set_start_position<
8942        T: std::convert::Into<std::option::Option<crate::model::cdc_strategy::StartPosition>>,
8943    >(
8944        mut self,
8945        v: T,
8946    ) -> Self {
8947        self.start_position = v.into();
8948        self
8949    }
8950
8951    /// The value of [start_position][crate::model::CdcStrategy::start_position]
8952    /// if it holds a `MostRecentStartPosition`, `None` if the field is not set or
8953    /// holds a different branch.
8954    pub fn get_most_recent_start_position(
8955        &self,
8956    ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>>
8957    {
8958        #[allow(unreachable_patterns)]
8959        self.start_position.as_ref().and_then(|v| match v {
8960            crate::model::cdc_strategy::StartPosition::MostRecentStartPosition(v) => {
8961                std::option::Option::Some(v)
8962            }
8963            _ => std::option::Option::None,
8964        })
8965    }
8966
8967    /// The value of [start_position][crate::model::CdcStrategy::start_position]
8968    /// if it holds a `NextAvailableStartPosition`, `None` if the field is not set or
8969    /// holds a different branch.
8970    pub fn get_next_available_start_position(
8971        &self,
8972    ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>>
8973    {
8974        #[allow(unreachable_patterns)]
8975        self.start_position.as_ref().and_then(|v| match v {
8976            crate::model::cdc_strategy::StartPosition::NextAvailableStartPosition(v) => {
8977                std::option::Option::Some(v)
8978            }
8979            _ => std::option::Option::None,
8980        })
8981    }
8982
8983    /// The value of [start_position][crate::model::CdcStrategy::start_position]
8984    /// if it holds a `SpecificStartPosition`, `None` if the field is not set or
8985    /// holds a different branch.
8986    pub fn get_specific_start_position(
8987        &self,
8988    ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>>
8989    {
8990        #[allow(unreachable_patterns)]
8991        self.start_position.as_ref().and_then(|v| match v {
8992            crate::model::cdc_strategy::StartPosition::SpecificStartPosition(v) => {
8993                std::option::Option::Some(v)
8994            }
8995            _ => std::option::Option::None,
8996        })
8997    }
8998
8999    /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
9000    /// to hold a `MostRecentStartPosition`.
9001    ///
9002    /// Note that all the setters affecting `start_position` are
9003    /// mutually exclusive.
9004    pub fn set_most_recent_start_position<
9005        T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>>,
9006    >(
9007        mut self,
9008        v: T,
9009    ) -> Self {
9010        self.start_position = std::option::Option::Some(
9011            crate::model::cdc_strategy::StartPosition::MostRecentStartPosition(v.into()),
9012        );
9013        self
9014    }
9015
9016    /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
9017    /// to hold a `NextAvailableStartPosition`.
9018    ///
9019    /// Note that all the setters affecting `start_position` are
9020    /// mutually exclusive.
9021    pub fn set_next_available_start_position<
9022        T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>>,
9023    >(
9024        mut self,
9025        v: T,
9026    ) -> Self {
9027        self.start_position = std::option::Option::Some(
9028            crate::model::cdc_strategy::StartPosition::NextAvailableStartPosition(v.into()),
9029        );
9030        self
9031    }
9032
9033    /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
9034    /// to hold a `SpecificStartPosition`.
9035    ///
9036    /// Note that all the setters affecting `start_position` are
9037    /// mutually exclusive.
9038    pub fn set_specific_start_position<
9039        T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>>,
9040    >(
9041        mut self,
9042        v: T,
9043    ) -> Self {
9044        self.start_position = std::option::Option::Some(
9045            crate::model::cdc_strategy::StartPosition::SpecificStartPosition(v.into()),
9046        );
9047        self
9048    }
9049}
9050
9051impl wkt::message::Message for CdcStrategy {
9052    fn typename() -> &'static str {
9053        "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy"
9054    }
9055}
9056
9057/// Defines additional types related to CdcStrategy
9058pub mod cdc_strategy {
9059    #[allow(unused_imports)]
9060    use super::*;
9061
9062    /// CDC strategy to start replicating from the most recent position in the
9063    /// source.
9064    #[serde_with::serde_as]
9065    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9066    #[serde(default, rename_all = "camelCase")]
9067    #[non_exhaustive]
9068    pub struct MostRecentStartPosition {}
9069
9070    impl MostRecentStartPosition {
9071        pub fn new() -> Self {
9072            std::default::Default::default()
9073        }
9074    }
9075
9076    impl wkt::message::Message for MostRecentStartPosition {
9077        fn typename() -> &'static str {
9078            "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.MostRecentStartPosition"
9079        }
9080    }
9081
9082    /// CDC strategy to resume replication from the next available position in the
9083    /// source.
9084    #[serde_with::serde_as]
9085    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9086    #[serde(default, rename_all = "camelCase")]
9087    #[non_exhaustive]
9088    pub struct NextAvailableStartPosition {}
9089
9090    impl NextAvailableStartPosition {
9091        pub fn new() -> Self {
9092            std::default::Default::default()
9093        }
9094    }
9095
9096    impl wkt::message::Message for NextAvailableStartPosition {
9097        fn typename() -> &'static str {
9098            "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.NextAvailableStartPosition"
9099        }
9100    }
9101
9102    /// CDC strategy to start replicating from a specific position in the source.
9103    #[serde_with::serde_as]
9104    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9105    #[serde(default, rename_all = "camelCase")]
9106    #[non_exhaustive]
9107    pub struct SpecificStartPosition {
9108        #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
9109        pub position:
9110            std::option::Option<crate::model::cdc_strategy::specific_start_position::Position>,
9111    }
9112
9113    impl SpecificStartPosition {
9114        pub fn new() -> Self {
9115            std::default::Default::default()
9116        }
9117
9118        /// Sets the value of `position`.
9119        pub fn set_position<
9120            T: std::convert::Into<
9121                std::option::Option<crate::model::cdc_strategy::specific_start_position::Position>,
9122            >,
9123        >(
9124            mut self,
9125            v: T,
9126        ) -> Self {
9127            self.position = v.into();
9128            self
9129        }
9130
9131        /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
9132        /// if it holds a `MysqlLogPosition`, `None` if the field is not set or
9133        /// holds a different branch.
9134        pub fn get_mysql_log_position(
9135            &self,
9136        ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlLogPosition>> {
9137            #[allow(unreachable_patterns)]
9138            self.position.as_ref().and_then(|v| match v {
9139                crate::model::cdc_strategy::specific_start_position::Position::MysqlLogPosition(
9140                    v,
9141                ) => std::option::Option::Some(v),
9142                _ => std::option::Option::None,
9143            })
9144        }
9145
9146        /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
9147        /// if it holds a `OracleScnPosition`, `None` if the field is not set or
9148        /// holds a different branch.
9149        pub fn get_oracle_scn_position(
9150            &self,
9151        ) -> std::option::Option<&std::boxed::Box<crate::model::OracleScnPosition>> {
9152            #[allow(unreachable_patterns)]
9153            self.position.as_ref().and_then(|v| match v {
9154                crate::model::cdc_strategy::specific_start_position::Position::OracleScnPosition(v) => std::option::Option::Some(v),
9155                _ => std::option::Option::None,
9156            })
9157        }
9158
9159        /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
9160        /// if it holds a `SqlServerLsnPosition`, `None` if the field is not set or
9161        /// holds a different branch.
9162        pub fn get_sql_server_lsn_position(
9163            &self,
9164        ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerLsnPosition>> {
9165            #[allow(unreachable_patterns)]
9166            self.position.as_ref().and_then(|v| match v {
9167                crate::model::cdc_strategy::specific_start_position::Position::SqlServerLsnPosition(v) => std::option::Option::Some(v),
9168                _ => std::option::Option::None,
9169            })
9170        }
9171
9172        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
9173        /// to hold a `MysqlLogPosition`.
9174        ///
9175        /// Note that all the setters affecting `position` are
9176        /// mutually exclusive.
9177        pub fn set_mysql_log_position<
9178            T: std::convert::Into<std::boxed::Box<crate::model::MysqlLogPosition>>,
9179        >(
9180            mut self,
9181            v: T,
9182        ) -> Self {
9183            self.position = std::option::Option::Some(
9184                crate::model::cdc_strategy::specific_start_position::Position::MysqlLogPosition(
9185                    v.into(),
9186                ),
9187            );
9188            self
9189        }
9190
9191        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
9192        /// to hold a `OracleScnPosition`.
9193        ///
9194        /// Note that all the setters affecting `position` are
9195        /// mutually exclusive.
9196        pub fn set_oracle_scn_position<
9197            T: std::convert::Into<std::boxed::Box<crate::model::OracleScnPosition>>,
9198        >(
9199            mut self,
9200            v: T,
9201        ) -> Self {
9202            self.position = std::option::Option::Some(
9203                crate::model::cdc_strategy::specific_start_position::Position::OracleScnPosition(
9204                    v.into(),
9205                ),
9206            );
9207            self
9208        }
9209
9210        /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
9211        /// to hold a `SqlServerLsnPosition`.
9212        ///
9213        /// Note that all the setters affecting `position` are
9214        /// mutually exclusive.
9215        pub fn set_sql_server_lsn_position<
9216            T: std::convert::Into<std::boxed::Box<crate::model::SqlServerLsnPosition>>,
9217        >(
9218            mut self,
9219            v: T,
9220        ) -> Self {
9221            self.position = std::option::Option::Some(
9222                crate::model::cdc_strategy::specific_start_position::Position::SqlServerLsnPosition(
9223                    v.into(),
9224                ),
9225            );
9226            self
9227        }
9228    }
9229
9230    impl wkt::message::Message for SpecificStartPosition {
9231        fn typename() -> &'static str {
9232            "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.SpecificStartPosition"
9233        }
9234    }
9235
9236    /// Defines additional types related to SpecificStartPosition
9237    pub mod specific_start_position {
9238        #[allow(unused_imports)]
9239        use super::*;
9240
9241        #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9242        #[serde(rename_all = "camelCase")]
9243        #[non_exhaustive]
9244        pub enum Position {
9245            /// MySQL specific log position to start replicating from.
9246            MysqlLogPosition(std::boxed::Box<crate::model::MysqlLogPosition>),
9247            /// Oracle SCN to start replicating from.
9248            OracleScnPosition(std::boxed::Box<crate::model::OracleScnPosition>),
9249            /// SqlServer LSN to start replicating from.
9250            SqlServerLsnPosition(std::boxed::Box<crate::model::SqlServerLsnPosition>),
9251        }
9252    }
9253
9254    /// The position to start reading from when starting, resuming, or recovering
9255    /// the stream.
9256    /// If not set, the system's default value will be used.
9257    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9258    #[serde(rename_all = "camelCase")]
9259    #[non_exhaustive]
9260    pub enum StartPosition {
9261        /// Optional. Start replicating from the most recent position in the source.
9262        MostRecentStartPosition(
9263            std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>,
9264        ),
9265        /// Optional. Resume replication from the next available position in the
9266        /// source.
9267        NextAvailableStartPosition(
9268            std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>,
9269        ),
9270        /// Optional. Start replicating from a specific position in the source.
9271        SpecificStartPosition(std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>),
9272    }
9273}
9274
9275/// SQL Server LSN position
9276#[serde_with::serde_as]
9277#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9278#[serde(default, rename_all = "camelCase")]
9279#[non_exhaustive]
9280pub struct SqlServerLsnPosition {
9281    /// Required. Log sequence number (LSN) from where Logs will be read
9282    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9283    pub lsn: std::string::String,
9284}
9285
9286impl SqlServerLsnPosition {
9287    pub fn new() -> Self {
9288        std::default::Default::default()
9289    }
9290
9291    /// Sets the value of [lsn][crate::model::SqlServerLsnPosition::lsn].
9292    pub fn set_lsn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9293        self.lsn = v.into();
9294        self
9295    }
9296}
9297
9298impl wkt::message::Message for SqlServerLsnPosition {
9299    fn typename() -> &'static str {
9300        "type.googleapis.com/google.cloud.datastream.v1.SqlServerLsnPosition"
9301    }
9302}
9303
9304/// Oracle SCN position
9305#[serde_with::serde_as]
9306#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9307#[serde(default, rename_all = "camelCase")]
9308#[non_exhaustive]
9309pub struct OracleScnPosition {
9310    /// Required. SCN number from where Logs will be read
9311    #[serde_as(as = "serde_with::DisplayFromStr")]
9312    pub scn: i64,
9313}
9314
9315impl OracleScnPosition {
9316    pub fn new() -> Self {
9317        std::default::Default::default()
9318    }
9319
9320    /// Sets the value of [scn][crate::model::OracleScnPosition::scn].
9321    pub fn set_scn<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9322        self.scn = v.into();
9323        self
9324    }
9325}
9326
9327impl wkt::message::Message for OracleScnPosition {
9328    fn typename() -> &'static str {
9329        "type.googleapis.com/google.cloud.datastream.v1.OracleScnPosition"
9330    }
9331}
9332
9333/// MySQL log position
9334#[serde_with::serde_as]
9335#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9336#[serde(default, rename_all = "camelCase")]
9337#[non_exhaustive]
9338pub struct MysqlLogPosition {
9339    /// Required. The binary log file name.
9340    #[serde(skip_serializing_if = "std::string::String::is_empty")]
9341    pub log_file: std::string::String,
9342
9343    /// Optional. The position within the binary log file. Default is head of file.
9344    #[serde(skip_serializing_if = "std::option::Option::is_none")]
9345    pub log_position: std::option::Option<i32>,
9346}
9347
9348impl MysqlLogPosition {
9349    pub fn new() -> Self {
9350        std::default::Default::default()
9351    }
9352
9353    /// Sets the value of [log_file][crate::model::MysqlLogPosition::log_file].
9354    pub fn set_log_file<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9355        self.log_file = v.into();
9356        self
9357    }
9358
9359    /// Sets the value of [log_position][crate::model::MysqlLogPosition::log_position].
9360    pub fn set_log_position<T: std::convert::Into<std::option::Option<i32>>>(
9361        mut self,
9362        v: T,
9363    ) -> Self {
9364        self.log_position = v.into();
9365        self
9366    }
9367}
9368
9369impl wkt::message::Message for MysqlLogPosition {
9370    fn typename() -> &'static str {
9371        "type.googleapis.com/google.cloud.datastream.v1.MysqlLogPosition"
9372    }
9373}