1#![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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
44 pub parent: std::string::String,
45
46 #[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 #[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 #[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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
356pub mod discover_connection_profile_request {
358 #[allow(unused_imports)]
359 use super::*;
360
361 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
363 #[serde(rename_all = "camelCase")]
364 #[non_exhaustive]
365 pub enum Target {
366 ConnectionProfile(std::boxed::Box<crate::model::ConnectionProfile>),
368 ConnectionProfileName(std::string::String),
370 }
371
372 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
374 #[serde(rename_all = "camelCase")]
375 #[non_exhaustive]
376 pub enum Hierarchy {
377 FullHierarchy(bool),
380 HierarchyDepth(i32),
382 }
383
384 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
386 #[serde(rename_all = "camelCase")]
387 #[non_exhaustive]
388 pub enum DataObject {
389 OracleRdbms(std::boxed::Box<crate::model::OracleRdbms>),
391 MysqlRdbms(std::boxed::Box<crate::model::MysqlRdbms>),
393 PostgresqlRdbms(std::boxed::Box<crate::model::PostgresqlRdbms>),
395 SqlServerRdbms(std::boxed::Box<crate::model::SqlServerRdbms>),
397 }
398}
399
400#[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 #[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 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 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 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 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 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 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 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 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 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
565pub mod discover_connection_profile_response {
567 #[allow(unused_imports)]
568 use super::*;
569
570 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
572 #[serde(rename_all = "camelCase")]
573 #[non_exhaustive]
574 pub enum DataObject {
575 OracleRdbms(std::boxed::Box<crate::model::OracleRdbms>),
577 MysqlRdbms(std::boxed::Box<crate::model::MysqlRdbms>),
579 PostgresqlRdbms(std::boxed::Box<crate::model::PostgresqlRdbms>),
581 SqlServerRdbms(std::boxed::Box<crate::model::SqlServerRdbms>),
583 }
584}
585
586#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
595 pub name: std::string::String,
596
597 pub page_size: i32,
599
600 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
644 pub static_ips: std::vec::Vec<std::string::String>,
645
646 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
689 pub parent: std::string::String,
690
691 pub page_size: i32,
695
696 #[serde(skip_serializing_if = "std::string::String::is_empty")]
702 pub page_token: std::string::String,
703
704 #[serde(skip_serializing_if = "std::string::String::is_empty")]
706 pub filter: std::string::String,
707
708 #[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 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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
763 pub connection_profiles: std::vec::Vec<crate::model::ConnectionProfile>,
764
765 #[serde(skip_serializing_if = "std::string::String::is_empty")]
768 pub next_page_token: std::string::String,
769
770 #[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 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 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 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#[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 #[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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
865 pub parent: std::string::String,
866
867 #[serde(skip_serializing_if = "std::string::String::is_empty")]
869 pub connection_profile_id: std::string::String,
870
871 #[serde(skip_serializing_if = "std::option::Option::is_none")]
873 pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
874
875 #[serde(skip_serializing_if = "std::string::String::is_empty")]
889 pub request_id: std::string::String,
890
891 pub validate_only: bool,
894
895 pub force: bool,
897}
898
899impl CreateConnectionProfileRequest {
900 pub fn new() -> Self {
901 std::default::Default::default()
902 }
903
904 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 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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::option::Option::is_none")]
967 pub update_mask: std::option::Option<wkt::FieldMask>,
968
969 #[serde(skip_serializing_if = "std::option::Option::is_none")]
971 pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
972
973 #[serde(skip_serializing_if = "std::string::String::is_empty")]
987 pub request_id: std::string::String,
988
989 pub validate_only: bool,
992
993 pub force: bool,
995}
996
997impl UpdateConnectionProfileRequest {
998 pub fn new() -> Self {
999 std::default::Default::default()
1000 }
1001
1002 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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1055 pub name: std::string::String,
1056
1057 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1106 pub parent: std::string::String,
1107
1108 pub page_size: i32,
1112
1113 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1119 pub page_token: std::string::String,
1120
1121 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1123 pub filter: std::string::String,
1124
1125 #[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 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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1180 pub streams: std::vec::Vec<crate::model::Stream>,
1181
1182 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1185 pub next_page_token: std::string::String,
1186
1187 #[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 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 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 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#[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 #[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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1282 pub parent: std::string::String,
1283
1284 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1286 pub stream_id: std::string::String,
1287
1288 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1290 pub stream: std::option::Option<crate::model::Stream>,
1291
1292 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1306 pub request_id: std::string::String,
1307
1308 pub validate_only: bool,
1311
1312 pub force: bool,
1314}
1315
1316impl CreateStreamRequest {
1317 pub fn new() -> Self {
1318 std::default::Default::default()
1319 }
1320
1321 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 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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1379 pub update_mask: std::option::Option<wkt::FieldMask>,
1380
1381 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1383 pub stream: std::option::Option<crate::model::Stream>,
1384
1385 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1399 pub request_id: std::string::String,
1400
1401 pub validate_only: bool,
1404
1405 pub force: bool,
1407}
1408
1409impl UpdateStreamRequest {
1410 pub fn new() -> Self {
1411 std::default::Default::default()
1412 }
1413
1414 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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1465 pub name: std::string::String,
1466
1467 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1517 pub name: std::string::String,
1518
1519 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1522 pub cdc_strategy: std::option::Option<crate::model::CdcStrategy>,
1523
1524 pub force: bool,
1526}
1527
1528impl RunStreamRequest {
1529 pub fn new() -> Self {
1530 std::default::Default::default()
1531 }
1532
1533 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 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 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#[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 #[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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1601 pub parent: std::string::String,
1602
1603 #[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 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 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#[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 #[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 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#[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 #[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 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#[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 #[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 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#[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 #[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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1770 pub parent: std::string::String,
1771
1772 pub page_size: i32,
1775
1776 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1824 pub stream_objects: std::vec::Vec<crate::model::StreamObject>,
1825
1826 #[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 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 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#[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 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1881 pub create_time: std::option::Option<wkt::Timestamp>,
1882
1883 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1885 pub end_time: std::option::Option<wkt::Timestamp>,
1886
1887 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1889 pub target: std::string::String,
1890
1891 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1893 pub verb: std::string::String,
1894
1895 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1897 pub status_message: std::string::String,
1898
1899 pub requested_cancellation: bool,
1909
1910 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1912 pub api_version: std::string::String,
1913
1914 #[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 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 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 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 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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1998 pub parent: std::string::String,
1999
2000 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2002 pub private_connection_id: std::string::String,
2003
2004 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2006 pub private_connection: std::option::Option<crate::model::PrivateConnection>,
2007
2008 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2022 pub request_id: std::string::String,
2023
2024 pub force: bool,
2026}
2027
2028impl CreatePrivateConnectionRequest {
2029 pub fn new() -> Self {
2030 std::default::Default::default()
2031 }
2032
2033 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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2087 pub parent: std::string::String,
2088
2089 pub page_size: i32,
2094
2095 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2102 pub page_token: std::string::String,
2103
2104 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2106 pub filter: std::string::String,
2107
2108 #[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 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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2163 pub private_connections: std::vec::Vec<crate::model::PrivateConnection>,
2164
2165 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2168 pub next_page_token: std::string::String,
2169
2170 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2236 pub name: std::string::String,
2237
2238 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2252 pub request_id: std::string::String,
2253
2254 pub force: bool,
2257}
2258
2259impl DeletePrivateConnectionRequest {
2260 pub fn new() -> Self {
2261 std::default::Default::default()
2262 }
2263
2264 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 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 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#[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 #[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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2326 pub parent: std::string::String,
2327
2328 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2330 pub route_id: std::string::String,
2331
2332 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2334 pub route: std::option::Option<crate::model::Route>,
2335
2336 #[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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2400 pub parent: std::string::String,
2401
2402 pub page_size: i32,
2407
2408 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2415 pub page_token: std::string::String,
2416
2417 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2419 pub filter: std::string::String,
2420
2421 #[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 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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2476 pub routes: std::vec::Vec<crate::model::Route>,
2477
2478 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2481 pub next_page_token: std::string::String,
2482
2483 #[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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2549 pub name: std::string::String,
2550
2551 #[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 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 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#[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 #[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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2630 pub hostname: std::string::String,
2631
2632 pub port: i32,
2634
2635 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2637 pub username: std::string::String,
2638
2639 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2642 pub password: std::string::String,
2643
2644 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2646 pub database_service: std::string::String,
2647
2648 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
2650 pub connection_attributes: std::collections::HashMap<std::string::String, std::string::String>,
2651
2652 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2654 pub oracle_ssl_config: std::option::Option<crate::model::OracleSslConfig>,
2655
2656 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2658 pub oracle_asm_config: std::option::Option<crate::model::OracleAsmConfig>,
2659
2660 #[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 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 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2679 self.port = v.into();
2680 self
2681 }
2682
2683 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 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 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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2763 pub hostname: std::string::String,
2764
2765 pub port: i32,
2767
2768 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2770 pub username: std::string::String,
2771
2772 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2774 pub password: std::string::String,
2775
2776 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2778 pub asm_service: std::string::String,
2779
2780 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
2782 pub connection_attributes: std::collections::HashMap<std::string::String, std::string::String>,
2783
2784 #[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 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 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2802 self.port = v.into();
2803 self
2804 }
2805
2806 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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2863 pub hostname: std::string::String,
2864
2865 pub port: i32,
2867
2868 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2870 pub username: std::string::String,
2871
2872 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2875 pub password: std::string::String,
2876
2877 #[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 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 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2895 self.port = v.into();
2896 self
2897 }
2898
2899 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2937 pub hostname: std::string::String,
2938
2939 pub port: i32,
2941
2942 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2944 pub username: std::string::String,
2945
2946 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2949 pub password: std::string::String,
2950
2951 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2953 pub database: std::string::String,
2954
2955 #[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 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 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2976 self.port = v.into();
2977 self
2978 }
2979
2980 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3025 pub hostname: std::string::String,
3026
3027 pub port: i32,
3029
3030 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3032 pub username: std::string::String,
3033
3034 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3037 pub password: std::string::String,
3038
3039 #[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 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 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3057 self.port = v.into();
3058 self
3059 }
3060
3061 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3094 pub bucket: std::string::String,
3095
3096 #[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 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 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#[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#[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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3173 pub hostname: std::string::String,
3174
3175 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3177 pub username: std::string::String,
3178
3179 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 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 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 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3206 self.port = v.into();
3207 self
3208 }
3209
3210 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 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 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 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 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
3284pub 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 Password(std::string::String),
3295 PrivateKey(std::string::String),
3297 }
3298}
3299
3300#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3310 pub vpc: std::string::String,
3311
3312 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3350 pub name: std::string::String,
3351
3352 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3354 pub create_time: std::option::Option<wkt::Timestamp>,
3355
3356 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3358 pub update_time: std::option::Option<wkt::Timestamp>,
3359
3360 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
3362 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3363
3364 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3366 pub display_name: std::string::String,
3367
3368 pub state: crate::model::private_connection::State,
3370
3371 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3374 pub error: std::option::Option<crate::model::Error>,
3375
3376 #[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 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 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 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 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 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 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 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 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
3464pub mod private_connection {
3466 #[allow(unused_imports)]
3467 use super::*;
3468
3469 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3471 pub struct State(std::borrow::Cow<'static, str>);
3472
3473 impl State {
3474 pub const fn new(v: &'static str) -> Self {
3476 Self(std::borrow::Cow::Borrowed(v))
3477 }
3478
3479 pub fn value(&self) -> &str {
3481 &self.0
3482 }
3483 }
3484
3485 pub mod state {
3487 use super::State;
3488
3489 pub const STATE_UNSPECIFIED: State = State::new("STATE_UNSPECIFIED");
3491
3492 pub const CREATING: State = State::new("CREATING");
3494
3495 pub const CREATED: State = State::new("CREATED");
3497
3498 pub const FAILED: State = State::new("FAILED");
3500
3501 pub const DELETING: State = State::new("DELETING");
3503
3504 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#[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 #[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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3557 pub name: std::string::String,
3558
3559 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3561 pub create_time: std::option::Option<wkt::Timestamp>,
3562
3563 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3565 pub update_time: std::option::Option<wkt::Timestamp>,
3566
3567 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
3569 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3570
3571 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3573 pub display_name: std::string::String,
3574
3575 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3577 pub destination_address: std::string::String,
3578
3579 pub destination_port: i32,
3581}
3582
3583impl Route {
3584 pub fn new() -> Self {
3585 std::default::Default::default()
3586 }
3587
3588 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 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 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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3662 pub client_key: std::string::String,
3663
3664 pub client_key_set: bool,
3666
3667 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3671 pub client_certificate: std::string::String,
3672
3673 pub client_certificate_set: bool,
3675
3676 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3679 pub ca_certificate: std::string::String,
3680
3681 pub ca_certificate_set: bool,
3683}
3684
3685impl MysqlSslConfig {
3686 pub fn new() -> Self {
3687 std::default::Default::default()
3688 }
3689
3690 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 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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3745 pub ca_certificate: std::string::String,
3746
3747 pub ca_certificate_set: bool,
3750}
3751
3752impl OracleSslConfig {
3753 pub fn new() -> Self {
3754 std::default::Default::default()
3755 }
3756
3757 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 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#[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 #[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 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 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 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 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 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
3890pub mod postgresql_ssl_config {
3892 #[allow(unused_imports)]
3893 use super::*;
3894
3895 #[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 #[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 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 #[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3945 pub client_certificate: std::string::String,
3946
3947 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3952 pub client_key: std::string::String,
3953
3954 #[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 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 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 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 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
4000 #[serde(rename_all = "camelCase")]
4001 #[non_exhaustive]
4002 pub enum EncryptionSetting {
4003 ServerVerification(
4006 std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
4007 ),
4008 ServerAndClientVerification(
4012 std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
4013 ),
4014 }
4015}
4016
4017#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4026 pub name: std::string::String,
4027
4028 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4030 pub create_time: std::option::Option<wkt::Timestamp>,
4031
4032 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4034 pub update_time: std::option::Option<wkt::Timestamp>,
4035
4036 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
4038 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4039
4040 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4042 pub display_name: std::string::String,
4043
4044 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
4046 pub profile: std::option::Option<crate::model::connection_profile::Profile>,
4047
4048 #[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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
4413pub mod connection_profile {
4415 #[allow(unused_imports)]
4416 use super::*;
4417
4418 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
4420 #[serde(rename_all = "camelCase")]
4421 #[non_exhaustive]
4422 pub enum Profile {
4423 OracleProfile(std::boxed::Box<crate::model::OracleProfile>),
4425 GcsProfile(std::boxed::Box<crate::model::GcsProfile>),
4427 MysqlProfile(std::boxed::Box<crate::model::MysqlProfile>),
4429 BigqueryProfile(std::boxed::Box<crate::model::BigQueryProfile>),
4431 PostgresqlProfile(std::boxed::Box<crate::model::PostgresqlProfile>),
4433 SqlServerProfile(std::boxed::Box<crate::model::SqlServerProfile>),
4435 }
4436
4437 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
4439 #[serde(rename_all = "camelCase")]
4440 #[non_exhaustive]
4441 pub enum Connectivity {
4442 StaticServiceIpConnectivity(std::boxed::Box<crate::model::StaticServiceIpConnectivity>),
4444 ForwardSshConnectivity(std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>),
4446 PrivateConnectivity(std::boxed::Box<crate::model::PrivateConnectivity>),
4448 }
4449}
4450
4451#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4459 pub column: std::string::String,
4460
4461 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4463 pub data_type: std::string::String,
4464
4465 pub length: i32,
4467
4468 pub precision: i32,
4470
4471 pub scale: i32,
4473
4474 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4476 pub encoding: std::string::String,
4477
4478 pub primary_key: bool,
4480
4481 pub nullable: bool,
4483
4484 pub ordinal_position: i32,
4486}
4487
4488impl OracleColumn {
4489 pub fn new() -> Self {
4490 std::default::Default::default()
4491 }
4492
4493 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 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 pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4507 self.length = v.into();
4508 self
4509 }
4510
4511 pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4513 self.precision = v.into();
4514 self
4515 }
4516
4517 pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4519 self.scale = v.into();
4520 self
4521 }
4522
4523 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 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 pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4537 self.nullable = v.into();
4538 self
4539 }
4540
4541 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4562 pub table: std::string::String,
4563
4564 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4608 pub schema: std::string::String,
4609
4610 #[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 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 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#[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 #[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 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#[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 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4686 pub include_objects: std::option::Option<crate::model::OracleRdbms>,
4687
4688 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4690 pub exclude_objects: std::option::Option<crate::model::OracleRdbms>,
4691
4692 pub max_concurrent_cdc_tasks: i32,
4695
4696 pub max_concurrent_backfill_tasks: i32,
4699
4700 #[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 #[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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
4911pub mod oracle_source_config {
4913 #[allow(unused_imports)]
4914 use super::*;
4915
4916 #[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 #[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 #[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 #[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 #[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 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 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 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 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 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 pub mod binary_log_parser {
5095 #[allow(unused_imports)]
5096 use super::*;
5097
5098 #[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 #[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5125 pub online_log_directory: std::string::String,
5126
5127 #[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 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 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 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
5164 #[serde(rename_all = "camelCase")]
5165 #[non_exhaustive]
5166 pub enum LogFileAccess {
5167 OracleAsmLogFileAccess(
5169 std::boxed::Box<
5170 crate::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess,
5171 >,
5172 ),
5173 LogFileDirectories(
5175 std::boxed::Box<
5176 crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
5177 >,
5178 ),
5179 }
5180 }
5181
5182 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
5184 #[serde(rename_all = "camelCase")]
5185 #[non_exhaustive]
5186 pub enum LargeObjectsHandling {
5187 DropLargeObjects(std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>),
5189 StreamLargeObjects(std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>),
5191 }
5192
5193 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
5195 #[serde(rename_all = "camelCase")]
5196 #[non_exhaustive]
5197 pub enum CdcMethod {
5198 LogMiner(std::boxed::Box<crate::model::oracle_source_config::LogMiner>),
5200 BinaryLogParser(std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>),
5202 }
5203}
5204
5205#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5213 pub column: std::string::String,
5214
5215 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5217 pub data_type: std::string::String,
5218
5219 pub length: i32,
5221
5222 pub precision: i32,
5224
5225 pub scale: i32,
5227
5228 pub primary_key: bool,
5230
5231 pub nullable: bool,
5233
5234 pub ordinal_position: i32,
5236}
5237
5238impl PostgresqlColumn {
5239 pub fn new() -> Self {
5240 std::default::Default::default()
5241 }
5242
5243 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 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 pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5257 self.length = v.into();
5258 self
5259 }
5260
5261 pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5263 self.precision = v.into();
5264 self
5265 }
5266
5267 pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5269 self.scale = v.into();
5270 self
5271 }
5272
5273 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 pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5281 self.nullable = v.into();
5282 self
5283 }
5284
5285 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5306 pub table: std::string::String,
5307
5308 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5352 pub schema: std::string::String,
5353
5354 #[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 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 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#[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 #[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 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#[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 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5430 pub include_objects: std::option::Option<crate::model::PostgresqlRdbms>,
5431
5432 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5434 pub exclude_objects: std::option::Option<crate::model::PostgresqlRdbms>,
5435
5436 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5439 pub replication_slot: std::string::String,
5440
5441 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5444 pub publication: std::string::String,
5445
5446 pub max_concurrent_backfill_tasks: i32,
5450}
5451
5452impl PostgresqlSourceConfig {
5453 pub fn new() -> Self {
5454 std::default::Default::default()
5455 }
5456
5457 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 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 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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5515 pub column: std::string::String,
5516
5517 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5519 pub data_type: std::string::String,
5520
5521 pub length: i32,
5523
5524 pub precision: i32,
5526
5527 pub scale: i32,
5529
5530 pub primary_key: bool,
5532
5533 pub nullable: bool,
5535
5536 pub ordinal_position: i32,
5538}
5539
5540impl SqlServerColumn {
5541 pub fn new() -> Self {
5542 std::default::Default::default()
5543 }
5544
5545 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 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 pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5559 self.length = v.into();
5560 self
5561 }
5562
5563 pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5565 self.precision = v.into();
5566 self
5567 }
5568
5569 pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5571 self.scale = v.into();
5572 self
5573 }
5574
5575 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 pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5583 self.nullable = v.into();
5584 self
5585 }
5586
5587 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5608 pub table: std::string::String,
5609
5610 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5654 pub schema: std::string::String,
5655
5656 #[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 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 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#[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 #[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 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#[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 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5732 pub include_objects: std::option::Option<crate::model::SqlServerRdbms>,
5733
5734 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5736 pub exclude_objects: std::option::Option<crate::model::SqlServerRdbms>,
5737
5738 pub max_concurrent_cdc_tasks: i32,
5740
5741 pub max_concurrent_backfill_tasks: i32,
5743
5744 #[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 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 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 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 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 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 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 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 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 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
5870pub mod sql_server_source_config {
5872 #[allow(unused_imports)]
5873 use super::*;
5874
5875 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
5877 #[serde(rename_all = "camelCase")]
5878 #[non_exhaustive]
5879 pub enum CdcMethod {
5880 TransactionLogs(std::boxed::Box<crate::model::SqlServerTransactionLogs>),
5882 ChangeTables(std::boxed::Box<crate::model::SqlServerChangeTables>),
5884 }
5885}
5886
5887#[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#[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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5933 pub column: std::string::String,
5934
5935 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5938 pub data_type: std::string::String,
5939
5940 pub length: i32,
5942
5943 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5945 pub collation: std::string::String,
5946
5947 pub primary_key: bool,
5949
5950 pub nullable: bool,
5952
5953 pub ordinal_position: i32,
5955
5956 pub precision: i32,
5958
5959 pub scale: i32,
5961}
5962
5963impl MysqlColumn {
5964 pub fn new() -> Self {
5965 std::default::Default::default()
5966 }
5967
5968 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 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 pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5982 self.length = v.into();
5983 self
5984 }
5985
5986 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 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 pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6000 self.nullable = v.into();
6001 self
6002 }
6003
6004 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 pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6012 self.precision = v.into();
6013 self
6014 }
6015
6016 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6037 pub table: std::string::String,
6038
6039 #[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 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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6083 pub database: std::string::String,
6084
6085 #[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 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 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#[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 #[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 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#[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 #[serde(skip_serializing_if = "std::option::Option::is_none")]
6161 pub include_objects: std::option::Option<crate::model::MysqlRdbms>,
6162
6163 #[serde(skip_serializing_if = "std::option::Option::is_none")]
6165 pub exclude_objects: std::option::Option<crate::model::MysqlRdbms>,
6166
6167 pub max_concurrent_cdc_tasks: i32,
6170
6171 pub max_concurrent_backfill_tasks: i32,
6175
6176 #[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 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 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 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 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 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 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 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 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 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
6300pub mod mysql_source_config {
6302 #[allow(unused_imports)]
6303 use super::*;
6304
6305 #[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 #[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 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
6345 #[serde(rename_all = "camelCase")]
6346 #[non_exhaustive]
6347 pub enum CdcMethod {
6348 BinaryLogPosition(std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>),
6350 Gtid(std::boxed::Box<crate::model::mysql_source_config::Gtid>),
6352 }
6353}
6354
6355#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6364 pub source_connection_profile: std::string::String,
6365
6366 #[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 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 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 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 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 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 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 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 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 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 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
6531pub mod source_config {
6533 #[allow(unused_imports)]
6534 use super::*;
6535
6536 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
6538 #[serde(rename_all = "camelCase")]
6539 #[non_exhaustive]
6540 pub enum SourceStreamConfig {
6541 OracleSourceConfig(std::boxed::Box<crate::model::OracleSourceConfig>),
6543 MysqlSourceConfig(std::boxed::Box<crate::model::MysqlSourceConfig>),
6545 PostgresqlSourceConfig(std::boxed::Box<crate::model::PostgresqlSourceConfig>),
6547 SqlServerSourceConfig(std::boxed::Box<crate::model::SqlServerSourceConfig>),
6549 }
6550}
6551
6552#[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#[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 pub schema_file_format: crate::model::json_file_format::SchemaFileFormat,
6579
6580 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 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 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
6618pub mod json_file_format {
6620 #[allow(unused_imports)]
6621 use super::*;
6622
6623 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6625 pub struct SchemaFileFormat(std::borrow::Cow<'static, str>);
6626
6627 impl SchemaFileFormat {
6628 pub const fn new(v: &'static str) -> Self {
6630 Self(std::borrow::Cow::Borrowed(v))
6631 }
6632
6633 pub fn value(&self) -> &str {
6635 &self.0
6636 }
6637 }
6638
6639 pub mod schema_file_format {
6641 use super::SchemaFileFormat;
6642
6643 pub const SCHEMA_FILE_FORMAT_UNSPECIFIED: SchemaFileFormat =
6645 SchemaFileFormat::new("SCHEMA_FILE_FORMAT_UNSPECIFIED");
6646
6647 pub const NO_SCHEMA_FILE: SchemaFileFormat = SchemaFileFormat::new("NO_SCHEMA_FILE");
6649
6650 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 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6662 pub struct JsonCompression(std::borrow::Cow<'static, str>);
6663
6664 impl JsonCompression {
6665 pub const fn new(v: &'static str) -> Self {
6667 Self(std::borrow::Cow::Borrowed(v))
6668 }
6669
6670 pub fn value(&self) -> &str {
6672 &self.0
6673 }
6674 }
6675
6676 pub mod json_compression {
6678 use super::JsonCompression;
6679
6680 pub const JSON_COMPRESSION_UNSPECIFIED: JsonCompression =
6682 JsonCompression::new("JSON_COMPRESSION_UNSPECIFIED");
6683
6684 pub const NO_COMPRESSION: JsonCompression = JsonCompression::new("NO_COMPRESSION");
6686
6687 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6706 pub path: std::string::String,
6707
6708 pub file_rotation_mb: i32,
6710
6711 #[serde(skip_serializing_if = "std::option::Option::is_none")]
6715 pub file_rotation_interval: std::option::Option<wkt::Duration>,
6716
6717 #[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 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 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 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 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 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 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 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 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
6830pub mod gcs_destination_config {
6832 #[allow(unused_imports)]
6833 use super::*;
6834
6835 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
6837 #[serde(rename_all = "camelCase")]
6838 #[non_exhaustive]
6839 pub enum FileFormat {
6840 AvroFileFormat(std::boxed::Box<crate::model::AvroFileFormat>),
6842 JsonFileFormat(std::boxed::Box<crate::model::JsonFileFormat>),
6844 }
6845}
6846
6847#[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 #[serde(skip_serializing_if = "std::option::Option::is_none")]
6858 pub data_freshness: std::option::Option<wkt::Duration>,
6859
6860 #[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 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 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 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 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 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 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 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 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 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 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 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
7058pub mod big_query_destination_config {
7060 #[allow(unused_imports)]
7061 use super::*;
7062
7063 #[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 #[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 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 #[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 #[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 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 pub mod source_hierarchy_datasets {
7128 #[allow(unused_imports)]
7129 use super::*;
7130
7131 #[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7141 pub location: std::string::String,
7142
7143 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7147 pub dataset_id_prefix: std::string::String,
7148
7149 #[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 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 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 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 #[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 #[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 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
7242 #[serde(rename_all = "camelCase")]
7243 #[non_exhaustive]
7244 pub enum DatasetConfig {
7245 SingleTargetDataset(
7247 std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
7248 ),
7249 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 Merge(std::boxed::Box<crate::model::big_query_destination_config::Merge>),
7261 AppendOnly(std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>),
7263 }
7264}
7265
7266#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7275 pub destination_connection_profile: std::string::String,
7276
7277 #[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 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 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 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 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 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 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
7385pub mod destination_config {
7387 #[allow(unused_imports)]
7388 use super::*;
7389
7390 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
7392 #[serde(rename_all = "camelCase")]
7393 #[non_exhaustive]
7394 pub enum DestinationStreamConfig {
7395 GcsDestinationConfig(std::boxed::Box<crate::model::GcsDestinationConfig>),
7397 BigqueryDestinationConfig(std::boxed::Box<crate::model::BigQueryDestinationConfig>),
7399 }
7400}
7401
7402#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7410 pub name: std::string::String,
7411
7412 #[serde(skip_serializing_if = "std::option::Option::is_none")]
7414 pub create_time: std::option::Option<wkt::Timestamp>,
7415
7416 #[serde(skip_serializing_if = "std::option::Option::is_none")]
7418 pub update_time: std::option::Option<wkt::Timestamp>,
7419
7420 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
7422 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7423
7424 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7426 pub display_name: std::string::String,
7427
7428 #[serde(skip_serializing_if = "std::option::Option::is_none")]
7430 pub source_config: std::option::Option<crate::model::SourceConfig>,
7431
7432 #[serde(skip_serializing_if = "std::option::Option::is_none")]
7434 pub destination_config: std::option::Option<crate::model::DestinationConfig>,
7435
7436 pub state: crate::model::stream::State,
7438
7439 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7441 pub errors: std::vec::Vec<crate::model::Error>,
7442
7443 #[serde(skip_serializing_if = "std::option::Option::is_none")]
7448 pub customer_managed_encryption_key: std::option::Option<std::string::String>,
7449
7450 #[serde(skip_serializing_if = "std::option::Option::is_none")]
7453 pub last_recovery_time: std::option::Option<wkt::Timestamp>,
7454
7455 #[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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
7644pub mod stream {
7646 #[allow(unused_imports)]
7647 use super::*;
7648
7649 #[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 #[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 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 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 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 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 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 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 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 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 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 pub mod backfill_all_strategy {
7817 #[allow(unused_imports)]
7818 use super::*;
7819
7820 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
7822 #[serde(rename_all = "camelCase")]
7823 #[non_exhaustive]
7824 pub enum ExcludedObjects {
7825 OracleExcludedObjects(std::boxed::Box<crate::model::OracleRdbms>),
7827 MysqlExcludedObjects(std::boxed::Box<crate::model::MysqlRdbms>),
7829 PostgresqlExcludedObjects(std::boxed::Box<crate::model::PostgresqlRdbms>),
7831 SqlServerExcludedObjects(std::boxed::Box<crate::model::SqlServerRdbms>),
7833 }
7834 }
7835
7836 #[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 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7857 pub struct State(std::borrow::Cow<'static, str>);
7858
7859 impl State {
7860 pub const fn new(v: &'static str) -> Self {
7862 Self(std::borrow::Cow::Borrowed(v))
7863 }
7864
7865 pub fn value(&self) -> &str {
7867 &self.0
7868 }
7869 }
7870
7871 pub mod state {
7873 use super::State;
7874
7875 pub const STATE_UNSPECIFIED: State = State::new("STATE_UNSPECIFIED");
7877
7878 pub const NOT_STARTED: State = State::new("NOT_STARTED");
7880
7881 pub const RUNNING: State = State::new("RUNNING");
7883
7884 pub const PAUSED: State = State::new("PAUSED");
7886
7887 pub const MAINTENANCE: State = State::new("MAINTENANCE");
7891
7892 pub const FAILED: State = State::new("FAILED");
7895
7896 pub const FAILED_PERMANENTLY: State = State::new("FAILED_PERMANENTLY");
7898
7899 pub const STARTING: State = State::new("STARTING");
7901
7902 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 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
7915 #[serde(rename_all = "camelCase")]
7916 #[non_exhaustive]
7917 pub enum BackfillStrategy {
7918 BackfillAll(std::boxed::Box<crate::model::stream::BackfillAllStrategy>),
7921 BackfillNone(std::boxed::Box<crate::model::stream::BackfillNoneStrategy>),
7923 }
7924}
7925
7926#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7934 pub name: std::string::String,
7935
7936 #[serde(skip_serializing_if = "std::option::Option::is_none")]
7938 pub create_time: std::option::Option<wkt::Timestamp>,
7939
7940 #[serde(skip_serializing_if = "std::option::Option::is_none")]
7942 pub update_time: std::option::Option<wkt::Timestamp>,
7943
7944 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7946 pub display_name: std::string::String,
7947
7948 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7950 pub errors: std::vec::Vec<crate::model::Error>,
7951
7952 #[serde(skip_serializing_if = "std::option::Option::is_none")]
7954 pub backfill_job: std::option::Option<crate::model::BackfillJob>,
7955
7956 #[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 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 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 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 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 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 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 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#[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 #[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 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 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 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 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 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 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 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 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 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
8219pub mod source_object_identifier {
8221 #[allow(unused_imports)]
8222 use super::*;
8223
8224 #[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8232 pub schema: std::string::String,
8233
8234 #[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 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 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 #[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8271 pub schema: std::string::String,
8272
8273 #[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 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 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 #[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8310 pub database: std::string::String,
8311
8312 #[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 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 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 #[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8349 pub schema: std::string::String,
8350
8351 #[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 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 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 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8382 #[serde(rename_all = "camelCase")]
8383 #[non_exhaustive]
8384 pub enum SourceIdentifier {
8385 OracleIdentifier(
8387 std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
8388 ),
8389 MysqlIdentifier(
8391 std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
8392 ),
8393 PostgresqlIdentifier(
8395 std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
8396 ),
8397 SqlServerIdentifier(
8399 std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
8400 ),
8401 }
8402}
8403
8404#[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 pub state: crate::model::backfill_job::State,
8412
8413 pub trigger: crate::model::backfill_job::Trigger,
8415
8416 #[serde(skip_serializing_if = "std::option::Option::is_none")]
8418 pub last_start_time: std::option::Option<wkt::Timestamp>,
8419
8420 #[serde(skip_serializing_if = "std::option::Option::is_none")]
8422 pub last_end_time: std::option::Option<wkt::Timestamp>,
8423
8424 #[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 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 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 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 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 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
8488pub mod backfill_job {
8490 #[allow(unused_imports)]
8491 use super::*;
8492
8493 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8495 pub struct State(std::borrow::Cow<'static, str>);
8496
8497 impl State {
8498 pub const fn new(v: &'static str) -> Self {
8500 Self(std::borrow::Cow::Borrowed(v))
8501 }
8502
8503 pub fn value(&self) -> &str {
8505 &self.0
8506 }
8507 }
8508
8509 pub mod state {
8511 use super::State;
8512
8513 pub const STATE_UNSPECIFIED: State = State::new("STATE_UNSPECIFIED");
8515
8516 pub const NOT_STARTED: State = State::new("NOT_STARTED");
8520
8521 pub const PENDING: State = State::new("PENDING");
8523
8524 pub const ACTIVE: State = State::new("ACTIVE");
8526
8527 pub const STOPPED: State = State::new("STOPPED");
8529
8530 pub const FAILED: State = State::new("FAILED");
8532
8533 pub const COMPLETED: State = State::new("COMPLETED");
8535
8536 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 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8549 pub struct Trigger(std::borrow::Cow<'static, str>);
8550
8551 impl Trigger {
8552 pub const fn new(v: &'static str) -> Self {
8554 Self(std::borrow::Cow::Borrowed(v))
8555 }
8556
8557 pub fn value(&self) -> &str {
8559 &self.0
8560 }
8561 }
8562
8563 pub mod trigger {
8565 use super::Trigger;
8566
8567 pub const TRIGGER_UNSPECIFIED: Trigger = Trigger::new("TRIGGER_UNSPECIFIED");
8569
8570 pub const AUTOMATIC: Trigger = Trigger::new("AUTOMATIC");
8573
8574 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8593 pub reason: std::string::String,
8594
8595 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8598 pub error_uuid: std::string::String,
8599
8600 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8602 pub message: std::string::String,
8603
8604 #[serde(skip_serializing_if = "std::option::Option::is_none")]
8606 pub error_time: std::option::Option<wkt::Timestamp>,
8607
8608 #[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 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 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 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 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 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#[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 #[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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8707 pub description: std::string::String,
8708
8709 pub state: crate::model::validation::State,
8711
8712 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8714 pub message: std::vec::Vec<crate::model::ValidationMessage>,
8715
8716 #[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 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 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 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 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
8765pub mod validation {
8767 #[allow(unused_imports)]
8768 use super::*;
8769
8770 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8772 pub struct State(std::borrow::Cow<'static, str>);
8773
8774 impl State {
8775 pub const fn new(v: &'static str) -> Self {
8777 Self(std::borrow::Cow::Borrowed(v))
8778 }
8779
8780 pub fn value(&self) -> &str {
8782 &self.0
8783 }
8784 }
8785
8786 pub mod state {
8788 use super::State;
8789
8790 pub const STATE_UNSPECIFIED: State = State::new("STATE_UNSPECIFIED");
8792
8793 pub const NOT_EXECUTED: State = State::new("NOT_EXECUTED");
8795
8796 pub const FAILED: State = State::new("FAILED");
8798
8799 pub const PASSED: State = State::new("PASSED");
8801
8802 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8821 pub message: std::string::String,
8822
8823 pub level: crate::model::validation_message::Level,
8825
8826 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
8828 pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
8829
8830 #[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 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 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 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 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
8880pub mod validation_message {
8882 #[allow(unused_imports)]
8883 use super::*;
8884
8885 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8887 pub struct Level(std::borrow::Cow<'static, str>);
8888
8889 impl Level {
8890 pub const fn new(v: &'static str) -> Self {
8892 Self(std::borrow::Cow::Borrowed(v))
8893 }
8894
8895 pub fn value(&self) -> &str {
8897 &self.0
8898 }
8899 }
8900
8901 pub mod level {
8903 use super::Level;
8904
8905 pub const LEVEL_UNSPECIFIED: Level = Level::new("LEVEL_UNSPECIFIED");
8907
8908 pub const WARNING: Level = Level::new("WARNING");
8910
8911 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#[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 #[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 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 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 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 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 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 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 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
9057pub mod cdc_strategy {
9059 #[allow(unused_imports)]
9060 use super::*;
9061
9062 #[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 #[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 #[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 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 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 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 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 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 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 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 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 MysqlLogPosition(std::boxed::Box<crate::model::MysqlLogPosition>),
9247 OracleScnPosition(std::boxed::Box<crate::model::OracleScnPosition>),
9249 SqlServerLsnPosition(std::boxed::Box<crate::model::SqlServerLsnPosition>),
9251 }
9252 }
9253
9254 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9258 #[serde(rename_all = "camelCase")]
9259 #[non_exhaustive]
9260 pub enum StartPosition {
9261 MostRecentStartPosition(
9263 std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>,
9264 ),
9265 NextAvailableStartPosition(
9268 std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>,
9269 ),
9270 SpecificStartPosition(std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>),
9272 }
9273}
9274
9275#[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 #[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 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#[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 #[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 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#[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 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9341 pub log_file: std::string::String,
9342
9343 #[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 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 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}