google_cloud_datastream_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_location;
25extern crate google_cloud_longrunning;
26extern crate google_cloud_lro;
27extern crate serde;
28extern crate serde_json;
29extern crate serde_with;
30extern crate std;
31extern crate tracing;
32extern crate wkt;
33
34mod debug;
35mod deserialize;
36mod serialize;
37
38/// Request message for 'discover' ConnectionProfile request.
39#[derive(Clone, Default, PartialEq)]
40#[non_exhaustive]
41pub struct DiscoverConnectionProfileRequest {
42 /// Required. The parent resource of the connection profile type. Must be in
43 /// the format `projects/*/locations/*`.
44 pub parent: std::string::String,
45
46 /// The connection profile on which to run discover.
47 pub target: std::option::Option<crate::model::discover_connection_profile_request::Target>,
48
49 /// The depth of the retrieved hierarchy of data objects.
50 pub hierarchy:
51 std::option::Option<crate::model::discover_connection_profile_request::Hierarchy>,
52
53 /// The data object to populate with child data objects and metadata.
54 pub data_object:
55 std::option::Option<crate::model::discover_connection_profile_request::DataObject>,
56
57 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
58}
59
60impl DiscoverConnectionProfileRequest {
61 /// Creates a new default instance.
62 pub fn new() -> Self {
63 std::default::Default::default()
64 }
65
66 /// Sets the value of [parent][crate::model::DiscoverConnectionProfileRequest::parent].
67 ///
68 /// # Example
69 /// ```ignore,no_run
70 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
71 /// let x = DiscoverConnectionProfileRequest::new().set_parent("example");
72 /// ```
73 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
74 self.parent = v.into();
75 self
76 }
77
78 /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target].
79 ///
80 /// Note that all the setters affecting `target` are mutually
81 /// exclusive.
82 ///
83 /// # Example
84 /// ```ignore,no_run
85 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
86 /// use google_cloud_datastream_v1::model::discover_connection_profile_request::Target;
87 /// let x = DiscoverConnectionProfileRequest::new().set_target(Some(Target::ConnectionProfileName("example".to_string())));
88 /// ```
89 pub fn set_target<
90 T: std::convert::Into<
91 std::option::Option<crate::model::discover_connection_profile_request::Target>,
92 >,
93 >(
94 mut self,
95 v: T,
96 ) -> Self {
97 self.target = v.into();
98 self
99 }
100
101 /// The value of [target][crate::model::DiscoverConnectionProfileRequest::target]
102 /// if it holds a `ConnectionProfile`, `None` if the field is not set or
103 /// holds a different branch.
104 pub fn connection_profile(
105 &self,
106 ) -> std::option::Option<&std::boxed::Box<crate::model::ConnectionProfile>> {
107 #[allow(unreachable_patterns)]
108 self.target.as_ref().and_then(|v| match v {
109 crate::model::discover_connection_profile_request::Target::ConnectionProfile(v) => {
110 std::option::Option::Some(v)
111 }
112 _ => std::option::Option::None,
113 })
114 }
115
116 /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target]
117 /// to hold a `ConnectionProfile`.
118 ///
119 /// Note that all the setters affecting `target` are
120 /// mutually exclusive.
121 ///
122 /// # Example
123 /// ```ignore,no_run
124 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
125 /// use google_cloud_datastream_v1::model::ConnectionProfile;
126 /// let x = DiscoverConnectionProfileRequest::new().set_connection_profile(ConnectionProfile::default()/* use setters */);
127 /// assert!(x.connection_profile().is_some());
128 /// assert!(x.connection_profile_name().is_none());
129 /// ```
130 pub fn set_connection_profile<
131 T: std::convert::Into<std::boxed::Box<crate::model::ConnectionProfile>>,
132 >(
133 mut self,
134 v: T,
135 ) -> Self {
136 self.target = std::option::Option::Some(
137 crate::model::discover_connection_profile_request::Target::ConnectionProfile(v.into()),
138 );
139 self
140 }
141
142 /// The value of [target][crate::model::DiscoverConnectionProfileRequest::target]
143 /// if it holds a `ConnectionProfileName`, `None` if the field is not set or
144 /// holds a different branch.
145 pub fn connection_profile_name(&self) -> std::option::Option<&std::string::String> {
146 #[allow(unreachable_patterns)]
147 self.target.as_ref().and_then(|v| match v {
148 crate::model::discover_connection_profile_request::Target::ConnectionProfileName(v) => {
149 std::option::Option::Some(v)
150 }
151 _ => std::option::Option::None,
152 })
153 }
154
155 /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target]
156 /// to hold a `ConnectionProfileName`.
157 ///
158 /// Note that all the setters affecting `target` are
159 /// mutually exclusive.
160 ///
161 /// # Example
162 /// ```ignore,no_run
163 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
164 /// let x = DiscoverConnectionProfileRequest::new().set_connection_profile_name("example");
165 /// assert!(x.connection_profile_name().is_some());
166 /// assert!(x.connection_profile().is_none());
167 /// ```
168 pub fn set_connection_profile_name<T: std::convert::Into<std::string::String>>(
169 mut self,
170 v: T,
171 ) -> Self {
172 self.target = std::option::Option::Some(
173 crate::model::discover_connection_profile_request::Target::ConnectionProfileName(
174 v.into(),
175 ),
176 );
177 self
178 }
179
180 /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy].
181 ///
182 /// Note that all the setters affecting `hierarchy` are mutually
183 /// exclusive.
184 ///
185 /// # Example
186 /// ```ignore,no_run
187 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
188 /// use google_cloud_datastream_v1::model::discover_connection_profile_request::Hierarchy;
189 /// let x = DiscoverConnectionProfileRequest::new().set_hierarchy(Some(Hierarchy::FullHierarchy(true)));
190 /// ```
191 pub fn set_hierarchy<
192 T: std::convert::Into<
193 std::option::Option<crate::model::discover_connection_profile_request::Hierarchy>,
194 >,
195 >(
196 mut self,
197 v: T,
198 ) -> Self {
199 self.hierarchy = v.into();
200 self
201 }
202
203 /// The value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
204 /// if it holds a `FullHierarchy`, `None` if the field is not set or
205 /// holds a different branch.
206 pub fn full_hierarchy(&self) -> std::option::Option<&bool> {
207 #[allow(unreachable_patterns)]
208 self.hierarchy.as_ref().and_then(|v| match v {
209 crate::model::discover_connection_profile_request::Hierarchy::FullHierarchy(v) => {
210 std::option::Option::Some(v)
211 }
212 _ => std::option::Option::None,
213 })
214 }
215
216 /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
217 /// to hold a `FullHierarchy`.
218 ///
219 /// Note that all the setters affecting `hierarchy` are
220 /// mutually exclusive.
221 ///
222 /// # Example
223 /// ```ignore,no_run
224 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
225 /// let x = DiscoverConnectionProfileRequest::new().set_full_hierarchy(true);
226 /// assert!(x.full_hierarchy().is_some());
227 /// assert!(x.hierarchy_depth().is_none());
228 /// ```
229 pub fn set_full_hierarchy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
230 self.hierarchy = std::option::Option::Some(
231 crate::model::discover_connection_profile_request::Hierarchy::FullHierarchy(v.into()),
232 );
233 self
234 }
235
236 /// The value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
237 /// if it holds a `HierarchyDepth`, `None` if the field is not set or
238 /// holds a different branch.
239 pub fn hierarchy_depth(&self) -> std::option::Option<&i32> {
240 #[allow(unreachable_patterns)]
241 self.hierarchy.as_ref().and_then(|v| match v {
242 crate::model::discover_connection_profile_request::Hierarchy::HierarchyDepth(v) => {
243 std::option::Option::Some(v)
244 }
245 _ => std::option::Option::None,
246 })
247 }
248
249 /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
250 /// to hold a `HierarchyDepth`.
251 ///
252 /// Note that all the setters affecting `hierarchy` are
253 /// mutually exclusive.
254 ///
255 /// # Example
256 /// ```ignore,no_run
257 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
258 /// let x = DiscoverConnectionProfileRequest::new().set_hierarchy_depth(42);
259 /// assert!(x.hierarchy_depth().is_some());
260 /// assert!(x.full_hierarchy().is_none());
261 /// ```
262 pub fn set_hierarchy_depth<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
263 self.hierarchy = std::option::Option::Some(
264 crate::model::discover_connection_profile_request::Hierarchy::HierarchyDepth(v.into()),
265 );
266 self
267 }
268
269 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object].
270 ///
271 /// Note that all the setters affecting `data_object` are mutually
272 /// exclusive.
273 ///
274 /// # Example
275 /// ```ignore,no_run
276 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
277 /// use google_cloud_datastream_v1::model::OracleRdbms;
278 /// let x = DiscoverConnectionProfileRequest::new().set_data_object(Some(
279 /// google_cloud_datastream_v1::model::discover_connection_profile_request::DataObject::OracleRdbms(OracleRdbms::default().into())));
280 /// ```
281 pub fn set_data_object<
282 T: std::convert::Into<
283 std::option::Option<crate::model::discover_connection_profile_request::DataObject>,
284 >,
285 >(
286 mut self,
287 v: T,
288 ) -> Self {
289 self.data_object = v.into();
290 self
291 }
292
293 /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
294 /// if it holds a `OracleRdbms`, `None` if the field is not set or
295 /// holds a different branch.
296 pub fn oracle_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
297 #[allow(unreachable_patterns)]
298 self.data_object.as_ref().and_then(|v| match v {
299 crate::model::discover_connection_profile_request::DataObject::OracleRdbms(v) => {
300 std::option::Option::Some(v)
301 }
302 _ => std::option::Option::None,
303 })
304 }
305
306 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
307 /// to hold a `OracleRdbms`.
308 ///
309 /// Note that all the setters affecting `data_object` are
310 /// mutually exclusive.
311 ///
312 /// # Example
313 /// ```ignore,no_run
314 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
315 /// use google_cloud_datastream_v1::model::OracleRdbms;
316 /// let x = DiscoverConnectionProfileRequest::new().set_oracle_rdbms(OracleRdbms::default()/* use setters */);
317 /// assert!(x.oracle_rdbms().is_some());
318 /// assert!(x.mysql_rdbms().is_none());
319 /// assert!(x.postgresql_rdbms().is_none());
320 /// assert!(x.sql_server_rdbms().is_none());
321 /// assert!(x.salesforce_org().is_none());
322 /// assert!(x.mongodb_cluster().is_none());
323 /// ```
324 pub fn set_oracle_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>>(
325 mut self,
326 v: T,
327 ) -> Self {
328 self.data_object = std::option::Option::Some(
329 crate::model::discover_connection_profile_request::DataObject::OracleRdbms(v.into()),
330 );
331 self
332 }
333
334 /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
335 /// if it holds a `MysqlRdbms`, `None` if the field is not set or
336 /// holds a different branch.
337 pub fn mysql_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
338 #[allow(unreachable_patterns)]
339 self.data_object.as_ref().and_then(|v| match v {
340 crate::model::discover_connection_profile_request::DataObject::MysqlRdbms(v) => {
341 std::option::Option::Some(v)
342 }
343 _ => std::option::Option::None,
344 })
345 }
346
347 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
348 /// to hold a `MysqlRdbms`.
349 ///
350 /// Note that all the setters affecting `data_object` are
351 /// mutually exclusive.
352 ///
353 /// # Example
354 /// ```ignore,no_run
355 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
356 /// use google_cloud_datastream_v1::model::MysqlRdbms;
357 /// let x = DiscoverConnectionProfileRequest::new().set_mysql_rdbms(MysqlRdbms::default()/* use setters */);
358 /// assert!(x.mysql_rdbms().is_some());
359 /// assert!(x.oracle_rdbms().is_none());
360 /// assert!(x.postgresql_rdbms().is_none());
361 /// assert!(x.sql_server_rdbms().is_none());
362 /// assert!(x.salesforce_org().is_none());
363 /// assert!(x.mongodb_cluster().is_none());
364 /// ```
365 pub fn set_mysql_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>>(
366 mut self,
367 v: T,
368 ) -> Self {
369 self.data_object = std::option::Option::Some(
370 crate::model::discover_connection_profile_request::DataObject::MysqlRdbms(v.into()),
371 );
372 self
373 }
374
375 /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
376 /// if it holds a `PostgresqlRdbms`, `None` if the field is not set or
377 /// holds a different branch.
378 pub fn postgresql_rdbms(
379 &self,
380 ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
381 #[allow(unreachable_patterns)]
382 self.data_object.as_ref().and_then(|v| match v {
383 crate::model::discover_connection_profile_request::DataObject::PostgresqlRdbms(v) => {
384 std::option::Option::Some(v)
385 }
386 _ => std::option::Option::None,
387 })
388 }
389
390 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
391 /// to hold a `PostgresqlRdbms`.
392 ///
393 /// Note that all the setters affecting `data_object` are
394 /// mutually exclusive.
395 ///
396 /// # Example
397 /// ```ignore,no_run
398 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
399 /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
400 /// let x = DiscoverConnectionProfileRequest::new().set_postgresql_rdbms(PostgresqlRdbms::default()/* use setters */);
401 /// assert!(x.postgresql_rdbms().is_some());
402 /// assert!(x.oracle_rdbms().is_none());
403 /// assert!(x.mysql_rdbms().is_none());
404 /// assert!(x.sql_server_rdbms().is_none());
405 /// assert!(x.salesforce_org().is_none());
406 /// assert!(x.mongodb_cluster().is_none());
407 /// ```
408 pub fn set_postgresql_rdbms<
409 T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
410 >(
411 mut self,
412 v: T,
413 ) -> Self {
414 self.data_object = std::option::Option::Some(
415 crate::model::discover_connection_profile_request::DataObject::PostgresqlRdbms(
416 v.into(),
417 ),
418 );
419 self
420 }
421
422 /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
423 /// if it holds a `SqlServerRdbms`, `None` if the field is not set or
424 /// holds a different branch.
425 pub fn sql_server_rdbms(
426 &self,
427 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
428 #[allow(unreachable_patterns)]
429 self.data_object.as_ref().and_then(|v| match v {
430 crate::model::discover_connection_profile_request::DataObject::SqlServerRdbms(v) => {
431 std::option::Option::Some(v)
432 }
433 _ => std::option::Option::None,
434 })
435 }
436
437 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
438 /// to hold a `SqlServerRdbms`.
439 ///
440 /// Note that all the setters affecting `data_object` are
441 /// mutually exclusive.
442 ///
443 /// # Example
444 /// ```ignore,no_run
445 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
446 /// use google_cloud_datastream_v1::model::SqlServerRdbms;
447 /// let x = DiscoverConnectionProfileRequest::new().set_sql_server_rdbms(SqlServerRdbms::default()/* use setters */);
448 /// assert!(x.sql_server_rdbms().is_some());
449 /// assert!(x.oracle_rdbms().is_none());
450 /// assert!(x.mysql_rdbms().is_none());
451 /// assert!(x.postgresql_rdbms().is_none());
452 /// assert!(x.salesforce_org().is_none());
453 /// assert!(x.mongodb_cluster().is_none());
454 /// ```
455 pub fn set_sql_server_rdbms<
456 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
457 >(
458 mut self,
459 v: T,
460 ) -> Self {
461 self.data_object = std::option::Option::Some(
462 crate::model::discover_connection_profile_request::DataObject::SqlServerRdbms(v.into()),
463 );
464 self
465 }
466
467 /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
468 /// if it holds a `SalesforceOrg`, `None` if the field is not set or
469 /// holds a different branch.
470 pub fn salesforce_org(
471 &self,
472 ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceOrg>> {
473 #[allow(unreachable_patterns)]
474 self.data_object.as_ref().and_then(|v| match v {
475 crate::model::discover_connection_profile_request::DataObject::SalesforceOrg(v) => {
476 std::option::Option::Some(v)
477 }
478 _ => std::option::Option::None,
479 })
480 }
481
482 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
483 /// to hold a `SalesforceOrg`.
484 ///
485 /// Note that all the setters affecting `data_object` are
486 /// mutually exclusive.
487 ///
488 /// # Example
489 /// ```ignore,no_run
490 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
491 /// use google_cloud_datastream_v1::model::SalesforceOrg;
492 /// let x = DiscoverConnectionProfileRequest::new().set_salesforce_org(SalesforceOrg::default()/* use setters */);
493 /// assert!(x.salesforce_org().is_some());
494 /// assert!(x.oracle_rdbms().is_none());
495 /// assert!(x.mysql_rdbms().is_none());
496 /// assert!(x.postgresql_rdbms().is_none());
497 /// assert!(x.sql_server_rdbms().is_none());
498 /// assert!(x.mongodb_cluster().is_none());
499 /// ```
500 pub fn set_salesforce_org<
501 T: std::convert::Into<std::boxed::Box<crate::model::SalesforceOrg>>,
502 >(
503 mut self,
504 v: T,
505 ) -> Self {
506 self.data_object = std::option::Option::Some(
507 crate::model::discover_connection_profile_request::DataObject::SalesforceOrg(v.into()),
508 );
509 self
510 }
511
512 /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
513 /// if it holds a `MongodbCluster`, `None` if the field is not set or
514 /// holds a different branch.
515 pub fn mongodb_cluster(
516 &self,
517 ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbCluster>> {
518 #[allow(unreachable_patterns)]
519 self.data_object.as_ref().and_then(|v| match v {
520 crate::model::discover_connection_profile_request::DataObject::MongodbCluster(v) => {
521 std::option::Option::Some(v)
522 }
523 _ => std::option::Option::None,
524 })
525 }
526
527 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
528 /// to hold a `MongodbCluster`.
529 ///
530 /// Note that all the setters affecting `data_object` are
531 /// mutually exclusive.
532 ///
533 /// # Example
534 /// ```ignore,no_run
535 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
536 /// use google_cloud_datastream_v1::model::MongodbCluster;
537 /// let x = DiscoverConnectionProfileRequest::new().set_mongodb_cluster(MongodbCluster::default()/* use setters */);
538 /// assert!(x.mongodb_cluster().is_some());
539 /// assert!(x.oracle_rdbms().is_none());
540 /// assert!(x.mysql_rdbms().is_none());
541 /// assert!(x.postgresql_rdbms().is_none());
542 /// assert!(x.sql_server_rdbms().is_none());
543 /// assert!(x.salesforce_org().is_none());
544 /// ```
545 pub fn set_mongodb_cluster<
546 T: std::convert::Into<std::boxed::Box<crate::model::MongodbCluster>>,
547 >(
548 mut self,
549 v: T,
550 ) -> Self {
551 self.data_object = std::option::Option::Some(
552 crate::model::discover_connection_profile_request::DataObject::MongodbCluster(v.into()),
553 );
554 self
555 }
556}
557
558impl wkt::message::Message for DiscoverConnectionProfileRequest {
559 fn typename() -> &'static str {
560 "type.googleapis.com/google.cloud.datastream.v1.DiscoverConnectionProfileRequest"
561 }
562}
563
564/// Defines additional types related to [DiscoverConnectionProfileRequest].
565pub mod discover_connection_profile_request {
566 #[allow(unused_imports)]
567 use super::*;
568
569 /// The connection profile on which to run discover.
570 #[derive(Clone, Debug, PartialEq)]
571 #[non_exhaustive]
572 pub enum Target {
573 /// An ad-hoc connection profile configuration.
574 ConnectionProfile(std::boxed::Box<crate::model::ConnectionProfile>),
575 /// A reference to an existing connection profile.
576 ConnectionProfileName(std::string::String),
577 }
578
579 /// The depth of the retrieved hierarchy of data objects.
580 #[derive(Clone, Debug, PartialEq)]
581 #[non_exhaustive]
582 pub enum Hierarchy {
583 /// Whether to retrieve the full hierarchy of data objects (TRUE) or only the
584 /// current level (FALSE).
585 FullHierarchy(bool),
586 /// The number of hierarchy levels below the current level to be retrieved.
587 HierarchyDepth(i32),
588 }
589
590 /// The data object to populate with child data objects and metadata.
591 #[derive(Clone, Debug, PartialEq)]
592 #[non_exhaustive]
593 pub enum DataObject {
594 /// Oracle RDBMS to enrich with child data objects and metadata.
595 OracleRdbms(std::boxed::Box<crate::model::OracleRdbms>),
596 /// MySQL RDBMS to enrich with child data objects and metadata.
597 MysqlRdbms(std::boxed::Box<crate::model::MysqlRdbms>),
598 /// PostgreSQL RDBMS to enrich with child data objects and metadata.
599 PostgresqlRdbms(std::boxed::Box<crate::model::PostgresqlRdbms>),
600 /// SQLServer RDBMS to enrich with child data objects and metadata.
601 SqlServerRdbms(std::boxed::Box<crate::model::SqlServerRdbms>),
602 /// Salesforce organization to enrich with child data objects and metadata.
603 SalesforceOrg(std::boxed::Box<crate::model::SalesforceOrg>),
604 /// MongoDB cluster to enrich with child data objects and metadata.
605 MongodbCluster(std::boxed::Box<crate::model::MongodbCluster>),
606 }
607}
608
609/// Response from a discover request.
610#[derive(Clone, Default, PartialEq)]
611#[non_exhaustive]
612pub struct DiscoverConnectionProfileResponse {
613 /// The data object that has been enriched by the discover API call.
614 pub data_object:
615 std::option::Option<crate::model::discover_connection_profile_response::DataObject>,
616
617 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
618}
619
620impl DiscoverConnectionProfileResponse {
621 /// Creates a new default instance.
622 pub fn new() -> Self {
623 std::default::Default::default()
624 }
625
626 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object].
627 ///
628 /// Note that all the setters affecting `data_object` are mutually
629 /// exclusive.
630 ///
631 /// # Example
632 /// ```ignore,no_run
633 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
634 /// use google_cloud_datastream_v1::model::OracleRdbms;
635 /// let x = DiscoverConnectionProfileResponse::new().set_data_object(Some(
636 /// google_cloud_datastream_v1::model::discover_connection_profile_response::DataObject::OracleRdbms(OracleRdbms::default().into())));
637 /// ```
638 pub fn set_data_object<
639 T: std::convert::Into<
640 std::option::Option<crate::model::discover_connection_profile_response::DataObject>,
641 >,
642 >(
643 mut self,
644 v: T,
645 ) -> Self {
646 self.data_object = v.into();
647 self
648 }
649
650 /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
651 /// if it holds a `OracleRdbms`, `None` if the field is not set or
652 /// holds a different branch.
653 pub fn oracle_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
654 #[allow(unreachable_patterns)]
655 self.data_object.as_ref().and_then(|v| match v {
656 crate::model::discover_connection_profile_response::DataObject::OracleRdbms(v) => {
657 std::option::Option::Some(v)
658 }
659 _ => std::option::Option::None,
660 })
661 }
662
663 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
664 /// to hold a `OracleRdbms`.
665 ///
666 /// Note that all the setters affecting `data_object` are
667 /// mutually exclusive.
668 ///
669 /// # Example
670 /// ```ignore,no_run
671 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
672 /// use google_cloud_datastream_v1::model::OracleRdbms;
673 /// let x = DiscoverConnectionProfileResponse::new().set_oracle_rdbms(OracleRdbms::default()/* use setters */);
674 /// assert!(x.oracle_rdbms().is_some());
675 /// assert!(x.mysql_rdbms().is_none());
676 /// assert!(x.postgresql_rdbms().is_none());
677 /// assert!(x.sql_server_rdbms().is_none());
678 /// assert!(x.salesforce_org().is_none());
679 /// assert!(x.mongodb_cluster().is_none());
680 /// ```
681 pub fn set_oracle_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>>(
682 mut self,
683 v: T,
684 ) -> Self {
685 self.data_object = std::option::Option::Some(
686 crate::model::discover_connection_profile_response::DataObject::OracleRdbms(v.into()),
687 );
688 self
689 }
690
691 /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
692 /// if it holds a `MysqlRdbms`, `None` if the field is not set or
693 /// holds a different branch.
694 pub fn mysql_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
695 #[allow(unreachable_patterns)]
696 self.data_object.as_ref().and_then(|v| match v {
697 crate::model::discover_connection_profile_response::DataObject::MysqlRdbms(v) => {
698 std::option::Option::Some(v)
699 }
700 _ => std::option::Option::None,
701 })
702 }
703
704 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
705 /// to hold a `MysqlRdbms`.
706 ///
707 /// Note that all the setters affecting `data_object` are
708 /// mutually exclusive.
709 ///
710 /// # Example
711 /// ```ignore,no_run
712 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
713 /// use google_cloud_datastream_v1::model::MysqlRdbms;
714 /// let x = DiscoverConnectionProfileResponse::new().set_mysql_rdbms(MysqlRdbms::default()/* use setters */);
715 /// assert!(x.mysql_rdbms().is_some());
716 /// assert!(x.oracle_rdbms().is_none());
717 /// assert!(x.postgresql_rdbms().is_none());
718 /// assert!(x.sql_server_rdbms().is_none());
719 /// assert!(x.salesforce_org().is_none());
720 /// assert!(x.mongodb_cluster().is_none());
721 /// ```
722 pub fn set_mysql_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>>(
723 mut self,
724 v: T,
725 ) -> Self {
726 self.data_object = std::option::Option::Some(
727 crate::model::discover_connection_profile_response::DataObject::MysqlRdbms(v.into()),
728 );
729 self
730 }
731
732 /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
733 /// if it holds a `PostgresqlRdbms`, `None` if the field is not set or
734 /// holds a different branch.
735 pub fn postgresql_rdbms(
736 &self,
737 ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
738 #[allow(unreachable_patterns)]
739 self.data_object.as_ref().and_then(|v| match v {
740 crate::model::discover_connection_profile_response::DataObject::PostgresqlRdbms(v) => {
741 std::option::Option::Some(v)
742 }
743 _ => std::option::Option::None,
744 })
745 }
746
747 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
748 /// to hold a `PostgresqlRdbms`.
749 ///
750 /// Note that all the setters affecting `data_object` are
751 /// mutually exclusive.
752 ///
753 /// # Example
754 /// ```ignore,no_run
755 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
756 /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
757 /// let x = DiscoverConnectionProfileResponse::new().set_postgresql_rdbms(PostgresqlRdbms::default()/* use setters */);
758 /// assert!(x.postgresql_rdbms().is_some());
759 /// assert!(x.oracle_rdbms().is_none());
760 /// assert!(x.mysql_rdbms().is_none());
761 /// assert!(x.sql_server_rdbms().is_none());
762 /// assert!(x.salesforce_org().is_none());
763 /// assert!(x.mongodb_cluster().is_none());
764 /// ```
765 pub fn set_postgresql_rdbms<
766 T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
767 >(
768 mut self,
769 v: T,
770 ) -> Self {
771 self.data_object = std::option::Option::Some(
772 crate::model::discover_connection_profile_response::DataObject::PostgresqlRdbms(
773 v.into(),
774 ),
775 );
776 self
777 }
778
779 /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
780 /// if it holds a `SqlServerRdbms`, `None` if the field is not set or
781 /// holds a different branch.
782 pub fn sql_server_rdbms(
783 &self,
784 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
785 #[allow(unreachable_patterns)]
786 self.data_object.as_ref().and_then(|v| match v {
787 crate::model::discover_connection_profile_response::DataObject::SqlServerRdbms(v) => {
788 std::option::Option::Some(v)
789 }
790 _ => std::option::Option::None,
791 })
792 }
793
794 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
795 /// to hold a `SqlServerRdbms`.
796 ///
797 /// Note that all the setters affecting `data_object` are
798 /// mutually exclusive.
799 ///
800 /// # Example
801 /// ```ignore,no_run
802 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
803 /// use google_cloud_datastream_v1::model::SqlServerRdbms;
804 /// let x = DiscoverConnectionProfileResponse::new().set_sql_server_rdbms(SqlServerRdbms::default()/* use setters */);
805 /// assert!(x.sql_server_rdbms().is_some());
806 /// assert!(x.oracle_rdbms().is_none());
807 /// assert!(x.mysql_rdbms().is_none());
808 /// assert!(x.postgresql_rdbms().is_none());
809 /// assert!(x.salesforce_org().is_none());
810 /// assert!(x.mongodb_cluster().is_none());
811 /// ```
812 pub fn set_sql_server_rdbms<
813 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
814 >(
815 mut self,
816 v: T,
817 ) -> Self {
818 self.data_object = std::option::Option::Some(
819 crate::model::discover_connection_profile_response::DataObject::SqlServerRdbms(
820 v.into(),
821 ),
822 );
823 self
824 }
825
826 /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
827 /// if it holds a `SalesforceOrg`, `None` if the field is not set or
828 /// holds a different branch.
829 pub fn salesforce_org(
830 &self,
831 ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceOrg>> {
832 #[allow(unreachable_patterns)]
833 self.data_object.as_ref().and_then(|v| match v {
834 crate::model::discover_connection_profile_response::DataObject::SalesforceOrg(v) => {
835 std::option::Option::Some(v)
836 }
837 _ => std::option::Option::None,
838 })
839 }
840
841 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
842 /// to hold a `SalesforceOrg`.
843 ///
844 /// Note that all the setters affecting `data_object` are
845 /// mutually exclusive.
846 ///
847 /// # Example
848 /// ```ignore,no_run
849 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
850 /// use google_cloud_datastream_v1::model::SalesforceOrg;
851 /// let x = DiscoverConnectionProfileResponse::new().set_salesforce_org(SalesforceOrg::default()/* use setters */);
852 /// assert!(x.salesforce_org().is_some());
853 /// assert!(x.oracle_rdbms().is_none());
854 /// assert!(x.mysql_rdbms().is_none());
855 /// assert!(x.postgresql_rdbms().is_none());
856 /// assert!(x.sql_server_rdbms().is_none());
857 /// assert!(x.mongodb_cluster().is_none());
858 /// ```
859 pub fn set_salesforce_org<
860 T: std::convert::Into<std::boxed::Box<crate::model::SalesforceOrg>>,
861 >(
862 mut self,
863 v: T,
864 ) -> Self {
865 self.data_object = std::option::Option::Some(
866 crate::model::discover_connection_profile_response::DataObject::SalesforceOrg(v.into()),
867 );
868 self
869 }
870
871 /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
872 /// if it holds a `MongodbCluster`, `None` if the field is not set or
873 /// holds a different branch.
874 pub fn mongodb_cluster(
875 &self,
876 ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbCluster>> {
877 #[allow(unreachable_patterns)]
878 self.data_object.as_ref().and_then(|v| match v {
879 crate::model::discover_connection_profile_response::DataObject::MongodbCluster(v) => {
880 std::option::Option::Some(v)
881 }
882 _ => std::option::Option::None,
883 })
884 }
885
886 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
887 /// to hold a `MongodbCluster`.
888 ///
889 /// Note that all the setters affecting `data_object` are
890 /// mutually exclusive.
891 ///
892 /// # Example
893 /// ```ignore,no_run
894 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
895 /// use google_cloud_datastream_v1::model::MongodbCluster;
896 /// let x = DiscoverConnectionProfileResponse::new().set_mongodb_cluster(MongodbCluster::default()/* use setters */);
897 /// assert!(x.mongodb_cluster().is_some());
898 /// assert!(x.oracle_rdbms().is_none());
899 /// assert!(x.mysql_rdbms().is_none());
900 /// assert!(x.postgresql_rdbms().is_none());
901 /// assert!(x.sql_server_rdbms().is_none());
902 /// assert!(x.salesforce_org().is_none());
903 /// ```
904 pub fn set_mongodb_cluster<
905 T: std::convert::Into<std::boxed::Box<crate::model::MongodbCluster>>,
906 >(
907 mut self,
908 v: T,
909 ) -> Self {
910 self.data_object = std::option::Option::Some(
911 crate::model::discover_connection_profile_response::DataObject::MongodbCluster(
912 v.into(),
913 ),
914 );
915 self
916 }
917}
918
919impl wkt::message::Message for DiscoverConnectionProfileResponse {
920 fn typename() -> &'static str {
921 "type.googleapis.com/google.cloud.datastream.v1.DiscoverConnectionProfileResponse"
922 }
923}
924
925/// Defines additional types related to [DiscoverConnectionProfileResponse].
926pub mod discover_connection_profile_response {
927 #[allow(unused_imports)]
928 use super::*;
929
930 /// The data object that has been enriched by the discover API call.
931 #[derive(Clone, Debug, PartialEq)]
932 #[non_exhaustive]
933 pub enum DataObject {
934 /// Enriched Oracle RDBMS object.
935 OracleRdbms(std::boxed::Box<crate::model::OracleRdbms>),
936 /// Enriched MySQL RDBMS object.
937 MysqlRdbms(std::boxed::Box<crate::model::MysqlRdbms>),
938 /// Enriched PostgreSQL RDBMS object.
939 PostgresqlRdbms(std::boxed::Box<crate::model::PostgresqlRdbms>),
940 /// Enriched SQLServer RDBMS object.
941 SqlServerRdbms(std::boxed::Box<crate::model::SqlServerRdbms>),
942 /// Enriched Salesforce organization.
943 SalesforceOrg(std::boxed::Box<crate::model::SalesforceOrg>),
944 /// Enriched MongoDB cluster.
945 MongodbCluster(std::boxed::Box<crate::model::MongodbCluster>),
946 }
947}
948
949/// Request message for 'FetchStaticIps' request.
950#[derive(Clone, Default, PartialEq)]
951#[non_exhaustive]
952pub struct FetchStaticIpsRequest {
953 /// Required. The resource name for the location for which static IPs should be
954 /// returned. Must be in the format `projects/*/locations/*`.
955 pub name: std::string::String,
956
957 /// Maximum number of Ips to return, will likely not be specified.
958 pub page_size: i32,
959
960 /// A page token, received from a previous `ListStaticIps` call.
961 /// will likely not be specified.
962 pub page_token: std::string::String,
963
964 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
965}
966
967impl FetchStaticIpsRequest {
968 /// Creates a new default instance.
969 pub fn new() -> Self {
970 std::default::Default::default()
971 }
972
973 /// Sets the value of [name][crate::model::FetchStaticIpsRequest::name].
974 ///
975 /// # Example
976 /// ```ignore,no_run
977 /// # use google_cloud_datastream_v1::model::FetchStaticIpsRequest;
978 /// let x = FetchStaticIpsRequest::new().set_name("example");
979 /// ```
980 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
981 self.name = v.into();
982 self
983 }
984
985 /// Sets the value of [page_size][crate::model::FetchStaticIpsRequest::page_size].
986 ///
987 /// # Example
988 /// ```ignore,no_run
989 /// # use google_cloud_datastream_v1::model::FetchStaticIpsRequest;
990 /// let x = FetchStaticIpsRequest::new().set_page_size(42);
991 /// ```
992 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
993 self.page_size = v.into();
994 self
995 }
996
997 /// Sets the value of [page_token][crate::model::FetchStaticIpsRequest::page_token].
998 ///
999 /// # Example
1000 /// ```ignore,no_run
1001 /// # use google_cloud_datastream_v1::model::FetchStaticIpsRequest;
1002 /// let x = FetchStaticIpsRequest::new().set_page_token("example");
1003 /// ```
1004 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1005 self.page_token = v.into();
1006 self
1007 }
1008}
1009
1010impl wkt::message::Message for FetchStaticIpsRequest {
1011 fn typename() -> &'static str {
1012 "type.googleapis.com/google.cloud.datastream.v1.FetchStaticIpsRequest"
1013 }
1014}
1015
1016/// Response message for a 'FetchStaticIps' response.
1017#[derive(Clone, Default, PartialEq)]
1018#[non_exhaustive]
1019pub struct FetchStaticIpsResponse {
1020 /// list of static ips by account
1021 pub static_ips: std::vec::Vec<std::string::String>,
1022
1023 /// A token that can be sent as `page_token` to retrieve the next page.
1024 /// If this field is omitted, there are no subsequent pages.
1025 pub next_page_token: std::string::String,
1026
1027 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1028}
1029
1030impl FetchStaticIpsResponse {
1031 /// Creates a new default instance.
1032 pub fn new() -> Self {
1033 std::default::Default::default()
1034 }
1035
1036 /// Sets the value of [static_ips][crate::model::FetchStaticIpsResponse::static_ips].
1037 ///
1038 /// # Example
1039 /// ```ignore,no_run
1040 /// # use google_cloud_datastream_v1::model::FetchStaticIpsResponse;
1041 /// let x = FetchStaticIpsResponse::new().set_static_ips(["a", "b", "c"]);
1042 /// ```
1043 pub fn set_static_ips<T, V>(mut self, v: T) -> Self
1044 where
1045 T: std::iter::IntoIterator<Item = V>,
1046 V: std::convert::Into<std::string::String>,
1047 {
1048 use std::iter::Iterator;
1049 self.static_ips = v.into_iter().map(|i| i.into()).collect();
1050 self
1051 }
1052
1053 /// Sets the value of [next_page_token][crate::model::FetchStaticIpsResponse::next_page_token].
1054 ///
1055 /// # Example
1056 /// ```ignore,no_run
1057 /// # use google_cloud_datastream_v1::model::FetchStaticIpsResponse;
1058 /// let x = FetchStaticIpsResponse::new().set_next_page_token("example");
1059 /// ```
1060 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1061 self.next_page_token = v.into();
1062 self
1063 }
1064}
1065
1066impl wkt::message::Message for FetchStaticIpsResponse {
1067 fn typename() -> &'static str {
1068 "type.googleapis.com/google.cloud.datastream.v1.FetchStaticIpsResponse"
1069 }
1070}
1071
1072/// Request message for listing connection profiles.
1073#[derive(Clone, Default, PartialEq)]
1074#[non_exhaustive]
1075pub struct ListConnectionProfilesRequest {
1076 /// Required. The parent that owns the collection of connection profiles.
1077 pub parent: std::string::String,
1078
1079 /// Maximum number of connection profiles to return.
1080 /// If unspecified, at most 50 connection profiles will be returned.
1081 /// The maximum value is 1000; values above 1000 will be coerced to 1000.
1082 pub page_size: i32,
1083
1084 /// Page token received from a previous `ListConnectionProfiles` call.
1085 /// Provide this to retrieve the subsequent page.
1086 ///
1087 /// When paginating, all other parameters provided to `ListConnectionProfiles`
1088 /// must match the call that provided the page token.
1089 pub page_token: std::string::String,
1090
1091 /// Filter request.
1092 pub filter: std::string::String,
1093
1094 /// Order by fields for the result.
1095 pub order_by: std::string::String,
1096
1097 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1098}
1099
1100impl ListConnectionProfilesRequest {
1101 /// Creates a new default instance.
1102 pub fn new() -> Self {
1103 std::default::Default::default()
1104 }
1105
1106 /// Sets the value of [parent][crate::model::ListConnectionProfilesRequest::parent].
1107 ///
1108 /// # Example
1109 /// ```ignore,no_run
1110 /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1111 /// let x = ListConnectionProfilesRequest::new().set_parent("example");
1112 /// ```
1113 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1114 self.parent = v.into();
1115 self
1116 }
1117
1118 /// Sets the value of [page_size][crate::model::ListConnectionProfilesRequest::page_size].
1119 ///
1120 /// # Example
1121 /// ```ignore,no_run
1122 /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1123 /// let x = ListConnectionProfilesRequest::new().set_page_size(42);
1124 /// ```
1125 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1126 self.page_size = v.into();
1127 self
1128 }
1129
1130 /// Sets the value of [page_token][crate::model::ListConnectionProfilesRequest::page_token].
1131 ///
1132 /// # Example
1133 /// ```ignore,no_run
1134 /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1135 /// let x = ListConnectionProfilesRequest::new().set_page_token("example");
1136 /// ```
1137 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1138 self.page_token = v.into();
1139 self
1140 }
1141
1142 /// Sets the value of [filter][crate::model::ListConnectionProfilesRequest::filter].
1143 ///
1144 /// # Example
1145 /// ```ignore,no_run
1146 /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1147 /// let x = ListConnectionProfilesRequest::new().set_filter("example");
1148 /// ```
1149 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1150 self.filter = v.into();
1151 self
1152 }
1153
1154 /// Sets the value of [order_by][crate::model::ListConnectionProfilesRequest::order_by].
1155 ///
1156 /// # Example
1157 /// ```ignore,no_run
1158 /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1159 /// let x = ListConnectionProfilesRequest::new().set_order_by("example");
1160 /// ```
1161 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1162 self.order_by = v.into();
1163 self
1164 }
1165}
1166
1167impl wkt::message::Message for ListConnectionProfilesRequest {
1168 fn typename() -> &'static str {
1169 "type.googleapis.com/google.cloud.datastream.v1.ListConnectionProfilesRequest"
1170 }
1171}
1172
1173/// Response message for listing connection profiles.
1174#[derive(Clone, Default, PartialEq)]
1175#[non_exhaustive]
1176pub struct ListConnectionProfilesResponse {
1177 /// List of connection profiles.
1178 pub connection_profiles: std::vec::Vec<crate::model::ConnectionProfile>,
1179
1180 /// A token, which can be sent as `page_token` to retrieve the next page.
1181 /// If this field is omitted, there are no subsequent pages.
1182 pub next_page_token: std::string::String,
1183
1184 /// Locations that could not be reached.
1185 pub unreachable: std::vec::Vec<std::string::String>,
1186
1187 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1188}
1189
1190impl ListConnectionProfilesResponse {
1191 /// Creates a new default instance.
1192 pub fn new() -> Self {
1193 std::default::Default::default()
1194 }
1195
1196 /// Sets the value of [connection_profiles][crate::model::ListConnectionProfilesResponse::connection_profiles].
1197 ///
1198 /// # Example
1199 /// ```ignore,no_run
1200 /// # use google_cloud_datastream_v1::model::ListConnectionProfilesResponse;
1201 /// use google_cloud_datastream_v1::model::ConnectionProfile;
1202 /// let x = ListConnectionProfilesResponse::new()
1203 /// .set_connection_profiles([
1204 /// ConnectionProfile::default()/* use setters */,
1205 /// ConnectionProfile::default()/* use (different) setters */,
1206 /// ]);
1207 /// ```
1208 pub fn set_connection_profiles<T, V>(mut self, v: T) -> Self
1209 where
1210 T: std::iter::IntoIterator<Item = V>,
1211 V: std::convert::Into<crate::model::ConnectionProfile>,
1212 {
1213 use std::iter::Iterator;
1214 self.connection_profiles = v.into_iter().map(|i| i.into()).collect();
1215 self
1216 }
1217
1218 /// Sets the value of [next_page_token][crate::model::ListConnectionProfilesResponse::next_page_token].
1219 ///
1220 /// # Example
1221 /// ```ignore,no_run
1222 /// # use google_cloud_datastream_v1::model::ListConnectionProfilesResponse;
1223 /// let x = ListConnectionProfilesResponse::new().set_next_page_token("example");
1224 /// ```
1225 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1226 self.next_page_token = v.into();
1227 self
1228 }
1229
1230 /// Sets the value of [unreachable][crate::model::ListConnectionProfilesResponse::unreachable].
1231 ///
1232 /// # Example
1233 /// ```ignore,no_run
1234 /// # use google_cloud_datastream_v1::model::ListConnectionProfilesResponse;
1235 /// let x = ListConnectionProfilesResponse::new().set_unreachable(["a", "b", "c"]);
1236 /// ```
1237 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1238 where
1239 T: std::iter::IntoIterator<Item = V>,
1240 V: std::convert::Into<std::string::String>,
1241 {
1242 use std::iter::Iterator;
1243 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1244 self
1245 }
1246}
1247
1248impl wkt::message::Message for ListConnectionProfilesResponse {
1249 fn typename() -> &'static str {
1250 "type.googleapis.com/google.cloud.datastream.v1.ListConnectionProfilesResponse"
1251 }
1252}
1253
1254#[doc(hidden)]
1255impl google_cloud_gax::paginator::internal::PageableResponse for ListConnectionProfilesResponse {
1256 type PageItem = crate::model::ConnectionProfile;
1257
1258 fn items(self) -> std::vec::Vec<Self::PageItem> {
1259 self.connection_profiles
1260 }
1261
1262 fn next_page_token(&self) -> std::string::String {
1263 use std::clone::Clone;
1264 self.next_page_token.clone()
1265 }
1266}
1267
1268/// Request message for getting a connection profile.
1269#[derive(Clone, Default, PartialEq)]
1270#[non_exhaustive]
1271pub struct GetConnectionProfileRequest {
1272 /// Required. The name of the connection profile resource to get.
1273 pub name: std::string::String,
1274
1275 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1276}
1277
1278impl GetConnectionProfileRequest {
1279 /// Creates a new default instance.
1280 pub fn new() -> Self {
1281 std::default::Default::default()
1282 }
1283
1284 /// Sets the value of [name][crate::model::GetConnectionProfileRequest::name].
1285 ///
1286 /// # Example
1287 /// ```ignore,no_run
1288 /// # use google_cloud_datastream_v1::model::GetConnectionProfileRequest;
1289 /// let x = GetConnectionProfileRequest::new().set_name("example");
1290 /// ```
1291 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1292 self.name = v.into();
1293 self
1294 }
1295}
1296
1297impl wkt::message::Message for GetConnectionProfileRequest {
1298 fn typename() -> &'static str {
1299 "type.googleapis.com/google.cloud.datastream.v1.GetConnectionProfileRequest"
1300 }
1301}
1302
1303/// Request message for creating a connection profile.
1304#[derive(Clone, Default, PartialEq)]
1305#[non_exhaustive]
1306pub struct CreateConnectionProfileRequest {
1307 /// Required. The parent that owns the collection of ConnectionProfiles.
1308 pub parent: std::string::String,
1309
1310 /// Required. The connection profile identifier.
1311 pub connection_profile_id: std::string::String,
1312
1313 /// Required. The connection profile resource to create.
1314 pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
1315
1316 /// Optional. A request ID to identify requests. Specify a unique request ID
1317 /// so that if you must retry your request, the server will know to ignore
1318 /// the request if it has already been completed. The server will guarantee
1319 /// that for at least 60 minutes since the first request.
1320 ///
1321 /// For example, consider a situation where you make an initial request and the
1322 /// request times out. If you make the request again with the same request ID,
1323 /// the server can check if original operation with the same request ID was
1324 /// received, and if so, will ignore the second request. This prevents clients
1325 /// from accidentally creating duplicate commitments.
1326 ///
1327 /// The request ID must be a valid UUID with the exception that zero UUID is
1328 /// not supported (00000000-0000-0000-0000-000000000000).
1329 pub request_id: std::string::String,
1330
1331 /// Optional. Only validate the connection profile, but don't create any
1332 /// resources. The default is false.
1333 pub validate_only: bool,
1334
1335 /// Optional. Create the connection profile without validating it.
1336 pub force: bool,
1337
1338 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1339}
1340
1341impl CreateConnectionProfileRequest {
1342 /// Creates a new default instance.
1343 pub fn new() -> Self {
1344 std::default::Default::default()
1345 }
1346
1347 /// Sets the value of [parent][crate::model::CreateConnectionProfileRequest::parent].
1348 ///
1349 /// # Example
1350 /// ```ignore,no_run
1351 /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1352 /// let x = CreateConnectionProfileRequest::new().set_parent("example");
1353 /// ```
1354 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1355 self.parent = v.into();
1356 self
1357 }
1358
1359 /// Sets the value of [connection_profile_id][crate::model::CreateConnectionProfileRequest::connection_profile_id].
1360 ///
1361 /// # Example
1362 /// ```ignore,no_run
1363 /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1364 /// let x = CreateConnectionProfileRequest::new().set_connection_profile_id("example");
1365 /// ```
1366 pub fn set_connection_profile_id<T: std::convert::Into<std::string::String>>(
1367 mut self,
1368 v: T,
1369 ) -> Self {
1370 self.connection_profile_id = v.into();
1371 self
1372 }
1373
1374 /// Sets the value of [connection_profile][crate::model::CreateConnectionProfileRequest::connection_profile].
1375 ///
1376 /// # Example
1377 /// ```ignore,no_run
1378 /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1379 /// use google_cloud_datastream_v1::model::ConnectionProfile;
1380 /// let x = CreateConnectionProfileRequest::new().set_connection_profile(ConnectionProfile::default()/* use setters */);
1381 /// ```
1382 pub fn set_connection_profile<T>(mut self, v: T) -> Self
1383 where
1384 T: std::convert::Into<crate::model::ConnectionProfile>,
1385 {
1386 self.connection_profile = std::option::Option::Some(v.into());
1387 self
1388 }
1389
1390 /// Sets or clears the value of [connection_profile][crate::model::CreateConnectionProfileRequest::connection_profile].
1391 ///
1392 /// # Example
1393 /// ```ignore,no_run
1394 /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1395 /// use google_cloud_datastream_v1::model::ConnectionProfile;
1396 /// let x = CreateConnectionProfileRequest::new().set_or_clear_connection_profile(Some(ConnectionProfile::default()/* use setters */));
1397 /// let x = CreateConnectionProfileRequest::new().set_or_clear_connection_profile(None::<ConnectionProfile>);
1398 /// ```
1399 pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
1400 where
1401 T: std::convert::Into<crate::model::ConnectionProfile>,
1402 {
1403 self.connection_profile = v.map(|x| x.into());
1404 self
1405 }
1406
1407 /// Sets the value of [request_id][crate::model::CreateConnectionProfileRequest::request_id].
1408 ///
1409 /// # Example
1410 /// ```ignore,no_run
1411 /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1412 /// let x = CreateConnectionProfileRequest::new().set_request_id("example");
1413 /// ```
1414 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1415 self.request_id = v.into();
1416 self
1417 }
1418
1419 /// Sets the value of [validate_only][crate::model::CreateConnectionProfileRequest::validate_only].
1420 ///
1421 /// # Example
1422 /// ```ignore,no_run
1423 /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1424 /// let x = CreateConnectionProfileRequest::new().set_validate_only(true);
1425 /// ```
1426 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1427 self.validate_only = v.into();
1428 self
1429 }
1430
1431 /// Sets the value of [force][crate::model::CreateConnectionProfileRequest::force].
1432 ///
1433 /// # Example
1434 /// ```ignore,no_run
1435 /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1436 /// let x = CreateConnectionProfileRequest::new().set_force(true);
1437 /// ```
1438 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1439 self.force = v.into();
1440 self
1441 }
1442}
1443
1444impl wkt::message::Message for CreateConnectionProfileRequest {
1445 fn typename() -> &'static str {
1446 "type.googleapis.com/google.cloud.datastream.v1.CreateConnectionProfileRequest"
1447 }
1448}
1449
1450/// Connection profile update message.
1451#[derive(Clone, Default, PartialEq)]
1452#[non_exhaustive]
1453pub struct UpdateConnectionProfileRequest {
1454 /// Optional. Field mask is used to specify the fields to be overwritten in the
1455 /// ConnectionProfile resource by the update.
1456 /// The fields specified in the update_mask are relative to the resource, not
1457 /// the full request. A field will be overwritten if it is in the mask. If the
1458 /// user does not provide a mask then all fields will be overwritten.
1459 pub update_mask: std::option::Option<wkt::FieldMask>,
1460
1461 /// Required. The connection profile to update.
1462 pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
1463
1464 /// Optional. A request ID to identify requests. Specify a unique request ID
1465 /// so that if you must retry your request, the server will know to ignore
1466 /// the request if it has already been completed. The server will guarantee
1467 /// that for at least 60 minutes since the first request.
1468 ///
1469 /// For example, consider a situation where you make an initial request and the
1470 /// request times out. If you make the request again with the same request ID,
1471 /// the server can check if original operation with the same request ID was
1472 /// received, and if so, will ignore the second request. This prevents clients
1473 /// from accidentally creating duplicate commitments.
1474 ///
1475 /// The request ID must be a valid UUID with the exception that zero UUID is
1476 /// not supported (00000000-0000-0000-0000-000000000000).
1477 pub request_id: std::string::String,
1478
1479 /// Optional. Only validate the connection profile, but don't update any
1480 /// resources. The default is false.
1481 pub validate_only: bool,
1482
1483 /// Optional. Update the connection profile without validating it.
1484 pub force: bool,
1485
1486 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1487}
1488
1489impl UpdateConnectionProfileRequest {
1490 /// Creates a new default instance.
1491 pub fn new() -> Self {
1492 std::default::Default::default()
1493 }
1494
1495 /// Sets the value of [update_mask][crate::model::UpdateConnectionProfileRequest::update_mask].
1496 ///
1497 /// # Example
1498 /// ```ignore,no_run
1499 /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1500 /// use wkt::FieldMask;
1501 /// let x = UpdateConnectionProfileRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1502 /// ```
1503 pub fn set_update_mask<T>(mut self, v: T) -> Self
1504 where
1505 T: std::convert::Into<wkt::FieldMask>,
1506 {
1507 self.update_mask = std::option::Option::Some(v.into());
1508 self
1509 }
1510
1511 /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionProfileRequest::update_mask].
1512 ///
1513 /// # Example
1514 /// ```ignore,no_run
1515 /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1516 /// use wkt::FieldMask;
1517 /// let x = UpdateConnectionProfileRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1518 /// let x = UpdateConnectionProfileRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1519 /// ```
1520 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1521 where
1522 T: std::convert::Into<wkt::FieldMask>,
1523 {
1524 self.update_mask = v.map(|x| x.into());
1525 self
1526 }
1527
1528 /// Sets the value of [connection_profile][crate::model::UpdateConnectionProfileRequest::connection_profile].
1529 ///
1530 /// # Example
1531 /// ```ignore,no_run
1532 /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1533 /// use google_cloud_datastream_v1::model::ConnectionProfile;
1534 /// let x = UpdateConnectionProfileRequest::new().set_connection_profile(ConnectionProfile::default()/* use setters */);
1535 /// ```
1536 pub fn set_connection_profile<T>(mut self, v: T) -> Self
1537 where
1538 T: std::convert::Into<crate::model::ConnectionProfile>,
1539 {
1540 self.connection_profile = std::option::Option::Some(v.into());
1541 self
1542 }
1543
1544 /// Sets or clears the value of [connection_profile][crate::model::UpdateConnectionProfileRequest::connection_profile].
1545 ///
1546 /// # Example
1547 /// ```ignore,no_run
1548 /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1549 /// use google_cloud_datastream_v1::model::ConnectionProfile;
1550 /// let x = UpdateConnectionProfileRequest::new().set_or_clear_connection_profile(Some(ConnectionProfile::default()/* use setters */));
1551 /// let x = UpdateConnectionProfileRequest::new().set_or_clear_connection_profile(None::<ConnectionProfile>);
1552 /// ```
1553 pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
1554 where
1555 T: std::convert::Into<crate::model::ConnectionProfile>,
1556 {
1557 self.connection_profile = v.map(|x| x.into());
1558 self
1559 }
1560
1561 /// Sets the value of [request_id][crate::model::UpdateConnectionProfileRequest::request_id].
1562 ///
1563 /// # Example
1564 /// ```ignore,no_run
1565 /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1566 /// let x = UpdateConnectionProfileRequest::new().set_request_id("example");
1567 /// ```
1568 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1569 self.request_id = v.into();
1570 self
1571 }
1572
1573 /// Sets the value of [validate_only][crate::model::UpdateConnectionProfileRequest::validate_only].
1574 ///
1575 /// # Example
1576 /// ```ignore,no_run
1577 /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1578 /// let x = UpdateConnectionProfileRequest::new().set_validate_only(true);
1579 /// ```
1580 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1581 self.validate_only = v.into();
1582 self
1583 }
1584
1585 /// Sets the value of [force][crate::model::UpdateConnectionProfileRequest::force].
1586 ///
1587 /// # Example
1588 /// ```ignore,no_run
1589 /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1590 /// let x = UpdateConnectionProfileRequest::new().set_force(true);
1591 /// ```
1592 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1593 self.force = v.into();
1594 self
1595 }
1596}
1597
1598impl wkt::message::Message for UpdateConnectionProfileRequest {
1599 fn typename() -> &'static str {
1600 "type.googleapis.com/google.cloud.datastream.v1.UpdateConnectionProfileRequest"
1601 }
1602}
1603
1604/// Request message for deleting a connection profile.
1605#[derive(Clone, Default, PartialEq)]
1606#[non_exhaustive]
1607pub struct DeleteConnectionProfileRequest {
1608 /// Required. The name of the connection profile resource to delete.
1609 pub name: std::string::String,
1610
1611 /// Optional. A request ID to identify requests. Specify a unique request ID
1612 /// so that if you must retry your request, the server will know to ignore
1613 /// the request if it has already been completed. The server will guarantee
1614 /// that for at least 60 minutes after the first request.
1615 ///
1616 /// For example, consider a situation where you make an initial request and the
1617 /// request times out. If you make the request again with the same request ID,
1618 /// the server can check if original operation with the same request ID was
1619 /// received, and if so, will ignore the second request. This prevents clients
1620 /// from accidentally creating duplicate commitments.
1621 ///
1622 /// The request ID must be a valid UUID with the exception that zero UUID is
1623 /// not supported (00000000-0000-0000-0000-000000000000).
1624 pub request_id: std::string::String,
1625
1626 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1627}
1628
1629impl DeleteConnectionProfileRequest {
1630 /// Creates a new default instance.
1631 pub fn new() -> Self {
1632 std::default::Default::default()
1633 }
1634
1635 /// Sets the value of [name][crate::model::DeleteConnectionProfileRequest::name].
1636 ///
1637 /// # Example
1638 /// ```ignore,no_run
1639 /// # use google_cloud_datastream_v1::model::DeleteConnectionProfileRequest;
1640 /// let x = DeleteConnectionProfileRequest::new().set_name("example");
1641 /// ```
1642 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1643 self.name = v.into();
1644 self
1645 }
1646
1647 /// Sets the value of [request_id][crate::model::DeleteConnectionProfileRequest::request_id].
1648 ///
1649 /// # Example
1650 /// ```ignore,no_run
1651 /// # use google_cloud_datastream_v1::model::DeleteConnectionProfileRequest;
1652 /// let x = DeleteConnectionProfileRequest::new().set_request_id("example");
1653 /// ```
1654 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1655 self.request_id = v.into();
1656 self
1657 }
1658}
1659
1660impl wkt::message::Message for DeleteConnectionProfileRequest {
1661 fn typename() -> &'static str {
1662 "type.googleapis.com/google.cloud.datastream.v1.DeleteConnectionProfileRequest"
1663 }
1664}
1665
1666/// Request message for listing streams.
1667#[derive(Clone, Default, PartialEq)]
1668#[non_exhaustive]
1669pub struct ListStreamsRequest {
1670 /// Required. The parent that owns the collection of streams.
1671 pub parent: std::string::String,
1672
1673 /// Maximum number of streams to return.
1674 /// If unspecified, at most 50 streams will be returned. The maximum
1675 /// value is 1000; values above 1000 will be coerced to 1000.
1676 pub page_size: i32,
1677
1678 /// Page token received from a previous `ListStreams` call.
1679 /// Provide this to retrieve the subsequent page.
1680 ///
1681 /// When paginating, all other parameters provided to `ListStreams`
1682 /// must match the call that provided the page token.
1683 pub page_token: std::string::String,
1684
1685 /// Filter request.
1686 pub filter: std::string::String,
1687
1688 /// Order by fields for the result.
1689 pub order_by: std::string::String,
1690
1691 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1692}
1693
1694impl ListStreamsRequest {
1695 /// Creates a new default instance.
1696 pub fn new() -> Self {
1697 std::default::Default::default()
1698 }
1699
1700 /// Sets the value of [parent][crate::model::ListStreamsRequest::parent].
1701 ///
1702 /// # Example
1703 /// ```ignore,no_run
1704 /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1705 /// let x = ListStreamsRequest::new().set_parent("example");
1706 /// ```
1707 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1708 self.parent = v.into();
1709 self
1710 }
1711
1712 /// Sets the value of [page_size][crate::model::ListStreamsRequest::page_size].
1713 ///
1714 /// # Example
1715 /// ```ignore,no_run
1716 /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1717 /// let x = ListStreamsRequest::new().set_page_size(42);
1718 /// ```
1719 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1720 self.page_size = v.into();
1721 self
1722 }
1723
1724 /// Sets the value of [page_token][crate::model::ListStreamsRequest::page_token].
1725 ///
1726 /// # Example
1727 /// ```ignore,no_run
1728 /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1729 /// let x = ListStreamsRequest::new().set_page_token("example");
1730 /// ```
1731 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1732 self.page_token = v.into();
1733 self
1734 }
1735
1736 /// Sets the value of [filter][crate::model::ListStreamsRequest::filter].
1737 ///
1738 /// # Example
1739 /// ```ignore,no_run
1740 /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1741 /// let x = ListStreamsRequest::new().set_filter("example");
1742 /// ```
1743 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1744 self.filter = v.into();
1745 self
1746 }
1747
1748 /// Sets the value of [order_by][crate::model::ListStreamsRequest::order_by].
1749 ///
1750 /// # Example
1751 /// ```ignore,no_run
1752 /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1753 /// let x = ListStreamsRequest::new().set_order_by("example");
1754 /// ```
1755 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1756 self.order_by = v.into();
1757 self
1758 }
1759}
1760
1761impl wkt::message::Message for ListStreamsRequest {
1762 fn typename() -> &'static str {
1763 "type.googleapis.com/google.cloud.datastream.v1.ListStreamsRequest"
1764 }
1765}
1766
1767/// Response message for listing streams.
1768#[derive(Clone, Default, PartialEq)]
1769#[non_exhaustive]
1770pub struct ListStreamsResponse {
1771 /// List of streams
1772 pub streams: std::vec::Vec<crate::model::Stream>,
1773
1774 /// A token, which can be sent as `page_token` to retrieve the next page.
1775 /// If this field is omitted, there are no subsequent pages.
1776 pub next_page_token: std::string::String,
1777
1778 /// Locations that could not be reached.
1779 pub unreachable: std::vec::Vec<std::string::String>,
1780
1781 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1782}
1783
1784impl ListStreamsResponse {
1785 /// Creates a new default instance.
1786 pub fn new() -> Self {
1787 std::default::Default::default()
1788 }
1789
1790 /// Sets the value of [streams][crate::model::ListStreamsResponse::streams].
1791 ///
1792 /// # Example
1793 /// ```ignore,no_run
1794 /// # use google_cloud_datastream_v1::model::ListStreamsResponse;
1795 /// use google_cloud_datastream_v1::model::Stream;
1796 /// let x = ListStreamsResponse::new()
1797 /// .set_streams([
1798 /// Stream::default()/* use setters */,
1799 /// Stream::default()/* use (different) setters */,
1800 /// ]);
1801 /// ```
1802 pub fn set_streams<T, V>(mut self, v: T) -> Self
1803 where
1804 T: std::iter::IntoIterator<Item = V>,
1805 V: std::convert::Into<crate::model::Stream>,
1806 {
1807 use std::iter::Iterator;
1808 self.streams = v.into_iter().map(|i| i.into()).collect();
1809 self
1810 }
1811
1812 /// Sets the value of [next_page_token][crate::model::ListStreamsResponse::next_page_token].
1813 ///
1814 /// # Example
1815 /// ```ignore,no_run
1816 /// # use google_cloud_datastream_v1::model::ListStreamsResponse;
1817 /// let x = ListStreamsResponse::new().set_next_page_token("example");
1818 /// ```
1819 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1820 self.next_page_token = v.into();
1821 self
1822 }
1823
1824 /// Sets the value of [unreachable][crate::model::ListStreamsResponse::unreachable].
1825 ///
1826 /// # Example
1827 /// ```ignore,no_run
1828 /// # use google_cloud_datastream_v1::model::ListStreamsResponse;
1829 /// let x = ListStreamsResponse::new().set_unreachable(["a", "b", "c"]);
1830 /// ```
1831 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1832 where
1833 T: std::iter::IntoIterator<Item = V>,
1834 V: std::convert::Into<std::string::String>,
1835 {
1836 use std::iter::Iterator;
1837 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1838 self
1839 }
1840}
1841
1842impl wkt::message::Message for ListStreamsResponse {
1843 fn typename() -> &'static str {
1844 "type.googleapis.com/google.cloud.datastream.v1.ListStreamsResponse"
1845 }
1846}
1847
1848#[doc(hidden)]
1849impl google_cloud_gax::paginator::internal::PageableResponse for ListStreamsResponse {
1850 type PageItem = crate::model::Stream;
1851
1852 fn items(self) -> std::vec::Vec<Self::PageItem> {
1853 self.streams
1854 }
1855
1856 fn next_page_token(&self) -> std::string::String {
1857 use std::clone::Clone;
1858 self.next_page_token.clone()
1859 }
1860}
1861
1862/// Request message for getting a stream.
1863#[derive(Clone, Default, PartialEq)]
1864#[non_exhaustive]
1865pub struct GetStreamRequest {
1866 /// Required. The name of the stream resource to get.
1867 pub name: std::string::String,
1868
1869 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1870}
1871
1872impl GetStreamRequest {
1873 /// Creates a new default instance.
1874 pub fn new() -> Self {
1875 std::default::Default::default()
1876 }
1877
1878 /// Sets the value of [name][crate::model::GetStreamRequest::name].
1879 ///
1880 /// # Example
1881 /// ```ignore,no_run
1882 /// # use google_cloud_datastream_v1::model::GetStreamRequest;
1883 /// let x = GetStreamRequest::new().set_name("example");
1884 /// ```
1885 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1886 self.name = v.into();
1887 self
1888 }
1889}
1890
1891impl wkt::message::Message for GetStreamRequest {
1892 fn typename() -> &'static str {
1893 "type.googleapis.com/google.cloud.datastream.v1.GetStreamRequest"
1894 }
1895}
1896
1897/// Request message for creating a stream.
1898#[derive(Clone, Default, PartialEq)]
1899#[non_exhaustive]
1900pub struct CreateStreamRequest {
1901 /// Required. The parent that owns the collection of streams.
1902 pub parent: std::string::String,
1903
1904 /// Required. The stream identifier.
1905 pub stream_id: std::string::String,
1906
1907 /// Required. The stream resource to create.
1908 pub stream: std::option::Option<crate::model::Stream>,
1909
1910 /// Optional. A request ID to identify requests. Specify a unique request ID
1911 /// so that if you must retry your request, the server will know to ignore
1912 /// the request if it has already been completed. The server will guarantee
1913 /// that for at least 60 minutes since the first request.
1914 ///
1915 /// For example, consider a situation where you make an initial request and the
1916 /// request times out. If you make the request again with the same request ID,
1917 /// the server can check if original operation with the same request ID was
1918 /// received, and if so, will ignore the second request. This prevents clients
1919 /// from accidentally creating duplicate commitments.
1920 ///
1921 /// The request ID must be a valid UUID with the exception that zero UUID is
1922 /// not supported (00000000-0000-0000-0000-000000000000).
1923 pub request_id: std::string::String,
1924
1925 /// Optional. Only validate the stream, but don't create any resources.
1926 /// The default is false.
1927 pub validate_only: bool,
1928
1929 /// Optional. Create the stream without validating it.
1930 pub force: bool,
1931
1932 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1933}
1934
1935impl CreateStreamRequest {
1936 /// Creates a new default instance.
1937 pub fn new() -> Self {
1938 std::default::Default::default()
1939 }
1940
1941 /// Sets the value of [parent][crate::model::CreateStreamRequest::parent].
1942 ///
1943 /// # Example
1944 /// ```ignore,no_run
1945 /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
1946 /// let x = CreateStreamRequest::new().set_parent("example");
1947 /// ```
1948 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1949 self.parent = v.into();
1950 self
1951 }
1952
1953 /// Sets the value of [stream_id][crate::model::CreateStreamRequest::stream_id].
1954 ///
1955 /// # Example
1956 /// ```ignore,no_run
1957 /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
1958 /// let x = CreateStreamRequest::new().set_stream_id("example");
1959 /// ```
1960 pub fn set_stream_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1961 self.stream_id = v.into();
1962 self
1963 }
1964
1965 /// Sets the value of [stream][crate::model::CreateStreamRequest::stream].
1966 ///
1967 /// # Example
1968 /// ```ignore,no_run
1969 /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
1970 /// use google_cloud_datastream_v1::model::Stream;
1971 /// let x = CreateStreamRequest::new().set_stream(Stream::default()/* use setters */);
1972 /// ```
1973 pub fn set_stream<T>(mut self, v: T) -> Self
1974 where
1975 T: std::convert::Into<crate::model::Stream>,
1976 {
1977 self.stream = std::option::Option::Some(v.into());
1978 self
1979 }
1980
1981 /// Sets or clears the value of [stream][crate::model::CreateStreamRequest::stream].
1982 ///
1983 /// # Example
1984 /// ```ignore,no_run
1985 /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
1986 /// use google_cloud_datastream_v1::model::Stream;
1987 /// let x = CreateStreamRequest::new().set_or_clear_stream(Some(Stream::default()/* use setters */));
1988 /// let x = CreateStreamRequest::new().set_or_clear_stream(None::<Stream>);
1989 /// ```
1990 pub fn set_or_clear_stream<T>(mut self, v: std::option::Option<T>) -> Self
1991 where
1992 T: std::convert::Into<crate::model::Stream>,
1993 {
1994 self.stream = v.map(|x| x.into());
1995 self
1996 }
1997
1998 /// Sets the value of [request_id][crate::model::CreateStreamRequest::request_id].
1999 ///
2000 /// # Example
2001 /// ```ignore,no_run
2002 /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
2003 /// let x = CreateStreamRequest::new().set_request_id("example");
2004 /// ```
2005 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2006 self.request_id = v.into();
2007 self
2008 }
2009
2010 /// Sets the value of [validate_only][crate::model::CreateStreamRequest::validate_only].
2011 ///
2012 /// # Example
2013 /// ```ignore,no_run
2014 /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
2015 /// let x = CreateStreamRequest::new().set_validate_only(true);
2016 /// ```
2017 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2018 self.validate_only = v.into();
2019 self
2020 }
2021
2022 /// Sets the value of [force][crate::model::CreateStreamRequest::force].
2023 ///
2024 /// # Example
2025 /// ```ignore,no_run
2026 /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
2027 /// let x = CreateStreamRequest::new().set_force(true);
2028 /// ```
2029 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2030 self.force = v.into();
2031 self
2032 }
2033}
2034
2035impl wkt::message::Message for CreateStreamRequest {
2036 fn typename() -> &'static str {
2037 "type.googleapis.com/google.cloud.datastream.v1.CreateStreamRequest"
2038 }
2039}
2040
2041/// Request message for updating a stream.
2042#[derive(Clone, Default, PartialEq)]
2043#[non_exhaustive]
2044pub struct UpdateStreamRequest {
2045 /// Optional. Field mask is used to specify the fields to be overwritten in the
2046 /// stream resource by the update.
2047 /// The fields specified in the update_mask are relative to the resource, not
2048 /// the full request. A field will be overwritten if it is in the mask. If the
2049 /// user does not provide a mask then all fields will be overwritten.
2050 pub update_mask: std::option::Option<wkt::FieldMask>,
2051
2052 /// Required. The stream resource to update.
2053 pub stream: std::option::Option<crate::model::Stream>,
2054
2055 /// Optional. A request ID to identify requests. Specify a unique request ID
2056 /// so that if you must retry your request, the server will know to ignore
2057 /// the request if it has already been completed. The server will guarantee
2058 /// that for at least 60 minutes since the first request.
2059 ///
2060 /// For example, consider a situation where you make an initial request and the
2061 /// request times out. If you make the request again with the same request ID,
2062 /// the server can check if original operation with the same request ID was
2063 /// received, and if so, will ignore the second request. This prevents clients
2064 /// from accidentally creating duplicate commitments.
2065 ///
2066 /// The request ID must be a valid UUID with the exception that zero UUID is
2067 /// not supported (00000000-0000-0000-0000-000000000000).
2068 pub request_id: std::string::String,
2069
2070 /// Optional. Only validate the stream with the changes, without actually
2071 /// updating it. The default is false.
2072 pub validate_only: bool,
2073
2074 /// Optional. Update the stream without validating it.
2075 pub force: bool,
2076
2077 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2078}
2079
2080impl UpdateStreamRequest {
2081 /// Creates a new default instance.
2082 pub fn new() -> Self {
2083 std::default::Default::default()
2084 }
2085
2086 /// Sets the value of [update_mask][crate::model::UpdateStreamRequest::update_mask].
2087 ///
2088 /// # Example
2089 /// ```ignore,no_run
2090 /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2091 /// use wkt::FieldMask;
2092 /// let x = UpdateStreamRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2093 /// ```
2094 pub fn set_update_mask<T>(mut self, v: T) -> Self
2095 where
2096 T: std::convert::Into<wkt::FieldMask>,
2097 {
2098 self.update_mask = std::option::Option::Some(v.into());
2099 self
2100 }
2101
2102 /// Sets or clears the value of [update_mask][crate::model::UpdateStreamRequest::update_mask].
2103 ///
2104 /// # Example
2105 /// ```ignore,no_run
2106 /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2107 /// use wkt::FieldMask;
2108 /// let x = UpdateStreamRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2109 /// let x = UpdateStreamRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2110 /// ```
2111 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2112 where
2113 T: std::convert::Into<wkt::FieldMask>,
2114 {
2115 self.update_mask = v.map(|x| x.into());
2116 self
2117 }
2118
2119 /// Sets the value of [stream][crate::model::UpdateStreamRequest::stream].
2120 ///
2121 /// # Example
2122 /// ```ignore,no_run
2123 /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2124 /// use google_cloud_datastream_v1::model::Stream;
2125 /// let x = UpdateStreamRequest::new().set_stream(Stream::default()/* use setters */);
2126 /// ```
2127 pub fn set_stream<T>(mut self, v: T) -> Self
2128 where
2129 T: std::convert::Into<crate::model::Stream>,
2130 {
2131 self.stream = std::option::Option::Some(v.into());
2132 self
2133 }
2134
2135 /// Sets or clears the value of [stream][crate::model::UpdateStreamRequest::stream].
2136 ///
2137 /// # Example
2138 /// ```ignore,no_run
2139 /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2140 /// use google_cloud_datastream_v1::model::Stream;
2141 /// let x = UpdateStreamRequest::new().set_or_clear_stream(Some(Stream::default()/* use setters */));
2142 /// let x = UpdateStreamRequest::new().set_or_clear_stream(None::<Stream>);
2143 /// ```
2144 pub fn set_or_clear_stream<T>(mut self, v: std::option::Option<T>) -> Self
2145 where
2146 T: std::convert::Into<crate::model::Stream>,
2147 {
2148 self.stream = v.map(|x| x.into());
2149 self
2150 }
2151
2152 /// Sets the value of [request_id][crate::model::UpdateStreamRequest::request_id].
2153 ///
2154 /// # Example
2155 /// ```ignore,no_run
2156 /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2157 /// let x = UpdateStreamRequest::new().set_request_id("example");
2158 /// ```
2159 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2160 self.request_id = v.into();
2161 self
2162 }
2163
2164 /// Sets the value of [validate_only][crate::model::UpdateStreamRequest::validate_only].
2165 ///
2166 /// # Example
2167 /// ```ignore,no_run
2168 /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2169 /// let x = UpdateStreamRequest::new().set_validate_only(true);
2170 /// ```
2171 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2172 self.validate_only = v.into();
2173 self
2174 }
2175
2176 /// Sets the value of [force][crate::model::UpdateStreamRequest::force].
2177 ///
2178 /// # Example
2179 /// ```ignore,no_run
2180 /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2181 /// let x = UpdateStreamRequest::new().set_force(true);
2182 /// ```
2183 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2184 self.force = v.into();
2185 self
2186 }
2187}
2188
2189impl wkt::message::Message for UpdateStreamRequest {
2190 fn typename() -> &'static str {
2191 "type.googleapis.com/google.cloud.datastream.v1.UpdateStreamRequest"
2192 }
2193}
2194
2195/// Request message for deleting a stream.
2196#[derive(Clone, Default, PartialEq)]
2197#[non_exhaustive]
2198pub struct DeleteStreamRequest {
2199 /// Required. The name of the stream resource to delete.
2200 pub name: std::string::String,
2201
2202 /// Optional. A request ID to identify requests. Specify a unique request ID
2203 /// so that if you must retry your request, the server will know to ignore
2204 /// the request if it has already been completed. The server will guarantee
2205 /// that for at least 60 minutes after the first request.
2206 ///
2207 /// For example, consider a situation where you make an initial request and the
2208 /// request times out. If you make the request again with the same request ID,
2209 /// the server can check if original operation with the same request ID was
2210 /// received, and if so, will ignore the second request. This prevents clients
2211 /// from accidentally creating duplicate commitments.
2212 ///
2213 /// The request ID must be a valid UUID with the exception that zero UUID is
2214 /// not supported (00000000-0000-0000-0000-000000000000).
2215 pub request_id: std::string::String,
2216
2217 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2218}
2219
2220impl DeleteStreamRequest {
2221 /// Creates a new default instance.
2222 pub fn new() -> Self {
2223 std::default::Default::default()
2224 }
2225
2226 /// Sets the value of [name][crate::model::DeleteStreamRequest::name].
2227 ///
2228 /// # Example
2229 /// ```ignore,no_run
2230 /// # use google_cloud_datastream_v1::model::DeleteStreamRequest;
2231 /// let x = DeleteStreamRequest::new().set_name("example");
2232 /// ```
2233 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2234 self.name = v.into();
2235 self
2236 }
2237
2238 /// Sets the value of [request_id][crate::model::DeleteStreamRequest::request_id].
2239 ///
2240 /// # Example
2241 /// ```ignore,no_run
2242 /// # use google_cloud_datastream_v1::model::DeleteStreamRequest;
2243 /// let x = DeleteStreamRequest::new().set_request_id("example");
2244 /// ```
2245 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2246 self.request_id = v.into();
2247 self
2248 }
2249}
2250
2251impl wkt::message::Message for DeleteStreamRequest {
2252 fn typename() -> &'static str {
2253 "type.googleapis.com/google.cloud.datastream.v1.DeleteStreamRequest"
2254 }
2255}
2256
2257/// Request message for running a stream.
2258#[derive(Clone, Default, PartialEq)]
2259#[non_exhaustive]
2260pub struct RunStreamRequest {
2261 /// Required. Name of the stream resource to start, in the format:
2262 /// projects/{project_id}/locations/{location}/streams/{stream_name}
2263 pub name: std::string::String,
2264
2265 /// Optional. The CDC strategy of the stream. If not set, the system's default
2266 /// value will be used.
2267 pub cdc_strategy: std::option::Option<crate::model::CdcStrategy>,
2268
2269 /// Optional. Update the stream without validating it.
2270 pub force: bool,
2271
2272 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2273}
2274
2275impl RunStreamRequest {
2276 /// Creates a new default instance.
2277 pub fn new() -> Self {
2278 std::default::Default::default()
2279 }
2280
2281 /// Sets the value of [name][crate::model::RunStreamRequest::name].
2282 ///
2283 /// # Example
2284 /// ```ignore,no_run
2285 /// # use google_cloud_datastream_v1::model::RunStreamRequest;
2286 /// let x = RunStreamRequest::new().set_name("example");
2287 /// ```
2288 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2289 self.name = v.into();
2290 self
2291 }
2292
2293 /// Sets the value of [cdc_strategy][crate::model::RunStreamRequest::cdc_strategy].
2294 ///
2295 /// # Example
2296 /// ```ignore,no_run
2297 /// # use google_cloud_datastream_v1::model::RunStreamRequest;
2298 /// use google_cloud_datastream_v1::model::CdcStrategy;
2299 /// let x = RunStreamRequest::new().set_cdc_strategy(CdcStrategy::default()/* use setters */);
2300 /// ```
2301 pub fn set_cdc_strategy<T>(mut self, v: T) -> Self
2302 where
2303 T: std::convert::Into<crate::model::CdcStrategy>,
2304 {
2305 self.cdc_strategy = std::option::Option::Some(v.into());
2306 self
2307 }
2308
2309 /// Sets or clears the value of [cdc_strategy][crate::model::RunStreamRequest::cdc_strategy].
2310 ///
2311 /// # Example
2312 /// ```ignore,no_run
2313 /// # use google_cloud_datastream_v1::model::RunStreamRequest;
2314 /// use google_cloud_datastream_v1::model::CdcStrategy;
2315 /// let x = RunStreamRequest::new().set_or_clear_cdc_strategy(Some(CdcStrategy::default()/* use setters */));
2316 /// let x = RunStreamRequest::new().set_or_clear_cdc_strategy(None::<CdcStrategy>);
2317 /// ```
2318 pub fn set_or_clear_cdc_strategy<T>(mut self, v: std::option::Option<T>) -> Self
2319 where
2320 T: std::convert::Into<crate::model::CdcStrategy>,
2321 {
2322 self.cdc_strategy = v.map(|x| x.into());
2323 self
2324 }
2325
2326 /// Sets the value of [force][crate::model::RunStreamRequest::force].
2327 ///
2328 /// # Example
2329 /// ```ignore,no_run
2330 /// # use google_cloud_datastream_v1::model::RunStreamRequest;
2331 /// let x = RunStreamRequest::new().set_force(true);
2332 /// ```
2333 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2334 self.force = v.into();
2335 self
2336 }
2337}
2338
2339impl wkt::message::Message for RunStreamRequest {
2340 fn typename() -> &'static str {
2341 "type.googleapis.com/google.cloud.datastream.v1.RunStreamRequest"
2342 }
2343}
2344
2345/// Request for fetching a specific stream object.
2346#[derive(Clone, Default, PartialEq)]
2347#[non_exhaustive]
2348pub struct GetStreamObjectRequest {
2349 /// Required. The name of the stream object resource to get.
2350 pub name: std::string::String,
2351
2352 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2353}
2354
2355impl GetStreamObjectRequest {
2356 /// Creates a new default instance.
2357 pub fn new() -> Self {
2358 std::default::Default::default()
2359 }
2360
2361 /// Sets the value of [name][crate::model::GetStreamObjectRequest::name].
2362 ///
2363 /// # Example
2364 /// ```ignore,no_run
2365 /// # use google_cloud_datastream_v1::model::GetStreamObjectRequest;
2366 /// let x = GetStreamObjectRequest::new().set_name("example");
2367 /// ```
2368 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2369 self.name = v.into();
2370 self
2371 }
2372}
2373
2374impl wkt::message::Message for GetStreamObjectRequest {
2375 fn typename() -> &'static str {
2376 "type.googleapis.com/google.cloud.datastream.v1.GetStreamObjectRequest"
2377 }
2378}
2379
2380/// Request for looking up a specific stream object by its source object
2381/// identifier.
2382#[derive(Clone, Default, PartialEq)]
2383#[non_exhaustive]
2384pub struct LookupStreamObjectRequest {
2385 /// Required. The parent stream that owns the collection of objects.
2386 pub parent: std::string::String,
2387
2388 /// Required. The source object identifier which maps to the stream object.
2389 pub source_object_identifier: std::option::Option<crate::model::SourceObjectIdentifier>,
2390
2391 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2392}
2393
2394impl LookupStreamObjectRequest {
2395 /// Creates a new default instance.
2396 pub fn new() -> Self {
2397 std::default::Default::default()
2398 }
2399
2400 /// Sets the value of [parent][crate::model::LookupStreamObjectRequest::parent].
2401 ///
2402 /// # Example
2403 /// ```ignore,no_run
2404 /// # use google_cloud_datastream_v1::model::LookupStreamObjectRequest;
2405 /// let x = LookupStreamObjectRequest::new().set_parent("example");
2406 /// ```
2407 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2408 self.parent = v.into();
2409 self
2410 }
2411
2412 /// Sets the value of [source_object_identifier][crate::model::LookupStreamObjectRequest::source_object_identifier].
2413 ///
2414 /// # Example
2415 /// ```ignore,no_run
2416 /// # use google_cloud_datastream_v1::model::LookupStreamObjectRequest;
2417 /// use google_cloud_datastream_v1::model::SourceObjectIdentifier;
2418 /// let x = LookupStreamObjectRequest::new().set_source_object_identifier(SourceObjectIdentifier::default()/* use setters */);
2419 /// ```
2420 pub fn set_source_object_identifier<T>(mut self, v: T) -> Self
2421 where
2422 T: std::convert::Into<crate::model::SourceObjectIdentifier>,
2423 {
2424 self.source_object_identifier = std::option::Option::Some(v.into());
2425 self
2426 }
2427
2428 /// Sets or clears the value of [source_object_identifier][crate::model::LookupStreamObjectRequest::source_object_identifier].
2429 ///
2430 /// # Example
2431 /// ```ignore,no_run
2432 /// # use google_cloud_datastream_v1::model::LookupStreamObjectRequest;
2433 /// use google_cloud_datastream_v1::model::SourceObjectIdentifier;
2434 /// let x = LookupStreamObjectRequest::new().set_or_clear_source_object_identifier(Some(SourceObjectIdentifier::default()/* use setters */));
2435 /// let x = LookupStreamObjectRequest::new().set_or_clear_source_object_identifier(None::<SourceObjectIdentifier>);
2436 /// ```
2437 pub fn set_or_clear_source_object_identifier<T>(mut self, v: std::option::Option<T>) -> Self
2438 where
2439 T: std::convert::Into<crate::model::SourceObjectIdentifier>,
2440 {
2441 self.source_object_identifier = v.map(|x| x.into());
2442 self
2443 }
2444}
2445
2446impl wkt::message::Message for LookupStreamObjectRequest {
2447 fn typename() -> &'static str {
2448 "type.googleapis.com/google.cloud.datastream.v1.LookupStreamObjectRequest"
2449 }
2450}
2451
2452/// Request for manually initiating a backfill job for a specific stream object.
2453#[derive(Clone, Default, PartialEq)]
2454#[non_exhaustive]
2455pub struct StartBackfillJobRequest {
2456 /// Required. The name of the stream object resource to start a backfill job
2457 /// for.
2458 pub object: std::string::String,
2459
2460 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2461}
2462
2463impl StartBackfillJobRequest {
2464 /// Creates a new default instance.
2465 pub fn new() -> Self {
2466 std::default::Default::default()
2467 }
2468
2469 /// Sets the value of [object][crate::model::StartBackfillJobRequest::object].
2470 ///
2471 /// # Example
2472 /// ```ignore,no_run
2473 /// # use google_cloud_datastream_v1::model::StartBackfillJobRequest;
2474 /// let x = StartBackfillJobRequest::new().set_object("example");
2475 /// ```
2476 pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2477 self.object = v.into();
2478 self
2479 }
2480}
2481
2482impl wkt::message::Message for StartBackfillJobRequest {
2483 fn typename() -> &'static str {
2484 "type.googleapis.com/google.cloud.datastream.v1.StartBackfillJobRequest"
2485 }
2486}
2487
2488/// Response for manually initiating a backfill job for a specific stream object.
2489#[derive(Clone, Default, PartialEq)]
2490#[non_exhaustive]
2491pub struct StartBackfillJobResponse {
2492 /// The stream object resource a backfill job was started for.
2493 pub object: std::option::Option<crate::model::StreamObject>,
2494
2495 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2496}
2497
2498impl StartBackfillJobResponse {
2499 /// Creates a new default instance.
2500 pub fn new() -> Self {
2501 std::default::Default::default()
2502 }
2503
2504 /// Sets the value of [object][crate::model::StartBackfillJobResponse::object].
2505 ///
2506 /// # Example
2507 /// ```ignore,no_run
2508 /// # use google_cloud_datastream_v1::model::StartBackfillJobResponse;
2509 /// use google_cloud_datastream_v1::model::StreamObject;
2510 /// let x = StartBackfillJobResponse::new().set_object(StreamObject::default()/* use setters */);
2511 /// ```
2512 pub fn set_object<T>(mut self, v: T) -> Self
2513 where
2514 T: std::convert::Into<crate::model::StreamObject>,
2515 {
2516 self.object = std::option::Option::Some(v.into());
2517 self
2518 }
2519
2520 /// Sets or clears the value of [object][crate::model::StartBackfillJobResponse::object].
2521 ///
2522 /// # Example
2523 /// ```ignore,no_run
2524 /// # use google_cloud_datastream_v1::model::StartBackfillJobResponse;
2525 /// use google_cloud_datastream_v1::model::StreamObject;
2526 /// let x = StartBackfillJobResponse::new().set_or_clear_object(Some(StreamObject::default()/* use setters */));
2527 /// let x = StartBackfillJobResponse::new().set_or_clear_object(None::<StreamObject>);
2528 /// ```
2529 pub fn set_or_clear_object<T>(mut self, v: std::option::Option<T>) -> Self
2530 where
2531 T: std::convert::Into<crate::model::StreamObject>,
2532 {
2533 self.object = v.map(|x| x.into());
2534 self
2535 }
2536}
2537
2538impl wkt::message::Message for StartBackfillJobResponse {
2539 fn typename() -> &'static str {
2540 "type.googleapis.com/google.cloud.datastream.v1.StartBackfillJobResponse"
2541 }
2542}
2543
2544/// Request for manually stopping a running backfill job for a specific stream
2545/// object.
2546#[derive(Clone, Default, PartialEq)]
2547#[non_exhaustive]
2548pub struct StopBackfillJobRequest {
2549 /// Required. The name of the stream object resource to stop the backfill job
2550 /// for.
2551 pub object: std::string::String,
2552
2553 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2554}
2555
2556impl StopBackfillJobRequest {
2557 /// Creates a new default instance.
2558 pub fn new() -> Self {
2559 std::default::Default::default()
2560 }
2561
2562 /// Sets the value of [object][crate::model::StopBackfillJobRequest::object].
2563 ///
2564 /// # Example
2565 /// ```ignore,no_run
2566 /// # use google_cloud_datastream_v1::model::StopBackfillJobRequest;
2567 /// let x = StopBackfillJobRequest::new().set_object("example");
2568 /// ```
2569 pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2570 self.object = v.into();
2571 self
2572 }
2573}
2574
2575impl wkt::message::Message for StopBackfillJobRequest {
2576 fn typename() -> &'static str {
2577 "type.googleapis.com/google.cloud.datastream.v1.StopBackfillJobRequest"
2578 }
2579}
2580
2581/// Response for manually stop a backfill job for a specific stream object.
2582#[derive(Clone, Default, PartialEq)]
2583#[non_exhaustive]
2584pub struct StopBackfillJobResponse {
2585 /// The stream object resource the backfill job was stopped for.
2586 pub object: std::option::Option<crate::model::StreamObject>,
2587
2588 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2589}
2590
2591impl StopBackfillJobResponse {
2592 /// Creates a new default instance.
2593 pub fn new() -> Self {
2594 std::default::Default::default()
2595 }
2596
2597 /// Sets the value of [object][crate::model::StopBackfillJobResponse::object].
2598 ///
2599 /// # Example
2600 /// ```ignore,no_run
2601 /// # use google_cloud_datastream_v1::model::StopBackfillJobResponse;
2602 /// use google_cloud_datastream_v1::model::StreamObject;
2603 /// let x = StopBackfillJobResponse::new().set_object(StreamObject::default()/* use setters */);
2604 /// ```
2605 pub fn set_object<T>(mut self, v: T) -> Self
2606 where
2607 T: std::convert::Into<crate::model::StreamObject>,
2608 {
2609 self.object = std::option::Option::Some(v.into());
2610 self
2611 }
2612
2613 /// Sets or clears the value of [object][crate::model::StopBackfillJobResponse::object].
2614 ///
2615 /// # Example
2616 /// ```ignore,no_run
2617 /// # use google_cloud_datastream_v1::model::StopBackfillJobResponse;
2618 /// use google_cloud_datastream_v1::model::StreamObject;
2619 /// let x = StopBackfillJobResponse::new().set_or_clear_object(Some(StreamObject::default()/* use setters */));
2620 /// let x = StopBackfillJobResponse::new().set_or_clear_object(None::<StreamObject>);
2621 /// ```
2622 pub fn set_or_clear_object<T>(mut self, v: std::option::Option<T>) -> Self
2623 where
2624 T: std::convert::Into<crate::model::StreamObject>,
2625 {
2626 self.object = v.map(|x| x.into());
2627 self
2628 }
2629}
2630
2631impl wkt::message::Message for StopBackfillJobResponse {
2632 fn typename() -> &'static str {
2633 "type.googleapis.com/google.cloud.datastream.v1.StopBackfillJobResponse"
2634 }
2635}
2636
2637/// Request for listing all objects for a specific stream.
2638#[derive(Clone, Default, PartialEq)]
2639#[non_exhaustive]
2640pub struct ListStreamObjectsRequest {
2641 /// Required. The parent stream that owns the collection of objects.
2642 pub parent: std::string::String,
2643
2644 /// Maximum number of objects to return. Default is 50.
2645 /// The maximum value is 1000; values above 1000 will be coerced to 1000.
2646 pub page_size: i32,
2647
2648 /// Page token received from a previous `ListStreamObjectsRequest` call.
2649 /// Provide this to retrieve the subsequent page.
2650 ///
2651 /// When paginating, all other parameters provided to
2652 /// `ListStreamObjectsRequest` must match the call that provided the page
2653 /// token.
2654 pub page_token: std::string::String,
2655
2656 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2657}
2658
2659impl ListStreamObjectsRequest {
2660 /// Creates a new default instance.
2661 pub fn new() -> Self {
2662 std::default::Default::default()
2663 }
2664
2665 /// Sets the value of [parent][crate::model::ListStreamObjectsRequest::parent].
2666 ///
2667 /// # Example
2668 /// ```ignore,no_run
2669 /// # use google_cloud_datastream_v1::model::ListStreamObjectsRequest;
2670 /// let x = ListStreamObjectsRequest::new().set_parent("example");
2671 /// ```
2672 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2673 self.parent = v.into();
2674 self
2675 }
2676
2677 /// Sets the value of [page_size][crate::model::ListStreamObjectsRequest::page_size].
2678 ///
2679 /// # Example
2680 /// ```ignore,no_run
2681 /// # use google_cloud_datastream_v1::model::ListStreamObjectsRequest;
2682 /// let x = ListStreamObjectsRequest::new().set_page_size(42);
2683 /// ```
2684 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2685 self.page_size = v.into();
2686 self
2687 }
2688
2689 /// Sets the value of [page_token][crate::model::ListStreamObjectsRequest::page_token].
2690 ///
2691 /// # Example
2692 /// ```ignore,no_run
2693 /// # use google_cloud_datastream_v1::model::ListStreamObjectsRequest;
2694 /// let x = ListStreamObjectsRequest::new().set_page_token("example");
2695 /// ```
2696 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2697 self.page_token = v.into();
2698 self
2699 }
2700}
2701
2702impl wkt::message::Message for ListStreamObjectsRequest {
2703 fn typename() -> &'static str {
2704 "type.googleapis.com/google.cloud.datastream.v1.ListStreamObjectsRequest"
2705 }
2706}
2707
2708/// Response containing the objects for a stream.
2709#[derive(Clone, Default, PartialEq)]
2710#[non_exhaustive]
2711pub struct ListStreamObjectsResponse {
2712 /// List of stream objects.
2713 pub stream_objects: std::vec::Vec<crate::model::StreamObject>,
2714
2715 /// A token, which can be sent as `page_token` to retrieve the next page.
2716 pub next_page_token: std::string::String,
2717
2718 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2719}
2720
2721impl ListStreamObjectsResponse {
2722 /// Creates a new default instance.
2723 pub fn new() -> Self {
2724 std::default::Default::default()
2725 }
2726
2727 /// Sets the value of [stream_objects][crate::model::ListStreamObjectsResponse::stream_objects].
2728 ///
2729 /// # Example
2730 /// ```ignore,no_run
2731 /// # use google_cloud_datastream_v1::model::ListStreamObjectsResponse;
2732 /// use google_cloud_datastream_v1::model::StreamObject;
2733 /// let x = ListStreamObjectsResponse::new()
2734 /// .set_stream_objects([
2735 /// StreamObject::default()/* use setters */,
2736 /// StreamObject::default()/* use (different) setters */,
2737 /// ]);
2738 /// ```
2739 pub fn set_stream_objects<T, V>(mut self, v: T) -> Self
2740 where
2741 T: std::iter::IntoIterator<Item = V>,
2742 V: std::convert::Into<crate::model::StreamObject>,
2743 {
2744 use std::iter::Iterator;
2745 self.stream_objects = v.into_iter().map(|i| i.into()).collect();
2746 self
2747 }
2748
2749 /// Sets the value of [next_page_token][crate::model::ListStreamObjectsResponse::next_page_token].
2750 ///
2751 /// # Example
2752 /// ```ignore,no_run
2753 /// # use google_cloud_datastream_v1::model::ListStreamObjectsResponse;
2754 /// let x = ListStreamObjectsResponse::new().set_next_page_token("example");
2755 /// ```
2756 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2757 self.next_page_token = v.into();
2758 self
2759 }
2760}
2761
2762impl wkt::message::Message for ListStreamObjectsResponse {
2763 fn typename() -> &'static str {
2764 "type.googleapis.com/google.cloud.datastream.v1.ListStreamObjectsResponse"
2765 }
2766}
2767
2768#[doc(hidden)]
2769impl google_cloud_gax::paginator::internal::PageableResponse for ListStreamObjectsResponse {
2770 type PageItem = crate::model::StreamObject;
2771
2772 fn items(self) -> std::vec::Vec<Self::PageItem> {
2773 self.stream_objects
2774 }
2775
2776 fn next_page_token(&self) -> std::string::String {
2777 use std::clone::Clone;
2778 self.next_page_token.clone()
2779 }
2780}
2781
2782/// Represents the metadata of the long-running operation.
2783#[derive(Clone, Default, PartialEq)]
2784#[non_exhaustive]
2785pub struct OperationMetadata {
2786 /// Output only. The time the operation was created.
2787 pub create_time: std::option::Option<wkt::Timestamp>,
2788
2789 /// Output only. The time the operation finished running.
2790 pub end_time: std::option::Option<wkt::Timestamp>,
2791
2792 /// Output only. Server-defined resource path for the target of the operation.
2793 pub target: std::string::String,
2794
2795 /// Output only. Name of the verb executed by the operation.
2796 pub verb: std::string::String,
2797
2798 /// Output only. Human-readable status of the operation, if any.
2799 pub status_message: std::string::String,
2800
2801 /// Output only. Identifies whether the user has requested cancellation
2802 /// of the operation. Operations that have successfully been cancelled
2803 /// have
2804 /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
2805 /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
2806 /// corresponding to `Code.CANCELLED`.
2807 ///
2808 /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
2809 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
2810 pub requested_cancellation: bool,
2811
2812 /// Output only. API version used to start the operation.
2813 pub api_version: std::string::String,
2814
2815 /// Output only. Results of executed validations if there are any.
2816 pub validation_result: std::option::Option<crate::model::ValidationResult>,
2817
2818 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2819}
2820
2821impl OperationMetadata {
2822 /// Creates a new default instance.
2823 pub fn new() -> Self {
2824 std::default::Default::default()
2825 }
2826
2827 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
2828 ///
2829 /// # Example
2830 /// ```ignore,no_run
2831 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2832 /// use wkt::Timestamp;
2833 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
2834 /// ```
2835 pub fn set_create_time<T>(mut self, v: T) -> Self
2836 where
2837 T: std::convert::Into<wkt::Timestamp>,
2838 {
2839 self.create_time = std::option::Option::Some(v.into());
2840 self
2841 }
2842
2843 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
2844 ///
2845 /// # Example
2846 /// ```ignore,no_run
2847 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2848 /// use wkt::Timestamp;
2849 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2850 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
2851 /// ```
2852 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2853 where
2854 T: std::convert::Into<wkt::Timestamp>,
2855 {
2856 self.create_time = v.map(|x| x.into());
2857 self
2858 }
2859
2860 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
2861 ///
2862 /// # Example
2863 /// ```ignore,no_run
2864 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2865 /// use wkt::Timestamp;
2866 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
2867 /// ```
2868 pub fn set_end_time<T>(mut self, v: T) -> Self
2869 where
2870 T: std::convert::Into<wkt::Timestamp>,
2871 {
2872 self.end_time = std::option::Option::Some(v.into());
2873 self
2874 }
2875
2876 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
2877 ///
2878 /// # Example
2879 /// ```ignore,no_run
2880 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2881 /// use wkt::Timestamp;
2882 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
2883 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
2884 /// ```
2885 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2886 where
2887 T: std::convert::Into<wkt::Timestamp>,
2888 {
2889 self.end_time = v.map(|x| x.into());
2890 self
2891 }
2892
2893 /// Sets the value of [target][crate::model::OperationMetadata::target].
2894 ///
2895 /// # Example
2896 /// ```ignore,no_run
2897 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2898 /// let x = OperationMetadata::new().set_target("example");
2899 /// ```
2900 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2901 self.target = v.into();
2902 self
2903 }
2904
2905 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
2906 ///
2907 /// # Example
2908 /// ```ignore,no_run
2909 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2910 /// let x = OperationMetadata::new().set_verb("example");
2911 /// ```
2912 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2913 self.verb = v.into();
2914 self
2915 }
2916
2917 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
2918 ///
2919 /// # Example
2920 /// ```ignore,no_run
2921 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2922 /// let x = OperationMetadata::new().set_status_message("example");
2923 /// ```
2924 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2925 self.status_message = v.into();
2926 self
2927 }
2928
2929 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
2930 ///
2931 /// # Example
2932 /// ```ignore,no_run
2933 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2934 /// let x = OperationMetadata::new().set_requested_cancellation(true);
2935 /// ```
2936 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2937 self.requested_cancellation = v.into();
2938 self
2939 }
2940
2941 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
2942 ///
2943 /// # Example
2944 /// ```ignore,no_run
2945 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2946 /// let x = OperationMetadata::new().set_api_version("example");
2947 /// ```
2948 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2949 self.api_version = v.into();
2950 self
2951 }
2952
2953 /// Sets the value of [validation_result][crate::model::OperationMetadata::validation_result].
2954 ///
2955 /// # Example
2956 /// ```ignore,no_run
2957 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2958 /// use google_cloud_datastream_v1::model::ValidationResult;
2959 /// let x = OperationMetadata::new().set_validation_result(ValidationResult::default()/* use setters */);
2960 /// ```
2961 pub fn set_validation_result<T>(mut self, v: T) -> Self
2962 where
2963 T: std::convert::Into<crate::model::ValidationResult>,
2964 {
2965 self.validation_result = std::option::Option::Some(v.into());
2966 self
2967 }
2968
2969 /// Sets or clears the value of [validation_result][crate::model::OperationMetadata::validation_result].
2970 ///
2971 /// # Example
2972 /// ```ignore,no_run
2973 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2974 /// use google_cloud_datastream_v1::model::ValidationResult;
2975 /// let x = OperationMetadata::new().set_or_clear_validation_result(Some(ValidationResult::default()/* use setters */));
2976 /// let x = OperationMetadata::new().set_or_clear_validation_result(None::<ValidationResult>);
2977 /// ```
2978 pub fn set_or_clear_validation_result<T>(mut self, v: std::option::Option<T>) -> Self
2979 where
2980 T: std::convert::Into<crate::model::ValidationResult>,
2981 {
2982 self.validation_result = v.map(|x| x.into());
2983 self
2984 }
2985}
2986
2987impl wkt::message::Message for OperationMetadata {
2988 fn typename() -> &'static str {
2989 "type.googleapis.com/google.cloud.datastream.v1.OperationMetadata"
2990 }
2991}
2992
2993/// Request for creating a private connection.
2994#[derive(Clone, Default, PartialEq)]
2995#[non_exhaustive]
2996pub struct CreatePrivateConnectionRequest {
2997 /// Required. The parent that owns the collection of PrivateConnections.
2998 pub parent: std::string::String,
2999
3000 /// Required. The private connectivity identifier.
3001 pub private_connection_id: std::string::String,
3002
3003 /// Required. The Private Connectivity resource to create.
3004 pub private_connection: std::option::Option<crate::model::PrivateConnection>,
3005
3006 /// Optional. A request ID to identify requests. Specify a unique request ID
3007 /// so that if you must retry your request, the server will know to ignore
3008 /// the request if it has already been completed. The server will guarantee
3009 /// that for at least 60 minutes since the first request.
3010 ///
3011 /// For example, consider a situation where you make an initial request and the
3012 /// request times out. If you make the request again with the same request ID,
3013 /// the server can check if original operation with the same request ID was
3014 /// received, and if so, will ignore the second request. This prevents clients
3015 /// from accidentally creating duplicate commitments.
3016 ///
3017 /// The request ID must be a valid UUID with the exception that zero UUID is
3018 /// not supported (00000000-0000-0000-0000-000000000000).
3019 pub request_id: std::string::String,
3020
3021 /// Optional. If set to true, will skip validations.
3022 pub force: bool,
3023
3024 /// Optional. When supplied with PSC Interface config, will get/create the
3025 /// tenant project required for the customer to allow list and won't actually
3026 /// create the private connection.
3027 pub validate_only: bool,
3028
3029 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3030}
3031
3032impl CreatePrivateConnectionRequest {
3033 /// Creates a new default instance.
3034 pub fn new() -> Self {
3035 std::default::Default::default()
3036 }
3037
3038 /// Sets the value of [parent][crate::model::CreatePrivateConnectionRequest::parent].
3039 ///
3040 /// # Example
3041 /// ```ignore,no_run
3042 /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3043 /// let x = CreatePrivateConnectionRequest::new().set_parent("example");
3044 /// ```
3045 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3046 self.parent = v.into();
3047 self
3048 }
3049
3050 /// Sets the value of [private_connection_id][crate::model::CreatePrivateConnectionRequest::private_connection_id].
3051 ///
3052 /// # Example
3053 /// ```ignore,no_run
3054 /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3055 /// let x = CreatePrivateConnectionRequest::new().set_private_connection_id("example");
3056 /// ```
3057 pub fn set_private_connection_id<T: std::convert::Into<std::string::String>>(
3058 mut self,
3059 v: T,
3060 ) -> Self {
3061 self.private_connection_id = v.into();
3062 self
3063 }
3064
3065 /// Sets the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
3066 ///
3067 /// # Example
3068 /// ```ignore,no_run
3069 /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3070 /// use google_cloud_datastream_v1::model::PrivateConnection;
3071 /// let x = CreatePrivateConnectionRequest::new().set_private_connection(PrivateConnection::default()/* use setters */);
3072 /// ```
3073 pub fn set_private_connection<T>(mut self, v: T) -> Self
3074 where
3075 T: std::convert::Into<crate::model::PrivateConnection>,
3076 {
3077 self.private_connection = std::option::Option::Some(v.into());
3078 self
3079 }
3080
3081 /// Sets or clears the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
3082 ///
3083 /// # Example
3084 /// ```ignore,no_run
3085 /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3086 /// use google_cloud_datastream_v1::model::PrivateConnection;
3087 /// let x = CreatePrivateConnectionRequest::new().set_or_clear_private_connection(Some(PrivateConnection::default()/* use setters */));
3088 /// let x = CreatePrivateConnectionRequest::new().set_or_clear_private_connection(None::<PrivateConnection>);
3089 /// ```
3090 pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
3091 where
3092 T: std::convert::Into<crate::model::PrivateConnection>,
3093 {
3094 self.private_connection = v.map(|x| x.into());
3095 self
3096 }
3097
3098 /// Sets the value of [request_id][crate::model::CreatePrivateConnectionRequest::request_id].
3099 ///
3100 /// # Example
3101 /// ```ignore,no_run
3102 /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3103 /// let x = CreatePrivateConnectionRequest::new().set_request_id("example");
3104 /// ```
3105 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3106 self.request_id = v.into();
3107 self
3108 }
3109
3110 /// Sets the value of [force][crate::model::CreatePrivateConnectionRequest::force].
3111 ///
3112 /// # Example
3113 /// ```ignore,no_run
3114 /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3115 /// let x = CreatePrivateConnectionRequest::new().set_force(true);
3116 /// ```
3117 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3118 self.force = v.into();
3119 self
3120 }
3121
3122 /// Sets the value of [validate_only][crate::model::CreatePrivateConnectionRequest::validate_only].
3123 ///
3124 /// # Example
3125 /// ```ignore,no_run
3126 /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3127 /// let x = CreatePrivateConnectionRequest::new().set_validate_only(true);
3128 /// ```
3129 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3130 self.validate_only = v.into();
3131 self
3132 }
3133}
3134
3135impl wkt::message::Message for CreatePrivateConnectionRequest {
3136 fn typename() -> &'static str {
3137 "type.googleapis.com/google.cloud.datastream.v1.CreatePrivateConnectionRequest"
3138 }
3139}
3140
3141/// Request for listing private connections.
3142#[derive(Clone, Default, PartialEq)]
3143#[non_exhaustive]
3144pub struct ListPrivateConnectionsRequest {
3145 /// Required. The parent that owns the collection of private connectivity
3146 /// configurations.
3147 pub parent: std::string::String,
3148
3149 /// Maximum number of private connectivity configurations to return.
3150 /// If unspecified, at most 50 private connectivity configurations that will be
3151 /// returned. The maximum value is 1000; values above 1000 will be coerced to
3152 /// 1000.
3153 pub page_size: i32,
3154
3155 /// Page token received from a previous `ListPrivateConnections` call.
3156 /// Provide this to retrieve the subsequent page.
3157 ///
3158 /// When paginating, all other parameters provided to
3159 /// `ListPrivateConnections` must match the call that provided the page
3160 /// token.
3161 pub page_token: std::string::String,
3162
3163 /// Filter request.
3164 pub filter: std::string::String,
3165
3166 /// Order by fields for the result.
3167 pub order_by: std::string::String,
3168
3169 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3170}
3171
3172impl ListPrivateConnectionsRequest {
3173 /// Creates a new default instance.
3174 pub fn new() -> Self {
3175 std::default::Default::default()
3176 }
3177
3178 /// Sets the value of [parent][crate::model::ListPrivateConnectionsRequest::parent].
3179 ///
3180 /// # Example
3181 /// ```ignore,no_run
3182 /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3183 /// let x = ListPrivateConnectionsRequest::new().set_parent("example");
3184 /// ```
3185 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3186 self.parent = v.into();
3187 self
3188 }
3189
3190 /// Sets the value of [page_size][crate::model::ListPrivateConnectionsRequest::page_size].
3191 ///
3192 /// # Example
3193 /// ```ignore,no_run
3194 /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3195 /// let x = ListPrivateConnectionsRequest::new().set_page_size(42);
3196 /// ```
3197 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3198 self.page_size = v.into();
3199 self
3200 }
3201
3202 /// Sets the value of [page_token][crate::model::ListPrivateConnectionsRequest::page_token].
3203 ///
3204 /// # Example
3205 /// ```ignore,no_run
3206 /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3207 /// let x = ListPrivateConnectionsRequest::new().set_page_token("example");
3208 /// ```
3209 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3210 self.page_token = v.into();
3211 self
3212 }
3213
3214 /// Sets the value of [filter][crate::model::ListPrivateConnectionsRequest::filter].
3215 ///
3216 /// # Example
3217 /// ```ignore,no_run
3218 /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3219 /// let x = ListPrivateConnectionsRequest::new().set_filter("example");
3220 /// ```
3221 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3222 self.filter = v.into();
3223 self
3224 }
3225
3226 /// Sets the value of [order_by][crate::model::ListPrivateConnectionsRequest::order_by].
3227 ///
3228 /// # Example
3229 /// ```ignore,no_run
3230 /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3231 /// let x = ListPrivateConnectionsRequest::new().set_order_by("example");
3232 /// ```
3233 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3234 self.order_by = v.into();
3235 self
3236 }
3237}
3238
3239impl wkt::message::Message for ListPrivateConnectionsRequest {
3240 fn typename() -> &'static str {
3241 "type.googleapis.com/google.cloud.datastream.v1.ListPrivateConnectionsRequest"
3242 }
3243}
3244
3245/// Response containing a list of private connection configurations.
3246#[derive(Clone, Default, PartialEq)]
3247#[non_exhaustive]
3248pub struct ListPrivateConnectionsResponse {
3249 /// List of private connectivity configurations.
3250 pub private_connections: std::vec::Vec<crate::model::PrivateConnection>,
3251
3252 /// A token, which can be sent as `page_token` to retrieve the next page.
3253 /// If this field is omitted, there are no subsequent pages.
3254 pub next_page_token: std::string::String,
3255
3256 /// Locations that could not be reached.
3257 pub unreachable: std::vec::Vec<std::string::String>,
3258
3259 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3260}
3261
3262impl ListPrivateConnectionsResponse {
3263 /// Creates a new default instance.
3264 pub fn new() -> Self {
3265 std::default::Default::default()
3266 }
3267
3268 /// Sets the value of [private_connections][crate::model::ListPrivateConnectionsResponse::private_connections].
3269 ///
3270 /// # Example
3271 /// ```ignore,no_run
3272 /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsResponse;
3273 /// use google_cloud_datastream_v1::model::PrivateConnection;
3274 /// let x = ListPrivateConnectionsResponse::new()
3275 /// .set_private_connections([
3276 /// PrivateConnection::default()/* use setters */,
3277 /// PrivateConnection::default()/* use (different) setters */,
3278 /// ]);
3279 /// ```
3280 pub fn set_private_connections<T, V>(mut self, v: T) -> Self
3281 where
3282 T: std::iter::IntoIterator<Item = V>,
3283 V: std::convert::Into<crate::model::PrivateConnection>,
3284 {
3285 use std::iter::Iterator;
3286 self.private_connections = v.into_iter().map(|i| i.into()).collect();
3287 self
3288 }
3289
3290 /// Sets the value of [next_page_token][crate::model::ListPrivateConnectionsResponse::next_page_token].
3291 ///
3292 /// # Example
3293 /// ```ignore,no_run
3294 /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsResponse;
3295 /// let x = ListPrivateConnectionsResponse::new().set_next_page_token("example");
3296 /// ```
3297 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3298 self.next_page_token = v.into();
3299 self
3300 }
3301
3302 /// Sets the value of [unreachable][crate::model::ListPrivateConnectionsResponse::unreachable].
3303 ///
3304 /// # Example
3305 /// ```ignore,no_run
3306 /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsResponse;
3307 /// let x = ListPrivateConnectionsResponse::new().set_unreachable(["a", "b", "c"]);
3308 /// ```
3309 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3310 where
3311 T: std::iter::IntoIterator<Item = V>,
3312 V: std::convert::Into<std::string::String>,
3313 {
3314 use std::iter::Iterator;
3315 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3316 self
3317 }
3318}
3319
3320impl wkt::message::Message for ListPrivateConnectionsResponse {
3321 fn typename() -> &'static str {
3322 "type.googleapis.com/google.cloud.datastream.v1.ListPrivateConnectionsResponse"
3323 }
3324}
3325
3326#[doc(hidden)]
3327impl google_cloud_gax::paginator::internal::PageableResponse for ListPrivateConnectionsResponse {
3328 type PageItem = crate::model::PrivateConnection;
3329
3330 fn items(self) -> std::vec::Vec<Self::PageItem> {
3331 self.private_connections
3332 }
3333
3334 fn next_page_token(&self) -> std::string::String {
3335 use std::clone::Clone;
3336 self.next_page_token.clone()
3337 }
3338}
3339
3340/// Request to delete a private connection.
3341#[derive(Clone, Default, PartialEq)]
3342#[non_exhaustive]
3343pub struct DeletePrivateConnectionRequest {
3344 /// Required. The name of the private connectivity configuration to delete.
3345 pub name: std::string::String,
3346
3347 /// Optional. A request ID to identify requests. Specify a unique request ID
3348 /// so that if you must retry your request, the server will know to ignore
3349 /// the request if it has already been completed. The server will guarantee
3350 /// that for at least 60 minutes after the first request.
3351 ///
3352 /// For example, consider a situation where you make an initial request and the
3353 /// request times out. If you make the request again with the same request ID,
3354 /// the server can check if original operation with the same request ID was
3355 /// received, and if so, will ignore the second request. This prevents clients
3356 /// from accidentally creating duplicate commitments.
3357 ///
3358 /// The request ID must be a valid UUID with the exception that zero UUID is
3359 /// not supported (00000000-0000-0000-0000-000000000000).
3360 pub request_id: std::string::String,
3361
3362 /// Optional. If set to true, any child routes that belong to this
3363 /// PrivateConnection will also be deleted.
3364 pub force: bool,
3365
3366 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3367}
3368
3369impl DeletePrivateConnectionRequest {
3370 /// Creates a new default instance.
3371 pub fn new() -> Self {
3372 std::default::Default::default()
3373 }
3374
3375 /// Sets the value of [name][crate::model::DeletePrivateConnectionRequest::name].
3376 ///
3377 /// # Example
3378 /// ```ignore,no_run
3379 /// # use google_cloud_datastream_v1::model::DeletePrivateConnectionRequest;
3380 /// let x = DeletePrivateConnectionRequest::new().set_name("example");
3381 /// ```
3382 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3383 self.name = v.into();
3384 self
3385 }
3386
3387 /// Sets the value of [request_id][crate::model::DeletePrivateConnectionRequest::request_id].
3388 ///
3389 /// # Example
3390 /// ```ignore,no_run
3391 /// # use google_cloud_datastream_v1::model::DeletePrivateConnectionRequest;
3392 /// let x = DeletePrivateConnectionRequest::new().set_request_id("example");
3393 /// ```
3394 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3395 self.request_id = v.into();
3396 self
3397 }
3398
3399 /// Sets the value of [force][crate::model::DeletePrivateConnectionRequest::force].
3400 ///
3401 /// # Example
3402 /// ```ignore,no_run
3403 /// # use google_cloud_datastream_v1::model::DeletePrivateConnectionRequest;
3404 /// let x = DeletePrivateConnectionRequest::new().set_force(true);
3405 /// ```
3406 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3407 self.force = v.into();
3408 self
3409 }
3410}
3411
3412impl wkt::message::Message for DeletePrivateConnectionRequest {
3413 fn typename() -> &'static str {
3414 "type.googleapis.com/google.cloud.datastream.v1.DeletePrivateConnectionRequest"
3415 }
3416}
3417
3418/// Request to get a private connection configuration.
3419#[derive(Clone, Default, PartialEq)]
3420#[non_exhaustive]
3421pub struct GetPrivateConnectionRequest {
3422 /// Required. The name of the private connectivity configuration to get.
3423 pub name: std::string::String,
3424
3425 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3426}
3427
3428impl GetPrivateConnectionRequest {
3429 /// Creates a new default instance.
3430 pub fn new() -> Self {
3431 std::default::Default::default()
3432 }
3433
3434 /// Sets the value of [name][crate::model::GetPrivateConnectionRequest::name].
3435 ///
3436 /// # Example
3437 /// ```ignore,no_run
3438 /// # use google_cloud_datastream_v1::model::GetPrivateConnectionRequest;
3439 /// let x = GetPrivateConnectionRequest::new().set_name("example");
3440 /// ```
3441 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3442 self.name = v.into();
3443 self
3444 }
3445}
3446
3447impl wkt::message::Message for GetPrivateConnectionRequest {
3448 fn typename() -> &'static str {
3449 "type.googleapis.com/google.cloud.datastream.v1.GetPrivateConnectionRequest"
3450 }
3451}
3452
3453/// Route creation request.
3454#[derive(Clone, Default, PartialEq)]
3455#[non_exhaustive]
3456pub struct CreateRouteRequest {
3457 /// Required. The parent that owns the collection of Routes.
3458 pub parent: std::string::String,
3459
3460 /// Required. The Route identifier.
3461 pub route_id: std::string::String,
3462
3463 /// Required. The Route resource to create.
3464 pub route: std::option::Option<crate::model::Route>,
3465
3466 /// Optional. A request ID to identify requests. Specify a unique request ID
3467 /// so that if you must retry your request, the server will know to ignore
3468 /// the request if it has already been completed. The server will guarantee
3469 /// that for at least 60 minutes since the first request.
3470 ///
3471 /// For example, consider a situation where you make an initial request and the
3472 /// request times out. If you make the request again with the same request ID,
3473 /// the server can check if original operation with the same request ID was
3474 /// received, and if so, will ignore the second request. This prevents clients
3475 /// from accidentally creating duplicate commitments.
3476 ///
3477 /// The request ID must be a valid UUID with the exception that zero UUID is
3478 /// not supported (00000000-0000-0000-0000-000000000000).
3479 pub request_id: std::string::String,
3480
3481 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3482}
3483
3484impl CreateRouteRequest {
3485 /// Creates a new default instance.
3486 pub fn new() -> Self {
3487 std::default::Default::default()
3488 }
3489
3490 /// Sets the value of [parent][crate::model::CreateRouteRequest::parent].
3491 ///
3492 /// # Example
3493 /// ```ignore,no_run
3494 /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3495 /// let x = CreateRouteRequest::new().set_parent("example");
3496 /// ```
3497 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3498 self.parent = v.into();
3499 self
3500 }
3501
3502 /// Sets the value of [route_id][crate::model::CreateRouteRequest::route_id].
3503 ///
3504 /// # Example
3505 /// ```ignore,no_run
3506 /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3507 /// let x = CreateRouteRequest::new().set_route_id("example");
3508 /// ```
3509 pub fn set_route_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3510 self.route_id = v.into();
3511 self
3512 }
3513
3514 /// Sets the value of [route][crate::model::CreateRouteRequest::route].
3515 ///
3516 /// # Example
3517 /// ```ignore,no_run
3518 /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3519 /// use google_cloud_datastream_v1::model::Route;
3520 /// let x = CreateRouteRequest::new().set_route(Route::default()/* use setters */);
3521 /// ```
3522 pub fn set_route<T>(mut self, v: T) -> Self
3523 where
3524 T: std::convert::Into<crate::model::Route>,
3525 {
3526 self.route = std::option::Option::Some(v.into());
3527 self
3528 }
3529
3530 /// Sets or clears the value of [route][crate::model::CreateRouteRequest::route].
3531 ///
3532 /// # Example
3533 /// ```ignore,no_run
3534 /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3535 /// use google_cloud_datastream_v1::model::Route;
3536 /// let x = CreateRouteRequest::new().set_or_clear_route(Some(Route::default()/* use setters */));
3537 /// let x = CreateRouteRequest::new().set_or_clear_route(None::<Route>);
3538 /// ```
3539 pub fn set_or_clear_route<T>(mut self, v: std::option::Option<T>) -> Self
3540 where
3541 T: std::convert::Into<crate::model::Route>,
3542 {
3543 self.route = v.map(|x| x.into());
3544 self
3545 }
3546
3547 /// Sets the value of [request_id][crate::model::CreateRouteRequest::request_id].
3548 ///
3549 /// # Example
3550 /// ```ignore,no_run
3551 /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3552 /// let x = CreateRouteRequest::new().set_request_id("example");
3553 /// ```
3554 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3555 self.request_id = v.into();
3556 self
3557 }
3558}
3559
3560impl wkt::message::Message for CreateRouteRequest {
3561 fn typename() -> &'static str {
3562 "type.googleapis.com/google.cloud.datastream.v1.CreateRouteRequest"
3563 }
3564}
3565
3566/// Route list request.
3567#[derive(Clone, Default, PartialEq)]
3568#[non_exhaustive]
3569pub struct ListRoutesRequest {
3570 /// Required. The parent that owns the collection of Routess.
3571 pub parent: std::string::String,
3572
3573 /// Maximum number of Routes to return. The service may return
3574 /// fewer than this value. If unspecified, at most 50 Routes
3575 /// will be returned. The maximum value is 1000; values above 1000 will be
3576 /// coerced to 1000.
3577 pub page_size: i32,
3578
3579 /// Page token received from a previous `ListRoutes` call.
3580 /// Provide this to retrieve the subsequent page.
3581 ///
3582 /// When paginating, all other parameters provided to
3583 /// `ListRoutes` must match the call that provided the page
3584 /// token.
3585 pub page_token: std::string::String,
3586
3587 /// Filter request.
3588 pub filter: std::string::String,
3589
3590 /// Order by fields for the result.
3591 pub order_by: std::string::String,
3592
3593 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3594}
3595
3596impl ListRoutesRequest {
3597 /// Creates a new default instance.
3598 pub fn new() -> Self {
3599 std::default::Default::default()
3600 }
3601
3602 /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
3603 ///
3604 /// # Example
3605 /// ```ignore,no_run
3606 /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3607 /// let x = ListRoutesRequest::new().set_parent("example");
3608 /// ```
3609 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3610 self.parent = v.into();
3611 self
3612 }
3613
3614 /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
3615 ///
3616 /// # Example
3617 /// ```ignore,no_run
3618 /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3619 /// let x = ListRoutesRequest::new().set_page_size(42);
3620 /// ```
3621 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3622 self.page_size = v.into();
3623 self
3624 }
3625
3626 /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
3627 ///
3628 /// # Example
3629 /// ```ignore,no_run
3630 /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3631 /// let x = ListRoutesRequest::new().set_page_token("example");
3632 /// ```
3633 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3634 self.page_token = v.into();
3635 self
3636 }
3637
3638 /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
3639 ///
3640 /// # Example
3641 /// ```ignore,no_run
3642 /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3643 /// let x = ListRoutesRequest::new().set_filter("example");
3644 /// ```
3645 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3646 self.filter = v.into();
3647 self
3648 }
3649
3650 /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
3651 ///
3652 /// # Example
3653 /// ```ignore,no_run
3654 /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3655 /// let x = ListRoutesRequest::new().set_order_by("example");
3656 /// ```
3657 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3658 self.order_by = v.into();
3659 self
3660 }
3661}
3662
3663impl wkt::message::Message for ListRoutesRequest {
3664 fn typename() -> &'static str {
3665 "type.googleapis.com/google.cloud.datastream.v1.ListRoutesRequest"
3666 }
3667}
3668
3669/// Route list response.
3670#[derive(Clone, Default, PartialEq)]
3671#[non_exhaustive]
3672pub struct ListRoutesResponse {
3673 /// List of Routes.
3674 pub routes: std::vec::Vec<crate::model::Route>,
3675
3676 /// A token, which can be sent as `page_token` to retrieve the next page.
3677 /// If this field is omitted, there are no subsequent pages.
3678 pub next_page_token: std::string::String,
3679
3680 /// Locations that could not be reached.
3681 pub unreachable: std::vec::Vec<std::string::String>,
3682
3683 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3684}
3685
3686impl ListRoutesResponse {
3687 /// Creates a new default instance.
3688 pub fn new() -> Self {
3689 std::default::Default::default()
3690 }
3691
3692 /// Sets the value of [routes][crate::model::ListRoutesResponse::routes].
3693 ///
3694 /// # Example
3695 /// ```ignore,no_run
3696 /// # use google_cloud_datastream_v1::model::ListRoutesResponse;
3697 /// use google_cloud_datastream_v1::model::Route;
3698 /// let x = ListRoutesResponse::new()
3699 /// .set_routes([
3700 /// Route::default()/* use setters */,
3701 /// Route::default()/* use (different) setters */,
3702 /// ]);
3703 /// ```
3704 pub fn set_routes<T, V>(mut self, v: T) -> Self
3705 where
3706 T: std::iter::IntoIterator<Item = V>,
3707 V: std::convert::Into<crate::model::Route>,
3708 {
3709 use std::iter::Iterator;
3710 self.routes = v.into_iter().map(|i| i.into()).collect();
3711 self
3712 }
3713
3714 /// Sets the value of [next_page_token][crate::model::ListRoutesResponse::next_page_token].
3715 ///
3716 /// # Example
3717 /// ```ignore,no_run
3718 /// # use google_cloud_datastream_v1::model::ListRoutesResponse;
3719 /// let x = ListRoutesResponse::new().set_next_page_token("example");
3720 /// ```
3721 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3722 self.next_page_token = v.into();
3723 self
3724 }
3725
3726 /// Sets the value of [unreachable][crate::model::ListRoutesResponse::unreachable].
3727 ///
3728 /// # Example
3729 /// ```ignore,no_run
3730 /// # use google_cloud_datastream_v1::model::ListRoutesResponse;
3731 /// let x = ListRoutesResponse::new().set_unreachable(["a", "b", "c"]);
3732 /// ```
3733 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3734 where
3735 T: std::iter::IntoIterator<Item = V>,
3736 V: std::convert::Into<std::string::String>,
3737 {
3738 use std::iter::Iterator;
3739 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3740 self
3741 }
3742}
3743
3744impl wkt::message::Message for ListRoutesResponse {
3745 fn typename() -> &'static str {
3746 "type.googleapis.com/google.cloud.datastream.v1.ListRoutesResponse"
3747 }
3748}
3749
3750#[doc(hidden)]
3751impl google_cloud_gax::paginator::internal::PageableResponse for ListRoutesResponse {
3752 type PageItem = crate::model::Route;
3753
3754 fn items(self) -> std::vec::Vec<Self::PageItem> {
3755 self.routes
3756 }
3757
3758 fn next_page_token(&self) -> std::string::String {
3759 use std::clone::Clone;
3760 self.next_page_token.clone()
3761 }
3762}
3763
3764/// Route deletion request.
3765#[derive(Clone, Default, PartialEq)]
3766#[non_exhaustive]
3767pub struct DeleteRouteRequest {
3768 /// Required. The name of the Route resource to delete.
3769 pub name: std::string::String,
3770
3771 /// Optional. A request ID to identify requests. Specify a unique request ID
3772 /// so that if you must retry your request, the server will know to ignore
3773 /// the request if it has already been completed. The server will guarantee
3774 /// that for at least 60 minutes after the first request.
3775 ///
3776 /// For example, consider a situation where you make an initial request and the
3777 /// request times out. If you make the request again with the same request ID,
3778 /// the server can check if original operation with the same request ID was
3779 /// received, and if so, will ignore the second request. This prevents clients
3780 /// from accidentally creating duplicate commitments.
3781 ///
3782 /// The request ID must be a valid UUID with the exception that zero UUID is
3783 /// not supported (00000000-0000-0000-0000-000000000000).
3784 pub request_id: std::string::String,
3785
3786 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3787}
3788
3789impl DeleteRouteRequest {
3790 /// Creates a new default instance.
3791 pub fn new() -> Self {
3792 std::default::Default::default()
3793 }
3794
3795 /// Sets the value of [name][crate::model::DeleteRouteRequest::name].
3796 ///
3797 /// # Example
3798 /// ```ignore,no_run
3799 /// # use google_cloud_datastream_v1::model::DeleteRouteRequest;
3800 /// let x = DeleteRouteRequest::new().set_name("example");
3801 /// ```
3802 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3803 self.name = v.into();
3804 self
3805 }
3806
3807 /// Sets the value of [request_id][crate::model::DeleteRouteRequest::request_id].
3808 ///
3809 /// # Example
3810 /// ```ignore,no_run
3811 /// # use google_cloud_datastream_v1::model::DeleteRouteRequest;
3812 /// let x = DeleteRouteRequest::new().set_request_id("example");
3813 /// ```
3814 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3815 self.request_id = v.into();
3816 self
3817 }
3818}
3819
3820impl wkt::message::Message for DeleteRouteRequest {
3821 fn typename() -> &'static str {
3822 "type.googleapis.com/google.cloud.datastream.v1.DeleteRouteRequest"
3823 }
3824}
3825
3826/// Route get request.
3827#[derive(Clone, Default, PartialEq)]
3828#[non_exhaustive]
3829pub struct GetRouteRequest {
3830 /// Required. The name of the Route resource to get.
3831 pub name: std::string::String,
3832
3833 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3834}
3835
3836impl GetRouteRequest {
3837 /// Creates a new default instance.
3838 pub fn new() -> Self {
3839 std::default::Default::default()
3840 }
3841
3842 /// Sets the value of [name][crate::model::GetRouteRequest::name].
3843 ///
3844 /// # Example
3845 /// ```ignore,no_run
3846 /// # use google_cloud_datastream_v1::model::GetRouteRequest;
3847 /// let x = GetRouteRequest::new().set_name("example");
3848 /// ```
3849 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3850 self.name = v.into();
3851 self
3852 }
3853}
3854
3855impl wkt::message::Message for GetRouteRequest {
3856 fn typename() -> &'static str {
3857 "type.googleapis.com/google.cloud.datastream.v1.GetRouteRequest"
3858 }
3859}
3860
3861/// Oracle database profile.
3862#[derive(Clone, Default, PartialEq)]
3863#[non_exhaustive]
3864pub struct OracleProfile {
3865 /// Required. Hostname for the Oracle connection.
3866 pub hostname: std::string::String,
3867
3868 /// Port for the Oracle connection, default value is 1521.
3869 pub port: i32,
3870
3871 /// Required. Username for the Oracle connection.
3872 pub username: std::string::String,
3873
3874 /// Optional. Password for the Oracle connection. Mutually exclusive with the
3875 /// `secret_manager_stored_password` field.
3876 pub password: std::string::String,
3877
3878 /// Required. Database for the Oracle connection.
3879 pub database_service: std::string::String,
3880
3881 /// Connection string attributes
3882 pub connection_attributes: std::collections::HashMap<std::string::String, std::string::String>,
3883
3884 /// Optional. SSL configuration for the Oracle connection.
3885 pub oracle_ssl_config: std::option::Option<crate::model::OracleSslConfig>,
3886
3887 /// Optional. Configuration for Oracle ASM connection.
3888 pub oracle_asm_config: std::option::Option<crate::model::OracleAsmConfig>,
3889
3890 /// Optional. A reference to a Secret Manager resource name storing the Oracle
3891 /// connection password. Mutually exclusive with the `password` field.
3892 pub secret_manager_stored_password: std::string::String,
3893
3894 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3895}
3896
3897impl OracleProfile {
3898 /// Creates a new default instance.
3899 pub fn new() -> Self {
3900 std::default::Default::default()
3901 }
3902
3903 /// Sets the value of [hostname][crate::model::OracleProfile::hostname].
3904 ///
3905 /// # Example
3906 /// ```ignore,no_run
3907 /// # use google_cloud_datastream_v1::model::OracleProfile;
3908 /// let x = OracleProfile::new().set_hostname("example");
3909 /// ```
3910 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3911 self.hostname = v.into();
3912 self
3913 }
3914
3915 /// Sets the value of [port][crate::model::OracleProfile::port].
3916 ///
3917 /// # Example
3918 /// ```ignore,no_run
3919 /// # use google_cloud_datastream_v1::model::OracleProfile;
3920 /// let x = OracleProfile::new().set_port(42);
3921 /// ```
3922 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3923 self.port = v.into();
3924 self
3925 }
3926
3927 /// Sets the value of [username][crate::model::OracleProfile::username].
3928 ///
3929 /// # Example
3930 /// ```ignore,no_run
3931 /// # use google_cloud_datastream_v1::model::OracleProfile;
3932 /// let x = OracleProfile::new().set_username("example");
3933 /// ```
3934 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3935 self.username = v.into();
3936 self
3937 }
3938
3939 /// Sets the value of [password][crate::model::OracleProfile::password].
3940 ///
3941 /// # Example
3942 /// ```ignore,no_run
3943 /// # use google_cloud_datastream_v1::model::OracleProfile;
3944 /// let x = OracleProfile::new().set_password("example");
3945 /// ```
3946 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3947 self.password = v.into();
3948 self
3949 }
3950
3951 /// Sets the value of [database_service][crate::model::OracleProfile::database_service].
3952 ///
3953 /// # Example
3954 /// ```ignore,no_run
3955 /// # use google_cloud_datastream_v1::model::OracleProfile;
3956 /// let x = OracleProfile::new().set_database_service("example");
3957 /// ```
3958 pub fn set_database_service<T: std::convert::Into<std::string::String>>(
3959 mut self,
3960 v: T,
3961 ) -> Self {
3962 self.database_service = v.into();
3963 self
3964 }
3965
3966 /// Sets the value of [connection_attributes][crate::model::OracleProfile::connection_attributes].
3967 ///
3968 /// # Example
3969 /// ```ignore,no_run
3970 /// # use google_cloud_datastream_v1::model::OracleProfile;
3971 /// let x = OracleProfile::new().set_connection_attributes([
3972 /// ("key0", "abc"),
3973 /// ("key1", "xyz"),
3974 /// ]);
3975 /// ```
3976 pub fn set_connection_attributes<T, K, V>(mut self, v: T) -> Self
3977 where
3978 T: std::iter::IntoIterator<Item = (K, V)>,
3979 K: std::convert::Into<std::string::String>,
3980 V: std::convert::Into<std::string::String>,
3981 {
3982 use std::iter::Iterator;
3983 self.connection_attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3984 self
3985 }
3986
3987 /// Sets the value of [oracle_ssl_config][crate::model::OracleProfile::oracle_ssl_config].
3988 ///
3989 /// # Example
3990 /// ```ignore,no_run
3991 /// # use google_cloud_datastream_v1::model::OracleProfile;
3992 /// use google_cloud_datastream_v1::model::OracleSslConfig;
3993 /// let x = OracleProfile::new().set_oracle_ssl_config(OracleSslConfig::default()/* use setters */);
3994 /// ```
3995 pub fn set_oracle_ssl_config<T>(mut self, v: T) -> Self
3996 where
3997 T: std::convert::Into<crate::model::OracleSslConfig>,
3998 {
3999 self.oracle_ssl_config = std::option::Option::Some(v.into());
4000 self
4001 }
4002
4003 /// Sets or clears the value of [oracle_ssl_config][crate::model::OracleProfile::oracle_ssl_config].
4004 ///
4005 /// # Example
4006 /// ```ignore,no_run
4007 /// # use google_cloud_datastream_v1::model::OracleProfile;
4008 /// use google_cloud_datastream_v1::model::OracleSslConfig;
4009 /// let x = OracleProfile::new().set_or_clear_oracle_ssl_config(Some(OracleSslConfig::default()/* use setters */));
4010 /// let x = OracleProfile::new().set_or_clear_oracle_ssl_config(None::<OracleSslConfig>);
4011 /// ```
4012 pub fn set_or_clear_oracle_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
4013 where
4014 T: std::convert::Into<crate::model::OracleSslConfig>,
4015 {
4016 self.oracle_ssl_config = v.map(|x| x.into());
4017 self
4018 }
4019
4020 /// Sets the value of [oracle_asm_config][crate::model::OracleProfile::oracle_asm_config].
4021 ///
4022 /// # Example
4023 /// ```ignore,no_run
4024 /// # use google_cloud_datastream_v1::model::OracleProfile;
4025 /// use google_cloud_datastream_v1::model::OracleAsmConfig;
4026 /// let x = OracleProfile::new().set_oracle_asm_config(OracleAsmConfig::default()/* use setters */);
4027 /// ```
4028 pub fn set_oracle_asm_config<T>(mut self, v: T) -> Self
4029 where
4030 T: std::convert::Into<crate::model::OracleAsmConfig>,
4031 {
4032 self.oracle_asm_config = std::option::Option::Some(v.into());
4033 self
4034 }
4035
4036 /// Sets or clears the value of [oracle_asm_config][crate::model::OracleProfile::oracle_asm_config].
4037 ///
4038 /// # Example
4039 /// ```ignore,no_run
4040 /// # use google_cloud_datastream_v1::model::OracleProfile;
4041 /// use google_cloud_datastream_v1::model::OracleAsmConfig;
4042 /// let x = OracleProfile::new().set_or_clear_oracle_asm_config(Some(OracleAsmConfig::default()/* use setters */));
4043 /// let x = OracleProfile::new().set_or_clear_oracle_asm_config(None::<OracleAsmConfig>);
4044 /// ```
4045 pub fn set_or_clear_oracle_asm_config<T>(mut self, v: std::option::Option<T>) -> Self
4046 where
4047 T: std::convert::Into<crate::model::OracleAsmConfig>,
4048 {
4049 self.oracle_asm_config = v.map(|x| x.into());
4050 self
4051 }
4052
4053 /// Sets the value of [secret_manager_stored_password][crate::model::OracleProfile::secret_manager_stored_password].
4054 ///
4055 /// # Example
4056 /// ```ignore,no_run
4057 /// # use google_cloud_datastream_v1::model::OracleProfile;
4058 /// let x = OracleProfile::new().set_secret_manager_stored_password("example");
4059 /// ```
4060 pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4061 mut self,
4062 v: T,
4063 ) -> Self {
4064 self.secret_manager_stored_password = v.into();
4065 self
4066 }
4067}
4068
4069impl wkt::message::Message for OracleProfile {
4070 fn typename() -> &'static str {
4071 "type.googleapis.com/google.cloud.datastream.v1.OracleProfile"
4072 }
4073}
4074
4075/// Configuration for Oracle Automatic Storage Management (ASM) connection.
4076#[derive(Clone, Default, PartialEq)]
4077#[non_exhaustive]
4078pub struct OracleAsmConfig {
4079 /// Required. Hostname for the Oracle ASM connection.
4080 pub hostname: std::string::String,
4081
4082 /// Required. Port for the Oracle ASM connection.
4083 pub port: i32,
4084
4085 /// Required. Username for the Oracle ASM connection.
4086 pub username: std::string::String,
4087
4088 /// Optional. Password for the Oracle ASM connection. Mutually exclusive with
4089 /// the `secret_manager_stored_password` field.
4090 pub password: std::string::String,
4091
4092 /// Required. ASM service name for the Oracle ASM connection.
4093 pub asm_service: std::string::String,
4094
4095 /// Optional. Connection string attributes
4096 pub connection_attributes: std::collections::HashMap<std::string::String, std::string::String>,
4097
4098 /// Optional. SSL configuration for the Oracle connection.
4099 pub oracle_ssl_config: std::option::Option<crate::model::OracleSslConfig>,
4100
4101 /// Optional. A reference to a Secret Manager resource name storing the Oracle
4102 /// ASM connection password. Mutually exclusive with the `password` field.
4103 pub secret_manager_stored_password: std::string::String,
4104
4105 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4106}
4107
4108impl OracleAsmConfig {
4109 /// Creates a new default instance.
4110 pub fn new() -> Self {
4111 std::default::Default::default()
4112 }
4113
4114 /// Sets the value of [hostname][crate::model::OracleAsmConfig::hostname].
4115 ///
4116 /// # Example
4117 /// ```ignore,no_run
4118 /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4119 /// let x = OracleAsmConfig::new().set_hostname("example");
4120 /// ```
4121 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4122 self.hostname = v.into();
4123 self
4124 }
4125
4126 /// Sets the value of [port][crate::model::OracleAsmConfig::port].
4127 ///
4128 /// # Example
4129 /// ```ignore,no_run
4130 /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4131 /// let x = OracleAsmConfig::new().set_port(42);
4132 /// ```
4133 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4134 self.port = v.into();
4135 self
4136 }
4137
4138 /// Sets the value of [username][crate::model::OracleAsmConfig::username].
4139 ///
4140 /// # Example
4141 /// ```ignore,no_run
4142 /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4143 /// let x = OracleAsmConfig::new().set_username("example");
4144 /// ```
4145 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4146 self.username = v.into();
4147 self
4148 }
4149
4150 /// Sets the value of [password][crate::model::OracleAsmConfig::password].
4151 ///
4152 /// # Example
4153 /// ```ignore,no_run
4154 /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4155 /// let x = OracleAsmConfig::new().set_password("example");
4156 /// ```
4157 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4158 self.password = v.into();
4159 self
4160 }
4161
4162 /// Sets the value of [asm_service][crate::model::OracleAsmConfig::asm_service].
4163 ///
4164 /// # Example
4165 /// ```ignore,no_run
4166 /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4167 /// let x = OracleAsmConfig::new().set_asm_service("example");
4168 /// ```
4169 pub fn set_asm_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4170 self.asm_service = v.into();
4171 self
4172 }
4173
4174 /// Sets the value of [connection_attributes][crate::model::OracleAsmConfig::connection_attributes].
4175 ///
4176 /// # Example
4177 /// ```ignore,no_run
4178 /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4179 /// let x = OracleAsmConfig::new().set_connection_attributes([
4180 /// ("key0", "abc"),
4181 /// ("key1", "xyz"),
4182 /// ]);
4183 /// ```
4184 pub fn set_connection_attributes<T, K, V>(mut self, v: T) -> Self
4185 where
4186 T: std::iter::IntoIterator<Item = (K, V)>,
4187 K: std::convert::Into<std::string::String>,
4188 V: std::convert::Into<std::string::String>,
4189 {
4190 use std::iter::Iterator;
4191 self.connection_attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4192 self
4193 }
4194
4195 /// Sets the value of [oracle_ssl_config][crate::model::OracleAsmConfig::oracle_ssl_config].
4196 ///
4197 /// # Example
4198 /// ```ignore,no_run
4199 /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4200 /// use google_cloud_datastream_v1::model::OracleSslConfig;
4201 /// let x = OracleAsmConfig::new().set_oracle_ssl_config(OracleSslConfig::default()/* use setters */);
4202 /// ```
4203 pub fn set_oracle_ssl_config<T>(mut self, v: T) -> Self
4204 where
4205 T: std::convert::Into<crate::model::OracleSslConfig>,
4206 {
4207 self.oracle_ssl_config = std::option::Option::Some(v.into());
4208 self
4209 }
4210
4211 /// Sets or clears the value of [oracle_ssl_config][crate::model::OracleAsmConfig::oracle_ssl_config].
4212 ///
4213 /// # Example
4214 /// ```ignore,no_run
4215 /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4216 /// use google_cloud_datastream_v1::model::OracleSslConfig;
4217 /// let x = OracleAsmConfig::new().set_or_clear_oracle_ssl_config(Some(OracleSslConfig::default()/* use setters */));
4218 /// let x = OracleAsmConfig::new().set_or_clear_oracle_ssl_config(None::<OracleSslConfig>);
4219 /// ```
4220 pub fn set_or_clear_oracle_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
4221 where
4222 T: std::convert::Into<crate::model::OracleSslConfig>,
4223 {
4224 self.oracle_ssl_config = v.map(|x| x.into());
4225 self
4226 }
4227
4228 /// Sets the value of [secret_manager_stored_password][crate::model::OracleAsmConfig::secret_manager_stored_password].
4229 ///
4230 /// # Example
4231 /// ```ignore,no_run
4232 /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4233 /// let x = OracleAsmConfig::new().set_secret_manager_stored_password("example");
4234 /// ```
4235 pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4236 mut self,
4237 v: T,
4238 ) -> Self {
4239 self.secret_manager_stored_password = v.into();
4240 self
4241 }
4242}
4243
4244impl wkt::message::Message for OracleAsmConfig {
4245 fn typename() -> &'static str {
4246 "type.googleapis.com/google.cloud.datastream.v1.OracleAsmConfig"
4247 }
4248}
4249
4250/// MySQL database profile.
4251#[derive(Clone, Default, PartialEq)]
4252#[non_exhaustive]
4253pub struct MysqlProfile {
4254 /// Required. Hostname for the MySQL connection.
4255 pub hostname: std::string::String,
4256
4257 /// Port for the MySQL connection, default value is 3306.
4258 pub port: i32,
4259
4260 /// Required. Username for the MySQL connection.
4261 pub username: std::string::String,
4262
4263 /// Optional. Input only. Password for the MySQL connection. Mutually exclusive
4264 /// with the `secret_manager_stored_password` field.
4265 pub password: std::string::String,
4266
4267 /// SSL configuration for the MySQL connection.
4268 pub ssl_config: std::option::Option<crate::model::MysqlSslConfig>,
4269
4270 /// Optional. A reference to a Secret Manager resource name storing the MySQL
4271 /// connection password. Mutually exclusive with the `password` field.
4272 pub secret_manager_stored_password: std::string::String,
4273
4274 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4275}
4276
4277impl MysqlProfile {
4278 /// Creates a new default instance.
4279 pub fn new() -> Self {
4280 std::default::Default::default()
4281 }
4282
4283 /// Sets the value of [hostname][crate::model::MysqlProfile::hostname].
4284 ///
4285 /// # Example
4286 /// ```ignore,no_run
4287 /// # use google_cloud_datastream_v1::model::MysqlProfile;
4288 /// let x = MysqlProfile::new().set_hostname("example");
4289 /// ```
4290 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4291 self.hostname = v.into();
4292 self
4293 }
4294
4295 /// Sets the value of [port][crate::model::MysqlProfile::port].
4296 ///
4297 /// # Example
4298 /// ```ignore,no_run
4299 /// # use google_cloud_datastream_v1::model::MysqlProfile;
4300 /// let x = MysqlProfile::new().set_port(42);
4301 /// ```
4302 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4303 self.port = v.into();
4304 self
4305 }
4306
4307 /// Sets the value of [username][crate::model::MysqlProfile::username].
4308 ///
4309 /// # Example
4310 /// ```ignore,no_run
4311 /// # use google_cloud_datastream_v1::model::MysqlProfile;
4312 /// let x = MysqlProfile::new().set_username("example");
4313 /// ```
4314 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4315 self.username = v.into();
4316 self
4317 }
4318
4319 /// Sets the value of [password][crate::model::MysqlProfile::password].
4320 ///
4321 /// # Example
4322 /// ```ignore,no_run
4323 /// # use google_cloud_datastream_v1::model::MysqlProfile;
4324 /// let x = MysqlProfile::new().set_password("example");
4325 /// ```
4326 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4327 self.password = v.into();
4328 self
4329 }
4330
4331 /// Sets the value of [ssl_config][crate::model::MysqlProfile::ssl_config].
4332 ///
4333 /// # Example
4334 /// ```ignore,no_run
4335 /// # use google_cloud_datastream_v1::model::MysqlProfile;
4336 /// use google_cloud_datastream_v1::model::MysqlSslConfig;
4337 /// let x = MysqlProfile::new().set_ssl_config(MysqlSslConfig::default()/* use setters */);
4338 /// ```
4339 pub fn set_ssl_config<T>(mut self, v: T) -> Self
4340 where
4341 T: std::convert::Into<crate::model::MysqlSslConfig>,
4342 {
4343 self.ssl_config = std::option::Option::Some(v.into());
4344 self
4345 }
4346
4347 /// Sets or clears the value of [ssl_config][crate::model::MysqlProfile::ssl_config].
4348 ///
4349 /// # Example
4350 /// ```ignore,no_run
4351 /// # use google_cloud_datastream_v1::model::MysqlProfile;
4352 /// use google_cloud_datastream_v1::model::MysqlSslConfig;
4353 /// let x = MysqlProfile::new().set_or_clear_ssl_config(Some(MysqlSslConfig::default()/* use setters */));
4354 /// let x = MysqlProfile::new().set_or_clear_ssl_config(None::<MysqlSslConfig>);
4355 /// ```
4356 pub fn set_or_clear_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
4357 where
4358 T: std::convert::Into<crate::model::MysqlSslConfig>,
4359 {
4360 self.ssl_config = v.map(|x| x.into());
4361 self
4362 }
4363
4364 /// Sets the value of [secret_manager_stored_password][crate::model::MysqlProfile::secret_manager_stored_password].
4365 ///
4366 /// # Example
4367 /// ```ignore,no_run
4368 /// # use google_cloud_datastream_v1::model::MysqlProfile;
4369 /// let x = MysqlProfile::new().set_secret_manager_stored_password("example");
4370 /// ```
4371 pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4372 mut self,
4373 v: T,
4374 ) -> Self {
4375 self.secret_manager_stored_password = v.into();
4376 self
4377 }
4378}
4379
4380impl wkt::message::Message for MysqlProfile {
4381 fn typename() -> &'static str {
4382 "type.googleapis.com/google.cloud.datastream.v1.MysqlProfile"
4383 }
4384}
4385
4386/// PostgreSQL database profile.
4387#[derive(Clone, Default, PartialEq)]
4388#[non_exhaustive]
4389pub struct PostgresqlProfile {
4390 /// Required. Hostname for the PostgreSQL connection.
4391 pub hostname: std::string::String,
4392
4393 /// Port for the PostgreSQL connection, default value is 5432.
4394 pub port: i32,
4395
4396 /// Required. Username for the PostgreSQL connection.
4397 pub username: std::string::String,
4398
4399 /// Optional. Password for the PostgreSQL connection. Mutually exclusive with
4400 /// the `secret_manager_stored_password` field.
4401 pub password: std::string::String,
4402
4403 /// Required. Database for the PostgreSQL connection.
4404 pub database: std::string::String,
4405
4406 /// Optional. A reference to a Secret Manager resource name storing the
4407 /// PostgreSQL connection password. Mutually exclusive with the `password`
4408 /// field.
4409 pub secret_manager_stored_password: std::string::String,
4410
4411 /// Optional. SSL configuration for the PostgreSQL connection.
4412 /// In case PostgresqlSslConfig is not set, the connection will use the default
4413 /// SSL mode, which is `prefer` (i.e. this mode will only use encryption if
4414 /// enabled from database side, otherwise will use unencrypted communication)
4415 pub ssl_config: std::option::Option<crate::model::PostgresqlSslConfig>,
4416
4417 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4418}
4419
4420impl PostgresqlProfile {
4421 /// Creates a new default instance.
4422 pub fn new() -> Self {
4423 std::default::Default::default()
4424 }
4425
4426 /// Sets the value of [hostname][crate::model::PostgresqlProfile::hostname].
4427 ///
4428 /// # Example
4429 /// ```ignore,no_run
4430 /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4431 /// let x = PostgresqlProfile::new().set_hostname("example");
4432 /// ```
4433 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4434 self.hostname = v.into();
4435 self
4436 }
4437
4438 /// Sets the value of [port][crate::model::PostgresqlProfile::port].
4439 ///
4440 /// # Example
4441 /// ```ignore,no_run
4442 /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4443 /// let x = PostgresqlProfile::new().set_port(42);
4444 /// ```
4445 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4446 self.port = v.into();
4447 self
4448 }
4449
4450 /// Sets the value of [username][crate::model::PostgresqlProfile::username].
4451 ///
4452 /// # Example
4453 /// ```ignore,no_run
4454 /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4455 /// let x = PostgresqlProfile::new().set_username("example");
4456 /// ```
4457 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4458 self.username = v.into();
4459 self
4460 }
4461
4462 /// Sets the value of [password][crate::model::PostgresqlProfile::password].
4463 ///
4464 /// # Example
4465 /// ```ignore,no_run
4466 /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4467 /// let x = PostgresqlProfile::new().set_password("example");
4468 /// ```
4469 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4470 self.password = v.into();
4471 self
4472 }
4473
4474 /// Sets the value of [database][crate::model::PostgresqlProfile::database].
4475 ///
4476 /// # Example
4477 /// ```ignore,no_run
4478 /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4479 /// let x = PostgresqlProfile::new().set_database("example");
4480 /// ```
4481 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4482 self.database = v.into();
4483 self
4484 }
4485
4486 /// Sets the value of [secret_manager_stored_password][crate::model::PostgresqlProfile::secret_manager_stored_password].
4487 ///
4488 /// # Example
4489 /// ```ignore,no_run
4490 /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4491 /// let x = PostgresqlProfile::new().set_secret_manager_stored_password("example");
4492 /// ```
4493 pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4494 mut self,
4495 v: T,
4496 ) -> Self {
4497 self.secret_manager_stored_password = v.into();
4498 self
4499 }
4500
4501 /// Sets the value of [ssl_config][crate::model::PostgresqlProfile::ssl_config].
4502 ///
4503 /// # Example
4504 /// ```ignore,no_run
4505 /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4506 /// use google_cloud_datastream_v1::model::PostgresqlSslConfig;
4507 /// let x = PostgresqlProfile::new().set_ssl_config(PostgresqlSslConfig::default()/* use setters */);
4508 /// ```
4509 pub fn set_ssl_config<T>(mut self, v: T) -> Self
4510 where
4511 T: std::convert::Into<crate::model::PostgresqlSslConfig>,
4512 {
4513 self.ssl_config = std::option::Option::Some(v.into());
4514 self
4515 }
4516
4517 /// Sets or clears the value of [ssl_config][crate::model::PostgresqlProfile::ssl_config].
4518 ///
4519 /// # Example
4520 /// ```ignore,no_run
4521 /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4522 /// use google_cloud_datastream_v1::model::PostgresqlSslConfig;
4523 /// let x = PostgresqlProfile::new().set_or_clear_ssl_config(Some(PostgresqlSslConfig::default()/* use setters */));
4524 /// let x = PostgresqlProfile::new().set_or_clear_ssl_config(None::<PostgresqlSslConfig>);
4525 /// ```
4526 pub fn set_or_clear_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
4527 where
4528 T: std::convert::Into<crate::model::PostgresqlSslConfig>,
4529 {
4530 self.ssl_config = v.map(|x| x.into());
4531 self
4532 }
4533}
4534
4535impl wkt::message::Message for PostgresqlProfile {
4536 fn typename() -> &'static str {
4537 "type.googleapis.com/google.cloud.datastream.v1.PostgresqlProfile"
4538 }
4539}
4540
4541/// SQLServer database profile.
4542#[derive(Clone, Default, PartialEq)]
4543#[non_exhaustive]
4544pub struct SqlServerProfile {
4545 /// Required. Hostname for the SQLServer connection.
4546 pub hostname: std::string::String,
4547
4548 /// Port for the SQLServer connection, default value is 1433.
4549 pub port: i32,
4550
4551 /// Required. Username for the SQLServer connection.
4552 pub username: std::string::String,
4553
4554 /// Optional. Password for the SQLServer connection. Mutually exclusive with
4555 /// the `secret_manager_stored_password` field.
4556 pub password: std::string::String,
4557
4558 /// Required. Database for the SQLServer connection.
4559 pub database: std::string::String,
4560
4561 /// Optional. A reference to a Secret Manager resource name storing the
4562 /// SQLServer connection password. Mutually exclusive with the `password`
4563 /// field.
4564 pub secret_manager_stored_password: std::string::String,
4565
4566 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4567}
4568
4569impl SqlServerProfile {
4570 /// Creates a new default instance.
4571 pub fn new() -> Self {
4572 std::default::Default::default()
4573 }
4574
4575 /// Sets the value of [hostname][crate::model::SqlServerProfile::hostname].
4576 ///
4577 /// # Example
4578 /// ```ignore,no_run
4579 /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4580 /// let x = SqlServerProfile::new().set_hostname("example");
4581 /// ```
4582 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4583 self.hostname = v.into();
4584 self
4585 }
4586
4587 /// Sets the value of [port][crate::model::SqlServerProfile::port].
4588 ///
4589 /// # Example
4590 /// ```ignore,no_run
4591 /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4592 /// let x = SqlServerProfile::new().set_port(42);
4593 /// ```
4594 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4595 self.port = v.into();
4596 self
4597 }
4598
4599 /// Sets the value of [username][crate::model::SqlServerProfile::username].
4600 ///
4601 /// # Example
4602 /// ```ignore,no_run
4603 /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4604 /// let x = SqlServerProfile::new().set_username("example");
4605 /// ```
4606 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4607 self.username = v.into();
4608 self
4609 }
4610
4611 /// Sets the value of [password][crate::model::SqlServerProfile::password].
4612 ///
4613 /// # Example
4614 /// ```ignore,no_run
4615 /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4616 /// let x = SqlServerProfile::new().set_password("example");
4617 /// ```
4618 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4619 self.password = v.into();
4620 self
4621 }
4622
4623 /// Sets the value of [database][crate::model::SqlServerProfile::database].
4624 ///
4625 /// # Example
4626 /// ```ignore,no_run
4627 /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4628 /// let x = SqlServerProfile::new().set_database("example");
4629 /// ```
4630 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4631 self.database = v.into();
4632 self
4633 }
4634
4635 /// Sets the value of [secret_manager_stored_password][crate::model::SqlServerProfile::secret_manager_stored_password].
4636 ///
4637 /// # Example
4638 /// ```ignore,no_run
4639 /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4640 /// let x = SqlServerProfile::new().set_secret_manager_stored_password("example");
4641 /// ```
4642 pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4643 mut self,
4644 v: T,
4645 ) -> Self {
4646 self.secret_manager_stored_password = v.into();
4647 self
4648 }
4649}
4650
4651impl wkt::message::Message for SqlServerProfile {
4652 fn typename() -> &'static str {
4653 "type.googleapis.com/google.cloud.datastream.v1.SqlServerProfile"
4654 }
4655}
4656
4657/// Salesforce profile
4658#[derive(Clone, Default, PartialEq)]
4659#[non_exhaustive]
4660pub struct SalesforceProfile {
4661 /// Required. Domain endpoint for the Salesforce connection.
4662 pub domain: std::string::String,
4663
4664 /// Credentials for Salesforce connection.
4665 pub credentials: std::option::Option<crate::model::salesforce_profile::Credentials>,
4666
4667 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4668}
4669
4670impl SalesforceProfile {
4671 /// Creates a new default instance.
4672 pub fn new() -> Self {
4673 std::default::Default::default()
4674 }
4675
4676 /// Sets the value of [domain][crate::model::SalesforceProfile::domain].
4677 ///
4678 /// # Example
4679 /// ```ignore,no_run
4680 /// # use google_cloud_datastream_v1::model::SalesforceProfile;
4681 /// let x = SalesforceProfile::new().set_domain("example");
4682 /// ```
4683 pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4684 self.domain = v.into();
4685 self
4686 }
4687
4688 /// Sets the value of [credentials][crate::model::SalesforceProfile::credentials].
4689 ///
4690 /// Note that all the setters affecting `credentials` are mutually
4691 /// exclusive.
4692 ///
4693 /// # Example
4694 /// ```ignore,no_run
4695 /// # use google_cloud_datastream_v1::model::SalesforceProfile;
4696 /// use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4697 /// let x = SalesforceProfile::new().set_credentials(Some(
4698 /// google_cloud_datastream_v1::model::salesforce_profile::Credentials::UserCredentials(UserCredentials::default().into())));
4699 /// ```
4700 pub fn set_credentials<
4701 T: std::convert::Into<std::option::Option<crate::model::salesforce_profile::Credentials>>,
4702 >(
4703 mut self,
4704 v: T,
4705 ) -> Self {
4706 self.credentials = v.into();
4707 self
4708 }
4709
4710 /// The value of [credentials][crate::model::SalesforceProfile::credentials]
4711 /// if it holds a `UserCredentials`, `None` if the field is not set or
4712 /// holds a different branch.
4713 pub fn user_credentials(
4714 &self,
4715 ) -> std::option::Option<&std::boxed::Box<crate::model::salesforce_profile::UserCredentials>>
4716 {
4717 #[allow(unreachable_patterns)]
4718 self.credentials.as_ref().and_then(|v| match v {
4719 crate::model::salesforce_profile::Credentials::UserCredentials(v) => {
4720 std::option::Option::Some(v)
4721 }
4722 _ => std::option::Option::None,
4723 })
4724 }
4725
4726 /// Sets the value of [credentials][crate::model::SalesforceProfile::credentials]
4727 /// to hold a `UserCredentials`.
4728 ///
4729 /// Note that all the setters affecting `credentials` are
4730 /// mutually exclusive.
4731 ///
4732 /// # Example
4733 /// ```ignore,no_run
4734 /// # use google_cloud_datastream_v1::model::SalesforceProfile;
4735 /// use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4736 /// let x = SalesforceProfile::new().set_user_credentials(UserCredentials::default()/* use setters */);
4737 /// assert!(x.user_credentials().is_some());
4738 /// assert!(x.oauth2_client_credentials().is_none());
4739 /// ```
4740 pub fn set_user_credentials<
4741 T: std::convert::Into<std::boxed::Box<crate::model::salesforce_profile::UserCredentials>>,
4742 >(
4743 mut self,
4744 v: T,
4745 ) -> Self {
4746 self.credentials = std::option::Option::Some(
4747 crate::model::salesforce_profile::Credentials::UserCredentials(v.into()),
4748 );
4749 self
4750 }
4751
4752 /// The value of [credentials][crate::model::SalesforceProfile::credentials]
4753 /// if it holds a `Oauth2ClientCredentials`, `None` if the field is not set or
4754 /// holds a different branch.
4755 pub fn oauth2_client_credentials(
4756 &self,
4757 ) -> std::option::Option<
4758 &std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>,
4759 > {
4760 #[allow(unreachable_patterns)]
4761 self.credentials.as_ref().and_then(|v| match v {
4762 crate::model::salesforce_profile::Credentials::Oauth2ClientCredentials(v) => {
4763 std::option::Option::Some(v)
4764 }
4765 _ => std::option::Option::None,
4766 })
4767 }
4768
4769 /// Sets the value of [credentials][crate::model::SalesforceProfile::credentials]
4770 /// to hold a `Oauth2ClientCredentials`.
4771 ///
4772 /// Note that all the setters affecting `credentials` are
4773 /// mutually exclusive.
4774 ///
4775 /// # Example
4776 /// ```ignore,no_run
4777 /// # use google_cloud_datastream_v1::model::SalesforceProfile;
4778 /// use google_cloud_datastream_v1::model::salesforce_profile::Oauth2ClientCredentials;
4779 /// let x = SalesforceProfile::new().set_oauth2_client_credentials(Oauth2ClientCredentials::default()/* use setters */);
4780 /// assert!(x.oauth2_client_credentials().is_some());
4781 /// assert!(x.user_credentials().is_none());
4782 /// ```
4783 pub fn set_oauth2_client_credentials<
4784 T: std::convert::Into<
4785 std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>,
4786 >,
4787 >(
4788 mut self,
4789 v: T,
4790 ) -> Self {
4791 self.credentials = std::option::Option::Some(
4792 crate::model::salesforce_profile::Credentials::Oauth2ClientCredentials(v.into()),
4793 );
4794 self
4795 }
4796}
4797
4798impl wkt::message::Message for SalesforceProfile {
4799 fn typename() -> &'static str {
4800 "type.googleapis.com/google.cloud.datastream.v1.SalesforceProfile"
4801 }
4802}
4803
4804/// Defines additional types related to [SalesforceProfile].
4805pub mod salesforce_profile {
4806 #[allow(unused_imports)]
4807 use super::*;
4808
4809 /// Username-password credentials.
4810 #[derive(Clone, Default, PartialEq)]
4811 #[non_exhaustive]
4812 pub struct UserCredentials {
4813 /// Required. Username for the Salesforce connection.
4814 pub username: std::string::String,
4815
4816 /// Optional. Password for the Salesforce connection.
4817 /// Mutually exclusive with the `secret_manager_stored_password` field.
4818 pub password: std::string::String,
4819
4820 /// Optional. Security token for the Salesforce connection.
4821 /// Mutually exclusive with the `secret_manager_stored_security_token` field.
4822 pub security_token: std::string::String,
4823
4824 /// Optional. A reference to a Secret Manager resource name storing the
4825 /// Salesforce connection's password. Mutually exclusive with the `password`
4826 /// field.
4827 pub secret_manager_stored_password: std::string::String,
4828
4829 /// Optional. A reference to a Secret Manager resource name storing the
4830 /// Salesforce connection's security token. Mutually exclusive with the
4831 /// `security_token` field.
4832 pub secret_manager_stored_security_token: std::string::String,
4833
4834 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4835 }
4836
4837 impl UserCredentials {
4838 /// Creates a new default instance.
4839 pub fn new() -> Self {
4840 std::default::Default::default()
4841 }
4842
4843 /// Sets the value of [username][crate::model::salesforce_profile::UserCredentials::username].
4844 ///
4845 /// # Example
4846 /// ```ignore,no_run
4847 /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4848 /// let x = UserCredentials::new().set_username("example");
4849 /// ```
4850 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4851 self.username = v.into();
4852 self
4853 }
4854
4855 /// Sets the value of [password][crate::model::salesforce_profile::UserCredentials::password].
4856 ///
4857 /// # Example
4858 /// ```ignore,no_run
4859 /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4860 /// let x = UserCredentials::new().set_password("example");
4861 /// ```
4862 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4863 self.password = v.into();
4864 self
4865 }
4866
4867 /// Sets the value of [security_token][crate::model::salesforce_profile::UserCredentials::security_token].
4868 ///
4869 /// # Example
4870 /// ```ignore,no_run
4871 /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4872 /// let x = UserCredentials::new().set_security_token("example");
4873 /// ```
4874 pub fn set_security_token<T: std::convert::Into<std::string::String>>(
4875 mut self,
4876 v: T,
4877 ) -> Self {
4878 self.security_token = v.into();
4879 self
4880 }
4881
4882 /// Sets the value of [secret_manager_stored_password][crate::model::salesforce_profile::UserCredentials::secret_manager_stored_password].
4883 ///
4884 /// # Example
4885 /// ```ignore,no_run
4886 /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4887 /// let x = UserCredentials::new().set_secret_manager_stored_password("example");
4888 /// ```
4889 pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4890 mut self,
4891 v: T,
4892 ) -> Self {
4893 self.secret_manager_stored_password = v.into();
4894 self
4895 }
4896
4897 /// Sets the value of [secret_manager_stored_security_token][crate::model::salesforce_profile::UserCredentials::secret_manager_stored_security_token].
4898 ///
4899 /// # Example
4900 /// ```ignore,no_run
4901 /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4902 /// let x = UserCredentials::new().set_secret_manager_stored_security_token("example");
4903 /// ```
4904 pub fn set_secret_manager_stored_security_token<
4905 T: std::convert::Into<std::string::String>,
4906 >(
4907 mut self,
4908 v: T,
4909 ) -> Self {
4910 self.secret_manager_stored_security_token = v.into();
4911 self
4912 }
4913 }
4914
4915 impl wkt::message::Message for UserCredentials {
4916 fn typename() -> &'static str {
4917 "type.googleapis.com/google.cloud.datastream.v1.SalesforceProfile.UserCredentials"
4918 }
4919 }
4920
4921 /// OAuth2 Client Credentials.
4922 #[derive(Clone, Default, PartialEq)]
4923 #[non_exhaustive]
4924 pub struct Oauth2ClientCredentials {
4925 /// Required. Client ID for Salesforce OAuth2 Client Credentials.
4926 pub client_id: std::string::String,
4927
4928 /// Optional. Client secret for Salesforce OAuth2 Client Credentials.
4929 /// Mutually exclusive with the `secret_manager_stored_client_secret` field.
4930 pub client_secret: std::string::String,
4931
4932 /// Optional. A reference to a Secret Manager resource name storing the
4933 /// Salesforce OAuth2 client_secret. Mutually exclusive with the
4934 /// `client_secret` field.
4935 pub secret_manager_stored_client_secret: std::string::String,
4936
4937 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4938 }
4939
4940 impl Oauth2ClientCredentials {
4941 /// Creates a new default instance.
4942 pub fn new() -> Self {
4943 std::default::Default::default()
4944 }
4945
4946 /// Sets the value of [client_id][crate::model::salesforce_profile::Oauth2ClientCredentials::client_id].
4947 ///
4948 /// # Example
4949 /// ```ignore,no_run
4950 /// # use google_cloud_datastream_v1::model::salesforce_profile::Oauth2ClientCredentials;
4951 /// let x = Oauth2ClientCredentials::new().set_client_id("example");
4952 /// ```
4953 pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4954 self.client_id = v.into();
4955 self
4956 }
4957
4958 /// Sets the value of [client_secret][crate::model::salesforce_profile::Oauth2ClientCredentials::client_secret].
4959 ///
4960 /// # Example
4961 /// ```ignore,no_run
4962 /// # use google_cloud_datastream_v1::model::salesforce_profile::Oauth2ClientCredentials;
4963 /// let x = Oauth2ClientCredentials::new().set_client_secret("example");
4964 /// ```
4965 pub fn set_client_secret<T: std::convert::Into<std::string::String>>(
4966 mut self,
4967 v: T,
4968 ) -> Self {
4969 self.client_secret = v.into();
4970 self
4971 }
4972
4973 /// Sets the value of [secret_manager_stored_client_secret][crate::model::salesforce_profile::Oauth2ClientCredentials::secret_manager_stored_client_secret].
4974 ///
4975 /// # Example
4976 /// ```ignore,no_run
4977 /// # use google_cloud_datastream_v1::model::salesforce_profile::Oauth2ClientCredentials;
4978 /// let x = Oauth2ClientCredentials::new().set_secret_manager_stored_client_secret("example");
4979 /// ```
4980 pub fn set_secret_manager_stored_client_secret<
4981 T: std::convert::Into<std::string::String>,
4982 >(
4983 mut self,
4984 v: T,
4985 ) -> Self {
4986 self.secret_manager_stored_client_secret = v.into();
4987 self
4988 }
4989 }
4990
4991 impl wkt::message::Message for Oauth2ClientCredentials {
4992 fn typename() -> &'static str {
4993 "type.googleapis.com/google.cloud.datastream.v1.SalesforceProfile.Oauth2ClientCredentials"
4994 }
4995 }
4996
4997 /// Credentials for Salesforce connection.
4998 #[derive(Clone, Debug, PartialEq)]
4999 #[non_exhaustive]
5000 pub enum Credentials {
5001 /// User-password authentication.
5002 UserCredentials(std::boxed::Box<crate::model::salesforce_profile::UserCredentials>),
5003 /// Connected app authentication.
5004 Oauth2ClientCredentials(
5005 std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>,
5006 ),
5007 }
5008}
5009
5010/// MongoDB profile.
5011#[derive(Clone, Default, PartialEq)]
5012#[non_exhaustive]
5013pub struct MongodbProfile {
5014 /// Required. List of host addresses for a MongoDB cluster.
5015 /// For SRV connection format, this list must contain exactly one DNS host
5016 /// without a port. For Standard connection format, this list must contain all
5017 /// the required hosts in the cluster with their respective ports.
5018 pub host_addresses: std::vec::Vec<crate::model::HostAddress>,
5019
5020 /// Optional. Name of the replica set. Only needed for self hosted replica set
5021 /// type MongoDB cluster. For SRV connection format, this field must be empty.
5022 /// For Standard connection format, this field must be specified.
5023 pub replica_set: std::string::String,
5024
5025 /// Required. Username for the MongoDB connection.
5026 pub username: std::string::String,
5027
5028 /// Optional. Password for the MongoDB connection. Mutually exclusive with the
5029 /// `secret_manager_stored_password` field.
5030 pub password: std::string::String,
5031
5032 /// Optional. A reference to a Secret Manager resource name storing the
5033 /// SQLServer connection password. Mutually exclusive with the `password`
5034 /// field.
5035 pub secret_manager_stored_password: std::string::String,
5036
5037 /// Optional. SSL configuration for the MongoDB connection.
5038 pub ssl_config: std::option::Option<crate::model::MongodbSslConfig>,
5039
5040 /// MongoDB connection format.
5041 /// Must specify either srv_connection_format or standard_connection_format.
5042 pub mongodb_connection_format:
5043 std::option::Option<crate::model::mongodb_profile::MongodbConnectionFormat>,
5044
5045 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5046}
5047
5048impl MongodbProfile {
5049 /// Creates a new default instance.
5050 pub fn new() -> Self {
5051 std::default::Default::default()
5052 }
5053
5054 /// Sets the value of [host_addresses][crate::model::MongodbProfile::host_addresses].
5055 ///
5056 /// # Example
5057 /// ```ignore,no_run
5058 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5059 /// use google_cloud_datastream_v1::model::HostAddress;
5060 /// let x = MongodbProfile::new()
5061 /// .set_host_addresses([
5062 /// HostAddress::default()/* use setters */,
5063 /// HostAddress::default()/* use (different) setters */,
5064 /// ]);
5065 /// ```
5066 pub fn set_host_addresses<T, V>(mut self, v: T) -> Self
5067 where
5068 T: std::iter::IntoIterator<Item = V>,
5069 V: std::convert::Into<crate::model::HostAddress>,
5070 {
5071 use std::iter::Iterator;
5072 self.host_addresses = v.into_iter().map(|i| i.into()).collect();
5073 self
5074 }
5075
5076 /// Sets the value of [replica_set][crate::model::MongodbProfile::replica_set].
5077 ///
5078 /// # Example
5079 /// ```ignore,no_run
5080 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5081 /// let x = MongodbProfile::new().set_replica_set("example");
5082 /// ```
5083 pub fn set_replica_set<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5084 self.replica_set = v.into();
5085 self
5086 }
5087
5088 /// Sets the value of [username][crate::model::MongodbProfile::username].
5089 ///
5090 /// # Example
5091 /// ```ignore,no_run
5092 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5093 /// let x = MongodbProfile::new().set_username("example");
5094 /// ```
5095 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5096 self.username = v.into();
5097 self
5098 }
5099
5100 /// Sets the value of [password][crate::model::MongodbProfile::password].
5101 ///
5102 /// # Example
5103 /// ```ignore,no_run
5104 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5105 /// let x = MongodbProfile::new().set_password("example");
5106 /// ```
5107 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5108 self.password = v.into();
5109 self
5110 }
5111
5112 /// Sets the value of [secret_manager_stored_password][crate::model::MongodbProfile::secret_manager_stored_password].
5113 ///
5114 /// # Example
5115 /// ```ignore,no_run
5116 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5117 /// let x = MongodbProfile::new().set_secret_manager_stored_password("example");
5118 /// ```
5119 pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
5120 mut self,
5121 v: T,
5122 ) -> Self {
5123 self.secret_manager_stored_password = v.into();
5124 self
5125 }
5126
5127 /// Sets the value of [ssl_config][crate::model::MongodbProfile::ssl_config].
5128 ///
5129 /// # Example
5130 /// ```ignore,no_run
5131 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5132 /// use google_cloud_datastream_v1::model::MongodbSslConfig;
5133 /// let x = MongodbProfile::new().set_ssl_config(MongodbSslConfig::default()/* use setters */);
5134 /// ```
5135 pub fn set_ssl_config<T>(mut self, v: T) -> Self
5136 where
5137 T: std::convert::Into<crate::model::MongodbSslConfig>,
5138 {
5139 self.ssl_config = std::option::Option::Some(v.into());
5140 self
5141 }
5142
5143 /// Sets or clears the value of [ssl_config][crate::model::MongodbProfile::ssl_config].
5144 ///
5145 /// # Example
5146 /// ```ignore,no_run
5147 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5148 /// use google_cloud_datastream_v1::model::MongodbSslConfig;
5149 /// let x = MongodbProfile::new().set_or_clear_ssl_config(Some(MongodbSslConfig::default()/* use setters */));
5150 /// let x = MongodbProfile::new().set_or_clear_ssl_config(None::<MongodbSslConfig>);
5151 /// ```
5152 pub fn set_or_clear_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
5153 where
5154 T: std::convert::Into<crate::model::MongodbSslConfig>,
5155 {
5156 self.ssl_config = v.map(|x| x.into());
5157 self
5158 }
5159
5160 /// Sets the value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format].
5161 ///
5162 /// Note that all the setters affecting `mongodb_connection_format` are mutually
5163 /// exclusive.
5164 ///
5165 /// # Example
5166 /// ```ignore,no_run
5167 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5168 /// use google_cloud_datastream_v1::model::SrvConnectionFormat;
5169 /// let x = MongodbProfile::new().set_mongodb_connection_format(Some(
5170 /// google_cloud_datastream_v1::model::mongodb_profile::MongodbConnectionFormat::SrvConnectionFormat(SrvConnectionFormat::default().into())));
5171 /// ```
5172 pub fn set_mongodb_connection_format<
5173 T: std::convert::Into<
5174 std::option::Option<crate::model::mongodb_profile::MongodbConnectionFormat>,
5175 >,
5176 >(
5177 mut self,
5178 v: T,
5179 ) -> Self {
5180 self.mongodb_connection_format = v.into();
5181 self
5182 }
5183
5184 /// The value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
5185 /// if it holds a `SrvConnectionFormat`, `None` if the field is not set or
5186 /// holds a different branch.
5187 pub fn srv_connection_format(
5188 &self,
5189 ) -> std::option::Option<&std::boxed::Box<crate::model::SrvConnectionFormat>> {
5190 #[allow(unreachable_patterns)]
5191 self.mongodb_connection_format
5192 .as_ref()
5193 .and_then(|v| match v {
5194 crate::model::mongodb_profile::MongodbConnectionFormat::SrvConnectionFormat(v) => {
5195 std::option::Option::Some(v)
5196 }
5197 _ => std::option::Option::None,
5198 })
5199 }
5200
5201 /// Sets the value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
5202 /// to hold a `SrvConnectionFormat`.
5203 ///
5204 /// Note that all the setters affecting `mongodb_connection_format` are
5205 /// mutually exclusive.
5206 ///
5207 /// # Example
5208 /// ```ignore,no_run
5209 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5210 /// use google_cloud_datastream_v1::model::SrvConnectionFormat;
5211 /// let x = MongodbProfile::new().set_srv_connection_format(SrvConnectionFormat::default()/* use setters */);
5212 /// assert!(x.srv_connection_format().is_some());
5213 /// assert!(x.standard_connection_format().is_none());
5214 /// ```
5215 pub fn set_srv_connection_format<
5216 T: std::convert::Into<std::boxed::Box<crate::model::SrvConnectionFormat>>,
5217 >(
5218 mut self,
5219 v: T,
5220 ) -> Self {
5221 self.mongodb_connection_format = std::option::Option::Some(
5222 crate::model::mongodb_profile::MongodbConnectionFormat::SrvConnectionFormat(v.into()),
5223 );
5224 self
5225 }
5226
5227 /// The value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
5228 /// if it holds a `StandardConnectionFormat`, `None` if the field is not set or
5229 /// holds a different branch.
5230 pub fn standard_connection_format(
5231 &self,
5232 ) -> std::option::Option<&std::boxed::Box<crate::model::StandardConnectionFormat>> {
5233 #[allow(unreachable_patterns)]
5234 self.mongodb_connection_format.as_ref().and_then(|v| match v {
5235 crate::model::mongodb_profile::MongodbConnectionFormat::StandardConnectionFormat(v) => std::option::Option::Some(v),
5236 _ => std::option::Option::None,
5237 })
5238 }
5239
5240 /// Sets the value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
5241 /// to hold a `StandardConnectionFormat`.
5242 ///
5243 /// Note that all the setters affecting `mongodb_connection_format` are
5244 /// mutually exclusive.
5245 ///
5246 /// # Example
5247 /// ```ignore,no_run
5248 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5249 /// use google_cloud_datastream_v1::model::StandardConnectionFormat;
5250 /// let x = MongodbProfile::new().set_standard_connection_format(StandardConnectionFormat::default()/* use setters */);
5251 /// assert!(x.standard_connection_format().is_some());
5252 /// assert!(x.srv_connection_format().is_none());
5253 /// ```
5254 pub fn set_standard_connection_format<
5255 T: std::convert::Into<std::boxed::Box<crate::model::StandardConnectionFormat>>,
5256 >(
5257 mut self,
5258 v: T,
5259 ) -> Self {
5260 self.mongodb_connection_format = std::option::Option::Some(
5261 crate::model::mongodb_profile::MongodbConnectionFormat::StandardConnectionFormat(
5262 v.into(),
5263 ),
5264 );
5265 self
5266 }
5267}
5268
5269impl wkt::message::Message for MongodbProfile {
5270 fn typename() -> &'static str {
5271 "type.googleapis.com/google.cloud.datastream.v1.MongodbProfile"
5272 }
5273}
5274
5275/// Defines additional types related to [MongodbProfile].
5276pub mod mongodb_profile {
5277 #[allow(unused_imports)]
5278 use super::*;
5279
5280 /// MongoDB connection format.
5281 /// Must specify either srv_connection_format or standard_connection_format.
5282 #[derive(Clone, Debug, PartialEq)]
5283 #[non_exhaustive]
5284 pub enum MongodbConnectionFormat {
5285 /// Srv connection format.
5286 SrvConnectionFormat(std::boxed::Box<crate::model::SrvConnectionFormat>),
5287 /// Standard connection format.
5288 StandardConnectionFormat(std::boxed::Box<crate::model::StandardConnectionFormat>),
5289 }
5290}
5291
5292/// A HostAddress represents a transport end point, which is the combination
5293/// of an IP address or hostname and a port number.
5294#[derive(Clone, Default, PartialEq)]
5295#[non_exhaustive]
5296pub struct HostAddress {
5297 /// Required. Hostname for the connection.
5298 pub hostname: std::string::String,
5299
5300 /// Optional. Port for the connection.
5301 pub port: i32,
5302
5303 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5304}
5305
5306impl HostAddress {
5307 /// Creates a new default instance.
5308 pub fn new() -> Self {
5309 std::default::Default::default()
5310 }
5311
5312 /// Sets the value of [hostname][crate::model::HostAddress::hostname].
5313 ///
5314 /// # Example
5315 /// ```ignore,no_run
5316 /// # use google_cloud_datastream_v1::model::HostAddress;
5317 /// let x = HostAddress::new().set_hostname("example");
5318 /// ```
5319 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5320 self.hostname = v.into();
5321 self
5322 }
5323
5324 /// Sets the value of [port][crate::model::HostAddress::port].
5325 ///
5326 /// # Example
5327 /// ```ignore,no_run
5328 /// # use google_cloud_datastream_v1::model::HostAddress;
5329 /// let x = HostAddress::new().set_port(42);
5330 /// ```
5331 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5332 self.port = v.into();
5333 self
5334 }
5335}
5336
5337impl wkt::message::Message for HostAddress {
5338 fn typename() -> &'static str {
5339 "type.googleapis.com/google.cloud.datastream.v1.HostAddress"
5340 }
5341}
5342
5343/// Srv connection format.
5344#[derive(Clone, Default, PartialEq)]
5345#[non_exhaustive]
5346pub struct SrvConnectionFormat {
5347 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5348}
5349
5350impl SrvConnectionFormat {
5351 /// Creates a new default instance.
5352 pub fn new() -> Self {
5353 std::default::Default::default()
5354 }
5355}
5356
5357impl wkt::message::Message for SrvConnectionFormat {
5358 fn typename() -> &'static str {
5359 "type.googleapis.com/google.cloud.datastream.v1.SrvConnectionFormat"
5360 }
5361}
5362
5363/// Standard connection format.
5364#[derive(Clone, Default, PartialEq)]
5365#[non_exhaustive]
5366pub struct StandardConnectionFormat {
5367 /// Optional. Specifies whether the client connects directly to the host[:port]
5368 /// in the connection URI.
5369 pub direct_connection: bool,
5370
5371 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5372}
5373
5374impl StandardConnectionFormat {
5375 /// Creates a new default instance.
5376 pub fn new() -> Self {
5377 std::default::Default::default()
5378 }
5379
5380 /// Sets the value of [direct_connection][crate::model::StandardConnectionFormat::direct_connection].
5381 ///
5382 /// # Example
5383 /// ```ignore,no_run
5384 /// # use google_cloud_datastream_v1::model::StandardConnectionFormat;
5385 /// let x = StandardConnectionFormat::new().set_direct_connection(true);
5386 /// ```
5387 pub fn set_direct_connection<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5388 self.direct_connection = v.into();
5389 self
5390 }
5391}
5392
5393impl wkt::message::Message for StandardConnectionFormat {
5394 fn typename() -> &'static str {
5395 "type.googleapis.com/google.cloud.datastream.v1.StandardConnectionFormat"
5396 }
5397}
5398
5399/// Cloud Storage bucket profile.
5400#[derive(Clone, Default, PartialEq)]
5401#[non_exhaustive]
5402pub struct GcsProfile {
5403 /// Required. The Cloud Storage bucket name.
5404 pub bucket: std::string::String,
5405
5406 /// The root path inside the Cloud Storage bucket.
5407 pub root_path: std::string::String,
5408
5409 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5410}
5411
5412impl GcsProfile {
5413 /// Creates a new default instance.
5414 pub fn new() -> Self {
5415 std::default::Default::default()
5416 }
5417
5418 /// Sets the value of [bucket][crate::model::GcsProfile::bucket].
5419 ///
5420 /// # Example
5421 /// ```ignore,no_run
5422 /// # use google_cloud_datastream_v1::model::GcsProfile;
5423 /// let x = GcsProfile::new().set_bucket("example");
5424 /// ```
5425 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5426 self.bucket = v.into();
5427 self
5428 }
5429
5430 /// Sets the value of [root_path][crate::model::GcsProfile::root_path].
5431 ///
5432 /// # Example
5433 /// ```ignore,no_run
5434 /// # use google_cloud_datastream_v1::model::GcsProfile;
5435 /// let x = GcsProfile::new().set_root_path("example");
5436 /// ```
5437 pub fn set_root_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5438 self.root_path = v.into();
5439 self
5440 }
5441}
5442
5443impl wkt::message::Message for GcsProfile {
5444 fn typename() -> &'static str {
5445 "type.googleapis.com/google.cloud.datastream.v1.GcsProfile"
5446 }
5447}
5448
5449/// BigQuery warehouse profile.
5450#[derive(Clone, Default, PartialEq)]
5451#[non_exhaustive]
5452pub struct BigQueryProfile {
5453 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5454}
5455
5456impl BigQueryProfile {
5457 /// Creates a new default instance.
5458 pub fn new() -> Self {
5459 std::default::Default::default()
5460 }
5461}
5462
5463impl wkt::message::Message for BigQueryProfile {
5464 fn typename() -> &'static str {
5465 "type.googleapis.com/google.cloud.datastream.v1.BigQueryProfile"
5466 }
5467}
5468
5469/// Static IP address connectivity. Used when the source database is configured
5470/// to allow incoming connections from the Datastream public IP addresses
5471/// for the region specified in the connection profile.
5472#[derive(Clone, Default, PartialEq)]
5473#[non_exhaustive]
5474pub struct StaticServiceIpConnectivity {
5475 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5476}
5477
5478impl StaticServiceIpConnectivity {
5479 /// Creates a new default instance.
5480 pub fn new() -> Self {
5481 std::default::Default::default()
5482 }
5483}
5484
5485impl wkt::message::Message for StaticServiceIpConnectivity {
5486 fn typename() -> &'static str {
5487 "type.googleapis.com/google.cloud.datastream.v1.StaticServiceIpConnectivity"
5488 }
5489}
5490
5491/// Forward SSH Tunnel connectivity.
5492#[derive(Clone, Default, PartialEq)]
5493#[non_exhaustive]
5494pub struct ForwardSshTunnelConnectivity {
5495 /// Required. Hostname for the SSH tunnel.
5496 pub hostname: std::string::String,
5497
5498 /// Required. Username for the SSH tunnel.
5499 pub username: std::string::String,
5500
5501 /// Port for the SSH tunnel, default value is 22.
5502 pub port: i32,
5503
5504 #[allow(missing_docs)]
5505 pub authentication_method:
5506 std::option::Option<crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod>,
5507
5508 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5509}
5510
5511impl ForwardSshTunnelConnectivity {
5512 /// Creates a new default instance.
5513 pub fn new() -> Self {
5514 std::default::Default::default()
5515 }
5516
5517 /// Sets the value of [hostname][crate::model::ForwardSshTunnelConnectivity::hostname].
5518 ///
5519 /// # Example
5520 /// ```ignore,no_run
5521 /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5522 /// let x = ForwardSshTunnelConnectivity::new().set_hostname("example");
5523 /// ```
5524 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5525 self.hostname = v.into();
5526 self
5527 }
5528
5529 /// Sets the value of [username][crate::model::ForwardSshTunnelConnectivity::username].
5530 ///
5531 /// # Example
5532 /// ```ignore,no_run
5533 /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5534 /// let x = ForwardSshTunnelConnectivity::new().set_username("example");
5535 /// ```
5536 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5537 self.username = v.into();
5538 self
5539 }
5540
5541 /// Sets the value of [port][crate::model::ForwardSshTunnelConnectivity::port].
5542 ///
5543 /// # Example
5544 /// ```ignore,no_run
5545 /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5546 /// let x = ForwardSshTunnelConnectivity::new().set_port(42);
5547 /// ```
5548 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5549 self.port = v.into();
5550 self
5551 }
5552
5553 /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method].
5554 ///
5555 /// Note that all the setters affecting `authentication_method` are mutually
5556 /// exclusive.
5557 ///
5558 /// # Example
5559 /// ```ignore,no_run
5560 /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5561 /// use google_cloud_datastream_v1::model::forward_ssh_tunnel_connectivity::AuthenticationMethod;
5562 /// let x = ForwardSshTunnelConnectivity::new().set_authentication_method(Some(AuthenticationMethod::Password("example".to_string())));
5563 /// ```
5564 pub fn set_authentication_method<
5565 T: std::convert::Into<
5566 std::option::Option<
5567 crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod,
5568 >,
5569 >,
5570 >(
5571 mut self,
5572 v: T,
5573 ) -> Self {
5574 self.authentication_method = v.into();
5575 self
5576 }
5577
5578 /// The value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
5579 /// if it holds a `Password`, `None` if the field is not set or
5580 /// holds a different branch.
5581 pub fn password(&self) -> std::option::Option<&std::string::String> {
5582 #[allow(unreachable_patterns)]
5583 self.authentication_method.as_ref().and_then(|v| match v {
5584 crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::Password(v) => {
5585 std::option::Option::Some(v)
5586 }
5587 _ => std::option::Option::None,
5588 })
5589 }
5590
5591 /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
5592 /// to hold a `Password`.
5593 ///
5594 /// Note that all the setters affecting `authentication_method` are
5595 /// mutually exclusive.
5596 ///
5597 /// # Example
5598 /// ```ignore,no_run
5599 /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5600 /// let x = ForwardSshTunnelConnectivity::new().set_password("example");
5601 /// assert!(x.password().is_some());
5602 /// assert!(x.private_key().is_none());
5603 /// ```
5604 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5605 self.authentication_method = std::option::Option::Some(
5606 crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::Password(v.into()),
5607 );
5608 self
5609 }
5610
5611 /// The value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
5612 /// if it holds a `PrivateKey`, `None` if the field is not set or
5613 /// holds a different branch.
5614 pub fn private_key(&self) -> std::option::Option<&std::string::String> {
5615 #[allow(unreachable_patterns)]
5616 self.authentication_method.as_ref().and_then(|v| match v {
5617 crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::PrivateKey(v) => {
5618 std::option::Option::Some(v)
5619 }
5620 _ => std::option::Option::None,
5621 })
5622 }
5623
5624 /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
5625 /// to hold a `PrivateKey`.
5626 ///
5627 /// Note that all the setters affecting `authentication_method` are
5628 /// mutually exclusive.
5629 ///
5630 /// # Example
5631 /// ```ignore,no_run
5632 /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5633 /// let x = ForwardSshTunnelConnectivity::new().set_private_key("example");
5634 /// assert!(x.private_key().is_some());
5635 /// assert!(x.password().is_none());
5636 /// ```
5637 pub fn set_private_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5638 self.authentication_method = std::option::Option::Some(
5639 crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::PrivateKey(
5640 v.into(),
5641 ),
5642 );
5643 self
5644 }
5645}
5646
5647impl wkt::message::Message for ForwardSshTunnelConnectivity {
5648 fn typename() -> &'static str {
5649 "type.googleapis.com/google.cloud.datastream.v1.ForwardSshTunnelConnectivity"
5650 }
5651}
5652
5653/// Defines additional types related to [ForwardSshTunnelConnectivity].
5654pub mod forward_ssh_tunnel_connectivity {
5655 #[allow(unused_imports)]
5656 use super::*;
5657
5658 #[allow(missing_docs)]
5659 #[derive(Clone, Debug, PartialEq)]
5660 #[non_exhaustive]
5661 pub enum AuthenticationMethod {
5662 /// Input only. SSH password.
5663 Password(std::string::String),
5664 /// Input only. SSH private key.
5665 PrivateKey(std::string::String),
5666 }
5667}
5668
5669/// The VPC Peering configuration is used to create VPC peering between
5670/// Datastream and the consumer's VPC.
5671#[derive(Clone, Default, PartialEq)]
5672#[non_exhaustive]
5673pub struct VpcPeeringConfig {
5674 /// Required. Fully qualified name of the VPC that Datastream will peer to.
5675 /// Format: `projects/{project}/global/{networks}/{name}`
5676 pub vpc: std::string::String,
5677
5678 /// Required. A free subnet for peering. (CIDR of /29)
5679 pub subnet: std::string::String,
5680
5681 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5682}
5683
5684impl VpcPeeringConfig {
5685 /// Creates a new default instance.
5686 pub fn new() -> Self {
5687 std::default::Default::default()
5688 }
5689
5690 /// Sets the value of [vpc][crate::model::VpcPeeringConfig::vpc].
5691 ///
5692 /// # Example
5693 /// ```ignore,no_run
5694 /// # use google_cloud_datastream_v1::model::VpcPeeringConfig;
5695 /// let x = VpcPeeringConfig::new().set_vpc("example");
5696 /// ```
5697 pub fn set_vpc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5698 self.vpc = v.into();
5699 self
5700 }
5701
5702 /// Sets the value of [subnet][crate::model::VpcPeeringConfig::subnet].
5703 ///
5704 /// # Example
5705 /// ```ignore,no_run
5706 /// # use google_cloud_datastream_v1::model::VpcPeeringConfig;
5707 /// let x = VpcPeeringConfig::new().set_subnet("example");
5708 /// ```
5709 pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5710 self.subnet = v.into();
5711 self
5712 }
5713}
5714
5715impl wkt::message::Message for VpcPeeringConfig {
5716 fn typename() -> &'static str {
5717 "type.googleapis.com/google.cloud.datastream.v1.VpcPeeringConfig"
5718 }
5719}
5720
5721/// The PSC Interface configuration is used to create PSC Interface between
5722/// Datastream and the consumer's PSC.
5723#[derive(Clone, Default, PartialEq)]
5724#[non_exhaustive]
5725pub struct PscInterfaceConfig {
5726 /// Required. Fully qualified name of the Network Attachment that Datastream
5727 /// will connect to. Format:
5728 /// `projects/{project}/regions/{region}/networkAttachments/{name}`
5729 pub network_attachment: std::string::String,
5730
5731 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5732}
5733
5734impl PscInterfaceConfig {
5735 /// Creates a new default instance.
5736 pub fn new() -> Self {
5737 std::default::Default::default()
5738 }
5739
5740 /// Sets the value of [network_attachment][crate::model::PscInterfaceConfig::network_attachment].
5741 ///
5742 /// # Example
5743 /// ```ignore,no_run
5744 /// # use google_cloud_datastream_v1::model::PscInterfaceConfig;
5745 /// let x = PscInterfaceConfig::new().set_network_attachment("example");
5746 /// ```
5747 pub fn set_network_attachment<T: std::convert::Into<std::string::String>>(
5748 mut self,
5749 v: T,
5750 ) -> Self {
5751 self.network_attachment = v.into();
5752 self
5753 }
5754}
5755
5756impl wkt::message::Message for PscInterfaceConfig {
5757 fn typename() -> &'static str {
5758 "type.googleapis.com/google.cloud.datastream.v1.PscInterfaceConfig"
5759 }
5760}
5761
5762/// The PrivateConnection resource is used to establish private connectivity
5763/// between Datastream and a customer's network.
5764#[derive(Clone, Default, PartialEq)]
5765#[non_exhaustive]
5766pub struct PrivateConnection {
5767 /// Output only. Identifier. The resource's name.
5768 pub name: std::string::String,
5769
5770 /// Output only. The create time of the resource.
5771 pub create_time: std::option::Option<wkt::Timestamp>,
5772
5773 /// Output only. The update time of the resource.
5774 pub update_time: std::option::Option<wkt::Timestamp>,
5775
5776 /// Labels.
5777 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5778
5779 /// Required. Display name.
5780 pub display_name: std::string::String,
5781
5782 /// Output only. The state of the Private Connection.
5783 pub state: crate::model::private_connection::State,
5784
5785 /// Output only. In case of error, the details of the error in a user-friendly
5786 /// format.
5787 pub error: std::option::Option<crate::model::Error>,
5788
5789 /// Output only. Reserved for future use.
5790 pub satisfies_pzs: std::option::Option<bool>,
5791
5792 /// Output only. Reserved for future use.
5793 pub satisfies_pzi: std::option::Option<bool>,
5794
5795 /// VPC Peering Config.
5796 pub vpc_peering_config: std::option::Option<crate::model::VpcPeeringConfig>,
5797
5798 /// PSC Interface Config.
5799 pub psc_interface_config: std::option::Option<crate::model::PscInterfaceConfig>,
5800
5801 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5802}
5803
5804impl PrivateConnection {
5805 /// Creates a new default instance.
5806 pub fn new() -> Self {
5807 std::default::Default::default()
5808 }
5809
5810 /// Sets the value of [name][crate::model::PrivateConnection::name].
5811 ///
5812 /// # Example
5813 /// ```ignore,no_run
5814 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5815 /// let x = PrivateConnection::new().set_name("example");
5816 /// ```
5817 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5818 self.name = v.into();
5819 self
5820 }
5821
5822 /// Sets the value of [create_time][crate::model::PrivateConnection::create_time].
5823 ///
5824 /// # Example
5825 /// ```ignore,no_run
5826 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5827 /// use wkt::Timestamp;
5828 /// let x = PrivateConnection::new().set_create_time(Timestamp::default()/* use setters */);
5829 /// ```
5830 pub fn set_create_time<T>(mut self, v: T) -> Self
5831 where
5832 T: std::convert::Into<wkt::Timestamp>,
5833 {
5834 self.create_time = std::option::Option::Some(v.into());
5835 self
5836 }
5837
5838 /// Sets or clears the value of [create_time][crate::model::PrivateConnection::create_time].
5839 ///
5840 /// # Example
5841 /// ```ignore,no_run
5842 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5843 /// use wkt::Timestamp;
5844 /// let x = PrivateConnection::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5845 /// let x = PrivateConnection::new().set_or_clear_create_time(None::<Timestamp>);
5846 /// ```
5847 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5848 where
5849 T: std::convert::Into<wkt::Timestamp>,
5850 {
5851 self.create_time = v.map(|x| x.into());
5852 self
5853 }
5854
5855 /// Sets the value of [update_time][crate::model::PrivateConnection::update_time].
5856 ///
5857 /// # Example
5858 /// ```ignore,no_run
5859 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5860 /// use wkt::Timestamp;
5861 /// let x = PrivateConnection::new().set_update_time(Timestamp::default()/* use setters */);
5862 /// ```
5863 pub fn set_update_time<T>(mut self, v: T) -> Self
5864 where
5865 T: std::convert::Into<wkt::Timestamp>,
5866 {
5867 self.update_time = std::option::Option::Some(v.into());
5868 self
5869 }
5870
5871 /// Sets or clears the value of [update_time][crate::model::PrivateConnection::update_time].
5872 ///
5873 /// # Example
5874 /// ```ignore,no_run
5875 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5876 /// use wkt::Timestamp;
5877 /// let x = PrivateConnection::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5878 /// let x = PrivateConnection::new().set_or_clear_update_time(None::<Timestamp>);
5879 /// ```
5880 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5881 where
5882 T: std::convert::Into<wkt::Timestamp>,
5883 {
5884 self.update_time = v.map(|x| x.into());
5885 self
5886 }
5887
5888 /// Sets the value of [labels][crate::model::PrivateConnection::labels].
5889 ///
5890 /// # Example
5891 /// ```ignore,no_run
5892 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5893 /// let x = PrivateConnection::new().set_labels([
5894 /// ("key0", "abc"),
5895 /// ("key1", "xyz"),
5896 /// ]);
5897 /// ```
5898 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5899 where
5900 T: std::iter::IntoIterator<Item = (K, V)>,
5901 K: std::convert::Into<std::string::String>,
5902 V: std::convert::Into<std::string::String>,
5903 {
5904 use std::iter::Iterator;
5905 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5906 self
5907 }
5908
5909 /// Sets the value of [display_name][crate::model::PrivateConnection::display_name].
5910 ///
5911 /// # Example
5912 /// ```ignore,no_run
5913 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5914 /// let x = PrivateConnection::new().set_display_name("example");
5915 /// ```
5916 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5917 self.display_name = v.into();
5918 self
5919 }
5920
5921 /// Sets the value of [state][crate::model::PrivateConnection::state].
5922 ///
5923 /// # Example
5924 /// ```ignore,no_run
5925 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5926 /// use google_cloud_datastream_v1::model::private_connection::State;
5927 /// let x0 = PrivateConnection::new().set_state(State::Creating);
5928 /// let x1 = PrivateConnection::new().set_state(State::Created);
5929 /// let x2 = PrivateConnection::new().set_state(State::Failed);
5930 /// ```
5931 pub fn set_state<T: std::convert::Into<crate::model::private_connection::State>>(
5932 mut self,
5933 v: T,
5934 ) -> Self {
5935 self.state = v.into();
5936 self
5937 }
5938
5939 /// Sets the value of [error][crate::model::PrivateConnection::error].
5940 ///
5941 /// # Example
5942 /// ```ignore,no_run
5943 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5944 /// use google_cloud_datastream_v1::model::Error;
5945 /// let x = PrivateConnection::new().set_error(Error::default()/* use setters */);
5946 /// ```
5947 pub fn set_error<T>(mut self, v: T) -> Self
5948 where
5949 T: std::convert::Into<crate::model::Error>,
5950 {
5951 self.error = std::option::Option::Some(v.into());
5952 self
5953 }
5954
5955 /// Sets or clears the value of [error][crate::model::PrivateConnection::error].
5956 ///
5957 /// # Example
5958 /// ```ignore,no_run
5959 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5960 /// use google_cloud_datastream_v1::model::Error;
5961 /// let x = PrivateConnection::new().set_or_clear_error(Some(Error::default()/* use setters */));
5962 /// let x = PrivateConnection::new().set_or_clear_error(None::<Error>);
5963 /// ```
5964 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
5965 where
5966 T: std::convert::Into<crate::model::Error>,
5967 {
5968 self.error = v.map(|x| x.into());
5969 self
5970 }
5971
5972 /// Sets the value of [satisfies_pzs][crate::model::PrivateConnection::satisfies_pzs].
5973 ///
5974 /// # Example
5975 /// ```ignore,no_run
5976 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5977 /// let x = PrivateConnection::new().set_satisfies_pzs(true);
5978 /// ```
5979 pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
5980 where
5981 T: std::convert::Into<bool>,
5982 {
5983 self.satisfies_pzs = std::option::Option::Some(v.into());
5984 self
5985 }
5986
5987 /// Sets or clears the value of [satisfies_pzs][crate::model::PrivateConnection::satisfies_pzs].
5988 ///
5989 /// # Example
5990 /// ```ignore,no_run
5991 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5992 /// let x = PrivateConnection::new().set_or_clear_satisfies_pzs(Some(false));
5993 /// let x = PrivateConnection::new().set_or_clear_satisfies_pzs(None::<bool>);
5994 /// ```
5995 pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
5996 where
5997 T: std::convert::Into<bool>,
5998 {
5999 self.satisfies_pzs = v.map(|x| x.into());
6000 self
6001 }
6002
6003 /// Sets the value of [satisfies_pzi][crate::model::PrivateConnection::satisfies_pzi].
6004 ///
6005 /// # Example
6006 /// ```ignore,no_run
6007 /// # use google_cloud_datastream_v1::model::PrivateConnection;
6008 /// let x = PrivateConnection::new().set_satisfies_pzi(true);
6009 /// ```
6010 pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
6011 where
6012 T: std::convert::Into<bool>,
6013 {
6014 self.satisfies_pzi = std::option::Option::Some(v.into());
6015 self
6016 }
6017
6018 /// Sets or clears the value of [satisfies_pzi][crate::model::PrivateConnection::satisfies_pzi].
6019 ///
6020 /// # Example
6021 /// ```ignore,no_run
6022 /// # use google_cloud_datastream_v1::model::PrivateConnection;
6023 /// let x = PrivateConnection::new().set_or_clear_satisfies_pzi(Some(false));
6024 /// let x = PrivateConnection::new().set_or_clear_satisfies_pzi(None::<bool>);
6025 /// ```
6026 pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
6027 where
6028 T: std::convert::Into<bool>,
6029 {
6030 self.satisfies_pzi = v.map(|x| x.into());
6031 self
6032 }
6033
6034 /// Sets the value of [vpc_peering_config][crate::model::PrivateConnection::vpc_peering_config].
6035 ///
6036 /// # Example
6037 /// ```ignore,no_run
6038 /// # use google_cloud_datastream_v1::model::PrivateConnection;
6039 /// use google_cloud_datastream_v1::model::VpcPeeringConfig;
6040 /// let x = PrivateConnection::new().set_vpc_peering_config(VpcPeeringConfig::default()/* use setters */);
6041 /// ```
6042 pub fn set_vpc_peering_config<T>(mut self, v: T) -> Self
6043 where
6044 T: std::convert::Into<crate::model::VpcPeeringConfig>,
6045 {
6046 self.vpc_peering_config = std::option::Option::Some(v.into());
6047 self
6048 }
6049
6050 /// Sets or clears the value of [vpc_peering_config][crate::model::PrivateConnection::vpc_peering_config].
6051 ///
6052 /// # Example
6053 /// ```ignore,no_run
6054 /// # use google_cloud_datastream_v1::model::PrivateConnection;
6055 /// use google_cloud_datastream_v1::model::VpcPeeringConfig;
6056 /// let x = PrivateConnection::new().set_or_clear_vpc_peering_config(Some(VpcPeeringConfig::default()/* use setters */));
6057 /// let x = PrivateConnection::new().set_or_clear_vpc_peering_config(None::<VpcPeeringConfig>);
6058 /// ```
6059 pub fn set_or_clear_vpc_peering_config<T>(mut self, v: std::option::Option<T>) -> Self
6060 where
6061 T: std::convert::Into<crate::model::VpcPeeringConfig>,
6062 {
6063 self.vpc_peering_config = v.map(|x| x.into());
6064 self
6065 }
6066
6067 /// Sets the value of [psc_interface_config][crate::model::PrivateConnection::psc_interface_config].
6068 ///
6069 /// # Example
6070 /// ```ignore,no_run
6071 /// # use google_cloud_datastream_v1::model::PrivateConnection;
6072 /// use google_cloud_datastream_v1::model::PscInterfaceConfig;
6073 /// let x = PrivateConnection::new().set_psc_interface_config(PscInterfaceConfig::default()/* use setters */);
6074 /// ```
6075 pub fn set_psc_interface_config<T>(mut self, v: T) -> Self
6076 where
6077 T: std::convert::Into<crate::model::PscInterfaceConfig>,
6078 {
6079 self.psc_interface_config = std::option::Option::Some(v.into());
6080 self
6081 }
6082
6083 /// Sets or clears the value of [psc_interface_config][crate::model::PrivateConnection::psc_interface_config].
6084 ///
6085 /// # Example
6086 /// ```ignore,no_run
6087 /// # use google_cloud_datastream_v1::model::PrivateConnection;
6088 /// use google_cloud_datastream_v1::model::PscInterfaceConfig;
6089 /// let x = PrivateConnection::new().set_or_clear_psc_interface_config(Some(PscInterfaceConfig::default()/* use setters */));
6090 /// let x = PrivateConnection::new().set_or_clear_psc_interface_config(None::<PscInterfaceConfig>);
6091 /// ```
6092 pub fn set_or_clear_psc_interface_config<T>(mut self, v: std::option::Option<T>) -> Self
6093 where
6094 T: std::convert::Into<crate::model::PscInterfaceConfig>,
6095 {
6096 self.psc_interface_config = v.map(|x| x.into());
6097 self
6098 }
6099}
6100
6101impl wkt::message::Message for PrivateConnection {
6102 fn typename() -> &'static str {
6103 "type.googleapis.com/google.cloud.datastream.v1.PrivateConnection"
6104 }
6105}
6106
6107/// Defines additional types related to [PrivateConnection].
6108pub mod private_connection {
6109 #[allow(unused_imports)]
6110 use super::*;
6111
6112 /// Private Connection state.
6113 ///
6114 /// # Working with unknown values
6115 ///
6116 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6117 /// additional enum variants at any time. Adding new variants is not considered
6118 /// a breaking change. Applications should write their code in anticipation of:
6119 ///
6120 /// - New values appearing in future releases of the client library, **and**
6121 /// - New values received dynamically, without application changes.
6122 ///
6123 /// Please consult the [Working with enums] section in the user guide for some
6124 /// guidelines.
6125 ///
6126 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6127 #[derive(Clone, Debug, PartialEq)]
6128 #[non_exhaustive]
6129 pub enum State {
6130 /// Unspecified state.
6131 Unspecified,
6132 /// The private connection is in creation state - creating resources.
6133 Creating,
6134 /// The private connection has been created with all of its resources.
6135 Created,
6136 /// The private connection creation has failed.
6137 Failed,
6138 /// The private connection is being deleted.
6139 Deleting,
6140 /// Delete request has failed, resource is in invalid state.
6141 FailedToDelete,
6142 /// If set, the enum was initialized with an unknown value.
6143 ///
6144 /// Applications can examine the value using [State::value] or
6145 /// [State::name].
6146 UnknownValue(state::UnknownValue),
6147 }
6148
6149 #[doc(hidden)]
6150 pub mod state {
6151 #[allow(unused_imports)]
6152 use super::*;
6153 #[derive(Clone, Debug, PartialEq)]
6154 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6155 }
6156
6157 impl State {
6158 /// Gets the enum value.
6159 ///
6160 /// Returns `None` if the enum contains an unknown value deserialized from
6161 /// the string representation of enums.
6162 pub fn value(&self) -> std::option::Option<i32> {
6163 match self {
6164 Self::Unspecified => std::option::Option::Some(0),
6165 Self::Creating => std::option::Option::Some(1),
6166 Self::Created => std::option::Option::Some(2),
6167 Self::Failed => std::option::Option::Some(3),
6168 Self::Deleting => std::option::Option::Some(4),
6169 Self::FailedToDelete => std::option::Option::Some(5),
6170 Self::UnknownValue(u) => u.0.value(),
6171 }
6172 }
6173
6174 /// Gets the enum value as a string.
6175 ///
6176 /// Returns `None` if the enum contains an unknown value deserialized from
6177 /// the integer representation of enums.
6178 pub fn name(&self) -> std::option::Option<&str> {
6179 match self {
6180 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6181 Self::Creating => std::option::Option::Some("CREATING"),
6182 Self::Created => std::option::Option::Some("CREATED"),
6183 Self::Failed => std::option::Option::Some("FAILED"),
6184 Self::Deleting => std::option::Option::Some("DELETING"),
6185 Self::FailedToDelete => std::option::Option::Some("FAILED_TO_DELETE"),
6186 Self::UnknownValue(u) => u.0.name(),
6187 }
6188 }
6189 }
6190
6191 impl std::default::Default for State {
6192 fn default() -> Self {
6193 use std::convert::From;
6194 Self::from(0)
6195 }
6196 }
6197
6198 impl std::fmt::Display for State {
6199 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6200 wkt::internal::display_enum(f, self.name(), self.value())
6201 }
6202 }
6203
6204 impl std::convert::From<i32> for State {
6205 fn from(value: i32) -> Self {
6206 match value {
6207 0 => Self::Unspecified,
6208 1 => Self::Creating,
6209 2 => Self::Created,
6210 3 => Self::Failed,
6211 4 => Self::Deleting,
6212 5 => Self::FailedToDelete,
6213 _ => Self::UnknownValue(state::UnknownValue(
6214 wkt::internal::UnknownEnumValue::Integer(value),
6215 )),
6216 }
6217 }
6218 }
6219
6220 impl std::convert::From<&str> for State {
6221 fn from(value: &str) -> Self {
6222 use std::string::ToString;
6223 match value {
6224 "STATE_UNSPECIFIED" => Self::Unspecified,
6225 "CREATING" => Self::Creating,
6226 "CREATED" => Self::Created,
6227 "FAILED" => Self::Failed,
6228 "DELETING" => Self::Deleting,
6229 "FAILED_TO_DELETE" => Self::FailedToDelete,
6230 _ => Self::UnknownValue(state::UnknownValue(
6231 wkt::internal::UnknownEnumValue::String(value.to_string()),
6232 )),
6233 }
6234 }
6235 }
6236
6237 impl serde::ser::Serialize for State {
6238 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6239 where
6240 S: serde::Serializer,
6241 {
6242 match self {
6243 Self::Unspecified => serializer.serialize_i32(0),
6244 Self::Creating => serializer.serialize_i32(1),
6245 Self::Created => serializer.serialize_i32(2),
6246 Self::Failed => serializer.serialize_i32(3),
6247 Self::Deleting => serializer.serialize_i32(4),
6248 Self::FailedToDelete => serializer.serialize_i32(5),
6249 Self::UnknownValue(u) => u.0.serialize(serializer),
6250 }
6251 }
6252 }
6253
6254 impl<'de> serde::de::Deserialize<'de> for State {
6255 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6256 where
6257 D: serde::Deserializer<'de>,
6258 {
6259 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6260 ".google.cloud.datastream.v1.PrivateConnection.State",
6261 ))
6262 }
6263 }
6264}
6265
6266/// Private Connectivity
6267#[derive(Clone, Default, PartialEq)]
6268#[non_exhaustive]
6269pub struct PrivateConnectivity {
6270 /// Required. A reference to a private connection resource.
6271 /// Format: `projects/{project}/locations/{location}/privateConnections/{name}`
6272 pub private_connection: std::string::String,
6273
6274 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6275}
6276
6277impl PrivateConnectivity {
6278 /// Creates a new default instance.
6279 pub fn new() -> Self {
6280 std::default::Default::default()
6281 }
6282
6283 /// Sets the value of [private_connection][crate::model::PrivateConnectivity::private_connection].
6284 ///
6285 /// # Example
6286 /// ```ignore,no_run
6287 /// # use google_cloud_datastream_v1::model::PrivateConnectivity;
6288 /// let x = PrivateConnectivity::new().set_private_connection("example");
6289 /// ```
6290 pub fn set_private_connection<T: std::convert::Into<std::string::String>>(
6291 mut self,
6292 v: T,
6293 ) -> Self {
6294 self.private_connection = v.into();
6295 self
6296 }
6297}
6298
6299impl wkt::message::Message for PrivateConnectivity {
6300 fn typename() -> &'static str {
6301 "type.googleapis.com/google.cloud.datastream.v1.PrivateConnectivity"
6302 }
6303}
6304
6305/// The route resource is the child of the private connection resource,
6306/// used for defining a route for a private connection.
6307#[derive(Clone, Default, PartialEq)]
6308#[non_exhaustive]
6309pub struct Route {
6310 /// Output only. Identifier. The resource's name.
6311 pub name: std::string::String,
6312
6313 /// Output only. The create time of the resource.
6314 pub create_time: std::option::Option<wkt::Timestamp>,
6315
6316 /// Output only. The update time of the resource.
6317 pub update_time: std::option::Option<wkt::Timestamp>,
6318
6319 /// Labels.
6320 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6321
6322 /// Required. Display name.
6323 pub display_name: std::string::String,
6324
6325 /// Required. Destination address for connection
6326 pub destination_address: std::string::String,
6327
6328 /// Destination port for connection
6329 pub destination_port: i32,
6330
6331 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6332}
6333
6334impl Route {
6335 /// Creates a new default instance.
6336 pub fn new() -> Self {
6337 std::default::Default::default()
6338 }
6339
6340 /// Sets the value of [name][crate::model::Route::name].
6341 ///
6342 /// # Example
6343 /// ```ignore,no_run
6344 /// # use google_cloud_datastream_v1::model::Route;
6345 /// let x = Route::new().set_name("example");
6346 /// ```
6347 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6348 self.name = v.into();
6349 self
6350 }
6351
6352 /// Sets the value of [create_time][crate::model::Route::create_time].
6353 ///
6354 /// # Example
6355 /// ```ignore,no_run
6356 /// # use google_cloud_datastream_v1::model::Route;
6357 /// use wkt::Timestamp;
6358 /// let x = Route::new().set_create_time(Timestamp::default()/* use setters */);
6359 /// ```
6360 pub fn set_create_time<T>(mut self, v: T) -> Self
6361 where
6362 T: std::convert::Into<wkt::Timestamp>,
6363 {
6364 self.create_time = std::option::Option::Some(v.into());
6365 self
6366 }
6367
6368 /// Sets or clears the value of [create_time][crate::model::Route::create_time].
6369 ///
6370 /// # Example
6371 /// ```ignore,no_run
6372 /// # use google_cloud_datastream_v1::model::Route;
6373 /// use wkt::Timestamp;
6374 /// let x = Route::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6375 /// let x = Route::new().set_or_clear_create_time(None::<Timestamp>);
6376 /// ```
6377 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6378 where
6379 T: std::convert::Into<wkt::Timestamp>,
6380 {
6381 self.create_time = v.map(|x| x.into());
6382 self
6383 }
6384
6385 /// Sets the value of [update_time][crate::model::Route::update_time].
6386 ///
6387 /// # Example
6388 /// ```ignore,no_run
6389 /// # use google_cloud_datastream_v1::model::Route;
6390 /// use wkt::Timestamp;
6391 /// let x = Route::new().set_update_time(Timestamp::default()/* use setters */);
6392 /// ```
6393 pub fn set_update_time<T>(mut self, v: T) -> Self
6394 where
6395 T: std::convert::Into<wkt::Timestamp>,
6396 {
6397 self.update_time = std::option::Option::Some(v.into());
6398 self
6399 }
6400
6401 /// Sets or clears the value of [update_time][crate::model::Route::update_time].
6402 ///
6403 /// # Example
6404 /// ```ignore,no_run
6405 /// # use google_cloud_datastream_v1::model::Route;
6406 /// use wkt::Timestamp;
6407 /// let x = Route::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6408 /// let x = Route::new().set_or_clear_update_time(None::<Timestamp>);
6409 /// ```
6410 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6411 where
6412 T: std::convert::Into<wkt::Timestamp>,
6413 {
6414 self.update_time = v.map(|x| x.into());
6415 self
6416 }
6417
6418 /// Sets the value of [labels][crate::model::Route::labels].
6419 ///
6420 /// # Example
6421 /// ```ignore,no_run
6422 /// # use google_cloud_datastream_v1::model::Route;
6423 /// let x = Route::new().set_labels([
6424 /// ("key0", "abc"),
6425 /// ("key1", "xyz"),
6426 /// ]);
6427 /// ```
6428 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6429 where
6430 T: std::iter::IntoIterator<Item = (K, V)>,
6431 K: std::convert::Into<std::string::String>,
6432 V: std::convert::Into<std::string::String>,
6433 {
6434 use std::iter::Iterator;
6435 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6436 self
6437 }
6438
6439 /// Sets the value of [display_name][crate::model::Route::display_name].
6440 ///
6441 /// # Example
6442 /// ```ignore,no_run
6443 /// # use google_cloud_datastream_v1::model::Route;
6444 /// let x = Route::new().set_display_name("example");
6445 /// ```
6446 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6447 self.display_name = v.into();
6448 self
6449 }
6450
6451 /// Sets the value of [destination_address][crate::model::Route::destination_address].
6452 ///
6453 /// # Example
6454 /// ```ignore,no_run
6455 /// # use google_cloud_datastream_v1::model::Route;
6456 /// let x = Route::new().set_destination_address("example");
6457 /// ```
6458 pub fn set_destination_address<T: std::convert::Into<std::string::String>>(
6459 mut self,
6460 v: T,
6461 ) -> Self {
6462 self.destination_address = v.into();
6463 self
6464 }
6465
6466 /// Sets the value of [destination_port][crate::model::Route::destination_port].
6467 ///
6468 /// # Example
6469 /// ```ignore,no_run
6470 /// # use google_cloud_datastream_v1::model::Route;
6471 /// let x = Route::new().set_destination_port(42);
6472 /// ```
6473 pub fn set_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6474 self.destination_port = v.into();
6475 self
6476 }
6477}
6478
6479impl wkt::message::Message for Route {
6480 fn typename() -> &'static str {
6481 "type.googleapis.com/google.cloud.datastream.v1.Route"
6482 }
6483}
6484
6485/// MongoDB SSL configuration information.
6486#[derive(Clone, Default, PartialEq)]
6487#[non_exhaustive]
6488pub struct MongodbSslConfig {
6489 /// Optional. Input only. PEM-encoded private key associated with the Client
6490 /// Certificate. If this field is used then the 'client_certificate' and the
6491 /// 'ca_certificate' fields are mandatory.
6492 pub client_key: std::string::String,
6493
6494 /// Output only. Indicates whether the client_key field is set.
6495 pub client_key_set: bool,
6496
6497 /// Optional. Input only. PEM-encoded certificate that will be used by the
6498 /// replica to authenticate against the source database server. If this field
6499 /// is used then the 'client_key' and the 'ca_certificate' fields are
6500 /// mandatory.
6501 pub client_certificate: std::string::String,
6502
6503 /// Output only. Indicates whether the client_certificate field is set.
6504 pub client_certificate_set: bool,
6505
6506 /// Optional. Input only. PEM-encoded certificate of the CA that signed the
6507 /// source database server's certificate.
6508 pub ca_certificate: std::string::String,
6509
6510 /// Output only. Indicates whether the ca_certificate field is set.
6511 pub ca_certificate_set: bool,
6512
6513 /// Optional. Input only. A reference to a Secret Manager resource name storing
6514 /// the PEM-encoded private key associated with the Client Certificate. If this
6515 /// field is used then the 'client_certificate' and the 'ca_certificate' fields
6516 /// are mandatory. Mutually exclusive with the `client_key` field.
6517 pub secret_manager_stored_client_key: std::string::String,
6518
6519 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6520}
6521
6522impl MongodbSslConfig {
6523 /// Creates a new default instance.
6524 pub fn new() -> Self {
6525 std::default::Default::default()
6526 }
6527
6528 /// Sets the value of [client_key][crate::model::MongodbSslConfig::client_key].
6529 ///
6530 /// # Example
6531 /// ```ignore,no_run
6532 /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6533 /// let x = MongodbSslConfig::new().set_client_key("example");
6534 /// ```
6535 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6536 self.client_key = v.into();
6537 self
6538 }
6539
6540 /// Sets the value of [client_key_set][crate::model::MongodbSslConfig::client_key_set].
6541 ///
6542 /// # Example
6543 /// ```ignore,no_run
6544 /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6545 /// let x = MongodbSslConfig::new().set_client_key_set(true);
6546 /// ```
6547 pub fn set_client_key_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6548 self.client_key_set = v.into();
6549 self
6550 }
6551
6552 /// Sets the value of [client_certificate][crate::model::MongodbSslConfig::client_certificate].
6553 ///
6554 /// # Example
6555 /// ```ignore,no_run
6556 /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6557 /// let x = MongodbSslConfig::new().set_client_certificate("example");
6558 /// ```
6559 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
6560 mut self,
6561 v: T,
6562 ) -> Self {
6563 self.client_certificate = v.into();
6564 self
6565 }
6566
6567 /// Sets the value of [client_certificate_set][crate::model::MongodbSslConfig::client_certificate_set].
6568 ///
6569 /// # Example
6570 /// ```ignore,no_run
6571 /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6572 /// let x = MongodbSslConfig::new().set_client_certificate_set(true);
6573 /// ```
6574 pub fn set_client_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6575 self.client_certificate_set = v.into();
6576 self
6577 }
6578
6579 /// Sets the value of [ca_certificate][crate::model::MongodbSslConfig::ca_certificate].
6580 ///
6581 /// # Example
6582 /// ```ignore,no_run
6583 /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6584 /// let x = MongodbSslConfig::new().set_ca_certificate("example");
6585 /// ```
6586 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6587 self.ca_certificate = v.into();
6588 self
6589 }
6590
6591 /// Sets the value of [ca_certificate_set][crate::model::MongodbSslConfig::ca_certificate_set].
6592 ///
6593 /// # Example
6594 /// ```ignore,no_run
6595 /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6596 /// let x = MongodbSslConfig::new().set_ca_certificate_set(true);
6597 /// ```
6598 pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6599 self.ca_certificate_set = v.into();
6600 self
6601 }
6602
6603 /// Sets the value of [secret_manager_stored_client_key][crate::model::MongodbSslConfig::secret_manager_stored_client_key].
6604 ///
6605 /// # Example
6606 /// ```ignore,no_run
6607 /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6608 /// let x = MongodbSslConfig::new().set_secret_manager_stored_client_key("example");
6609 /// ```
6610 pub fn set_secret_manager_stored_client_key<T: std::convert::Into<std::string::String>>(
6611 mut self,
6612 v: T,
6613 ) -> Self {
6614 self.secret_manager_stored_client_key = v.into();
6615 self
6616 }
6617}
6618
6619impl wkt::message::Message for MongodbSslConfig {
6620 fn typename() -> &'static str {
6621 "type.googleapis.com/google.cloud.datastream.v1.MongodbSslConfig"
6622 }
6623}
6624
6625/// MySQL SSL configuration information.
6626#[derive(Clone, Default, PartialEq)]
6627#[non_exhaustive]
6628pub struct MysqlSslConfig {
6629 /// Optional. Input only. PEM-encoded private key associated with the Client
6630 /// Certificate. If this field is used then the 'client_certificate' and the
6631 /// 'ca_certificate' fields are mandatory.
6632 pub client_key: std::string::String,
6633
6634 /// Output only. Indicates whether the client_key field is set.
6635 pub client_key_set: bool,
6636
6637 /// Optional. Input only. PEM-encoded certificate that will be used by the
6638 /// replica to authenticate against the source database server. If this field
6639 /// is used then the 'client_key' and the 'ca_certificate' fields are
6640 /// mandatory.
6641 pub client_certificate: std::string::String,
6642
6643 /// Output only. Indicates whether the client_certificate field is set.
6644 pub client_certificate_set: bool,
6645
6646 /// Input only. PEM-encoded certificate of the CA that signed the source
6647 /// database server's certificate.
6648 pub ca_certificate: std::string::String,
6649
6650 /// Output only. Indicates whether the ca_certificate field is set.
6651 pub ca_certificate_set: bool,
6652
6653 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6654}
6655
6656impl MysqlSslConfig {
6657 /// Creates a new default instance.
6658 pub fn new() -> Self {
6659 std::default::Default::default()
6660 }
6661
6662 /// Sets the value of [client_key][crate::model::MysqlSslConfig::client_key].
6663 ///
6664 /// # Example
6665 /// ```ignore,no_run
6666 /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6667 /// let x = MysqlSslConfig::new().set_client_key("example");
6668 /// ```
6669 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6670 self.client_key = v.into();
6671 self
6672 }
6673
6674 /// Sets the value of [client_key_set][crate::model::MysqlSslConfig::client_key_set].
6675 ///
6676 /// # Example
6677 /// ```ignore,no_run
6678 /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6679 /// let x = MysqlSslConfig::new().set_client_key_set(true);
6680 /// ```
6681 pub fn set_client_key_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6682 self.client_key_set = v.into();
6683 self
6684 }
6685
6686 /// Sets the value of [client_certificate][crate::model::MysqlSslConfig::client_certificate].
6687 ///
6688 /// # Example
6689 /// ```ignore,no_run
6690 /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6691 /// let x = MysqlSslConfig::new().set_client_certificate("example");
6692 /// ```
6693 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
6694 mut self,
6695 v: T,
6696 ) -> Self {
6697 self.client_certificate = v.into();
6698 self
6699 }
6700
6701 /// Sets the value of [client_certificate_set][crate::model::MysqlSslConfig::client_certificate_set].
6702 ///
6703 /// # Example
6704 /// ```ignore,no_run
6705 /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6706 /// let x = MysqlSslConfig::new().set_client_certificate_set(true);
6707 /// ```
6708 pub fn set_client_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6709 self.client_certificate_set = v.into();
6710 self
6711 }
6712
6713 /// Sets the value of [ca_certificate][crate::model::MysqlSslConfig::ca_certificate].
6714 ///
6715 /// # Example
6716 /// ```ignore,no_run
6717 /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6718 /// let x = MysqlSslConfig::new().set_ca_certificate("example");
6719 /// ```
6720 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6721 self.ca_certificate = v.into();
6722 self
6723 }
6724
6725 /// Sets the value of [ca_certificate_set][crate::model::MysqlSslConfig::ca_certificate_set].
6726 ///
6727 /// # Example
6728 /// ```ignore,no_run
6729 /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6730 /// let x = MysqlSslConfig::new().set_ca_certificate_set(true);
6731 /// ```
6732 pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6733 self.ca_certificate_set = v.into();
6734 self
6735 }
6736}
6737
6738impl wkt::message::Message for MysqlSslConfig {
6739 fn typename() -> &'static str {
6740 "type.googleapis.com/google.cloud.datastream.v1.MysqlSslConfig"
6741 }
6742}
6743
6744/// Oracle SSL configuration information.
6745#[derive(Clone, Default, PartialEq)]
6746#[non_exhaustive]
6747pub struct OracleSslConfig {
6748 /// Input only. PEM-encoded certificate of the CA that signed the source
6749 /// database server's certificate.
6750 pub ca_certificate: std::string::String,
6751
6752 /// Output only. Indicates whether the ca_certificate field has been set for
6753 /// this Connection-Profile.
6754 pub ca_certificate_set: bool,
6755
6756 /// Optional. The distinguished name (DN) mentioned in the server
6757 /// certificate. This corresponds to SSL_SERVER_CERT_DN sqlnet parameter.
6758 /// Refer
6759 /// <https://docs.oracle.com/en/database/oracle/oracle-database/19/netrf/local-naming-parameters-in-tns-ora-file.html#GUID-70AB0695-A9AA-4A94-B141-4C605236EEB7>
6760 /// If this field is not provided, the DN matching is not enforced.
6761 pub server_certificate_distinguished_name: std::string::String,
6762
6763 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6764}
6765
6766impl OracleSslConfig {
6767 /// Creates a new default instance.
6768 pub fn new() -> Self {
6769 std::default::Default::default()
6770 }
6771
6772 /// Sets the value of [ca_certificate][crate::model::OracleSslConfig::ca_certificate].
6773 ///
6774 /// # Example
6775 /// ```ignore,no_run
6776 /// # use google_cloud_datastream_v1::model::OracleSslConfig;
6777 /// let x = OracleSslConfig::new().set_ca_certificate("example");
6778 /// ```
6779 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6780 self.ca_certificate = v.into();
6781 self
6782 }
6783
6784 /// Sets the value of [ca_certificate_set][crate::model::OracleSslConfig::ca_certificate_set].
6785 ///
6786 /// # Example
6787 /// ```ignore,no_run
6788 /// # use google_cloud_datastream_v1::model::OracleSslConfig;
6789 /// let x = OracleSslConfig::new().set_ca_certificate_set(true);
6790 /// ```
6791 pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6792 self.ca_certificate_set = v.into();
6793 self
6794 }
6795
6796 /// Sets the value of [server_certificate_distinguished_name][crate::model::OracleSslConfig::server_certificate_distinguished_name].
6797 ///
6798 /// # Example
6799 /// ```ignore,no_run
6800 /// # use google_cloud_datastream_v1::model::OracleSslConfig;
6801 /// let x = OracleSslConfig::new().set_server_certificate_distinguished_name("example");
6802 /// ```
6803 pub fn set_server_certificate_distinguished_name<T: std::convert::Into<std::string::String>>(
6804 mut self,
6805 v: T,
6806 ) -> Self {
6807 self.server_certificate_distinguished_name = v.into();
6808 self
6809 }
6810}
6811
6812impl wkt::message::Message for OracleSslConfig {
6813 fn typename() -> &'static str {
6814 "type.googleapis.com/google.cloud.datastream.v1.OracleSslConfig"
6815 }
6816}
6817
6818/// PostgreSQL SSL configuration information.
6819#[derive(Clone, Default, PartialEq)]
6820#[non_exhaustive]
6821pub struct PostgresqlSslConfig {
6822 /// The encryption settings available for PostgreSQL connection profiles.
6823 /// This captures various SSL mode supported by PostgreSQL, which includes
6824 /// TLS encryption with server verification, TLS encryption with both server
6825 /// and client verification and no TLS encryption.
6826 pub encryption_setting:
6827 std::option::Option<crate::model::postgresql_ssl_config::EncryptionSetting>,
6828
6829 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6830}
6831
6832impl PostgresqlSslConfig {
6833 /// Creates a new default instance.
6834 pub fn new() -> Self {
6835 std::default::Default::default()
6836 }
6837
6838 /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting].
6839 ///
6840 /// Note that all the setters affecting `encryption_setting` are mutually
6841 /// exclusive.
6842 ///
6843 /// # Example
6844 /// ```ignore,no_run
6845 /// # use google_cloud_datastream_v1::model::PostgresqlSslConfig;
6846 /// use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerVerification;
6847 /// let x = PostgresqlSslConfig::new().set_encryption_setting(Some(
6848 /// google_cloud_datastream_v1::model::postgresql_ssl_config::EncryptionSetting::ServerVerification(ServerVerification::default().into())));
6849 /// ```
6850 pub fn set_encryption_setting<
6851 T: std::convert::Into<
6852 std::option::Option<crate::model::postgresql_ssl_config::EncryptionSetting>,
6853 >,
6854 >(
6855 mut self,
6856 v: T,
6857 ) -> Self {
6858 self.encryption_setting = v.into();
6859 self
6860 }
6861
6862 /// The value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
6863 /// if it holds a `ServerVerification`, `None` if the field is not set or
6864 /// holds a different branch.
6865 pub fn server_verification(
6866 &self,
6867 ) -> std::option::Option<
6868 &std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
6869 > {
6870 #[allow(unreachable_patterns)]
6871 self.encryption_setting.as_ref().and_then(|v| match v {
6872 crate::model::postgresql_ssl_config::EncryptionSetting::ServerVerification(v) => {
6873 std::option::Option::Some(v)
6874 }
6875 _ => std::option::Option::None,
6876 })
6877 }
6878
6879 /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
6880 /// to hold a `ServerVerification`.
6881 ///
6882 /// Note that all the setters affecting `encryption_setting` are
6883 /// mutually exclusive.
6884 ///
6885 /// # Example
6886 /// ```ignore,no_run
6887 /// # use google_cloud_datastream_v1::model::PostgresqlSslConfig;
6888 /// use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerVerification;
6889 /// let x = PostgresqlSslConfig::new().set_server_verification(ServerVerification::default()/* use setters */);
6890 /// assert!(x.server_verification().is_some());
6891 /// assert!(x.server_and_client_verification().is_none());
6892 /// ```
6893 pub fn set_server_verification<
6894 T: std::convert::Into<
6895 std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
6896 >,
6897 >(
6898 mut self,
6899 v: T,
6900 ) -> Self {
6901 self.encryption_setting = std::option::Option::Some(
6902 crate::model::postgresql_ssl_config::EncryptionSetting::ServerVerification(v.into()),
6903 );
6904 self
6905 }
6906
6907 /// The value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
6908 /// if it holds a `ServerAndClientVerification`, `None` if the field is not set or
6909 /// holds a different branch.
6910 pub fn server_and_client_verification(
6911 &self,
6912 ) -> std::option::Option<
6913 &std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
6914 > {
6915 #[allow(unreachable_patterns)]
6916 self.encryption_setting.as_ref().and_then(|v| match v {
6917 crate::model::postgresql_ssl_config::EncryptionSetting::ServerAndClientVerification(
6918 v,
6919 ) => std::option::Option::Some(v),
6920 _ => std::option::Option::None,
6921 })
6922 }
6923
6924 /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
6925 /// to hold a `ServerAndClientVerification`.
6926 ///
6927 /// Note that all the setters affecting `encryption_setting` are
6928 /// mutually exclusive.
6929 ///
6930 /// # Example
6931 /// ```ignore,no_run
6932 /// # use google_cloud_datastream_v1::model::PostgresqlSslConfig;
6933 /// use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
6934 /// let x = PostgresqlSslConfig::new().set_server_and_client_verification(ServerAndClientVerification::default()/* use setters */);
6935 /// assert!(x.server_and_client_verification().is_some());
6936 /// assert!(x.server_verification().is_none());
6937 /// ```
6938 pub fn set_server_and_client_verification<
6939 T: std::convert::Into<
6940 std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
6941 >,
6942 >(
6943 mut self,
6944 v: T,
6945 ) -> Self {
6946 self.encryption_setting = std::option::Option::Some(
6947 crate::model::postgresql_ssl_config::EncryptionSetting::ServerAndClientVerification(
6948 v.into(),
6949 ),
6950 );
6951 self
6952 }
6953}
6954
6955impl wkt::message::Message for PostgresqlSslConfig {
6956 fn typename() -> &'static str {
6957 "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig"
6958 }
6959}
6960
6961/// Defines additional types related to [PostgresqlSslConfig].
6962pub mod postgresql_ssl_config {
6963 #[allow(unused_imports)]
6964 use super::*;
6965
6966 /// Message represents the option where Datastream will enforce the encryption
6967 /// and authenticate the server identity. ca_certificate must be set if user
6968 /// selects this option.
6969 #[derive(Clone, Default, PartialEq)]
6970 #[non_exhaustive]
6971 pub struct ServerVerification {
6972 /// Required. Input only. PEM-encoded server root CA certificate.
6973 pub ca_certificate: std::string::String,
6974
6975 /// Optional. The hostname mentioned in the Subject or SAN extension of the
6976 /// server certificate. If this field is not provided, the hostname in the
6977 /// server certificate is not validated.
6978 pub server_certificate_hostname: std::string::String,
6979
6980 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6981 }
6982
6983 impl ServerVerification {
6984 /// Creates a new default instance.
6985 pub fn new() -> Self {
6986 std::default::Default::default()
6987 }
6988
6989 /// Sets the value of [ca_certificate][crate::model::postgresql_ssl_config::ServerVerification::ca_certificate].
6990 ///
6991 /// # Example
6992 /// ```ignore,no_run
6993 /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerVerification;
6994 /// let x = ServerVerification::new().set_ca_certificate("example");
6995 /// ```
6996 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(
6997 mut self,
6998 v: T,
6999 ) -> Self {
7000 self.ca_certificate = v.into();
7001 self
7002 }
7003
7004 /// Sets the value of [server_certificate_hostname][crate::model::postgresql_ssl_config::ServerVerification::server_certificate_hostname].
7005 ///
7006 /// # Example
7007 /// ```ignore,no_run
7008 /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerVerification;
7009 /// let x = ServerVerification::new().set_server_certificate_hostname("example");
7010 /// ```
7011 pub fn set_server_certificate_hostname<T: std::convert::Into<std::string::String>>(
7012 mut self,
7013 v: T,
7014 ) -> Self {
7015 self.server_certificate_hostname = v.into();
7016 self
7017 }
7018 }
7019
7020 impl wkt::message::Message for ServerVerification {
7021 fn typename() -> &'static str {
7022 "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig.ServerVerification"
7023 }
7024 }
7025
7026 /// Message represents the option where Datastream will enforce the encryption
7027 /// and authenticate the server identity as well as the client identity.
7028 /// ca_certificate, client_certificate and client_key must be set if user
7029 /// selects this option.
7030 #[derive(Clone, Default, PartialEq)]
7031 #[non_exhaustive]
7032 pub struct ServerAndClientVerification {
7033 /// Required. Input only. PEM-encoded certificate used by the source database
7034 /// to authenticate the client identity (i.e., the Datastream's identity).
7035 /// This certificate is signed by either a root certificate trusted by the
7036 /// server or one or more intermediate certificates (which is stored with the
7037 /// leaf certificate) to link the this certificate to the trusted root
7038 /// certificate.
7039 pub client_certificate: std::string::String,
7040
7041 /// Optional. Input only. PEM-encoded private key associated with the client
7042 /// certificate. This value will be used during the SSL/TLS handshake,
7043 /// allowing the PostgreSQL server to authenticate the client's identity,
7044 /// i.e. identity of the Datastream.
7045 pub client_key: std::string::String,
7046
7047 /// Required. Input only. PEM-encoded server root CA certificate.
7048 pub ca_certificate: std::string::String,
7049
7050 /// Optional. The hostname mentioned in the Subject or SAN extension of the
7051 /// server certificate. If this field is not provided, the hostname in the
7052 /// server certificate is not validated.
7053 pub server_certificate_hostname: std::string::String,
7054
7055 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7056 }
7057
7058 impl ServerAndClientVerification {
7059 /// Creates a new default instance.
7060 pub fn new() -> Self {
7061 std::default::Default::default()
7062 }
7063
7064 /// Sets the value of [client_certificate][crate::model::postgresql_ssl_config::ServerAndClientVerification::client_certificate].
7065 ///
7066 /// # Example
7067 /// ```ignore,no_run
7068 /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
7069 /// let x = ServerAndClientVerification::new().set_client_certificate("example");
7070 /// ```
7071 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
7072 mut self,
7073 v: T,
7074 ) -> Self {
7075 self.client_certificate = v.into();
7076 self
7077 }
7078
7079 /// Sets the value of [client_key][crate::model::postgresql_ssl_config::ServerAndClientVerification::client_key].
7080 ///
7081 /// # Example
7082 /// ```ignore,no_run
7083 /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
7084 /// let x = ServerAndClientVerification::new().set_client_key("example");
7085 /// ```
7086 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7087 self.client_key = v.into();
7088 self
7089 }
7090
7091 /// Sets the value of [ca_certificate][crate::model::postgresql_ssl_config::ServerAndClientVerification::ca_certificate].
7092 ///
7093 /// # Example
7094 /// ```ignore,no_run
7095 /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
7096 /// let x = ServerAndClientVerification::new().set_ca_certificate("example");
7097 /// ```
7098 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(
7099 mut self,
7100 v: T,
7101 ) -> Self {
7102 self.ca_certificate = v.into();
7103 self
7104 }
7105
7106 /// Sets the value of [server_certificate_hostname][crate::model::postgresql_ssl_config::ServerAndClientVerification::server_certificate_hostname].
7107 ///
7108 /// # Example
7109 /// ```ignore,no_run
7110 /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
7111 /// let x = ServerAndClientVerification::new().set_server_certificate_hostname("example");
7112 /// ```
7113 pub fn set_server_certificate_hostname<T: std::convert::Into<std::string::String>>(
7114 mut self,
7115 v: T,
7116 ) -> Self {
7117 self.server_certificate_hostname = v.into();
7118 self
7119 }
7120 }
7121
7122 impl wkt::message::Message for ServerAndClientVerification {
7123 fn typename() -> &'static str {
7124 "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig.ServerAndClientVerification"
7125 }
7126 }
7127
7128 /// The encryption settings available for PostgreSQL connection profiles.
7129 /// This captures various SSL mode supported by PostgreSQL, which includes
7130 /// TLS encryption with server verification, TLS encryption with both server
7131 /// and client verification and no TLS encryption.
7132 #[derive(Clone, Debug, PartialEq)]
7133 #[non_exhaustive]
7134 pub enum EncryptionSetting {
7135 /// Â If this field is set, the communication will be encrypted with TLS
7136 /// encryption and the server identity will be authenticated.
7137 ServerVerification(
7138 std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
7139 ),
7140 /// If this field is set, the communication will be encrypted with TLS
7141 /// encryption and both the server identity and the client identity will be
7142 /// authenticated.
7143 ServerAndClientVerification(
7144 std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
7145 ),
7146 }
7147}
7148
7149/// A set of reusable connection configurations to be used as a source or
7150/// destination for a stream.
7151#[derive(Clone, Default, PartialEq)]
7152#[non_exhaustive]
7153pub struct ConnectionProfile {
7154 /// Output only. Identifier. The resource's name.
7155 pub name: std::string::String,
7156
7157 /// Output only. The create time of the resource.
7158 pub create_time: std::option::Option<wkt::Timestamp>,
7159
7160 /// Output only. The update time of the resource.
7161 pub update_time: std::option::Option<wkt::Timestamp>,
7162
7163 /// Labels.
7164 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7165
7166 /// Required. Display name.
7167 pub display_name: std::string::String,
7168
7169 /// Output only. Reserved for future use.
7170 pub satisfies_pzs: std::option::Option<bool>,
7171
7172 /// Output only. Reserved for future use.
7173 pub satisfies_pzi: std::option::Option<bool>,
7174
7175 /// Connection configuration for the ConnectionProfile.
7176 pub profile: std::option::Option<crate::model::connection_profile::Profile>,
7177
7178 /// Connectivity options used to establish a connection to the profile.
7179 pub connectivity: std::option::Option<crate::model::connection_profile::Connectivity>,
7180
7181 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7182}
7183
7184impl ConnectionProfile {
7185 /// Creates a new default instance.
7186 pub fn new() -> Self {
7187 std::default::Default::default()
7188 }
7189
7190 /// Sets the value of [name][crate::model::ConnectionProfile::name].
7191 ///
7192 /// # Example
7193 /// ```ignore,no_run
7194 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7195 /// let x = ConnectionProfile::new().set_name("example");
7196 /// ```
7197 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7198 self.name = v.into();
7199 self
7200 }
7201
7202 /// Sets the value of [create_time][crate::model::ConnectionProfile::create_time].
7203 ///
7204 /// # Example
7205 /// ```ignore,no_run
7206 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7207 /// use wkt::Timestamp;
7208 /// let x = ConnectionProfile::new().set_create_time(Timestamp::default()/* use setters */);
7209 /// ```
7210 pub fn set_create_time<T>(mut self, v: T) -> Self
7211 where
7212 T: std::convert::Into<wkt::Timestamp>,
7213 {
7214 self.create_time = std::option::Option::Some(v.into());
7215 self
7216 }
7217
7218 /// Sets or clears the value of [create_time][crate::model::ConnectionProfile::create_time].
7219 ///
7220 /// # Example
7221 /// ```ignore,no_run
7222 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7223 /// use wkt::Timestamp;
7224 /// let x = ConnectionProfile::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7225 /// let x = ConnectionProfile::new().set_or_clear_create_time(None::<Timestamp>);
7226 /// ```
7227 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7228 where
7229 T: std::convert::Into<wkt::Timestamp>,
7230 {
7231 self.create_time = v.map(|x| x.into());
7232 self
7233 }
7234
7235 /// Sets the value of [update_time][crate::model::ConnectionProfile::update_time].
7236 ///
7237 /// # Example
7238 /// ```ignore,no_run
7239 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7240 /// use wkt::Timestamp;
7241 /// let x = ConnectionProfile::new().set_update_time(Timestamp::default()/* use setters */);
7242 /// ```
7243 pub fn set_update_time<T>(mut self, v: T) -> Self
7244 where
7245 T: std::convert::Into<wkt::Timestamp>,
7246 {
7247 self.update_time = std::option::Option::Some(v.into());
7248 self
7249 }
7250
7251 /// Sets or clears the value of [update_time][crate::model::ConnectionProfile::update_time].
7252 ///
7253 /// # Example
7254 /// ```ignore,no_run
7255 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7256 /// use wkt::Timestamp;
7257 /// let x = ConnectionProfile::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7258 /// let x = ConnectionProfile::new().set_or_clear_update_time(None::<Timestamp>);
7259 /// ```
7260 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7261 where
7262 T: std::convert::Into<wkt::Timestamp>,
7263 {
7264 self.update_time = v.map(|x| x.into());
7265 self
7266 }
7267
7268 /// Sets the value of [labels][crate::model::ConnectionProfile::labels].
7269 ///
7270 /// # Example
7271 /// ```ignore,no_run
7272 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7273 /// let x = ConnectionProfile::new().set_labels([
7274 /// ("key0", "abc"),
7275 /// ("key1", "xyz"),
7276 /// ]);
7277 /// ```
7278 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7279 where
7280 T: std::iter::IntoIterator<Item = (K, V)>,
7281 K: std::convert::Into<std::string::String>,
7282 V: std::convert::Into<std::string::String>,
7283 {
7284 use std::iter::Iterator;
7285 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7286 self
7287 }
7288
7289 /// Sets the value of [display_name][crate::model::ConnectionProfile::display_name].
7290 ///
7291 /// # Example
7292 /// ```ignore,no_run
7293 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7294 /// let x = ConnectionProfile::new().set_display_name("example");
7295 /// ```
7296 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7297 self.display_name = v.into();
7298 self
7299 }
7300
7301 /// Sets the value of [satisfies_pzs][crate::model::ConnectionProfile::satisfies_pzs].
7302 ///
7303 /// # Example
7304 /// ```ignore,no_run
7305 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7306 /// let x = ConnectionProfile::new().set_satisfies_pzs(true);
7307 /// ```
7308 pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
7309 where
7310 T: std::convert::Into<bool>,
7311 {
7312 self.satisfies_pzs = std::option::Option::Some(v.into());
7313 self
7314 }
7315
7316 /// Sets or clears the value of [satisfies_pzs][crate::model::ConnectionProfile::satisfies_pzs].
7317 ///
7318 /// # Example
7319 /// ```ignore,no_run
7320 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7321 /// let x = ConnectionProfile::new().set_or_clear_satisfies_pzs(Some(false));
7322 /// let x = ConnectionProfile::new().set_or_clear_satisfies_pzs(None::<bool>);
7323 /// ```
7324 pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
7325 where
7326 T: std::convert::Into<bool>,
7327 {
7328 self.satisfies_pzs = v.map(|x| x.into());
7329 self
7330 }
7331
7332 /// Sets the value of [satisfies_pzi][crate::model::ConnectionProfile::satisfies_pzi].
7333 ///
7334 /// # Example
7335 /// ```ignore,no_run
7336 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7337 /// let x = ConnectionProfile::new().set_satisfies_pzi(true);
7338 /// ```
7339 pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
7340 where
7341 T: std::convert::Into<bool>,
7342 {
7343 self.satisfies_pzi = std::option::Option::Some(v.into());
7344 self
7345 }
7346
7347 /// Sets or clears the value of [satisfies_pzi][crate::model::ConnectionProfile::satisfies_pzi].
7348 ///
7349 /// # Example
7350 /// ```ignore,no_run
7351 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7352 /// let x = ConnectionProfile::new().set_or_clear_satisfies_pzi(Some(false));
7353 /// let x = ConnectionProfile::new().set_or_clear_satisfies_pzi(None::<bool>);
7354 /// ```
7355 pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
7356 where
7357 T: std::convert::Into<bool>,
7358 {
7359 self.satisfies_pzi = v.map(|x| x.into());
7360 self
7361 }
7362
7363 /// Sets the value of [profile][crate::model::ConnectionProfile::profile].
7364 ///
7365 /// Note that all the setters affecting `profile` are mutually
7366 /// exclusive.
7367 ///
7368 /// # Example
7369 /// ```ignore,no_run
7370 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7371 /// use google_cloud_datastream_v1::model::OracleProfile;
7372 /// let x = ConnectionProfile::new().set_profile(Some(
7373 /// google_cloud_datastream_v1::model::connection_profile::Profile::OracleProfile(OracleProfile::default().into())));
7374 /// ```
7375 pub fn set_profile<
7376 T: std::convert::Into<std::option::Option<crate::model::connection_profile::Profile>>,
7377 >(
7378 mut self,
7379 v: T,
7380 ) -> Self {
7381 self.profile = v.into();
7382 self
7383 }
7384
7385 /// The value of [profile][crate::model::ConnectionProfile::profile]
7386 /// if it holds a `OracleProfile`, `None` if the field is not set or
7387 /// holds a different branch.
7388 pub fn oracle_profile(
7389 &self,
7390 ) -> std::option::Option<&std::boxed::Box<crate::model::OracleProfile>> {
7391 #[allow(unreachable_patterns)]
7392 self.profile.as_ref().and_then(|v| match v {
7393 crate::model::connection_profile::Profile::OracleProfile(v) => {
7394 std::option::Option::Some(v)
7395 }
7396 _ => std::option::Option::None,
7397 })
7398 }
7399
7400 /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7401 /// to hold a `OracleProfile`.
7402 ///
7403 /// Note that all the setters affecting `profile` are
7404 /// mutually exclusive.
7405 ///
7406 /// # Example
7407 /// ```ignore,no_run
7408 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7409 /// use google_cloud_datastream_v1::model::OracleProfile;
7410 /// let x = ConnectionProfile::new().set_oracle_profile(OracleProfile::default()/* use setters */);
7411 /// assert!(x.oracle_profile().is_some());
7412 /// assert!(x.gcs_profile().is_none());
7413 /// assert!(x.mysql_profile().is_none());
7414 /// assert!(x.bigquery_profile().is_none());
7415 /// assert!(x.postgresql_profile().is_none());
7416 /// assert!(x.sql_server_profile().is_none());
7417 /// assert!(x.salesforce_profile().is_none());
7418 /// assert!(x.mongodb_profile().is_none());
7419 /// ```
7420 pub fn set_oracle_profile<
7421 T: std::convert::Into<std::boxed::Box<crate::model::OracleProfile>>,
7422 >(
7423 mut self,
7424 v: T,
7425 ) -> Self {
7426 self.profile = std::option::Option::Some(
7427 crate::model::connection_profile::Profile::OracleProfile(v.into()),
7428 );
7429 self
7430 }
7431
7432 /// The value of [profile][crate::model::ConnectionProfile::profile]
7433 /// if it holds a `GcsProfile`, `None` if the field is not set or
7434 /// holds a different branch.
7435 pub fn gcs_profile(&self) -> std::option::Option<&std::boxed::Box<crate::model::GcsProfile>> {
7436 #[allow(unreachable_patterns)]
7437 self.profile.as_ref().and_then(|v| match v {
7438 crate::model::connection_profile::Profile::GcsProfile(v) => {
7439 std::option::Option::Some(v)
7440 }
7441 _ => std::option::Option::None,
7442 })
7443 }
7444
7445 /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7446 /// to hold a `GcsProfile`.
7447 ///
7448 /// Note that all the setters affecting `profile` are
7449 /// mutually exclusive.
7450 ///
7451 /// # Example
7452 /// ```ignore,no_run
7453 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7454 /// use google_cloud_datastream_v1::model::GcsProfile;
7455 /// let x = ConnectionProfile::new().set_gcs_profile(GcsProfile::default()/* use setters */);
7456 /// assert!(x.gcs_profile().is_some());
7457 /// assert!(x.oracle_profile().is_none());
7458 /// assert!(x.mysql_profile().is_none());
7459 /// assert!(x.bigquery_profile().is_none());
7460 /// assert!(x.postgresql_profile().is_none());
7461 /// assert!(x.sql_server_profile().is_none());
7462 /// assert!(x.salesforce_profile().is_none());
7463 /// assert!(x.mongodb_profile().is_none());
7464 /// ```
7465 pub fn set_gcs_profile<T: std::convert::Into<std::boxed::Box<crate::model::GcsProfile>>>(
7466 mut self,
7467 v: T,
7468 ) -> Self {
7469 self.profile = std::option::Option::Some(
7470 crate::model::connection_profile::Profile::GcsProfile(v.into()),
7471 );
7472 self
7473 }
7474
7475 /// The value of [profile][crate::model::ConnectionProfile::profile]
7476 /// if it holds a `MysqlProfile`, `None` if the field is not set or
7477 /// holds a different branch.
7478 pub fn mysql_profile(
7479 &self,
7480 ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlProfile>> {
7481 #[allow(unreachable_patterns)]
7482 self.profile.as_ref().and_then(|v| match v {
7483 crate::model::connection_profile::Profile::MysqlProfile(v) => {
7484 std::option::Option::Some(v)
7485 }
7486 _ => std::option::Option::None,
7487 })
7488 }
7489
7490 /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7491 /// to hold a `MysqlProfile`.
7492 ///
7493 /// Note that all the setters affecting `profile` are
7494 /// mutually exclusive.
7495 ///
7496 /// # Example
7497 /// ```ignore,no_run
7498 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7499 /// use google_cloud_datastream_v1::model::MysqlProfile;
7500 /// let x = ConnectionProfile::new().set_mysql_profile(MysqlProfile::default()/* use setters */);
7501 /// assert!(x.mysql_profile().is_some());
7502 /// assert!(x.oracle_profile().is_none());
7503 /// assert!(x.gcs_profile().is_none());
7504 /// assert!(x.bigquery_profile().is_none());
7505 /// assert!(x.postgresql_profile().is_none());
7506 /// assert!(x.sql_server_profile().is_none());
7507 /// assert!(x.salesforce_profile().is_none());
7508 /// assert!(x.mongodb_profile().is_none());
7509 /// ```
7510 pub fn set_mysql_profile<T: std::convert::Into<std::boxed::Box<crate::model::MysqlProfile>>>(
7511 mut self,
7512 v: T,
7513 ) -> Self {
7514 self.profile = std::option::Option::Some(
7515 crate::model::connection_profile::Profile::MysqlProfile(v.into()),
7516 );
7517 self
7518 }
7519
7520 /// The value of [profile][crate::model::ConnectionProfile::profile]
7521 /// if it holds a `BigqueryProfile`, `None` if the field is not set or
7522 /// holds a different branch.
7523 pub fn bigquery_profile(
7524 &self,
7525 ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryProfile>> {
7526 #[allow(unreachable_patterns)]
7527 self.profile.as_ref().and_then(|v| match v {
7528 crate::model::connection_profile::Profile::BigqueryProfile(v) => {
7529 std::option::Option::Some(v)
7530 }
7531 _ => std::option::Option::None,
7532 })
7533 }
7534
7535 /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7536 /// to hold a `BigqueryProfile`.
7537 ///
7538 /// Note that all the setters affecting `profile` are
7539 /// mutually exclusive.
7540 ///
7541 /// # Example
7542 /// ```ignore,no_run
7543 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7544 /// use google_cloud_datastream_v1::model::BigQueryProfile;
7545 /// let x = ConnectionProfile::new().set_bigquery_profile(BigQueryProfile::default()/* use setters */);
7546 /// assert!(x.bigquery_profile().is_some());
7547 /// assert!(x.oracle_profile().is_none());
7548 /// assert!(x.gcs_profile().is_none());
7549 /// assert!(x.mysql_profile().is_none());
7550 /// assert!(x.postgresql_profile().is_none());
7551 /// assert!(x.sql_server_profile().is_none());
7552 /// assert!(x.salesforce_profile().is_none());
7553 /// assert!(x.mongodb_profile().is_none());
7554 /// ```
7555 pub fn set_bigquery_profile<
7556 T: std::convert::Into<std::boxed::Box<crate::model::BigQueryProfile>>,
7557 >(
7558 mut self,
7559 v: T,
7560 ) -> Self {
7561 self.profile = std::option::Option::Some(
7562 crate::model::connection_profile::Profile::BigqueryProfile(v.into()),
7563 );
7564 self
7565 }
7566
7567 /// The value of [profile][crate::model::ConnectionProfile::profile]
7568 /// if it holds a `PostgresqlProfile`, `None` if the field is not set or
7569 /// holds a different branch.
7570 pub fn postgresql_profile(
7571 &self,
7572 ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlProfile>> {
7573 #[allow(unreachable_patterns)]
7574 self.profile.as_ref().and_then(|v| match v {
7575 crate::model::connection_profile::Profile::PostgresqlProfile(v) => {
7576 std::option::Option::Some(v)
7577 }
7578 _ => std::option::Option::None,
7579 })
7580 }
7581
7582 /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7583 /// to hold a `PostgresqlProfile`.
7584 ///
7585 /// Note that all the setters affecting `profile` are
7586 /// mutually exclusive.
7587 ///
7588 /// # Example
7589 /// ```ignore,no_run
7590 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7591 /// use google_cloud_datastream_v1::model::PostgresqlProfile;
7592 /// let x = ConnectionProfile::new().set_postgresql_profile(PostgresqlProfile::default()/* use setters */);
7593 /// assert!(x.postgresql_profile().is_some());
7594 /// assert!(x.oracle_profile().is_none());
7595 /// assert!(x.gcs_profile().is_none());
7596 /// assert!(x.mysql_profile().is_none());
7597 /// assert!(x.bigquery_profile().is_none());
7598 /// assert!(x.sql_server_profile().is_none());
7599 /// assert!(x.salesforce_profile().is_none());
7600 /// assert!(x.mongodb_profile().is_none());
7601 /// ```
7602 pub fn set_postgresql_profile<
7603 T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlProfile>>,
7604 >(
7605 mut self,
7606 v: T,
7607 ) -> Self {
7608 self.profile = std::option::Option::Some(
7609 crate::model::connection_profile::Profile::PostgresqlProfile(v.into()),
7610 );
7611 self
7612 }
7613
7614 /// The value of [profile][crate::model::ConnectionProfile::profile]
7615 /// if it holds a `SqlServerProfile`, `None` if the field is not set or
7616 /// holds a different branch.
7617 pub fn sql_server_profile(
7618 &self,
7619 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerProfile>> {
7620 #[allow(unreachable_patterns)]
7621 self.profile.as_ref().and_then(|v| match v {
7622 crate::model::connection_profile::Profile::SqlServerProfile(v) => {
7623 std::option::Option::Some(v)
7624 }
7625 _ => std::option::Option::None,
7626 })
7627 }
7628
7629 /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7630 /// to hold a `SqlServerProfile`.
7631 ///
7632 /// Note that all the setters affecting `profile` are
7633 /// mutually exclusive.
7634 ///
7635 /// # Example
7636 /// ```ignore,no_run
7637 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7638 /// use google_cloud_datastream_v1::model::SqlServerProfile;
7639 /// let x = ConnectionProfile::new().set_sql_server_profile(SqlServerProfile::default()/* use setters */);
7640 /// assert!(x.sql_server_profile().is_some());
7641 /// assert!(x.oracle_profile().is_none());
7642 /// assert!(x.gcs_profile().is_none());
7643 /// assert!(x.mysql_profile().is_none());
7644 /// assert!(x.bigquery_profile().is_none());
7645 /// assert!(x.postgresql_profile().is_none());
7646 /// assert!(x.salesforce_profile().is_none());
7647 /// assert!(x.mongodb_profile().is_none());
7648 /// ```
7649 pub fn set_sql_server_profile<
7650 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerProfile>>,
7651 >(
7652 mut self,
7653 v: T,
7654 ) -> Self {
7655 self.profile = std::option::Option::Some(
7656 crate::model::connection_profile::Profile::SqlServerProfile(v.into()),
7657 );
7658 self
7659 }
7660
7661 /// The value of [profile][crate::model::ConnectionProfile::profile]
7662 /// if it holds a `SalesforceProfile`, `None` if the field is not set or
7663 /// holds a different branch.
7664 pub fn salesforce_profile(
7665 &self,
7666 ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceProfile>> {
7667 #[allow(unreachable_patterns)]
7668 self.profile.as_ref().and_then(|v| match v {
7669 crate::model::connection_profile::Profile::SalesforceProfile(v) => {
7670 std::option::Option::Some(v)
7671 }
7672 _ => std::option::Option::None,
7673 })
7674 }
7675
7676 /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7677 /// to hold a `SalesforceProfile`.
7678 ///
7679 /// Note that all the setters affecting `profile` are
7680 /// mutually exclusive.
7681 ///
7682 /// # Example
7683 /// ```ignore,no_run
7684 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7685 /// use google_cloud_datastream_v1::model::SalesforceProfile;
7686 /// let x = ConnectionProfile::new().set_salesforce_profile(SalesforceProfile::default()/* use setters */);
7687 /// assert!(x.salesforce_profile().is_some());
7688 /// assert!(x.oracle_profile().is_none());
7689 /// assert!(x.gcs_profile().is_none());
7690 /// assert!(x.mysql_profile().is_none());
7691 /// assert!(x.bigquery_profile().is_none());
7692 /// assert!(x.postgresql_profile().is_none());
7693 /// assert!(x.sql_server_profile().is_none());
7694 /// assert!(x.mongodb_profile().is_none());
7695 /// ```
7696 pub fn set_salesforce_profile<
7697 T: std::convert::Into<std::boxed::Box<crate::model::SalesforceProfile>>,
7698 >(
7699 mut self,
7700 v: T,
7701 ) -> Self {
7702 self.profile = std::option::Option::Some(
7703 crate::model::connection_profile::Profile::SalesforceProfile(v.into()),
7704 );
7705 self
7706 }
7707
7708 /// The value of [profile][crate::model::ConnectionProfile::profile]
7709 /// if it holds a `MongodbProfile`, `None` if the field is not set or
7710 /// holds a different branch.
7711 pub fn mongodb_profile(
7712 &self,
7713 ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbProfile>> {
7714 #[allow(unreachable_patterns)]
7715 self.profile.as_ref().and_then(|v| match v {
7716 crate::model::connection_profile::Profile::MongodbProfile(v) => {
7717 std::option::Option::Some(v)
7718 }
7719 _ => std::option::Option::None,
7720 })
7721 }
7722
7723 /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7724 /// to hold a `MongodbProfile`.
7725 ///
7726 /// Note that all the setters affecting `profile` are
7727 /// mutually exclusive.
7728 ///
7729 /// # Example
7730 /// ```ignore,no_run
7731 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7732 /// use google_cloud_datastream_v1::model::MongodbProfile;
7733 /// let x = ConnectionProfile::new().set_mongodb_profile(MongodbProfile::default()/* use setters */);
7734 /// assert!(x.mongodb_profile().is_some());
7735 /// assert!(x.oracle_profile().is_none());
7736 /// assert!(x.gcs_profile().is_none());
7737 /// assert!(x.mysql_profile().is_none());
7738 /// assert!(x.bigquery_profile().is_none());
7739 /// assert!(x.postgresql_profile().is_none());
7740 /// assert!(x.sql_server_profile().is_none());
7741 /// assert!(x.salesforce_profile().is_none());
7742 /// ```
7743 pub fn set_mongodb_profile<
7744 T: std::convert::Into<std::boxed::Box<crate::model::MongodbProfile>>,
7745 >(
7746 mut self,
7747 v: T,
7748 ) -> Self {
7749 self.profile = std::option::Option::Some(
7750 crate::model::connection_profile::Profile::MongodbProfile(v.into()),
7751 );
7752 self
7753 }
7754
7755 /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity].
7756 ///
7757 /// Note that all the setters affecting `connectivity` are mutually
7758 /// exclusive.
7759 ///
7760 /// # Example
7761 /// ```ignore,no_run
7762 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7763 /// use google_cloud_datastream_v1::model::StaticServiceIpConnectivity;
7764 /// let x = ConnectionProfile::new().set_connectivity(Some(
7765 /// google_cloud_datastream_v1::model::connection_profile::Connectivity::StaticServiceIpConnectivity(StaticServiceIpConnectivity::default().into())));
7766 /// ```
7767 pub fn set_connectivity<
7768 T: std::convert::Into<std::option::Option<crate::model::connection_profile::Connectivity>>,
7769 >(
7770 mut self,
7771 v: T,
7772 ) -> Self {
7773 self.connectivity = v.into();
7774 self
7775 }
7776
7777 /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
7778 /// if it holds a `StaticServiceIpConnectivity`, `None` if the field is not set or
7779 /// holds a different branch.
7780 pub fn static_service_ip_connectivity(
7781 &self,
7782 ) -> std::option::Option<&std::boxed::Box<crate::model::StaticServiceIpConnectivity>> {
7783 #[allow(unreachable_patterns)]
7784 self.connectivity.as_ref().and_then(|v| match v {
7785 crate::model::connection_profile::Connectivity::StaticServiceIpConnectivity(v) => {
7786 std::option::Option::Some(v)
7787 }
7788 _ => std::option::Option::None,
7789 })
7790 }
7791
7792 /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
7793 /// to hold a `StaticServiceIpConnectivity`.
7794 ///
7795 /// Note that all the setters affecting `connectivity` are
7796 /// mutually exclusive.
7797 ///
7798 /// # Example
7799 /// ```ignore,no_run
7800 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7801 /// use google_cloud_datastream_v1::model::StaticServiceIpConnectivity;
7802 /// let x = ConnectionProfile::new().set_static_service_ip_connectivity(StaticServiceIpConnectivity::default()/* use setters */);
7803 /// assert!(x.static_service_ip_connectivity().is_some());
7804 /// assert!(x.forward_ssh_connectivity().is_none());
7805 /// assert!(x.private_connectivity().is_none());
7806 /// ```
7807 pub fn set_static_service_ip_connectivity<
7808 T: std::convert::Into<std::boxed::Box<crate::model::StaticServiceIpConnectivity>>,
7809 >(
7810 mut self,
7811 v: T,
7812 ) -> Self {
7813 self.connectivity = std::option::Option::Some(
7814 crate::model::connection_profile::Connectivity::StaticServiceIpConnectivity(v.into()),
7815 );
7816 self
7817 }
7818
7819 /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
7820 /// if it holds a `ForwardSshConnectivity`, `None` if the field is not set or
7821 /// holds a different branch.
7822 pub fn forward_ssh_connectivity(
7823 &self,
7824 ) -> std::option::Option<&std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>> {
7825 #[allow(unreachable_patterns)]
7826 self.connectivity.as_ref().and_then(|v| match v {
7827 crate::model::connection_profile::Connectivity::ForwardSshConnectivity(v) => {
7828 std::option::Option::Some(v)
7829 }
7830 _ => std::option::Option::None,
7831 })
7832 }
7833
7834 /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
7835 /// to hold a `ForwardSshConnectivity`.
7836 ///
7837 /// Note that all the setters affecting `connectivity` are
7838 /// mutually exclusive.
7839 ///
7840 /// # Example
7841 /// ```ignore,no_run
7842 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7843 /// use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
7844 /// let x = ConnectionProfile::new().set_forward_ssh_connectivity(ForwardSshTunnelConnectivity::default()/* use setters */);
7845 /// assert!(x.forward_ssh_connectivity().is_some());
7846 /// assert!(x.static_service_ip_connectivity().is_none());
7847 /// assert!(x.private_connectivity().is_none());
7848 /// ```
7849 pub fn set_forward_ssh_connectivity<
7850 T: std::convert::Into<std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>>,
7851 >(
7852 mut self,
7853 v: T,
7854 ) -> Self {
7855 self.connectivity = std::option::Option::Some(
7856 crate::model::connection_profile::Connectivity::ForwardSshConnectivity(v.into()),
7857 );
7858 self
7859 }
7860
7861 /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
7862 /// if it holds a `PrivateConnectivity`, `None` if the field is not set or
7863 /// holds a different branch.
7864 pub fn private_connectivity(
7865 &self,
7866 ) -> std::option::Option<&std::boxed::Box<crate::model::PrivateConnectivity>> {
7867 #[allow(unreachable_patterns)]
7868 self.connectivity.as_ref().and_then(|v| match v {
7869 crate::model::connection_profile::Connectivity::PrivateConnectivity(v) => {
7870 std::option::Option::Some(v)
7871 }
7872 _ => std::option::Option::None,
7873 })
7874 }
7875
7876 /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
7877 /// to hold a `PrivateConnectivity`.
7878 ///
7879 /// Note that all the setters affecting `connectivity` are
7880 /// mutually exclusive.
7881 ///
7882 /// # Example
7883 /// ```ignore,no_run
7884 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7885 /// use google_cloud_datastream_v1::model::PrivateConnectivity;
7886 /// let x = ConnectionProfile::new().set_private_connectivity(PrivateConnectivity::default()/* use setters */);
7887 /// assert!(x.private_connectivity().is_some());
7888 /// assert!(x.static_service_ip_connectivity().is_none());
7889 /// assert!(x.forward_ssh_connectivity().is_none());
7890 /// ```
7891 pub fn set_private_connectivity<
7892 T: std::convert::Into<std::boxed::Box<crate::model::PrivateConnectivity>>,
7893 >(
7894 mut self,
7895 v: T,
7896 ) -> Self {
7897 self.connectivity = std::option::Option::Some(
7898 crate::model::connection_profile::Connectivity::PrivateConnectivity(v.into()),
7899 );
7900 self
7901 }
7902}
7903
7904impl wkt::message::Message for ConnectionProfile {
7905 fn typename() -> &'static str {
7906 "type.googleapis.com/google.cloud.datastream.v1.ConnectionProfile"
7907 }
7908}
7909
7910/// Defines additional types related to [ConnectionProfile].
7911pub mod connection_profile {
7912 #[allow(unused_imports)]
7913 use super::*;
7914
7915 /// Connection configuration for the ConnectionProfile.
7916 #[derive(Clone, Debug, PartialEq)]
7917 #[non_exhaustive]
7918 pub enum Profile {
7919 /// Oracle ConnectionProfile configuration.
7920 OracleProfile(std::boxed::Box<crate::model::OracleProfile>),
7921 /// Cloud Storage ConnectionProfile configuration.
7922 GcsProfile(std::boxed::Box<crate::model::GcsProfile>),
7923 /// MySQL ConnectionProfile configuration.
7924 MysqlProfile(std::boxed::Box<crate::model::MysqlProfile>),
7925 /// BigQuery Connection Profile configuration.
7926 BigqueryProfile(std::boxed::Box<crate::model::BigQueryProfile>),
7927 /// PostgreSQL Connection Profile configuration.
7928 PostgresqlProfile(std::boxed::Box<crate::model::PostgresqlProfile>),
7929 /// SQLServer Connection Profile configuration.
7930 SqlServerProfile(std::boxed::Box<crate::model::SqlServerProfile>),
7931 /// Salesforce Connection Profile configuration.
7932 SalesforceProfile(std::boxed::Box<crate::model::SalesforceProfile>),
7933 /// MongoDB Connection Profile configuration.
7934 MongodbProfile(std::boxed::Box<crate::model::MongodbProfile>),
7935 }
7936
7937 /// Connectivity options used to establish a connection to the profile.
7938 #[derive(Clone, Debug, PartialEq)]
7939 #[non_exhaustive]
7940 pub enum Connectivity {
7941 /// Static Service IP connectivity.
7942 StaticServiceIpConnectivity(std::boxed::Box<crate::model::StaticServiceIpConnectivity>),
7943 /// Forward SSH tunnel connectivity.
7944 ForwardSshConnectivity(std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>),
7945 /// Private connectivity.
7946 PrivateConnectivity(std::boxed::Box<crate::model::PrivateConnectivity>),
7947 }
7948}
7949
7950/// Oracle Column.
7951#[derive(Clone, Default, PartialEq)]
7952#[non_exhaustive]
7953pub struct OracleColumn {
7954 /// Column name.
7955 pub column: std::string::String,
7956
7957 /// The Oracle data type.
7958 pub data_type: std::string::String,
7959
7960 /// Column length.
7961 pub length: i32,
7962
7963 /// Column precision.
7964 pub precision: i32,
7965
7966 /// Column scale.
7967 pub scale: i32,
7968
7969 /// Column encoding.
7970 pub encoding: std::string::String,
7971
7972 /// Whether or not the column represents a primary key.
7973 pub primary_key: bool,
7974
7975 /// Whether or not the column can accept a null value.
7976 pub nullable: bool,
7977
7978 /// The ordinal position of the column in the table.
7979 pub ordinal_position: i32,
7980
7981 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7982}
7983
7984impl OracleColumn {
7985 /// Creates a new default instance.
7986 pub fn new() -> Self {
7987 std::default::Default::default()
7988 }
7989
7990 /// Sets the value of [column][crate::model::OracleColumn::column].
7991 ///
7992 /// # Example
7993 /// ```ignore,no_run
7994 /// # use google_cloud_datastream_v1::model::OracleColumn;
7995 /// let x = OracleColumn::new().set_column("example");
7996 /// ```
7997 pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7998 self.column = v.into();
7999 self
8000 }
8001
8002 /// Sets the value of [data_type][crate::model::OracleColumn::data_type].
8003 ///
8004 /// # Example
8005 /// ```ignore,no_run
8006 /// # use google_cloud_datastream_v1::model::OracleColumn;
8007 /// let x = OracleColumn::new().set_data_type("example");
8008 /// ```
8009 pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8010 self.data_type = v.into();
8011 self
8012 }
8013
8014 /// Sets the value of [length][crate::model::OracleColumn::length].
8015 ///
8016 /// # Example
8017 /// ```ignore,no_run
8018 /// # use google_cloud_datastream_v1::model::OracleColumn;
8019 /// let x = OracleColumn::new().set_length(42);
8020 /// ```
8021 pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8022 self.length = v.into();
8023 self
8024 }
8025
8026 /// Sets the value of [precision][crate::model::OracleColumn::precision].
8027 ///
8028 /// # Example
8029 /// ```ignore,no_run
8030 /// # use google_cloud_datastream_v1::model::OracleColumn;
8031 /// let x = OracleColumn::new().set_precision(42);
8032 /// ```
8033 pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8034 self.precision = v.into();
8035 self
8036 }
8037
8038 /// Sets the value of [scale][crate::model::OracleColumn::scale].
8039 ///
8040 /// # Example
8041 /// ```ignore,no_run
8042 /// # use google_cloud_datastream_v1::model::OracleColumn;
8043 /// let x = OracleColumn::new().set_scale(42);
8044 /// ```
8045 pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8046 self.scale = v.into();
8047 self
8048 }
8049
8050 /// Sets the value of [encoding][crate::model::OracleColumn::encoding].
8051 ///
8052 /// # Example
8053 /// ```ignore,no_run
8054 /// # use google_cloud_datastream_v1::model::OracleColumn;
8055 /// let x = OracleColumn::new().set_encoding("example");
8056 /// ```
8057 pub fn set_encoding<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8058 self.encoding = v.into();
8059 self
8060 }
8061
8062 /// Sets the value of [primary_key][crate::model::OracleColumn::primary_key].
8063 ///
8064 /// # Example
8065 /// ```ignore,no_run
8066 /// # use google_cloud_datastream_v1::model::OracleColumn;
8067 /// let x = OracleColumn::new().set_primary_key(true);
8068 /// ```
8069 pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8070 self.primary_key = v.into();
8071 self
8072 }
8073
8074 /// Sets the value of [nullable][crate::model::OracleColumn::nullable].
8075 ///
8076 /// # Example
8077 /// ```ignore,no_run
8078 /// # use google_cloud_datastream_v1::model::OracleColumn;
8079 /// let x = OracleColumn::new().set_nullable(true);
8080 /// ```
8081 pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8082 self.nullable = v.into();
8083 self
8084 }
8085
8086 /// Sets the value of [ordinal_position][crate::model::OracleColumn::ordinal_position].
8087 ///
8088 /// # Example
8089 /// ```ignore,no_run
8090 /// # use google_cloud_datastream_v1::model::OracleColumn;
8091 /// let x = OracleColumn::new().set_ordinal_position(42);
8092 /// ```
8093 pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8094 self.ordinal_position = v.into();
8095 self
8096 }
8097}
8098
8099impl wkt::message::Message for OracleColumn {
8100 fn typename() -> &'static str {
8101 "type.googleapis.com/google.cloud.datastream.v1.OracleColumn"
8102 }
8103}
8104
8105/// Oracle table.
8106#[derive(Clone, Default, PartialEq)]
8107#[non_exhaustive]
8108pub struct OracleTable {
8109 /// Table name.
8110 pub table: std::string::String,
8111
8112 /// Oracle columns in the schema.
8113 /// When unspecified as part of include/exclude objects, includes/excludes
8114 /// everything.
8115 pub oracle_columns: std::vec::Vec<crate::model::OracleColumn>,
8116
8117 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8118}
8119
8120impl OracleTable {
8121 /// Creates a new default instance.
8122 pub fn new() -> Self {
8123 std::default::Default::default()
8124 }
8125
8126 /// Sets the value of [table][crate::model::OracleTable::table].
8127 ///
8128 /// # Example
8129 /// ```ignore,no_run
8130 /// # use google_cloud_datastream_v1::model::OracleTable;
8131 /// let x = OracleTable::new().set_table("example");
8132 /// ```
8133 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8134 self.table = v.into();
8135 self
8136 }
8137
8138 /// Sets the value of [oracle_columns][crate::model::OracleTable::oracle_columns].
8139 ///
8140 /// # Example
8141 /// ```ignore,no_run
8142 /// # use google_cloud_datastream_v1::model::OracleTable;
8143 /// use google_cloud_datastream_v1::model::OracleColumn;
8144 /// let x = OracleTable::new()
8145 /// .set_oracle_columns([
8146 /// OracleColumn::default()/* use setters */,
8147 /// OracleColumn::default()/* use (different) setters */,
8148 /// ]);
8149 /// ```
8150 pub fn set_oracle_columns<T, V>(mut self, v: T) -> Self
8151 where
8152 T: std::iter::IntoIterator<Item = V>,
8153 V: std::convert::Into<crate::model::OracleColumn>,
8154 {
8155 use std::iter::Iterator;
8156 self.oracle_columns = v.into_iter().map(|i| i.into()).collect();
8157 self
8158 }
8159}
8160
8161impl wkt::message::Message for OracleTable {
8162 fn typename() -> &'static str {
8163 "type.googleapis.com/google.cloud.datastream.v1.OracleTable"
8164 }
8165}
8166
8167/// Oracle schema.
8168#[derive(Clone, Default, PartialEq)]
8169#[non_exhaustive]
8170pub struct OracleSchema {
8171 /// Schema name.
8172 pub schema: std::string::String,
8173
8174 /// Tables in the schema.
8175 pub oracle_tables: std::vec::Vec<crate::model::OracleTable>,
8176
8177 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8178}
8179
8180impl OracleSchema {
8181 /// Creates a new default instance.
8182 pub fn new() -> Self {
8183 std::default::Default::default()
8184 }
8185
8186 /// Sets the value of [schema][crate::model::OracleSchema::schema].
8187 ///
8188 /// # Example
8189 /// ```ignore,no_run
8190 /// # use google_cloud_datastream_v1::model::OracleSchema;
8191 /// let x = OracleSchema::new().set_schema("example");
8192 /// ```
8193 pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8194 self.schema = v.into();
8195 self
8196 }
8197
8198 /// Sets the value of [oracle_tables][crate::model::OracleSchema::oracle_tables].
8199 ///
8200 /// # Example
8201 /// ```ignore,no_run
8202 /// # use google_cloud_datastream_v1::model::OracleSchema;
8203 /// use google_cloud_datastream_v1::model::OracleTable;
8204 /// let x = OracleSchema::new()
8205 /// .set_oracle_tables([
8206 /// OracleTable::default()/* use setters */,
8207 /// OracleTable::default()/* use (different) setters */,
8208 /// ]);
8209 /// ```
8210 pub fn set_oracle_tables<T, V>(mut self, v: T) -> Self
8211 where
8212 T: std::iter::IntoIterator<Item = V>,
8213 V: std::convert::Into<crate::model::OracleTable>,
8214 {
8215 use std::iter::Iterator;
8216 self.oracle_tables = v.into_iter().map(|i| i.into()).collect();
8217 self
8218 }
8219}
8220
8221impl wkt::message::Message for OracleSchema {
8222 fn typename() -> &'static str {
8223 "type.googleapis.com/google.cloud.datastream.v1.OracleSchema"
8224 }
8225}
8226
8227/// Oracle database structure.
8228#[derive(Clone, Default, PartialEq)]
8229#[non_exhaustive]
8230pub struct OracleRdbms {
8231 /// Oracle schemas/databases in the database server.
8232 pub oracle_schemas: std::vec::Vec<crate::model::OracleSchema>,
8233
8234 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8235}
8236
8237impl OracleRdbms {
8238 /// Creates a new default instance.
8239 pub fn new() -> Self {
8240 std::default::Default::default()
8241 }
8242
8243 /// Sets the value of [oracle_schemas][crate::model::OracleRdbms::oracle_schemas].
8244 ///
8245 /// # Example
8246 /// ```ignore,no_run
8247 /// # use google_cloud_datastream_v1::model::OracleRdbms;
8248 /// use google_cloud_datastream_v1::model::OracleSchema;
8249 /// let x = OracleRdbms::new()
8250 /// .set_oracle_schemas([
8251 /// OracleSchema::default()/* use setters */,
8252 /// OracleSchema::default()/* use (different) setters */,
8253 /// ]);
8254 /// ```
8255 pub fn set_oracle_schemas<T, V>(mut self, v: T) -> Self
8256 where
8257 T: std::iter::IntoIterator<Item = V>,
8258 V: std::convert::Into<crate::model::OracleSchema>,
8259 {
8260 use std::iter::Iterator;
8261 self.oracle_schemas = v.into_iter().map(|i| i.into()).collect();
8262 self
8263 }
8264}
8265
8266impl wkt::message::Message for OracleRdbms {
8267 fn typename() -> &'static str {
8268 "type.googleapis.com/google.cloud.datastream.v1.OracleRdbms"
8269 }
8270}
8271
8272/// Oracle data source configuration
8273#[derive(Clone, Default, PartialEq)]
8274#[non_exhaustive]
8275pub struct OracleSourceConfig {
8276 /// Oracle objects to include in the stream.
8277 pub include_objects: std::option::Option<crate::model::OracleRdbms>,
8278
8279 /// Oracle objects to exclude from the stream.
8280 pub exclude_objects: std::option::Option<crate::model::OracleRdbms>,
8281
8282 /// Maximum number of concurrent CDC tasks. The number should be non-negative.
8283 /// If not set (or set to 0), the system's default value is used.
8284 pub max_concurrent_cdc_tasks: i32,
8285
8286 /// Maximum number of concurrent backfill tasks. The number should be
8287 /// non-negative. If not set (or set to 0), the system's default value is used.
8288 pub max_concurrent_backfill_tasks: i32,
8289
8290 /// The configuration for handle Oracle large objects.
8291 pub large_objects_handling:
8292 std::option::Option<crate::model::oracle_source_config::LargeObjectsHandling>,
8293
8294 /// Configuration to select the CDC method.
8295 pub cdc_method: std::option::Option<crate::model::oracle_source_config::CdcMethod>,
8296
8297 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8298}
8299
8300impl OracleSourceConfig {
8301 /// Creates a new default instance.
8302 pub fn new() -> Self {
8303 std::default::Default::default()
8304 }
8305
8306 /// Sets the value of [include_objects][crate::model::OracleSourceConfig::include_objects].
8307 ///
8308 /// # Example
8309 /// ```ignore,no_run
8310 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8311 /// use google_cloud_datastream_v1::model::OracleRdbms;
8312 /// let x = OracleSourceConfig::new().set_include_objects(OracleRdbms::default()/* use setters */);
8313 /// ```
8314 pub fn set_include_objects<T>(mut self, v: T) -> Self
8315 where
8316 T: std::convert::Into<crate::model::OracleRdbms>,
8317 {
8318 self.include_objects = std::option::Option::Some(v.into());
8319 self
8320 }
8321
8322 /// Sets or clears the value of [include_objects][crate::model::OracleSourceConfig::include_objects].
8323 ///
8324 /// # Example
8325 /// ```ignore,no_run
8326 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8327 /// use google_cloud_datastream_v1::model::OracleRdbms;
8328 /// let x = OracleSourceConfig::new().set_or_clear_include_objects(Some(OracleRdbms::default()/* use setters */));
8329 /// let x = OracleSourceConfig::new().set_or_clear_include_objects(None::<OracleRdbms>);
8330 /// ```
8331 pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
8332 where
8333 T: std::convert::Into<crate::model::OracleRdbms>,
8334 {
8335 self.include_objects = v.map(|x| x.into());
8336 self
8337 }
8338
8339 /// Sets the value of [exclude_objects][crate::model::OracleSourceConfig::exclude_objects].
8340 ///
8341 /// # Example
8342 /// ```ignore,no_run
8343 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8344 /// use google_cloud_datastream_v1::model::OracleRdbms;
8345 /// let x = OracleSourceConfig::new().set_exclude_objects(OracleRdbms::default()/* use setters */);
8346 /// ```
8347 pub fn set_exclude_objects<T>(mut self, v: T) -> Self
8348 where
8349 T: std::convert::Into<crate::model::OracleRdbms>,
8350 {
8351 self.exclude_objects = std::option::Option::Some(v.into());
8352 self
8353 }
8354
8355 /// Sets or clears the value of [exclude_objects][crate::model::OracleSourceConfig::exclude_objects].
8356 ///
8357 /// # Example
8358 /// ```ignore,no_run
8359 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8360 /// use google_cloud_datastream_v1::model::OracleRdbms;
8361 /// let x = OracleSourceConfig::new().set_or_clear_exclude_objects(Some(OracleRdbms::default()/* use setters */));
8362 /// let x = OracleSourceConfig::new().set_or_clear_exclude_objects(None::<OracleRdbms>);
8363 /// ```
8364 pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
8365 where
8366 T: std::convert::Into<crate::model::OracleRdbms>,
8367 {
8368 self.exclude_objects = v.map(|x| x.into());
8369 self
8370 }
8371
8372 /// Sets the value of [max_concurrent_cdc_tasks][crate::model::OracleSourceConfig::max_concurrent_cdc_tasks].
8373 ///
8374 /// # Example
8375 /// ```ignore,no_run
8376 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8377 /// let x = OracleSourceConfig::new().set_max_concurrent_cdc_tasks(42);
8378 /// ```
8379 pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8380 self.max_concurrent_cdc_tasks = v.into();
8381 self
8382 }
8383
8384 /// Sets the value of [max_concurrent_backfill_tasks][crate::model::OracleSourceConfig::max_concurrent_backfill_tasks].
8385 ///
8386 /// # Example
8387 /// ```ignore,no_run
8388 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8389 /// let x = OracleSourceConfig::new().set_max_concurrent_backfill_tasks(42);
8390 /// ```
8391 pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8392 self.max_concurrent_backfill_tasks = v.into();
8393 self
8394 }
8395
8396 /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling].
8397 ///
8398 /// Note that all the setters affecting `large_objects_handling` are mutually
8399 /// exclusive.
8400 ///
8401 /// # Example
8402 /// ```ignore,no_run
8403 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8404 /// use google_cloud_datastream_v1::model::oracle_source_config::DropLargeObjects;
8405 /// let x = OracleSourceConfig::new().set_large_objects_handling(Some(
8406 /// google_cloud_datastream_v1::model::oracle_source_config::LargeObjectsHandling::DropLargeObjects(DropLargeObjects::default().into())));
8407 /// ```
8408 pub fn set_large_objects_handling<
8409 T: std::convert::Into<
8410 std::option::Option<crate::model::oracle_source_config::LargeObjectsHandling>,
8411 >,
8412 >(
8413 mut self,
8414 v: T,
8415 ) -> Self {
8416 self.large_objects_handling = v.into();
8417 self
8418 }
8419
8420 /// The value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
8421 /// if it holds a `DropLargeObjects`, `None` if the field is not set or
8422 /// holds a different branch.
8423 pub fn drop_large_objects(
8424 &self,
8425 ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>>
8426 {
8427 #[allow(unreachable_patterns)]
8428 self.large_objects_handling.as_ref().and_then(|v| match v {
8429 crate::model::oracle_source_config::LargeObjectsHandling::DropLargeObjects(v) => {
8430 std::option::Option::Some(v)
8431 }
8432 _ => std::option::Option::None,
8433 })
8434 }
8435
8436 /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
8437 /// to hold a `DropLargeObjects`.
8438 ///
8439 /// Note that all the setters affecting `large_objects_handling` are
8440 /// mutually exclusive.
8441 ///
8442 /// # Example
8443 /// ```ignore,no_run
8444 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8445 /// use google_cloud_datastream_v1::model::oracle_source_config::DropLargeObjects;
8446 /// let x = OracleSourceConfig::new().set_drop_large_objects(DropLargeObjects::default()/* use setters */);
8447 /// assert!(x.drop_large_objects().is_some());
8448 /// assert!(x.stream_large_objects().is_none());
8449 /// ```
8450 pub fn set_drop_large_objects<
8451 T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>>,
8452 >(
8453 mut self,
8454 v: T,
8455 ) -> Self {
8456 self.large_objects_handling = std::option::Option::Some(
8457 crate::model::oracle_source_config::LargeObjectsHandling::DropLargeObjects(v.into()),
8458 );
8459 self
8460 }
8461
8462 /// The value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
8463 /// if it holds a `StreamLargeObjects`, `None` if the field is not set or
8464 /// holds a different branch.
8465 pub fn stream_large_objects(
8466 &self,
8467 ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>>
8468 {
8469 #[allow(unreachable_patterns)]
8470 self.large_objects_handling.as_ref().and_then(|v| match v {
8471 crate::model::oracle_source_config::LargeObjectsHandling::StreamLargeObjects(v) => {
8472 std::option::Option::Some(v)
8473 }
8474 _ => std::option::Option::None,
8475 })
8476 }
8477
8478 /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
8479 /// to hold a `StreamLargeObjects`.
8480 ///
8481 /// Note that all the setters affecting `large_objects_handling` are
8482 /// mutually exclusive.
8483 ///
8484 /// # Example
8485 /// ```ignore,no_run
8486 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8487 /// use google_cloud_datastream_v1::model::oracle_source_config::StreamLargeObjects;
8488 /// let x = OracleSourceConfig::new().set_stream_large_objects(StreamLargeObjects::default()/* use setters */);
8489 /// assert!(x.stream_large_objects().is_some());
8490 /// assert!(x.drop_large_objects().is_none());
8491 /// ```
8492 pub fn set_stream_large_objects<
8493 T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>>,
8494 >(
8495 mut self,
8496 v: T,
8497 ) -> Self {
8498 self.large_objects_handling = std::option::Option::Some(
8499 crate::model::oracle_source_config::LargeObjectsHandling::StreamLargeObjects(v.into()),
8500 );
8501 self
8502 }
8503
8504 /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method].
8505 ///
8506 /// Note that all the setters affecting `cdc_method` are mutually
8507 /// exclusive.
8508 ///
8509 /// # Example
8510 /// ```ignore,no_run
8511 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8512 /// use google_cloud_datastream_v1::model::oracle_source_config::LogMiner;
8513 /// let x = OracleSourceConfig::new().set_cdc_method(Some(
8514 /// google_cloud_datastream_v1::model::oracle_source_config::CdcMethod::LogMiner(LogMiner::default().into())));
8515 /// ```
8516 pub fn set_cdc_method<
8517 T: std::convert::Into<std::option::Option<crate::model::oracle_source_config::CdcMethod>>,
8518 >(
8519 mut self,
8520 v: T,
8521 ) -> Self {
8522 self.cdc_method = v.into();
8523 self
8524 }
8525
8526 /// The value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
8527 /// if it holds a `LogMiner`, `None` if the field is not set or
8528 /// holds a different branch.
8529 pub fn log_miner(
8530 &self,
8531 ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::LogMiner>> {
8532 #[allow(unreachable_patterns)]
8533 self.cdc_method.as_ref().and_then(|v| match v {
8534 crate::model::oracle_source_config::CdcMethod::LogMiner(v) => {
8535 std::option::Option::Some(v)
8536 }
8537 _ => std::option::Option::None,
8538 })
8539 }
8540
8541 /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
8542 /// to hold a `LogMiner`.
8543 ///
8544 /// Note that all the setters affecting `cdc_method` are
8545 /// mutually exclusive.
8546 ///
8547 /// # Example
8548 /// ```ignore,no_run
8549 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8550 /// use google_cloud_datastream_v1::model::oracle_source_config::LogMiner;
8551 /// let x = OracleSourceConfig::new().set_log_miner(LogMiner::default()/* use setters */);
8552 /// assert!(x.log_miner().is_some());
8553 /// assert!(x.binary_log_parser().is_none());
8554 /// ```
8555 pub fn set_log_miner<
8556 T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::LogMiner>>,
8557 >(
8558 mut self,
8559 v: T,
8560 ) -> Self {
8561 self.cdc_method = std::option::Option::Some(
8562 crate::model::oracle_source_config::CdcMethod::LogMiner(v.into()),
8563 );
8564 self
8565 }
8566
8567 /// The value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
8568 /// if it holds a `BinaryLogParser`, `None` if the field is not set or
8569 /// holds a different branch.
8570 pub fn binary_log_parser(
8571 &self,
8572 ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>>
8573 {
8574 #[allow(unreachable_patterns)]
8575 self.cdc_method.as_ref().and_then(|v| match v {
8576 crate::model::oracle_source_config::CdcMethod::BinaryLogParser(v) => {
8577 std::option::Option::Some(v)
8578 }
8579 _ => std::option::Option::None,
8580 })
8581 }
8582
8583 /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
8584 /// to hold a `BinaryLogParser`.
8585 ///
8586 /// Note that all the setters affecting `cdc_method` are
8587 /// mutually exclusive.
8588 ///
8589 /// # Example
8590 /// ```ignore,no_run
8591 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8592 /// use google_cloud_datastream_v1::model::oracle_source_config::BinaryLogParser;
8593 /// let x = OracleSourceConfig::new().set_binary_log_parser(BinaryLogParser::default()/* use setters */);
8594 /// assert!(x.binary_log_parser().is_some());
8595 /// assert!(x.log_miner().is_none());
8596 /// ```
8597 pub fn set_binary_log_parser<
8598 T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>>,
8599 >(
8600 mut self,
8601 v: T,
8602 ) -> Self {
8603 self.cdc_method = std::option::Option::Some(
8604 crate::model::oracle_source_config::CdcMethod::BinaryLogParser(v.into()),
8605 );
8606 self
8607 }
8608}
8609
8610impl wkt::message::Message for OracleSourceConfig {
8611 fn typename() -> &'static str {
8612 "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig"
8613 }
8614}
8615
8616/// Defines additional types related to [OracleSourceConfig].
8617pub mod oracle_source_config {
8618 #[allow(unused_imports)]
8619 use super::*;
8620
8621 /// Configuration to drop large object values.
8622 #[derive(Clone, Default, PartialEq)]
8623 #[non_exhaustive]
8624 pub struct DropLargeObjects {
8625 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8626 }
8627
8628 impl DropLargeObjects {
8629 /// Creates a new default instance.
8630 pub fn new() -> Self {
8631 std::default::Default::default()
8632 }
8633 }
8634
8635 impl wkt::message::Message for DropLargeObjects {
8636 fn typename() -> &'static str {
8637 "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.DropLargeObjects"
8638 }
8639 }
8640
8641 /// Configuration to stream large object values.
8642 #[derive(Clone, Default, PartialEq)]
8643 #[non_exhaustive]
8644 pub struct StreamLargeObjects {
8645 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8646 }
8647
8648 impl StreamLargeObjects {
8649 /// Creates a new default instance.
8650 pub fn new() -> Self {
8651 std::default::Default::default()
8652 }
8653 }
8654
8655 impl wkt::message::Message for StreamLargeObjects {
8656 fn typename() -> &'static str {
8657 "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.StreamLargeObjects"
8658 }
8659 }
8660
8661 /// Configuration to use LogMiner CDC method.
8662 #[derive(Clone, Default, PartialEq)]
8663 #[non_exhaustive]
8664 pub struct LogMiner {
8665 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8666 }
8667
8668 impl LogMiner {
8669 /// Creates a new default instance.
8670 pub fn new() -> Self {
8671 std::default::Default::default()
8672 }
8673 }
8674
8675 impl wkt::message::Message for LogMiner {
8676 fn typename() -> &'static str {
8677 "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.LogMiner"
8678 }
8679 }
8680
8681 /// Configuration to use Binary Log Parser CDC technique.
8682 #[derive(Clone, Default, PartialEq)]
8683 #[non_exhaustive]
8684 pub struct BinaryLogParser {
8685 /// Configuration to specify how the log file should be accessed.
8686 pub log_file_access: std::option::Option<
8687 crate::model::oracle_source_config::binary_log_parser::LogFileAccess,
8688 >,
8689
8690 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8691 }
8692
8693 impl BinaryLogParser {
8694 /// Creates a new default instance.
8695 pub fn new() -> Self {
8696 std::default::Default::default()
8697 }
8698
8699 /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access].
8700 ///
8701 /// Note that all the setters affecting `log_file_access` are mutually
8702 /// exclusive.
8703 ///
8704 /// # Example
8705 /// ```ignore,no_run
8706 /// # use google_cloud_datastream_v1::model::oracle_source_config::BinaryLogParser;
8707 /// use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess;
8708 /// let x = BinaryLogParser::new().set_log_file_access(Some(
8709 /// google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::LogFileAccess::OracleAsmLogFileAccess(OracleAsmLogFileAccess::default().into())));
8710 /// ```
8711 pub fn set_log_file_access<
8712 T: std::convert::Into<
8713 std::option::Option<
8714 crate::model::oracle_source_config::binary_log_parser::LogFileAccess,
8715 >,
8716 >,
8717 >(
8718 mut self,
8719 v: T,
8720 ) -> Self {
8721 self.log_file_access = v.into();
8722 self
8723 }
8724
8725 /// The value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
8726 /// if it holds a `OracleAsmLogFileAccess`, `None` if the field is not set or
8727 /// holds a different branch.
8728 pub fn oracle_asm_log_file_access(
8729 &self,
8730 ) -> std::option::Option<
8731 &std::boxed::Box<
8732 crate::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess,
8733 >,
8734 > {
8735 #[allow(unreachable_patterns)]
8736 self.log_file_access.as_ref().and_then(|v| match v {
8737 crate::model::oracle_source_config::binary_log_parser::LogFileAccess::OracleAsmLogFileAccess(v) => std::option::Option::Some(v),
8738 _ => std::option::Option::None,
8739 })
8740 }
8741
8742 /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
8743 /// to hold a `OracleAsmLogFileAccess`.
8744 ///
8745 /// Note that all the setters affecting `log_file_access` are
8746 /// mutually exclusive.
8747 ///
8748 /// # Example
8749 /// ```ignore,no_run
8750 /// # use google_cloud_datastream_v1::model::oracle_source_config::BinaryLogParser;
8751 /// use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess;
8752 /// let x = BinaryLogParser::new().set_oracle_asm_log_file_access(OracleAsmLogFileAccess::default()/* use setters */);
8753 /// assert!(x.oracle_asm_log_file_access().is_some());
8754 /// assert!(x.log_file_directories().is_none());
8755 /// ```
8756 pub fn set_oracle_asm_log_file_access<T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess>>>(mut self, v: T) -> Self{
8757 self.log_file_access = std::option::Option::Some(
8758 crate::model::oracle_source_config::binary_log_parser::LogFileAccess::OracleAsmLogFileAccess(
8759 v.into()
8760 )
8761 );
8762 self
8763 }
8764
8765 /// The value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
8766 /// if it holds a `LogFileDirectories`, `None` if the field is not set or
8767 /// holds a different branch.
8768 pub fn log_file_directories(
8769 &self,
8770 ) -> std::option::Option<
8771 &std::boxed::Box<
8772 crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
8773 >,
8774 > {
8775 #[allow(unreachable_patterns)]
8776 self.log_file_access.as_ref().and_then(|v| match v {
8777 crate::model::oracle_source_config::binary_log_parser::LogFileAccess::LogFileDirectories(v) => std::option::Option::Some(v),
8778 _ => std::option::Option::None,
8779 })
8780 }
8781
8782 /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
8783 /// to hold a `LogFileDirectories`.
8784 ///
8785 /// Note that all the setters affecting `log_file_access` are
8786 /// mutually exclusive.
8787 ///
8788 /// # Example
8789 /// ```ignore,no_run
8790 /// # use google_cloud_datastream_v1::model::oracle_source_config::BinaryLogParser;
8791 /// use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::LogFileDirectories;
8792 /// let x = BinaryLogParser::new().set_log_file_directories(LogFileDirectories::default()/* use setters */);
8793 /// assert!(x.log_file_directories().is_some());
8794 /// assert!(x.oracle_asm_log_file_access().is_none());
8795 /// ```
8796 pub fn set_log_file_directories<
8797 T: std::convert::Into<
8798 std::boxed::Box<
8799 crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
8800 >,
8801 >,
8802 >(
8803 mut self,
8804 v: T,
8805 ) -> Self {
8806 self.log_file_access = std::option::Option::Some(
8807 crate::model::oracle_source_config::binary_log_parser::LogFileAccess::LogFileDirectories(
8808 v.into()
8809 )
8810 );
8811 self
8812 }
8813 }
8814
8815 impl wkt::message::Message for BinaryLogParser {
8816 fn typename() -> &'static str {
8817 "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser"
8818 }
8819 }
8820
8821 /// Defines additional types related to [BinaryLogParser].
8822 pub mod binary_log_parser {
8823 #[allow(unused_imports)]
8824 use super::*;
8825
8826 /// Configuration to use Oracle ASM to access the log files.
8827 #[derive(Clone, Default, PartialEq)]
8828 #[non_exhaustive]
8829 pub struct OracleAsmLogFileAccess {
8830 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8831 }
8832
8833 impl OracleAsmLogFileAccess {
8834 /// Creates a new default instance.
8835 pub fn new() -> Self {
8836 std::default::Default::default()
8837 }
8838 }
8839
8840 impl wkt::message::Message for OracleAsmLogFileAccess {
8841 fn typename() -> &'static str {
8842 "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser.OracleAsmLogFileAccess"
8843 }
8844 }
8845
8846 /// Configuration to specify the Oracle directories to access the log files.
8847 #[derive(Clone, Default, PartialEq)]
8848 #[non_exhaustive]
8849 pub struct LogFileDirectories {
8850 /// Required. Oracle directory for online logs.
8851 pub online_log_directory: std::string::String,
8852
8853 /// Required. Oracle directory for archived logs.
8854 pub archived_log_directory: std::string::String,
8855
8856 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8857 }
8858
8859 impl LogFileDirectories {
8860 /// Creates a new default instance.
8861 pub fn new() -> Self {
8862 std::default::Default::default()
8863 }
8864
8865 /// Sets the value of [online_log_directory][crate::model::oracle_source_config::binary_log_parser::LogFileDirectories::online_log_directory].
8866 ///
8867 /// # Example
8868 /// ```ignore,no_run
8869 /// # use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::LogFileDirectories;
8870 /// let x = LogFileDirectories::new().set_online_log_directory("example");
8871 /// ```
8872 pub fn set_online_log_directory<T: std::convert::Into<std::string::String>>(
8873 mut self,
8874 v: T,
8875 ) -> Self {
8876 self.online_log_directory = v.into();
8877 self
8878 }
8879
8880 /// Sets the value of [archived_log_directory][crate::model::oracle_source_config::binary_log_parser::LogFileDirectories::archived_log_directory].
8881 ///
8882 /// # Example
8883 /// ```ignore,no_run
8884 /// # use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::LogFileDirectories;
8885 /// let x = LogFileDirectories::new().set_archived_log_directory("example");
8886 /// ```
8887 pub fn set_archived_log_directory<T: std::convert::Into<std::string::String>>(
8888 mut self,
8889 v: T,
8890 ) -> Self {
8891 self.archived_log_directory = v.into();
8892 self
8893 }
8894 }
8895
8896 impl wkt::message::Message for LogFileDirectories {
8897 fn typename() -> &'static str {
8898 "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser.LogFileDirectories"
8899 }
8900 }
8901
8902 /// Configuration to specify how the log file should be accessed.
8903 #[derive(Clone, Debug, PartialEq)]
8904 #[non_exhaustive]
8905 pub enum LogFileAccess {
8906 /// Use Oracle ASM.
8907 OracleAsmLogFileAccess(
8908 std::boxed::Box<
8909 crate::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess,
8910 >,
8911 ),
8912 /// Use Oracle directories.
8913 LogFileDirectories(
8914 std::boxed::Box<
8915 crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
8916 >,
8917 ),
8918 }
8919 }
8920
8921 /// The configuration for handle Oracle large objects.
8922 #[derive(Clone, Debug, PartialEq)]
8923 #[non_exhaustive]
8924 pub enum LargeObjectsHandling {
8925 /// Drop large object values.
8926 DropLargeObjects(std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>),
8927 /// Stream large object values.
8928 StreamLargeObjects(std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>),
8929 }
8930
8931 /// Configuration to select the CDC method.
8932 #[derive(Clone, Debug, PartialEq)]
8933 #[non_exhaustive]
8934 pub enum CdcMethod {
8935 /// Use LogMiner.
8936 LogMiner(std::boxed::Box<crate::model::oracle_source_config::LogMiner>),
8937 /// Use Binary Log Parser.
8938 BinaryLogParser(std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>),
8939 }
8940}
8941
8942/// PostgreSQL Column.
8943#[derive(Clone, Default, PartialEq)]
8944#[non_exhaustive]
8945pub struct PostgresqlColumn {
8946 /// Column name.
8947 pub column: std::string::String,
8948
8949 /// The PostgreSQL data type.
8950 pub data_type: std::string::String,
8951
8952 /// Column length.
8953 pub length: i32,
8954
8955 /// Column precision.
8956 pub precision: i32,
8957
8958 /// Column scale.
8959 pub scale: i32,
8960
8961 /// Whether or not the column represents a primary key.
8962 pub primary_key: bool,
8963
8964 /// Whether or not the column can accept a null value.
8965 pub nullable: bool,
8966
8967 /// The ordinal position of the column in the table.
8968 pub ordinal_position: i32,
8969
8970 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8971}
8972
8973impl PostgresqlColumn {
8974 /// Creates a new default instance.
8975 pub fn new() -> Self {
8976 std::default::Default::default()
8977 }
8978
8979 /// Sets the value of [column][crate::model::PostgresqlColumn::column].
8980 ///
8981 /// # Example
8982 /// ```ignore,no_run
8983 /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
8984 /// let x = PostgresqlColumn::new().set_column("example");
8985 /// ```
8986 pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8987 self.column = v.into();
8988 self
8989 }
8990
8991 /// Sets the value of [data_type][crate::model::PostgresqlColumn::data_type].
8992 ///
8993 /// # Example
8994 /// ```ignore,no_run
8995 /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
8996 /// let x = PostgresqlColumn::new().set_data_type("example");
8997 /// ```
8998 pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8999 self.data_type = v.into();
9000 self
9001 }
9002
9003 /// Sets the value of [length][crate::model::PostgresqlColumn::length].
9004 ///
9005 /// # Example
9006 /// ```ignore,no_run
9007 /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
9008 /// let x = PostgresqlColumn::new().set_length(42);
9009 /// ```
9010 pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9011 self.length = v.into();
9012 self
9013 }
9014
9015 /// Sets the value of [precision][crate::model::PostgresqlColumn::precision].
9016 ///
9017 /// # Example
9018 /// ```ignore,no_run
9019 /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
9020 /// let x = PostgresqlColumn::new().set_precision(42);
9021 /// ```
9022 pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9023 self.precision = v.into();
9024 self
9025 }
9026
9027 /// Sets the value of [scale][crate::model::PostgresqlColumn::scale].
9028 ///
9029 /// # Example
9030 /// ```ignore,no_run
9031 /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
9032 /// let x = PostgresqlColumn::new().set_scale(42);
9033 /// ```
9034 pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9035 self.scale = v.into();
9036 self
9037 }
9038
9039 /// Sets the value of [primary_key][crate::model::PostgresqlColumn::primary_key].
9040 ///
9041 /// # Example
9042 /// ```ignore,no_run
9043 /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
9044 /// let x = PostgresqlColumn::new().set_primary_key(true);
9045 /// ```
9046 pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9047 self.primary_key = v.into();
9048 self
9049 }
9050
9051 /// Sets the value of [nullable][crate::model::PostgresqlColumn::nullable].
9052 ///
9053 /// # Example
9054 /// ```ignore,no_run
9055 /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
9056 /// let x = PostgresqlColumn::new().set_nullable(true);
9057 /// ```
9058 pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9059 self.nullable = v.into();
9060 self
9061 }
9062
9063 /// Sets the value of [ordinal_position][crate::model::PostgresqlColumn::ordinal_position].
9064 ///
9065 /// # Example
9066 /// ```ignore,no_run
9067 /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
9068 /// let x = PostgresqlColumn::new().set_ordinal_position(42);
9069 /// ```
9070 pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9071 self.ordinal_position = v.into();
9072 self
9073 }
9074}
9075
9076impl wkt::message::Message for PostgresqlColumn {
9077 fn typename() -> &'static str {
9078 "type.googleapis.com/google.cloud.datastream.v1.PostgresqlColumn"
9079 }
9080}
9081
9082/// PostgreSQL table.
9083#[derive(Clone, Default, PartialEq)]
9084#[non_exhaustive]
9085pub struct PostgresqlTable {
9086 /// Table name.
9087 pub table: std::string::String,
9088
9089 /// PostgreSQL columns in the schema.
9090 /// When unspecified as part of include/exclude objects,
9091 /// includes/excludes everything.
9092 pub postgresql_columns: std::vec::Vec<crate::model::PostgresqlColumn>,
9093
9094 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9095}
9096
9097impl PostgresqlTable {
9098 /// Creates a new default instance.
9099 pub fn new() -> Self {
9100 std::default::Default::default()
9101 }
9102
9103 /// Sets the value of [table][crate::model::PostgresqlTable::table].
9104 ///
9105 /// # Example
9106 /// ```ignore,no_run
9107 /// # use google_cloud_datastream_v1::model::PostgresqlTable;
9108 /// let x = PostgresqlTable::new().set_table("example");
9109 /// ```
9110 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9111 self.table = v.into();
9112 self
9113 }
9114
9115 /// Sets the value of [postgresql_columns][crate::model::PostgresqlTable::postgresql_columns].
9116 ///
9117 /// # Example
9118 /// ```ignore,no_run
9119 /// # use google_cloud_datastream_v1::model::PostgresqlTable;
9120 /// use google_cloud_datastream_v1::model::PostgresqlColumn;
9121 /// let x = PostgresqlTable::new()
9122 /// .set_postgresql_columns([
9123 /// PostgresqlColumn::default()/* use setters */,
9124 /// PostgresqlColumn::default()/* use (different) setters */,
9125 /// ]);
9126 /// ```
9127 pub fn set_postgresql_columns<T, V>(mut self, v: T) -> Self
9128 where
9129 T: std::iter::IntoIterator<Item = V>,
9130 V: std::convert::Into<crate::model::PostgresqlColumn>,
9131 {
9132 use std::iter::Iterator;
9133 self.postgresql_columns = v.into_iter().map(|i| i.into()).collect();
9134 self
9135 }
9136}
9137
9138impl wkt::message::Message for PostgresqlTable {
9139 fn typename() -> &'static str {
9140 "type.googleapis.com/google.cloud.datastream.v1.PostgresqlTable"
9141 }
9142}
9143
9144/// PostgreSQL schema.
9145#[derive(Clone, Default, PartialEq)]
9146#[non_exhaustive]
9147pub struct PostgresqlSchema {
9148 /// Schema name.
9149 pub schema: std::string::String,
9150
9151 /// Tables in the schema.
9152 pub postgresql_tables: std::vec::Vec<crate::model::PostgresqlTable>,
9153
9154 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9155}
9156
9157impl PostgresqlSchema {
9158 /// Creates a new default instance.
9159 pub fn new() -> Self {
9160 std::default::Default::default()
9161 }
9162
9163 /// Sets the value of [schema][crate::model::PostgresqlSchema::schema].
9164 ///
9165 /// # Example
9166 /// ```ignore,no_run
9167 /// # use google_cloud_datastream_v1::model::PostgresqlSchema;
9168 /// let x = PostgresqlSchema::new().set_schema("example");
9169 /// ```
9170 pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9171 self.schema = v.into();
9172 self
9173 }
9174
9175 /// Sets the value of [postgresql_tables][crate::model::PostgresqlSchema::postgresql_tables].
9176 ///
9177 /// # Example
9178 /// ```ignore,no_run
9179 /// # use google_cloud_datastream_v1::model::PostgresqlSchema;
9180 /// use google_cloud_datastream_v1::model::PostgresqlTable;
9181 /// let x = PostgresqlSchema::new()
9182 /// .set_postgresql_tables([
9183 /// PostgresqlTable::default()/* use setters */,
9184 /// PostgresqlTable::default()/* use (different) setters */,
9185 /// ]);
9186 /// ```
9187 pub fn set_postgresql_tables<T, V>(mut self, v: T) -> Self
9188 where
9189 T: std::iter::IntoIterator<Item = V>,
9190 V: std::convert::Into<crate::model::PostgresqlTable>,
9191 {
9192 use std::iter::Iterator;
9193 self.postgresql_tables = v.into_iter().map(|i| i.into()).collect();
9194 self
9195 }
9196}
9197
9198impl wkt::message::Message for PostgresqlSchema {
9199 fn typename() -> &'static str {
9200 "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSchema"
9201 }
9202}
9203
9204/// PostgreSQL database structure.
9205#[derive(Clone, Default, PartialEq)]
9206#[non_exhaustive]
9207pub struct PostgresqlRdbms {
9208 /// PostgreSQL schemas in the database server.
9209 pub postgresql_schemas: std::vec::Vec<crate::model::PostgresqlSchema>,
9210
9211 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9212}
9213
9214impl PostgresqlRdbms {
9215 /// Creates a new default instance.
9216 pub fn new() -> Self {
9217 std::default::Default::default()
9218 }
9219
9220 /// Sets the value of [postgresql_schemas][crate::model::PostgresqlRdbms::postgresql_schemas].
9221 ///
9222 /// # Example
9223 /// ```ignore,no_run
9224 /// # use google_cloud_datastream_v1::model::PostgresqlRdbms;
9225 /// use google_cloud_datastream_v1::model::PostgresqlSchema;
9226 /// let x = PostgresqlRdbms::new()
9227 /// .set_postgresql_schemas([
9228 /// PostgresqlSchema::default()/* use setters */,
9229 /// PostgresqlSchema::default()/* use (different) setters */,
9230 /// ]);
9231 /// ```
9232 pub fn set_postgresql_schemas<T, V>(mut self, v: T) -> Self
9233 where
9234 T: std::iter::IntoIterator<Item = V>,
9235 V: std::convert::Into<crate::model::PostgresqlSchema>,
9236 {
9237 use std::iter::Iterator;
9238 self.postgresql_schemas = v.into_iter().map(|i| i.into()).collect();
9239 self
9240 }
9241}
9242
9243impl wkt::message::Message for PostgresqlRdbms {
9244 fn typename() -> &'static str {
9245 "type.googleapis.com/google.cloud.datastream.v1.PostgresqlRdbms"
9246 }
9247}
9248
9249/// PostgreSQL data source configuration
9250#[derive(Clone, Default, PartialEq)]
9251#[non_exhaustive]
9252pub struct PostgresqlSourceConfig {
9253 /// PostgreSQL objects to include in the stream.
9254 pub include_objects: std::option::Option<crate::model::PostgresqlRdbms>,
9255
9256 /// PostgreSQL objects to exclude from the stream.
9257 pub exclude_objects: std::option::Option<crate::model::PostgresqlRdbms>,
9258
9259 /// Required. Immutable. The name of the logical replication slot that's
9260 /// configured with the pgoutput plugin.
9261 pub replication_slot: std::string::String,
9262
9263 /// Required. The name of the publication that includes the set of all tables
9264 /// that are defined in the stream's include_objects.
9265 pub publication: std::string::String,
9266
9267 /// Maximum number of concurrent backfill tasks. The number should be non
9268 /// negative. If not set (or set to 0), the system's default value will be
9269 /// used.
9270 pub max_concurrent_backfill_tasks: i32,
9271
9272 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9273}
9274
9275impl PostgresqlSourceConfig {
9276 /// Creates a new default instance.
9277 pub fn new() -> Self {
9278 std::default::Default::default()
9279 }
9280
9281 /// Sets the value of [include_objects][crate::model::PostgresqlSourceConfig::include_objects].
9282 ///
9283 /// # Example
9284 /// ```ignore,no_run
9285 /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9286 /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
9287 /// let x = PostgresqlSourceConfig::new().set_include_objects(PostgresqlRdbms::default()/* use setters */);
9288 /// ```
9289 pub fn set_include_objects<T>(mut self, v: T) -> Self
9290 where
9291 T: std::convert::Into<crate::model::PostgresqlRdbms>,
9292 {
9293 self.include_objects = std::option::Option::Some(v.into());
9294 self
9295 }
9296
9297 /// Sets or clears the value of [include_objects][crate::model::PostgresqlSourceConfig::include_objects].
9298 ///
9299 /// # Example
9300 /// ```ignore,no_run
9301 /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9302 /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
9303 /// let x = PostgresqlSourceConfig::new().set_or_clear_include_objects(Some(PostgresqlRdbms::default()/* use setters */));
9304 /// let x = PostgresqlSourceConfig::new().set_or_clear_include_objects(None::<PostgresqlRdbms>);
9305 /// ```
9306 pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
9307 where
9308 T: std::convert::Into<crate::model::PostgresqlRdbms>,
9309 {
9310 self.include_objects = v.map(|x| x.into());
9311 self
9312 }
9313
9314 /// Sets the value of [exclude_objects][crate::model::PostgresqlSourceConfig::exclude_objects].
9315 ///
9316 /// # Example
9317 /// ```ignore,no_run
9318 /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9319 /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
9320 /// let x = PostgresqlSourceConfig::new().set_exclude_objects(PostgresqlRdbms::default()/* use setters */);
9321 /// ```
9322 pub fn set_exclude_objects<T>(mut self, v: T) -> Self
9323 where
9324 T: std::convert::Into<crate::model::PostgresqlRdbms>,
9325 {
9326 self.exclude_objects = std::option::Option::Some(v.into());
9327 self
9328 }
9329
9330 /// Sets or clears the value of [exclude_objects][crate::model::PostgresqlSourceConfig::exclude_objects].
9331 ///
9332 /// # Example
9333 /// ```ignore,no_run
9334 /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9335 /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
9336 /// let x = PostgresqlSourceConfig::new().set_or_clear_exclude_objects(Some(PostgresqlRdbms::default()/* use setters */));
9337 /// let x = PostgresqlSourceConfig::new().set_or_clear_exclude_objects(None::<PostgresqlRdbms>);
9338 /// ```
9339 pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
9340 where
9341 T: std::convert::Into<crate::model::PostgresqlRdbms>,
9342 {
9343 self.exclude_objects = v.map(|x| x.into());
9344 self
9345 }
9346
9347 /// Sets the value of [replication_slot][crate::model::PostgresqlSourceConfig::replication_slot].
9348 ///
9349 /// # Example
9350 /// ```ignore,no_run
9351 /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9352 /// let x = PostgresqlSourceConfig::new().set_replication_slot("example");
9353 /// ```
9354 pub fn set_replication_slot<T: std::convert::Into<std::string::String>>(
9355 mut self,
9356 v: T,
9357 ) -> Self {
9358 self.replication_slot = v.into();
9359 self
9360 }
9361
9362 /// Sets the value of [publication][crate::model::PostgresqlSourceConfig::publication].
9363 ///
9364 /// # Example
9365 /// ```ignore,no_run
9366 /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9367 /// let x = PostgresqlSourceConfig::new().set_publication("example");
9368 /// ```
9369 pub fn set_publication<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9370 self.publication = v.into();
9371 self
9372 }
9373
9374 /// Sets the value of [max_concurrent_backfill_tasks][crate::model::PostgresqlSourceConfig::max_concurrent_backfill_tasks].
9375 ///
9376 /// # Example
9377 /// ```ignore,no_run
9378 /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9379 /// let x = PostgresqlSourceConfig::new().set_max_concurrent_backfill_tasks(42);
9380 /// ```
9381 pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9382 self.max_concurrent_backfill_tasks = v.into();
9383 self
9384 }
9385}
9386
9387impl wkt::message::Message for PostgresqlSourceConfig {
9388 fn typename() -> &'static str {
9389 "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSourceConfig"
9390 }
9391}
9392
9393/// SQLServer Column.
9394#[derive(Clone, Default, PartialEq)]
9395#[non_exhaustive]
9396pub struct SqlServerColumn {
9397 /// Column name.
9398 pub column: std::string::String,
9399
9400 /// The SQLServer data type.
9401 pub data_type: std::string::String,
9402
9403 /// Column length.
9404 pub length: i32,
9405
9406 /// Column precision.
9407 pub precision: i32,
9408
9409 /// Column scale.
9410 pub scale: i32,
9411
9412 /// Whether or not the column represents a primary key.
9413 pub primary_key: bool,
9414
9415 /// Whether or not the column can accept a null value.
9416 pub nullable: bool,
9417
9418 /// The ordinal position of the column in the table.
9419 pub ordinal_position: i32,
9420
9421 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9422}
9423
9424impl SqlServerColumn {
9425 /// Creates a new default instance.
9426 pub fn new() -> Self {
9427 std::default::Default::default()
9428 }
9429
9430 /// Sets the value of [column][crate::model::SqlServerColumn::column].
9431 ///
9432 /// # Example
9433 /// ```ignore,no_run
9434 /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9435 /// let x = SqlServerColumn::new().set_column("example");
9436 /// ```
9437 pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9438 self.column = v.into();
9439 self
9440 }
9441
9442 /// Sets the value of [data_type][crate::model::SqlServerColumn::data_type].
9443 ///
9444 /// # Example
9445 /// ```ignore,no_run
9446 /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9447 /// let x = SqlServerColumn::new().set_data_type("example");
9448 /// ```
9449 pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9450 self.data_type = v.into();
9451 self
9452 }
9453
9454 /// Sets the value of [length][crate::model::SqlServerColumn::length].
9455 ///
9456 /// # Example
9457 /// ```ignore,no_run
9458 /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9459 /// let x = SqlServerColumn::new().set_length(42);
9460 /// ```
9461 pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9462 self.length = v.into();
9463 self
9464 }
9465
9466 /// Sets the value of [precision][crate::model::SqlServerColumn::precision].
9467 ///
9468 /// # Example
9469 /// ```ignore,no_run
9470 /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9471 /// let x = SqlServerColumn::new().set_precision(42);
9472 /// ```
9473 pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9474 self.precision = v.into();
9475 self
9476 }
9477
9478 /// Sets the value of [scale][crate::model::SqlServerColumn::scale].
9479 ///
9480 /// # Example
9481 /// ```ignore,no_run
9482 /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9483 /// let x = SqlServerColumn::new().set_scale(42);
9484 /// ```
9485 pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9486 self.scale = v.into();
9487 self
9488 }
9489
9490 /// Sets the value of [primary_key][crate::model::SqlServerColumn::primary_key].
9491 ///
9492 /// # Example
9493 /// ```ignore,no_run
9494 /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9495 /// let x = SqlServerColumn::new().set_primary_key(true);
9496 /// ```
9497 pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9498 self.primary_key = v.into();
9499 self
9500 }
9501
9502 /// Sets the value of [nullable][crate::model::SqlServerColumn::nullable].
9503 ///
9504 /// # Example
9505 /// ```ignore,no_run
9506 /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9507 /// let x = SqlServerColumn::new().set_nullable(true);
9508 /// ```
9509 pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9510 self.nullable = v.into();
9511 self
9512 }
9513
9514 /// Sets the value of [ordinal_position][crate::model::SqlServerColumn::ordinal_position].
9515 ///
9516 /// # Example
9517 /// ```ignore,no_run
9518 /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9519 /// let x = SqlServerColumn::new().set_ordinal_position(42);
9520 /// ```
9521 pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9522 self.ordinal_position = v.into();
9523 self
9524 }
9525}
9526
9527impl wkt::message::Message for SqlServerColumn {
9528 fn typename() -> &'static str {
9529 "type.googleapis.com/google.cloud.datastream.v1.SqlServerColumn"
9530 }
9531}
9532
9533/// SQLServer table.
9534#[derive(Clone, Default, PartialEq)]
9535#[non_exhaustive]
9536pub struct SqlServerTable {
9537 /// Table name.
9538 pub table: std::string::String,
9539
9540 /// SQLServer columns in the schema.
9541 /// When unspecified as part of include/exclude objects,
9542 /// includes/excludes everything.
9543 pub columns: std::vec::Vec<crate::model::SqlServerColumn>,
9544
9545 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9546}
9547
9548impl SqlServerTable {
9549 /// Creates a new default instance.
9550 pub fn new() -> Self {
9551 std::default::Default::default()
9552 }
9553
9554 /// Sets the value of [table][crate::model::SqlServerTable::table].
9555 ///
9556 /// # Example
9557 /// ```ignore,no_run
9558 /// # use google_cloud_datastream_v1::model::SqlServerTable;
9559 /// let x = SqlServerTable::new().set_table("example");
9560 /// ```
9561 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9562 self.table = v.into();
9563 self
9564 }
9565
9566 /// Sets the value of [columns][crate::model::SqlServerTable::columns].
9567 ///
9568 /// # Example
9569 /// ```ignore,no_run
9570 /// # use google_cloud_datastream_v1::model::SqlServerTable;
9571 /// use google_cloud_datastream_v1::model::SqlServerColumn;
9572 /// let x = SqlServerTable::new()
9573 /// .set_columns([
9574 /// SqlServerColumn::default()/* use setters */,
9575 /// SqlServerColumn::default()/* use (different) setters */,
9576 /// ]);
9577 /// ```
9578 pub fn set_columns<T, V>(mut self, v: T) -> Self
9579 where
9580 T: std::iter::IntoIterator<Item = V>,
9581 V: std::convert::Into<crate::model::SqlServerColumn>,
9582 {
9583 use std::iter::Iterator;
9584 self.columns = v.into_iter().map(|i| i.into()).collect();
9585 self
9586 }
9587}
9588
9589impl wkt::message::Message for SqlServerTable {
9590 fn typename() -> &'static str {
9591 "type.googleapis.com/google.cloud.datastream.v1.SqlServerTable"
9592 }
9593}
9594
9595/// SQLServer schema.
9596#[derive(Clone, Default, PartialEq)]
9597#[non_exhaustive]
9598pub struct SqlServerSchema {
9599 /// Schema name.
9600 pub schema: std::string::String,
9601
9602 /// Tables in the schema.
9603 pub tables: std::vec::Vec<crate::model::SqlServerTable>,
9604
9605 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9606}
9607
9608impl SqlServerSchema {
9609 /// Creates a new default instance.
9610 pub fn new() -> Self {
9611 std::default::Default::default()
9612 }
9613
9614 /// Sets the value of [schema][crate::model::SqlServerSchema::schema].
9615 ///
9616 /// # Example
9617 /// ```ignore,no_run
9618 /// # use google_cloud_datastream_v1::model::SqlServerSchema;
9619 /// let x = SqlServerSchema::new().set_schema("example");
9620 /// ```
9621 pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9622 self.schema = v.into();
9623 self
9624 }
9625
9626 /// Sets the value of [tables][crate::model::SqlServerSchema::tables].
9627 ///
9628 /// # Example
9629 /// ```ignore,no_run
9630 /// # use google_cloud_datastream_v1::model::SqlServerSchema;
9631 /// use google_cloud_datastream_v1::model::SqlServerTable;
9632 /// let x = SqlServerSchema::new()
9633 /// .set_tables([
9634 /// SqlServerTable::default()/* use setters */,
9635 /// SqlServerTable::default()/* use (different) setters */,
9636 /// ]);
9637 /// ```
9638 pub fn set_tables<T, V>(mut self, v: T) -> Self
9639 where
9640 T: std::iter::IntoIterator<Item = V>,
9641 V: std::convert::Into<crate::model::SqlServerTable>,
9642 {
9643 use std::iter::Iterator;
9644 self.tables = v.into_iter().map(|i| i.into()).collect();
9645 self
9646 }
9647}
9648
9649impl wkt::message::Message for SqlServerSchema {
9650 fn typename() -> &'static str {
9651 "type.googleapis.com/google.cloud.datastream.v1.SqlServerSchema"
9652 }
9653}
9654
9655/// SQLServer database structure.
9656#[derive(Clone, Default, PartialEq)]
9657#[non_exhaustive]
9658pub struct SqlServerRdbms {
9659 /// SQLServer schemas in the database server.
9660 pub schemas: std::vec::Vec<crate::model::SqlServerSchema>,
9661
9662 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9663}
9664
9665impl SqlServerRdbms {
9666 /// Creates a new default instance.
9667 pub fn new() -> Self {
9668 std::default::Default::default()
9669 }
9670
9671 /// Sets the value of [schemas][crate::model::SqlServerRdbms::schemas].
9672 ///
9673 /// # Example
9674 /// ```ignore,no_run
9675 /// # use google_cloud_datastream_v1::model::SqlServerRdbms;
9676 /// use google_cloud_datastream_v1::model::SqlServerSchema;
9677 /// let x = SqlServerRdbms::new()
9678 /// .set_schemas([
9679 /// SqlServerSchema::default()/* use setters */,
9680 /// SqlServerSchema::default()/* use (different) setters */,
9681 /// ]);
9682 /// ```
9683 pub fn set_schemas<T, V>(mut self, v: T) -> Self
9684 where
9685 T: std::iter::IntoIterator<Item = V>,
9686 V: std::convert::Into<crate::model::SqlServerSchema>,
9687 {
9688 use std::iter::Iterator;
9689 self.schemas = v.into_iter().map(|i| i.into()).collect();
9690 self
9691 }
9692}
9693
9694impl wkt::message::Message for SqlServerRdbms {
9695 fn typename() -> &'static str {
9696 "type.googleapis.com/google.cloud.datastream.v1.SqlServerRdbms"
9697 }
9698}
9699
9700/// SQLServer data source configuration
9701#[derive(Clone, Default, PartialEq)]
9702#[non_exhaustive]
9703pub struct SqlServerSourceConfig {
9704 /// SQLServer objects to include in the stream.
9705 pub include_objects: std::option::Option<crate::model::SqlServerRdbms>,
9706
9707 /// SQLServer objects to exclude from the stream.
9708 pub exclude_objects: std::option::Option<crate::model::SqlServerRdbms>,
9709
9710 /// Max concurrent CDC tasks.
9711 pub max_concurrent_cdc_tasks: i32,
9712
9713 /// Max concurrent backfill tasks.
9714 pub max_concurrent_backfill_tasks: i32,
9715
9716 /// Configuration to select the CDC read method for the stream.
9717 pub cdc_method: std::option::Option<crate::model::sql_server_source_config::CdcMethod>,
9718
9719 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9720}
9721
9722impl SqlServerSourceConfig {
9723 /// Creates a new default instance.
9724 pub fn new() -> Self {
9725 std::default::Default::default()
9726 }
9727
9728 /// Sets the value of [include_objects][crate::model::SqlServerSourceConfig::include_objects].
9729 ///
9730 /// # Example
9731 /// ```ignore,no_run
9732 /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9733 /// use google_cloud_datastream_v1::model::SqlServerRdbms;
9734 /// let x = SqlServerSourceConfig::new().set_include_objects(SqlServerRdbms::default()/* use setters */);
9735 /// ```
9736 pub fn set_include_objects<T>(mut self, v: T) -> Self
9737 where
9738 T: std::convert::Into<crate::model::SqlServerRdbms>,
9739 {
9740 self.include_objects = std::option::Option::Some(v.into());
9741 self
9742 }
9743
9744 /// Sets or clears the value of [include_objects][crate::model::SqlServerSourceConfig::include_objects].
9745 ///
9746 /// # Example
9747 /// ```ignore,no_run
9748 /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9749 /// use google_cloud_datastream_v1::model::SqlServerRdbms;
9750 /// let x = SqlServerSourceConfig::new().set_or_clear_include_objects(Some(SqlServerRdbms::default()/* use setters */));
9751 /// let x = SqlServerSourceConfig::new().set_or_clear_include_objects(None::<SqlServerRdbms>);
9752 /// ```
9753 pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
9754 where
9755 T: std::convert::Into<crate::model::SqlServerRdbms>,
9756 {
9757 self.include_objects = v.map(|x| x.into());
9758 self
9759 }
9760
9761 /// Sets the value of [exclude_objects][crate::model::SqlServerSourceConfig::exclude_objects].
9762 ///
9763 /// # Example
9764 /// ```ignore,no_run
9765 /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9766 /// use google_cloud_datastream_v1::model::SqlServerRdbms;
9767 /// let x = SqlServerSourceConfig::new().set_exclude_objects(SqlServerRdbms::default()/* use setters */);
9768 /// ```
9769 pub fn set_exclude_objects<T>(mut self, v: T) -> Self
9770 where
9771 T: std::convert::Into<crate::model::SqlServerRdbms>,
9772 {
9773 self.exclude_objects = std::option::Option::Some(v.into());
9774 self
9775 }
9776
9777 /// Sets or clears the value of [exclude_objects][crate::model::SqlServerSourceConfig::exclude_objects].
9778 ///
9779 /// # Example
9780 /// ```ignore,no_run
9781 /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9782 /// use google_cloud_datastream_v1::model::SqlServerRdbms;
9783 /// let x = SqlServerSourceConfig::new().set_or_clear_exclude_objects(Some(SqlServerRdbms::default()/* use setters */));
9784 /// let x = SqlServerSourceConfig::new().set_or_clear_exclude_objects(None::<SqlServerRdbms>);
9785 /// ```
9786 pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
9787 where
9788 T: std::convert::Into<crate::model::SqlServerRdbms>,
9789 {
9790 self.exclude_objects = v.map(|x| x.into());
9791 self
9792 }
9793
9794 /// Sets the value of [max_concurrent_cdc_tasks][crate::model::SqlServerSourceConfig::max_concurrent_cdc_tasks].
9795 ///
9796 /// # Example
9797 /// ```ignore,no_run
9798 /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9799 /// let x = SqlServerSourceConfig::new().set_max_concurrent_cdc_tasks(42);
9800 /// ```
9801 pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9802 self.max_concurrent_cdc_tasks = v.into();
9803 self
9804 }
9805
9806 /// Sets the value of [max_concurrent_backfill_tasks][crate::model::SqlServerSourceConfig::max_concurrent_backfill_tasks].
9807 ///
9808 /// # Example
9809 /// ```ignore,no_run
9810 /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9811 /// let x = SqlServerSourceConfig::new().set_max_concurrent_backfill_tasks(42);
9812 /// ```
9813 pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9814 self.max_concurrent_backfill_tasks = v.into();
9815 self
9816 }
9817
9818 /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method].
9819 ///
9820 /// Note that all the setters affecting `cdc_method` are mutually
9821 /// exclusive.
9822 ///
9823 /// # Example
9824 /// ```ignore,no_run
9825 /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9826 /// use google_cloud_datastream_v1::model::SqlServerTransactionLogs;
9827 /// let x = SqlServerSourceConfig::new().set_cdc_method(Some(
9828 /// google_cloud_datastream_v1::model::sql_server_source_config::CdcMethod::TransactionLogs(SqlServerTransactionLogs::default().into())));
9829 /// ```
9830 pub fn set_cdc_method<
9831 T: std::convert::Into<std::option::Option<crate::model::sql_server_source_config::CdcMethod>>,
9832 >(
9833 mut self,
9834 v: T,
9835 ) -> Self {
9836 self.cdc_method = v.into();
9837 self
9838 }
9839
9840 /// The value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
9841 /// if it holds a `TransactionLogs`, `None` if the field is not set or
9842 /// holds a different branch.
9843 pub fn transaction_logs(
9844 &self,
9845 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerTransactionLogs>> {
9846 #[allow(unreachable_patterns)]
9847 self.cdc_method.as_ref().and_then(|v| match v {
9848 crate::model::sql_server_source_config::CdcMethod::TransactionLogs(v) => {
9849 std::option::Option::Some(v)
9850 }
9851 _ => std::option::Option::None,
9852 })
9853 }
9854
9855 /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
9856 /// to hold a `TransactionLogs`.
9857 ///
9858 /// Note that all the setters affecting `cdc_method` are
9859 /// mutually exclusive.
9860 ///
9861 /// # Example
9862 /// ```ignore,no_run
9863 /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9864 /// use google_cloud_datastream_v1::model::SqlServerTransactionLogs;
9865 /// let x = SqlServerSourceConfig::new().set_transaction_logs(SqlServerTransactionLogs::default()/* use setters */);
9866 /// assert!(x.transaction_logs().is_some());
9867 /// assert!(x.change_tables().is_none());
9868 /// ```
9869 pub fn set_transaction_logs<
9870 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerTransactionLogs>>,
9871 >(
9872 mut self,
9873 v: T,
9874 ) -> Self {
9875 self.cdc_method = std::option::Option::Some(
9876 crate::model::sql_server_source_config::CdcMethod::TransactionLogs(v.into()),
9877 );
9878 self
9879 }
9880
9881 /// The value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
9882 /// if it holds a `ChangeTables`, `None` if the field is not set or
9883 /// holds a different branch.
9884 pub fn change_tables(
9885 &self,
9886 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerChangeTables>> {
9887 #[allow(unreachable_patterns)]
9888 self.cdc_method.as_ref().and_then(|v| match v {
9889 crate::model::sql_server_source_config::CdcMethod::ChangeTables(v) => {
9890 std::option::Option::Some(v)
9891 }
9892 _ => std::option::Option::None,
9893 })
9894 }
9895
9896 /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
9897 /// to hold a `ChangeTables`.
9898 ///
9899 /// Note that all the setters affecting `cdc_method` are
9900 /// mutually exclusive.
9901 ///
9902 /// # Example
9903 /// ```ignore,no_run
9904 /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9905 /// use google_cloud_datastream_v1::model::SqlServerChangeTables;
9906 /// let x = SqlServerSourceConfig::new().set_change_tables(SqlServerChangeTables::default()/* use setters */);
9907 /// assert!(x.change_tables().is_some());
9908 /// assert!(x.transaction_logs().is_none());
9909 /// ```
9910 pub fn set_change_tables<
9911 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerChangeTables>>,
9912 >(
9913 mut self,
9914 v: T,
9915 ) -> Self {
9916 self.cdc_method = std::option::Option::Some(
9917 crate::model::sql_server_source_config::CdcMethod::ChangeTables(v.into()),
9918 );
9919 self
9920 }
9921}
9922
9923impl wkt::message::Message for SqlServerSourceConfig {
9924 fn typename() -> &'static str {
9925 "type.googleapis.com/google.cloud.datastream.v1.SqlServerSourceConfig"
9926 }
9927}
9928
9929/// Defines additional types related to [SqlServerSourceConfig].
9930pub mod sql_server_source_config {
9931 #[allow(unused_imports)]
9932 use super::*;
9933
9934 /// Configuration to select the CDC read method for the stream.
9935 #[derive(Clone, Debug, PartialEq)]
9936 #[non_exhaustive]
9937 pub enum CdcMethod {
9938 /// CDC reader reads from transaction logs.
9939 TransactionLogs(std::boxed::Box<crate::model::SqlServerTransactionLogs>),
9940 /// CDC reader reads from change tables.
9941 ChangeTables(std::boxed::Box<crate::model::SqlServerChangeTables>),
9942 }
9943}
9944
9945/// Configuration to use Transaction Logs CDC read method.
9946#[derive(Clone, Default, PartialEq)]
9947#[non_exhaustive]
9948pub struct SqlServerTransactionLogs {
9949 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9950}
9951
9952impl SqlServerTransactionLogs {
9953 /// Creates a new default instance.
9954 pub fn new() -> Self {
9955 std::default::Default::default()
9956 }
9957}
9958
9959impl wkt::message::Message for SqlServerTransactionLogs {
9960 fn typename() -> &'static str {
9961 "type.googleapis.com/google.cloud.datastream.v1.SqlServerTransactionLogs"
9962 }
9963}
9964
9965/// Configuration to use Change Tables CDC read method.
9966#[derive(Clone, Default, PartialEq)]
9967#[non_exhaustive]
9968pub struct SqlServerChangeTables {
9969 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9970}
9971
9972impl SqlServerChangeTables {
9973 /// Creates a new default instance.
9974 pub fn new() -> Self {
9975 std::default::Default::default()
9976 }
9977}
9978
9979impl wkt::message::Message for SqlServerChangeTables {
9980 fn typename() -> &'static str {
9981 "type.googleapis.com/google.cloud.datastream.v1.SqlServerChangeTables"
9982 }
9983}
9984
9985/// MySQL Column.
9986#[derive(Clone, Default, PartialEq)]
9987#[non_exhaustive]
9988pub struct MysqlColumn {
9989 /// Column name.
9990 pub column: std::string::String,
9991
9992 /// The MySQL data type. Full data types list can be found here:
9993 /// <https://dev.mysql.com/doc/refman/8.0/en/data-types.html>
9994 pub data_type: std::string::String,
9995
9996 /// Column length.
9997 pub length: i32,
9998
9999 /// Column collation.
10000 pub collation: std::string::String,
10001
10002 /// Whether or not the column represents a primary key.
10003 pub primary_key: bool,
10004
10005 /// Whether or not the column can accept a null value.
10006 pub nullable: bool,
10007
10008 /// The ordinal position of the column in the table.
10009 pub ordinal_position: i32,
10010
10011 /// Column precision.
10012 pub precision: i32,
10013
10014 /// Column scale.
10015 pub scale: i32,
10016
10017 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10018}
10019
10020impl MysqlColumn {
10021 /// Creates a new default instance.
10022 pub fn new() -> Self {
10023 std::default::Default::default()
10024 }
10025
10026 /// Sets the value of [column][crate::model::MysqlColumn::column].
10027 ///
10028 /// # Example
10029 /// ```ignore,no_run
10030 /// # use google_cloud_datastream_v1::model::MysqlColumn;
10031 /// let x = MysqlColumn::new().set_column("example");
10032 /// ```
10033 pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10034 self.column = v.into();
10035 self
10036 }
10037
10038 /// Sets the value of [data_type][crate::model::MysqlColumn::data_type].
10039 ///
10040 /// # Example
10041 /// ```ignore,no_run
10042 /// # use google_cloud_datastream_v1::model::MysqlColumn;
10043 /// let x = MysqlColumn::new().set_data_type("example");
10044 /// ```
10045 pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10046 self.data_type = v.into();
10047 self
10048 }
10049
10050 /// Sets the value of [length][crate::model::MysqlColumn::length].
10051 ///
10052 /// # Example
10053 /// ```ignore,no_run
10054 /// # use google_cloud_datastream_v1::model::MysqlColumn;
10055 /// let x = MysqlColumn::new().set_length(42);
10056 /// ```
10057 pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10058 self.length = v.into();
10059 self
10060 }
10061
10062 /// Sets the value of [collation][crate::model::MysqlColumn::collation].
10063 ///
10064 /// # Example
10065 /// ```ignore,no_run
10066 /// # use google_cloud_datastream_v1::model::MysqlColumn;
10067 /// let x = MysqlColumn::new().set_collation("example");
10068 /// ```
10069 pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10070 self.collation = v.into();
10071 self
10072 }
10073
10074 /// Sets the value of [primary_key][crate::model::MysqlColumn::primary_key].
10075 ///
10076 /// # Example
10077 /// ```ignore,no_run
10078 /// # use google_cloud_datastream_v1::model::MysqlColumn;
10079 /// let x = MysqlColumn::new().set_primary_key(true);
10080 /// ```
10081 pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10082 self.primary_key = v.into();
10083 self
10084 }
10085
10086 /// Sets the value of [nullable][crate::model::MysqlColumn::nullable].
10087 ///
10088 /// # Example
10089 /// ```ignore,no_run
10090 /// # use google_cloud_datastream_v1::model::MysqlColumn;
10091 /// let x = MysqlColumn::new().set_nullable(true);
10092 /// ```
10093 pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10094 self.nullable = v.into();
10095 self
10096 }
10097
10098 /// Sets the value of [ordinal_position][crate::model::MysqlColumn::ordinal_position].
10099 ///
10100 /// # Example
10101 /// ```ignore,no_run
10102 /// # use google_cloud_datastream_v1::model::MysqlColumn;
10103 /// let x = MysqlColumn::new().set_ordinal_position(42);
10104 /// ```
10105 pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10106 self.ordinal_position = v.into();
10107 self
10108 }
10109
10110 /// Sets the value of [precision][crate::model::MysqlColumn::precision].
10111 ///
10112 /// # Example
10113 /// ```ignore,no_run
10114 /// # use google_cloud_datastream_v1::model::MysqlColumn;
10115 /// let x = MysqlColumn::new().set_precision(42);
10116 /// ```
10117 pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10118 self.precision = v.into();
10119 self
10120 }
10121
10122 /// Sets the value of [scale][crate::model::MysqlColumn::scale].
10123 ///
10124 /// # Example
10125 /// ```ignore,no_run
10126 /// # use google_cloud_datastream_v1::model::MysqlColumn;
10127 /// let x = MysqlColumn::new().set_scale(42);
10128 /// ```
10129 pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10130 self.scale = v.into();
10131 self
10132 }
10133}
10134
10135impl wkt::message::Message for MysqlColumn {
10136 fn typename() -> &'static str {
10137 "type.googleapis.com/google.cloud.datastream.v1.MysqlColumn"
10138 }
10139}
10140
10141/// MySQL table.
10142#[derive(Clone, Default, PartialEq)]
10143#[non_exhaustive]
10144pub struct MysqlTable {
10145 /// Table name.
10146 pub table: std::string::String,
10147
10148 /// MySQL columns in the database.
10149 /// When unspecified as part of include/exclude objects, includes/excludes
10150 /// everything.
10151 pub mysql_columns: std::vec::Vec<crate::model::MysqlColumn>,
10152
10153 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10154}
10155
10156impl MysqlTable {
10157 /// Creates a new default instance.
10158 pub fn new() -> Self {
10159 std::default::Default::default()
10160 }
10161
10162 /// Sets the value of [table][crate::model::MysqlTable::table].
10163 ///
10164 /// # Example
10165 /// ```ignore,no_run
10166 /// # use google_cloud_datastream_v1::model::MysqlTable;
10167 /// let x = MysqlTable::new().set_table("example");
10168 /// ```
10169 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10170 self.table = v.into();
10171 self
10172 }
10173
10174 /// Sets the value of [mysql_columns][crate::model::MysqlTable::mysql_columns].
10175 ///
10176 /// # Example
10177 /// ```ignore,no_run
10178 /// # use google_cloud_datastream_v1::model::MysqlTable;
10179 /// use google_cloud_datastream_v1::model::MysqlColumn;
10180 /// let x = MysqlTable::new()
10181 /// .set_mysql_columns([
10182 /// MysqlColumn::default()/* use setters */,
10183 /// MysqlColumn::default()/* use (different) setters */,
10184 /// ]);
10185 /// ```
10186 pub fn set_mysql_columns<T, V>(mut self, v: T) -> Self
10187 where
10188 T: std::iter::IntoIterator<Item = V>,
10189 V: std::convert::Into<crate::model::MysqlColumn>,
10190 {
10191 use std::iter::Iterator;
10192 self.mysql_columns = v.into_iter().map(|i| i.into()).collect();
10193 self
10194 }
10195}
10196
10197impl wkt::message::Message for MysqlTable {
10198 fn typename() -> &'static str {
10199 "type.googleapis.com/google.cloud.datastream.v1.MysqlTable"
10200 }
10201}
10202
10203/// MySQL database.
10204#[derive(Clone, Default, PartialEq)]
10205#[non_exhaustive]
10206pub struct MysqlDatabase {
10207 /// Database name.
10208 pub database: std::string::String,
10209
10210 /// Tables in the database.
10211 pub mysql_tables: std::vec::Vec<crate::model::MysqlTable>,
10212
10213 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10214}
10215
10216impl MysqlDatabase {
10217 /// Creates a new default instance.
10218 pub fn new() -> Self {
10219 std::default::Default::default()
10220 }
10221
10222 /// Sets the value of [database][crate::model::MysqlDatabase::database].
10223 ///
10224 /// # Example
10225 /// ```ignore,no_run
10226 /// # use google_cloud_datastream_v1::model::MysqlDatabase;
10227 /// let x = MysqlDatabase::new().set_database("example");
10228 /// ```
10229 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10230 self.database = v.into();
10231 self
10232 }
10233
10234 /// Sets the value of [mysql_tables][crate::model::MysqlDatabase::mysql_tables].
10235 ///
10236 /// # Example
10237 /// ```ignore,no_run
10238 /// # use google_cloud_datastream_v1::model::MysqlDatabase;
10239 /// use google_cloud_datastream_v1::model::MysqlTable;
10240 /// let x = MysqlDatabase::new()
10241 /// .set_mysql_tables([
10242 /// MysqlTable::default()/* use setters */,
10243 /// MysqlTable::default()/* use (different) setters */,
10244 /// ]);
10245 /// ```
10246 pub fn set_mysql_tables<T, V>(mut self, v: T) -> Self
10247 where
10248 T: std::iter::IntoIterator<Item = V>,
10249 V: std::convert::Into<crate::model::MysqlTable>,
10250 {
10251 use std::iter::Iterator;
10252 self.mysql_tables = v.into_iter().map(|i| i.into()).collect();
10253 self
10254 }
10255}
10256
10257impl wkt::message::Message for MysqlDatabase {
10258 fn typename() -> &'static str {
10259 "type.googleapis.com/google.cloud.datastream.v1.MysqlDatabase"
10260 }
10261}
10262
10263/// MySQL database structure
10264#[derive(Clone, Default, PartialEq)]
10265#[non_exhaustive]
10266pub struct MysqlRdbms {
10267 /// Mysql databases on the server
10268 pub mysql_databases: std::vec::Vec<crate::model::MysqlDatabase>,
10269
10270 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10271}
10272
10273impl MysqlRdbms {
10274 /// Creates a new default instance.
10275 pub fn new() -> Self {
10276 std::default::Default::default()
10277 }
10278
10279 /// Sets the value of [mysql_databases][crate::model::MysqlRdbms::mysql_databases].
10280 ///
10281 /// # Example
10282 /// ```ignore,no_run
10283 /// # use google_cloud_datastream_v1::model::MysqlRdbms;
10284 /// use google_cloud_datastream_v1::model::MysqlDatabase;
10285 /// let x = MysqlRdbms::new()
10286 /// .set_mysql_databases([
10287 /// MysqlDatabase::default()/* use setters */,
10288 /// MysqlDatabase::default()/* use (different) setters */,
10289 /// ]);
10290 /// ```
10291 pub fn set_mysql_databases<T, V>(mut self, v: T) -> Self
10292 where
10293 T: std::iter::IntoIterator<Item = V>,
10294 V: std::convert::Into<crate::model::MysqlDatabase>,
10295 {
10296 use std::iter::Iterator;
10297 self.mysql_databases = v.into_iter().map(|i| i.into()).collect();
10298 self
10299 }
10300}
10301
10302impl wkt::message::Message for MysqlRdbms {
10303 fn typename() -> &'static str {
10304 "type.googleapis.com/google.cloud.datastream.v1.MysqlRdbms"
10305 }
10306}
10307
10308/// MySQL source configuration
10309#[derive(Clone, Default, PartialEq)]
10310#[non_exhaustive]
10311pub struct MysqlSourceConfig {
10312 /// MySQL objects to retrieve from the source.
10313 pub include_objects: std::option::Option<crate::model::MysqlRdbms>,
10314
10315 /// MySQL objects to exclude from the stream.
10316 pub exclude_objects: std::option::Option<crate::model::MysqlRdbms>,
10317
10318 /// Maximum number of concurrent CDC tasks. The number should be non negative.
10319 /// If not set (or set to 0), the system's default value will be used.
10320 pub max_concurrent_cdc_tasks: i32,
10321
10322 /// Maximum number of concurrent backfill tasks. The number should be non
10323 /// negative. If not set (or set to 0), the system's default value will be
10324 /// used.
10325 pub max_concurrent_backfill_tasks: i32,
10326
10327 /// The CDC method to use for the stream.
10328 pub cdc_method: std::option::Option<crate::model::mysql_source_config::CdcMethod>,
10329
10330 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10331}
10332
10333impl MysqlSourceConfig {
10334 /// Creates a new default instance.
10335 pub fn new() -> Self {
10336 std::default::Default::default()
10337 }
10338
10339 /// Sets the value of [include_objects][crate::model::MysqlSourceConfig::include_objects].
10340 ///
10341 /// # Example
10342 /// ```ignore,no_run
10343 /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10344 /// use google_cloud_datastream_v1::model::MysqlRdbms;
10345 /// let x = MysqlSourceConfig::new().set_include_objects(MysqlRdbms::default()/* use setters */);
10346 /// ```
10347 pub fn set_include_objects<T>(mut self, v: T) -> Self
10348 where
10349 T: std::convert::Into<crate::model::MysqlRdbms>,
10350 {
10351 self.include_objects = std::option::Option::Some(v.into());
10352 self
10353 }
10354
10355 /// Sets or clears the value of [include_objects][crate::model::MysqlSourceConfig::include_objects].
10356 ///
10357 /// # Example
10358 /// ```ignore,no_run
10359 /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10360 /// use google_cloud_datastream_v1::model::MysqlRdbms;
10361 /// let x = MysqlSourceConfig::new().set_or_clear_include_objects(Some(MysqlRdbms::default()/* use setters */));
10362 /// let x = MysqlSourceConfig::new().set_or_clear_include_objects(None::<MysqlRdbms>);
10363 /// ```
10364 pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
10365 where
10366 T: std::convert::Into<crate::model::MysqlRdbms>,
10367 {
10368 self.include_objects = v.map(|x| x.into());
10369 self
10370 }
10371
10372 /// Sets the value of [exclude_objects][crate::model::MysqlSourceConfig::exclude_objects].
10373 ///
10374 /// # Example
10375 /// ```ignore,no_run
10376 /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10377 /// use google_cloud_datastream_v1::model::MysqlRdbms;
10378 /// let x = MysqlSourceConfig::new().set_exclude_objects(MysqlRdbms::default()/* use setters */);
10379 /// ```
10380 pub fn set_exclude_objects<T>(mut self, v: T) -> Self
10381 where
10382 T: std::convert::Into<crate::model::MysqlRdbms>,
10383 {
10384 self.exclude_objects = std::option::Option::Some(v.into());
10385 self
10386 }
10387
10388 /// Sets or clears the value of [exclude_objects][crate::model::MysqlSourceConfig::exclude_objects].
10389 ///
10390 /// # Example
10391 /// ```ignore,no_run
10392 /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10393 /// use google_cloud_datastream_v1::model::MysqlRdbms;
10394 /// let x = MysqlSourceConfig::new().set_or_clear_exclude_objects(Some(MysqlRdbms::default()/* use setters */));
10395 /// let x = MysqlSourceConfig::new().set_or_clear_exclude_objects(None::<MysqlRdbms>);
10396 /// ```
10397 pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
10398 where
10399 T: std::convert::Into<crate::model::MysqlRdbms>,
10400 {
10401 self.exclude_objects = v.map(|x| x.into());
10402 self
10403 }
10404
10405 /// Sets the value of [max_concurrent_cdc_tasks][crate::model::MysqlSourceConfig::max_concurrent_cdc_tasks].
10406 ///
10407 /// # Example
10408 /// ```ignore,no_run
10409 /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10410 /// let x = MysqlSourceConfig::new().set_max_concurrent_cdc_tasks(42);
10411 /// ```
10412 pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10413 self.max_concurrent_cdc_tasks = v.into();
10414 self
10415 }
10416
10417 /// Sets the value of [max_concurrent_backfill_tasks][crate::model::MysqlSourceConfig::max_concurrent_backfill_tasks].
10418 ///
10419 /// # Example
10420 /// ```ignore,no_run
10421 /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10422 /// let x = MysqlSourceConfig::new().set_max_concurrent_backfill_tasks(42);
10423 /// ```
10424 pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10425 self.max_concurrent_backfill_tasks = v.into();
10426 self
10427 }
10428
10429 /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method].
10430 ///
10431 /// Note that all the setters affecting `cdc_method` are mutually
10432 /// exclusive.
10433 ///
10434 /// # Example
10435 /// ```ignore,no_run
10436 /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10437 /// use google_cloud_datastream_v1::model::mysql_source_config::BinaryLogPosition;
10438 /// let x = MysqlSourceConfig::new().set_cdc_method(Some(
10439 /// google_cloud_datastream_v1::model::mysql_source_config::CdcMethod::BinaryLogPosition(BinaryLogPosition::default().into())));
10440 /// ```
10441 pub fn set_cdc_method<
10442 T: std::convert::Into<std::option::Option<crate::model::mysql_source_config::CdcMethod>>,
10443 >(
10444 mut self,
10445 v: T,
10446 ) -> Self {
10447 self.cdc_method = v.into();
10448 self
10449 }
10450
10451 /// The value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
10452 /// if it holds a `BinaryLogPosition`, `None` if the field is not set or
10453 /// holds a different branch.
10454 pub fn binary_log_position(
10455 &self,
10456 ) -> std::option::Option<&std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>>
10457 {
10458 #[allow(unreachable_patterns)]
10459 self.cdc_method.as_ref().and_then(|v| match v {
10460 crate::model::mysql_source_config::CdcMethod::BinaryLogPosition(v) => {
10461 std::option::Option::Some(v)
10462 }
10463 _ => std::option::Option::None,
10464 })
10465 }
10466
10467 /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
10468 /// to hold a `BinaryLogPosition`.
10469 ///
10470 /// Note that all the setters affecting `cdc_method` are
10471 /// mutually exclusive.
10472 ///
10473 /// # Example
10474 /// ```ignore,no_run
10475 /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10476 /// use google_cloud_datastream_v1::model::mysql_source_config::BinaryLogPosition;
10477 /// let x = MysqlSourceConfig::new().set_binary_log_position(BinaryLogPosition::default()/* use setters */);
10478 /// assert!(x.binary_log_position().is_some());
10479 /// assert!(x.gtid().is_none());
10480 /// ```
10481 pub fn set_binary_log_position<
10482 T: std::convert::Into<std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>>,
10483 >(
10484 mut self,
10485 v: T,
10486 ) -> Self {
10487 self.cdc_method = std::option::Option::Some(
10488 crate::model::mysql_source_config::CdcMethod::BinaryLogPosition(v.into()),
10489 );
10490 self
10491 }
10492
10493 /// The value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
10494 /// if it holds a `Gtid`, `None` if the field is not set or
10495 /// holds a different branch.
10496 pub fn gtid(
10497 &self,
10498 ) -> std::option::Option<&std::boxed::Box<crate::model::mysql_source_config::Gtid>> {
10499 #[allow(unreachable_patterns)]
10500 self.cdc_method.as_ref().and_then(|v| match v {
10501 crate::model::mysql_source_config::CdcMethod::Gtid(v) => std::option::Option::Some(v),
10502 _ => std::option::Option::None,
10503 })
10504 }
10505
10506 /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
10507 /// to hold a `Gtid`.
10508 ///
10509 /// Note that all the setters affecting `cdc_method` are
10510 /// mutually exclusive.
10511 ///
10512 /// # Example
10513 /// ```ignore,no_run
10514 /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10515 /// use google_cloud_datastream_v1::model::mysql_source_config::Gtid;
10516 /// let x = MysqlSourceConfig::new().set_gtid(Gtid::default()/* use setters */);
10517 /// assert!(x.gtid().is_some());
10518 /// assert!(x.binary_log_position().is_none());
10519 /// ```
10520 pub fn set_gtid<
10521 T: std::convert::Into<std::boxed::Box<crate::model::mysql_source_config::Gtid>>,
10522 >(
10523 mut self,
10524 v: T,
10525 ) -> Self {
10526 self.cdc_method =
10527 std::option::Option::Some(crate::model::mysql_source_config::CdcMethod::Gtid(v.into()));
10528 self
10529 }
10530}
10531
10532impl wkt::message::Message for MysqlSourceConfig {
10533 fn typename() -> &'static str {
10534 "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig"
10535 }
10536}
10537
10538/// Defines additional types related to [MysqlSourceConfig].
10539pub mod mysql_source_config {
10540 #[allow(unused_imports)]
10541 use super::*;
10542
10543 /// Use Binary log position based replication.
10544 #[derive(Clone, Default, PartialEq)]
10545 #[non_exhaustive]
10546 pub struct BinaryLogPosition {
10547 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10548 }
10549
10550 impl BinaryLogPosition {
10551 /// Creates a new default instance.
10552 pub fn new() -> Self {
10553 std::default::Default::default()
10554 }
10555 }
10556
10557 impl wkt::message::Message for BinaryLogPosition {
10558 fn typename() -> &'static str {
10559 "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig.BinaryLogPosition"
10560 }
10561 }
10562
10563 /// Use GTID based replication.
10564 #[derive(Clone, Default, PartialEq)]
10565 #[non_exhaustive]
10566 pub struct Gtid {
10567 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10568 }
10569
10570 impl Gtid {
10571 /// Creates a new default instance.
10572 pub fn new() -> Self {
10573 std::default::Default::default()
10574 }
10575 }
10576
10577 impl wkt::message::Message for Gtid {
10578 fn typename() -> &'static str {
10579 "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig.Gtid"
10580 }
10581 }
10582
10583 /// The CDC method to use for the stream.
10584 #[derive(Clone, Debug, PartialEq)]
10585 #[non_exhaustive]
10586 pub enum CdcMethod {
10587 /// Use Binary log position based replication.
10588 BinaryLogPosition(std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>),
10589 /// Use GTID based replication.
10590 Gtid(std::boxed::Box<crate::model::mysql_source_config::Gtid>),
10591 }
10592}
10593
10594/// Salesforce source configuration
10595#[derive(Clone, Default, PartialEq)]
10596#[non_exhaustive]
10597pub struct SalesforceSourceConfig {
10598 /// Salesforce objects to retrieve from the source.
10599 pub include_objects: std::option::Option<crate::model::SalesforceOrg>,
10600
10601 /// Salesforce objects to exclude from the stream.
10602 pub exclude_objects: std::option::Option<crate::model::SalesforceOrg>,
10603
10604 /// Required. Salesforce objects polling interval. The interval at which new
10605 /// changes will be polled for each object. The duration must be between 5
10606 /// minutes and 24 hours.
10607 pub polling_interval: std::option::Option<wkt::Duration>,
10608
10609 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10610}
10611
10612impl SalesforceSourceConfig {
10613 /// Creates a new default instance.
10614 pub fn new() -> Self {
10615 std::default::Default::default()
10616 }
10617
10618 /// Sets the value of [include_objects][crate::model::SalesforceSourceConfig::include_objects].
10619 ///
10620 /// # Example
10621 /// ```ignore,no_run
10622 /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10623 /// use google_cloud_datastream_v1::model::SalesforceOrg;
10624 /// let x = SalesforceSourceConfig::new().set_include_objects(SalesforceOrg::default()/* use setters */);
10625 /// ```
10626 pub fn set_include_objects<T>(mut self, v: T) -> Self
10627 where
10628 T: std::convert::Into<crate::model::SalesforceOrg>,
10629 {
10630 self.include_objects = std::option::Option::Some(v.into());
10631 self
10632 }
10633
10634 /// Sets or clears the value of [include_objects][crate::model::SalesforceSourceConfig::include_objects].
10635 ///
10636 /// # Example
10637 /// ```ignore,no_run
10638 /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10639 /// use google_cloud_datastream_v1::model::SalesforceOrg;
10640 /// let x = SalesforceSourceConfig::new().set_or_clear_include_objects(Some(SalesforceOrg::default()/* use setters */));
10641 /// let x = SalesforceSourceConfig::new().set_or_clear_include_objects(None::<SalesforceOrg>);
10642 /// ```
10643 pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
10644 where
10645 T: std::convert::Into<crate::model::SalesforceOrg>,
10646 {
10647 self.include_objects = v.map(|x| x.into());
10648 self
10649 }
10650
10651 /// Sets the value of [exclude_objects][crate::model::SalesforceSourceConfig::exclude_objects].
10652 ///
10653 /// # Example
10654 /// ```ignore,no_run
10655 /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10656 /// use google_cloud_datastream_v1::model::SalesforceOrg;
10657 /// let x = SalesforceSourceConfig::new().set_exclude_objects(SalesforceOrg::default()/* use setters */);
10658 /// ```
10659 pub fn set_exclude_objects<T>(mut self, v: T) -> Self
10660 where
10661 T: std::convert::Into<crate::model::SalesforceOrg>,
10662 {
10663 self.exclude_objects = std::option::Option::Some(v.into());
10664 self
10665 }
10666
10667 /// Sets or clears the value of [exclude_objects][crate::model::SalesforceSourceConfig::exclude_objects].
10668 ///
10669 /// # Example
10670 /// ```ignore,no_run
10671 /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10672 /// use google_cloud_datastream_v1::model::SalesforceOrg;
10673 /// let x = SalesforceSourceConfig::new().set_or_clear_exclude_objects(Some(SalesforceOrg::default()/* use setters */));
10674 /// let x = SalesforceSourceConfig::new().set_or_clear_exclude_objects(None::<SalesforceOrg>);
10675 /// ```
10676 pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
10677 where
10678 T: std::convert::Into<crate::model::SalesforceOrg>,
10679 {
10680 self.exclude_objects = v.map(|x| x.into());
10681 self
10682 }
10683
10684 /// Sets the value of [polling_interval][crate::model::SalesforceSourceConfig::polling_interval].
10685 ///
10686 /// # Example
10687 /// ```ignore,no_run
10688 /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10689 /// use wkt::Duration;
10690 /// let x = SalesforceSourceConfig::new().set_polling_interval(Duration::default()/* use setters */);
10691 /// ```
10692 pub fn set_polling_interval<T>(mut self, v: T) -> Self
10693 where
10694 T: std::convert::Into<wkt::Duration>,
10695 {
10696 self.polling_interval = std::option::Option::Some(v.into());
10697 self
10698 }
10699
10700 /// Sets or clears the value of [polling_interval][crate::model::SalesforceSourceConfig::polling_interval].
10701 ///
10702 /// # Example
10703 /// ```ignore,no_run
10704 /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10705 /// use wkt::Duration;
10706 /// let x = SalesforceSourceConfig::new().set_or_clear_polling_interval(Some(Duration::default()/* use setters */));
10707 /// let x = SalesforceSourceConfig::new().set_or_clear_polling_interval(None::<Duration>);
10708 /// ```
10709 pub fn set_or_clear_polling_interval<T>(mut self, v: std::option::Option<T>) -> Self
10710 where
10711 T: std::convert::Into<wkt::Duration>,
10712 {
10713 self.polling_interval = v.map(|x| x.into());
10714 self
10715 }
10716}
10717
10718impl wkt::message::Message for SalesforceSourceConfig {
10719 fn typename() -> &'static str {
10720 "type.googleapis.com/google.cloud.datastream.v1.SalesforceSourceConfig"
10721 }
10722}
10723
10724/// Salesforce organization structure.
10725#[derive(Clone, Default, PartialEq)]
10726#[non_exhaustive]
10727pub struct SalesforceOrg {
10728 /// Salesforce objects in the database server.
10729 pub objects: std::vec::Vec<crate::model::SalesforceObject>,
10730
10731 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10732}
10733
10734impl SalesforceOrg {
10735 /// Creates a new default instance.
10736 pub fn new() -> Self {
10737 std::default::Default::default()
10738 }
10739
10740 /// Sets the value of [objects][crate::model::SalesforceOrg::objects].
10741 ///
10742 /// # Example
10743 /// ```ignore,no_run
10744 /// # use google_cloud_datastream_v1::model::SalesforceOrg;
10745 /// use google_cloud_datastream_v1::model::SalesforceObject;
10746 /// let x = SalesforceOrg::new()
10747 /// .set_objects([
10748 /// SalesforceObject::default()/* use setters */,
10749 /// SalesforceObject::default()/* use (different) setters */,
10750 /// ]);
10751 /// ```
10752 pub fn set_objects<T, V>(mut self, v: T) -> Self
10753 where
10754 T: std::iter::IntoIterator<Item = V>,
10755 V: std::convert::Into<crate::model::SalesforceObject>,
10756 {
10757 use std::iter::Iterator;
10758 self.objects = v.into_iter().map(|i| i.into()).collect();
10759 self
10760 }
10761}
10762
10763impl wkt::message::Message for SalesforceOrg {
10764 fn typename() -> &'static str {
10765 "type.googleapis.com/google.cloud.datastream.v1.SalesforceOrg"
10766 }
10767}
10768
10769/// Salesforce object.
10770#[derive(Clone, Default, PartialEq)]
10771#[non_exhaustive]
10772pub struct SalesforceObject {
10773 /// Object name.
10774 pub object_name: std::string::String,
10775
10776 /// Salesforce fields.
10777 /// When unspecified as part of include objects,
10778 /// includes everything, when unspecified as part of exclude objects,
10779 /// excludes nothing.
10780 pub fields: std::vec::Vec<crate::model::SalesforceField>,
10781
10782 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10783}
10784
10785impl SalesforceObject {
10786 /// Creates a new default instance.
10787 pub fn new() -> Self {
10788 std::default::Default::default()
10789 }
10790
10791 /// Sets the value of [object_name][crate::model::SalesforceObject::object_name].
10792 ///
10793 /// # Example
10794 /// ```ignore,no_run
10795 /// # use google_cloud_datastream_v1::model::SalesforceObject;
10796 /// let x = SalesforceObject::new().set_object_name("example");
10797 /// ```
10798 pub fn set_object_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10799 self.object_name = v.into();
10800 self
10801 }
10802
10803 /// Sets the value of [fields][crate::model::SalesforceObject::fields].
10804 ///
10805 /// # Example
10806 /// ```ignore,no_run
10807 /// # use google_cloud_datastream_v1::model::SalesforceObject;
10808 /// use google_cloud_datastream_v1::model::SalesforceField;
10809 /// let x = SalesforceObject::new()
10810 /// .set_fields([
10811 /// SalesforceField::default()/* use setters */,
10812 /// SalesforceField::default()/* use (different) setters */,
10813 /// ]);
10814 /// ```
10815 pub fn set_fields<T, V>(mut self, v: T) -> Self
10816 where
10817 T: std::iter::IntoIterator<Item = V>,
10818 V: std::convert::Into<crate::model::SalesforceField>,
10819 {
10820 use std::iter::Iterator;
10821 self.fields = v.into_iter().map(|i| i.into()).collect();
10822 self
10823 }
10824}
10825
10826impl wkt::message::Message for SalesforceObject {
10827 fn typename() -> &'static str {
10828 "type.googleapis.com/google.cloud.datastream.v1.SalesforceObject"
10829 }
10830}
10831
10832/// Salesforce field.
10833#[derive(Clone, Default, PartialEq)]
10834#[non_exhaustive]
10835pub struct SalesforceField {
10836 /// Field name.
10837 pub name: std::string::String,
10838
10839 /// The data type.
10840 pub data_type: std::string::String,
10841
10842 /// Indicates whether the field can accept nil values.
10843 pub nillable: bool,
10844
10845 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10846}
10847
10848impl SalesforceField {
10849 /// Creates a new default instance.
10850 pub fn new() -> Self {
10851 std::default::Default::default()
10852 }
10853
10854 /// Sets the value of [name][crate::model::SalesforceField::name].
10855 ///
10856 /// # Example
10857 /// ```ignore,no_run
10858 /// # use google_cloud_datastream_v1::model::SalesforceField;
10859 /// let x = SalesforceField::new().set_name("example");
10860 /// ```
10861 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10862 self.name = v.into();
10863 self
10864 }
10865
10866 /// Sets the value of [data_type][crate::model::SalesforceField::data_type].
10867 ///
10868 /// # Example
10869 /// ```ignore,no_run
10870 /// # use google_cloud_datastream_v1::model::SalesforceField;
10871 /// let x = SalesforceField::new().set_data_type("example");
10872 /// ```
10873 pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10874 self.data_type = v.into();
10875 self
10876 }
10877
10878 /// Sets the value of [nillable][crate::model::SalesforceField::nillable].
10879 ///
10880 /// # Example
10881 /// ```ignore,no_run
10882 /// # use google_cloud_datastream_v1::model::SalesforceField;
10883 /// let x = SalesforceField::new().set_nillable(true);
10884 /// ```
10885 pub fn set_nillable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10886 self.nillable = v.into();
10887 self
10888 }
10889}
10890
10891impl wkt::message::Message for SalesforceField {
10892 fn typename() -> &'static str {
10893 "type.googleapis.com/google.cloud.datastream.v1.SalesforceField"
10894 }
10895}
10896
10897/// MongoDB source configuration.
10898#[derive(Clone, Default, PartialEq)]
10899#[non_exhaustive]
10900pub struct MongodbSourceConfig {
10901 /// MongoDB collections to include in the stream.
10902 pub include_objects: std::option::Option<crate::model::MongodbCluster>,
10903
10904 /// MongoDB collections to exclude from the stream.
10905 pub exclude_objects: std::option::Option<crate::model::MongodbCluster>,
10906
10907 /// Optional. Maximum number of concurrent backfill tasks. The number should be
10908 /// non-negative and less than or equal to 50. If not set (or set to 0), the
10909 /// system's default value is used
10910 pub max_concurrent_backfill_tasks: i32,
10911
10912 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10913}
10914
10915impl MongodbSourceConfig {
10916 /// Creates a new default instance.
10917 pub fn new() -> Self {
10918 std::default::Default::default()
10919 }
10920
10921 /// Sets the value of [include_objects][crate::model::MongodbSourceConfig::include_objects].
10922 ///
10923 /// # Example
10924 /// ```ignore,no_run
10925 /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
10926 /// use google_cloud_datastream_v1::model::MongodbCluster;
10927 /// let x = MongodbSourceConfig::new().set_include_objects(MongodbCluster::default()/* use setters */);
10928 /// ```
10929 pub fn set_include_objects<T>(mut self, v: T) -> Self
10930 where
10931 T: std::convert::Into<crate::model::MongodbCluster>,
10932 {
10933 self.include_objects = std::option::Option::Some(v.into());
10934 self
10935 }
10936
10937 /// Sets or clears the value of [include_objects][crate::model::MongodbSourceConfig::include_objects].
10938 ///
10939 /// # Example
10940 /// ```ignore,no_run
10941 /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
10942 /// use google_cloud_datastream_v1::model::MongodbCluster;
10943 /// let x = MongodbSourceConfig::new().set_or_clear_include_objects(Some(MongodbCluster::default()/* use setters */));
10944 /// let x = MongodbSourceConfig::new().set_or_clear_include_objects(None::<MongodbCluster>);
10945 /// ```
10946 pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
10947 where
10948 T: std::convert::Into<crate::model::MongodbCluster>,
10949 {
10950 self.include_objects = v.map(|x| x.into());
10951 self
10952 }
10953
10954 /// Sets the value of [exclude_objects][crate::model::MongodbSourceConfig::exclude_objects].
10955 ///
10956 /// # Example
10957 /// ```ignore,no_run
10958 /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
10959 /// use google_cloud_datastream_v1::model::MongodbCluster;
10960 /// let x = MongodbSourceConfig::new().set_exclude_objects(MongodbCluster::default()/* use setters */);
10961 /// ```
10962 pub fn set_exclude_objects<T>(mut self, v: T) -> Self
10963 where
10964 T: std::convert::Into<crate::model::MongodbCluster>,
10965 {
10966 self.exclude_objects = std::option::Option::Some(v.into());
10967 self
10968 }
10969
10970 /// Sets or clears the value of [exclude_objects][crate::model::MongodbSourceConfig::exclude_objects].
10971 ///
10972 /// # Example
10973 /// ```ignore,no_run
10974 /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
10975 /// use google_cloud_datastream_v1::model::MongodbCluster;
10976 /// let x = MongodbSourceConfig::new().set_or_clear_exclude_objects(Some(MongodbCluster::default()/* use setters */));
10977 /// let x = MongodbSourceConfig::new().set_or_clear_exclude_objects(None::<MongodbCluster>);
10978 /// ```
10979 pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
10980 where
10981 T: std::convert::Into<crate::model::MongodbCluster>,
10982 {
10983 self.exclude_objects = v.map(|x| x.into());
10984 self
10985 }
10986
10987 /// Sets the value of [max_concurrent_backfill_tasks][crate::model::MongodbSourceConfig::max_concurrent_backfill_tasks].
10988 ///
10989 /// # Example
10990 /// ```ignore,no_run
10991 /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
10992 /// let x = MongodbSourceConfig::new().set_max_concurrent_backfill_tasks(42);
10993 /// ```
10994 pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10995 self.max_concurrent_backfill_tasks = v.into();
10996 self
10997 }
10998}
10999
11000impl wkt::message::Message for MongodbSourceConfig {
11001 fn typename() -> &'static str {
11002 "type.googleapis.com/google.cloud.datastream.v1.MongodbSourceConfig"
11003 }
11004}
11005
11006/// MongoDB Cluster structure.
11007#[derive(Clone, Default, PartialEq)]
11008#[non_exhaustive]
11009pub struct MongodbCluster {
11010 /// MongoDB databases in the cluster.
11011 pub databases: std::vec::Vec<crate::model::MongodbDatabase>,
11012
11013 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11014}
11015
11016impl MongodbCluster {
11017 /// Creates a new default instance.
11018 pub fn new() -> Self {
11019 std::default::Default::default()
11020 }
11021
11022 /// Sets the value of [databases][crate::model::MongodbCluster::databases].
11023 ///
11024 /// # Example
11025 /// ```ignore,no_run
11026 /// # use google_cloud_datastream_v1::model::MongodbCluster;
11027 /// use google_cloud_datastream_v1::model::MongodbDatabase;
11028 /// let x = MongodbCluster::new()
11029 /// .set_databases([
11030 /// MongodbDatabase::default()/* use setters */,
11031 /// MongodbDatabase::default()/* use (different) setters */,
11032 /// ]);
11033 /// ```
11034 pub fn set_databases<T, V>(mut self, v: T) -> Self
11035 where
11036 T: std::iter::IntoIterator<Item = V>,
11037 V: std::convert::Into<crate::model::MongodbDatabase>,
11038 {
11039 use std::iter::Iterator;
11040 self.databases = v.into_iter().map(|i| i.into()).collect();
11041 self
11042 }
11043}
11044
11045impl wkt::message::Message for MongodbCluster {
11046 fn typename() -> &'static str {
11047 "type.googleapis.com/google.cloud.datastream.v1.MongodbCluster"
11048 }
11049}
11050
11051/// MongoDB Database.
11052#[derive(Clone, Default, PartialEq)]
11053#[non_exhaustive]
11054pub struct MongodbDatabase {
11055 /// Database name.
11056 pub database: std::string::String,
11057
11058 /// Collections in the database.
11059 pub collections: std::vec::Vec<crate::model::MongodbCollection>,
11060
11061 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11062}
11063
11064impl MongodbDatabase {
11065 /// Creates a new default instance.
11066 pub fn new() -> Self {
11067 std::default::Default::default()
11068 }
11069
11070 /// Sets the value of [database][crate::model::MongodbDatabase::database].
11071 ///
11072 /// # Example
11073 /// ```ignore,no_run
11074 /// # use google_cloud_datastream_v1::model::MongodbDatabase;
11075 /// let x = MongodbDatabase::new().set_database("example");
11076 /// ```
11077 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11078 self.database = v.into();
11079 self
11080 }
11081
11082 /// Sets the value of [collections][crate::model::MongodbDatabase::collections].
11083 ///
11084 /// # Example
11085 /// ```ignore,no_run
11086 /// # use google_cloud_datastream_v1::model::MongodbDatabase;
11087 /// use google_cloud_datastream_v1::model::MongodbCollection;
11088 /// let x = MongodbDatabase::new()
11089 /// .set_collections([
11090 /// MongodbCollection::default()/* use setters */,
11091 /// MongodbCollection::default()/* use (different) setters */,
11092 /// ]);
11093 /// ```
11094 pub fn set_collections<T, V>(mut self, v: T) -> Self
11095 where
11096 T: std::iter::IntoIterator<Item = V>,
11097 V: std::convert::Into<crate::model::MongodbCollection>,
11098 {
11099 use std::iter::Iterator;
11100 self.collections = v.into_iter().map(|i| i.into()).collect();
11101 self
11102 }
11103}
11104
11105impl wkt::message::Message for MongodbDatabase {
11106 fn typename() -> &'static str {
11107 "type.googleapis.com/google.cloud.datastream.v1.MongodbDatabase"
11108 }
11109}
11110
11111/// MongoDB Collection.
11112#[derive(Clone, Default, PartialEq)]
11113#[non_exhaustive]
11114pub struct MongodbCollection {
11115 /// Collection name.
11116 pub collection: std::string::String,
11117
11118 /// Fields in the collection.
11119 pub fields: std::vec::Vec<crate::model::MongodbField>,
11120
11121 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11122}
11123
11124impl MongodbCollection {
11125 /// Creates a new default instance.
11126 pub fn new() -> Self {
11127 std::default::Default::default()
11128 }
11129
11130 /// Sets the value of [collection][crate::model::MongodbCollection::collection].
11131 ///
11132 /// # Example
11133 /// ```ignore,no_run
11134 /// # use google_cloud_datastream_v1::model::MongodbCollection;
11135 /// let x = MongodbCollection::new().set_collection("example");
11136 /// ```
11137 pub fn set_collection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11138 self.collection = v.into();
11139 self
11140 }
11141
11142 /// Sets the value of [fields][crate::model::MongodbCollection::fields].
11143 ///
11144 /// # Example
11145 /// ```ignore,no_run
11146 /// # use google_cloud_datastream_v1::model::MongodbCollection;
11147 /// use google_cloud_datastream_v1::model::MongodbField;
11148 /// let x = MongodbCollection::new()
11149 /// .set_fields([
11150 /// MongodbField::default()/* use setters */,
11151 /// MongodbField::default()/* use (different) setters */,
11152 /// ]);
11153 /// ```
11154 pub fn set_fields<T, V>(mut self, v: T) -> Self
11155 where
11156 T: std::iter::IntoIterator<Item = V>,
11157 V: std::convert::Into<crate::model::MongodbField>,
11158 {
11159 use std::iter::Iterator;
11160 self.fields = v.into_iter().map(|i| i.into()).collect();
11161 self
11162 }
11163}
11164
11165impl wkt::message::Message for MongodbCollection {
11166 fn typename() -> &'static str {
11167 "type.googleapis.com/google.cloud.datastream.v1.MongodbCollection"
11168 }
11169}
11170
11171/// MongoDB Field.
11172#[derive(Clone, Default, PartialEq)]
11173#[non_exhaustive]
11174pub struct MongodbField {
11175 /// Field name.
11176 pub field: std::string::String,
11177
11178 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11179}
11180
11181impl MongodbField {
11182 /// Creates a new default instance.
11183 pub fn new() -> Self {
11184 std::default::Default::default()
11185 }
11186
11187 /// Sets the value of [field][crate::model::MongodbField::field].
11188 ///
11189 /// # Example
11190 /// ```ignore,no_run
11191 /// # use google_cloud_datastream_v1::model::MongodbField;
11192 /// let x = MongodbField::new().set_field("example");
11193 /// ```
11194 pub fn set_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11195 self.field = v.into();
11196 self
11197 }
11198}
11199
11200impl wkt::message::Message for MongodbField {
11201 fn typename() -> &'static str {
11202 "type.googleapis.com/google.cloud.datastream.v1.MongodbField"
11203 }
11204}
11205
11206/// The configuration of the stream source.
11207#[derive(Clone, Default, PartialEq)]
11208#[non_exhaustive]
11209pub struct SourceConfig {
11210 /// Required. Source connection profile resource.
11211 /// Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
11212 pub source_connection_profile: std::string::String,
11213
11214 /// Stream configuration that is specific to the data source type.
11215 pub source_stream_config: std::option::Option<crate::model::source_config::SourceStreamConfig>,
11216
11217 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11218}
11219
11220impl SourceConfig {
11221 /// Creates a new default instance.
11222 pub fn new() -> Self {
11223 std::default::Default::default()
11224 }
11225
11226 /// Sets the value of [source_connection_profile][crate::model::SourceConfig::source_connection_profile].
11227 ///
11228 /// # Example
11229 /// ```ignore,no_run
11230 /// # use google_cloud_datastream_v1::model::SourceConfig;
11231 /// let x = SourceConfig::new().set_source_connection_profile("example");
11232 /// ```
11233 pub fn set_source_connection_profile<T: std::convert::Into<std::string::String>>(
11234 mut self,
11235 v: T,
11236 ) -> Self {
11237 self.source_connection_profile = v.into();
11238 self
11239 }
11240
11241 /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config].
11242 ///
11243 /// Note that all the setters affecting `source_stream_config` are mutually
11244 /// exclusive.
11245 ///
11246 /// # Example
11247 /// ```ignore,no_run
11248 /// # use google_cloud_datastream_v1::model::SourceConfig;
11249 /// use google_cloud_datastream_v1::model::OracleSourceConfig;
11250 /// let x = SourceConfig::new().set_source_stream_config(Some(
11251 /// google_cloud_datastream_v1::model::source_config::SourceStreamConfig::OracleSourceConfig(OracleSourceConfig::default().into())));
11252 /// ```
11253 pub fn set_source_stream_config<
11254 T: std::convert::Into<std::option::Option<crate::model::source_config::SourceStreamConfig>>,
11255 >(
11256 mut self,
11257 v: T,
11258 ) -> Self {
11259 self.source_stream_config = v.into();
11260 self
11261 }
11262
11263 /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11264 /// if it holds a `OracleSourceConfig`, `None` if the field is not set or
11265 /// holds a different branch.
11266 pub fn oracle_source_config(
11267 &self,
11268 ) -> std::option::Option<&std::boxed::Box<crate::model::OracleSourceConfig>> {
11269 #[allow(unreachable_patterns)]
11270 self.source_stream_config.as_ref().and_then(|v| match v {
11271 crate::model::source_config::SourceStreamConfig::OracleSourceConfig(v) => {
11272 std::option::Option::Some(v)
11273 }
11274 _ => std::option::Option::None,
11275 })
11276 }
11277
11278 /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11279 /// to hold a `OracleSourceConfig`.
11280 ///
11281 /// Note that all the setters affecting `source_stream_config` are
11282 /// mutually exclusive.
11283 ///
11284 /// # Example
11285 /// ```ignore,no_run
11286 /// # use google_cloud_datastream_v1::model::SourceConfig;
11287 /// use google_cloud_datastream_v1::model::OracleSourceConfig;
11288 /// let x = SourceConfig::new().set_oracle_source_config(OracleSourceConfig::default()/* use setters */);
11289 /// assert!(x.oracle_source_config().is_some());
11290 /// assert!(x.mysql_source_config().is_none());
11291 /// assert!(x.postgresql_source_config().is_none());
11292 /// assert!(x.sql_server_source_config().is_none());
11293 /// assert!(x.salesforce_source_config().is_none());
11294 /// assert!(x.mongodb_source_config().is_none());
11295 /// ```
11296 pub fn set_oracle_source_config<
11297 T: std::convert::Into<std::boxed::Box<crate::model::OracleSourceConfig>>,
11298 >(
11299 mut self,
11300 v: T,
11301 ) -> Self {
11302 self.source_stream_config = std::option::Option::Some(
11303 crate::model::source_config::SourceStreamConfig::OracleSourceConfig(v.into()),
11304 );
11305 self
11306 }
11307
11308 /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11309 /// if it holds a `MysqlSourceConfig`, `None` if the field is not set or
11310 /// holds a different branch.
11311 pub fn mysql_source_config(
11312 &self,
11313 ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlSourceConfig>> {
11314 #[allow(unreachable_patterns)]
11315 self.source_stream_config.as_ref().and_then(|v| match v {
11316 crate::model::source_config::SourceStreamConfig::MysqlSourceConfig(v) => {
11317 std::option::Option::Some(v)
11318 }
11319 _ => std::option::Option::None,
11320 })
11321 }
11322
11323 /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11324 /// to hold a `MysqlSourceConfig`.
11325 ///
11326 /// Note that all the setters affecting `source_stream_config` are
11327 /// mutually exclusive.
11328 ///
11329 /// # Example
11330 /// ```ignore,no_run
11331 /// # use google_cloud_datastream_v1::model::SourceConfig;
11332 /// use google_cloud_datastream_v1::model::MysqlSourceConfig;
11333 /// let x = SourceConfig::new().set_mysql_source_config(MysqlSourceConfig::default()/* use setters */);
11334 /// assert!(x.mysql_source_config().is_some());
11335 /// assert!(x.oracle_source_config().is_none());
11336 /// assert!(x.postgresql_source_config().is_none());
11337 /// assert!(x.sql_server_source_config().is_none());
11338 /// assert!(x.salesforce_source_config().is_none());
11339 /// assert!(x.mongodb_source_config().is_none());
11340 /// ```
11341 pub fn set_mysql_source_config<
11342 T: std::convert::Into<std::boxed::Box<crate::model::MysqlSourceConfig>>,
11343 >(
11344 mut self,
11345 v: T,
11346 ) -> Self {
11347 self.source_stream_config = std::option::Option::Some(
11348 crate::model::source_config::SourceStreamConfig::MysqlSourceConfig(v.into()),
11349 );
11350 self
11351 }
11352
11353 /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11354 /// if it holds a `PostgresqlSourceConfig`, `None` if the field is not set or
11355 /// holds a different branch.
11356 pub fn postgresql_source_config(
11357 &self,
11358 ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlSourceConfig>> {
11359 #[allow(unreachable_patterns)]
11360 self.source_stream_config.as_ref().and_then(|v| match v {
11361 crate::model::source_config::SourceStreamConfig::PostgresqlSourceConfig(v) => {
11362 std::option::Option::Some(v)
11363 }
11364 _ => std::option::Option::None,
11365 })
11366 }
11367
11368 /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11369 /// to hold a `PostgresqlSourceConfig`.
11370 ///
11371 /// Note that all the setters affecting `source_stream_config` are
11372 /// mutually exclusive.
11373 ///
11374 /// # Example
11375 /// ```ignore,no_run
11376 /// # use google_cloud_datastream_v1::model::SourceConfig;
11377 /// use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
11378 /// let x = SourceConfig::new().set_postgresql_source_config(PostgresqlSourceConfig::default()/* use setters */);
11379 /// assert!(x.postgresql_source_config().is_some());
11380 /// assert!(x.oracle_source_config().is_none());
11381 /// assert!(x.mysql_source_config().is_none());
11382 /// assert!(x.sql_server_source_config().is_none());
11383 /// assert!(x.salesforce_source_config().is_none());
11384 /// assert!(x.mongodb_source_config().is_none());
11385 /// ```
11386 pub fn set_postgresql_source_config<
11387 T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlSourceConfig>>,
11388 >(
11389 mut self,
11390 v: T,
11391 ) -> Self {
11392 self.source_stream_config = std::option::Option::Some(
11393 crate::model::source_config::SourceStreamConfig::PostgresqlSourceConfig(v.into()),
11394 );
11395 self
11396 }
11397
11398 /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11399 /// if it holds a `SqlServerSourceConfig`, `None` if the field is not set or
11400 /// holds a different branch.
11401 pub fn sql_server_source_config(
11402 &self,
11403 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerSourceConfig>> {
11404 #[allow(unreachable_patterns)]
11405 self.source_stream_config.as_ref().and_then(|v| match v {
11406 crate::model::source_config::SourceStreamConfig::SqlServerSourceConfig(v) => {
11407 std::option::Option::Some(v)
11408 }
11409 _ => std::option::Option::None,
11410 })
11411 }
11412
11413 /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11414 /// to hold a `SqlServerSourceConfig`.
11415 ///
11416 /// Note that all the setters affecting `source_stream_config` are
11417 /// mutually exclusive.
11418 ///
11419 /// # Example
11420 /// ```ignore,no_run
11421 /// # use google_cloud_datastream_v1::model::SourceConfig;
11422 /// use google_cloud_datastream_v1::model::SqlServerSourceConfig;
11423 /// let x = SourceConfig::new().set_sql_server_source_config(SqlServerSourceConfig::default()/* use setters */);
11424 /// assert!(x.sql_server_source_config().is_some());
11425 /// assert!(x.oracle_source_config().is_none());
11426 /// assert!(x.mysql_source_config().is_none());
11427 /// assert!(x.postgresql_source_config().is_none());
11428 /// assert!(x.salesforce_source_config().is_none());
11429 /// assert!(x.mongodb_source_config().is_none());
11430 /// ```
11431 pub fn set_sql_server_source_config<
11432 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerSourceConfig>>,
11433 >(
11434 mut self,
11435 v: T,
11436 ) -> Self {
11437 self.source_stream_config = std::option::Option::Some(
11438 crate::model::source_config::SourceStreamConfig::SqlServerSourceConfig(v.into()),
11439 );
11440 self
11441 }
11442
11443 /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11444 /// if it holds a `SalesforceSourceConfig`, `None` if the field is not set or
11445 /// holds a different branch.
11446 pub fn salesforce_source_config(
11447 &self,
11448 ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceSourceConfig>> {
11449 #[allow(unreachable_patterns)]
11450 self.source_stream_config.as_ref().and_then(|v| match v {
11451 crate::model::source_config::SourceStreamConfig::SalesforceSourceConfig(v) => {
11452 std::option::Option::Some(v)
11453 }
11454 _ => std::option::Option::None,
11455 })
11456 }
11457
11458 /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11459 /// to hold a `SalesforceSourceConfig`.
11460 ///
11461 /// Note that all the setters affecting `source_stream_config` are
11462 /// mutually exclusive.
11463 ///
11464 /// # Example
11465 /// ```ignore,no_run
11466 /// # use google_cloud_datastream_v1::model::SourceConfig;
11467 /// use google_cloud_datastream_v1::model::SalesforceSourceConfig;
11468 /// let x = SourceConfig::new().set_salesforce_source_config(SalesforceSourceConfig::default()/* use setters */);
11469 /// assert!(x.salesforce_source_config().is_some());
11470 /// assert!(x.oracle_source_config().is_none());
11471 /// assert!(x.mysql_source_config().is_none());
11472 /// assert!(x.postgresql_source_config().is_none());
11473 /// assert!(x.sql_server_source_config().is_none());
11474 /// assert!(x.mongodb_source_config().is_none());
11475 /// ```
11476 pub fn set_salesforce_source_config<
11477 T: std::convert::Into<std::boxed::Box<crate::model::SalesforceSourceConfig>>,
11478 >(
11479 mut self,
11480 v: T,
11481 ) -> Self {
11482 self.source_stream_config = std::option::Option::Some(
11483 crate::model::source_config::SourceStreamConfig::SalesforceSourceConfig(v.into()),
11484 );
11485 self
11486 }
11487
11488 /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11489 /// if it holds a `MongodbSourceConfig`, `None` if the field is not set or
11490 /// holds a different branch.
11491 pub fn mongodb_source_config(
11492 &self,
11493 ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbSourceConfig>> {
11494 #[allow(unreachable_patterns)]
11495 self.source_stream_config.as_ref().and_then(|v| match v {
11496 crate::model::source_config::SourceStreamConfig::MongodbSourceConfig(v) => {
11497 std::option::Option::Some(v)
11498 }
11499 _ => std::option::Option::None,
11500 })
11501 }
11502
11503 /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11504 /// to hold a `MongodbSourceConfig`.
11505 ///
11506 /// Note that all the setters affecting `source_stream_config` are
11507 /// mutually exclusive.
11508 ///
11509 /// # Example
11510 /// ```ignore,no_run
11511 /// # use google_cloud_datastream_v1::model::SourceConfig;
11512 /// use google_cloud_datastream_v1::model::MongodbSourceConfig;
11513 /// let x = SourceConfig::new().set_mongodb_source_config(MongodbSourceConfig::default()/* use setters */);
11514 /// assert!(x.mongodb_source_config().is_some());
11515 /// assert!(x.oracle_source_config().is_none());
11516 /// assert!(x.mysql_source_config().is_none());
11517 /// assert!(x.postgresql_source_config().is_none());
11518 /// assert!(x.sql_server_source_config().is_none());
11519 /// assert!(x.salesforce_source_config().is_none());
11520 /// ```
11521 pub fn set_mongodb_source_config<
11522 T: std::convert::Into<std::boxed::Box<crate::model::MongodbSourceConfig>>,
11523 >(
11524 mut self,
11525 v: T,
11526 ) -> Self {
11527 self.source_stream_config = std::option::Option::Some(
11528 crate::model::source_config::SourceStreamConfig::MongodbSourceConfig(v.into()),
11529 );
11530 self
11531 }
11532}
11533
11534impl wkt::message::Message for SourceConfig {
11535 fn typename() -> &'static str {
11536 "type.googleapis.com/google.cloud.datastream.v1.SourceConfig"
11537 }
11538}
11539
11540/// Defines additional types related to [SourceConfig].
11541pub mod source_config {
11542 #[allow(unused_imports)]
11543 use super::*;
11544
11545 /// Stream configuration that is specific to the data source type.
11546 #[derive(Clone, Debug, PartialEq)]
11547 #[non_exhaustive]
11548 pub enum SourceStreamConfig {
11549 /// Oracle data source configuration.
11550 OracleSourceConfig(std::boxed::Box<crate::model::OracleSourceConfig>),
11551 /// MySQL data source configuration.
11552 MysqlSourceConfig(std::boxed::Box<crate::model::MysqlSourceConfig>),
11553 /// PostgreSQL data source configuration.
11554 PostgresqlSourceConfig(std::boxed::Box<crate::model::PostgresqlSourceConfig>),
11555 /// SQLServer data source configuration.
11556 SqlServerSourceConfig(std::boxed::Box<crate::model::SqlServerSourceConfig>),
11557 /// Salesforce data source configuration.
11558 SalesforceSourceConfig(std::boxed::Box<crate::model::SalesforceSourceConfig>),
11559 /// MongoDB data source configuration.
11560 MongodbSourceConfig(std::boxed::Box<crate::model::MongodbSourceConfig>),
11561 }
11562}
11563
11564/// AVRO file format configuration.
11565#[derive(Clone, Default, PartialEq)]
11566#[non_exhaustive]
11567pub struct AvroFileFormat {
11568 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11569}
11570
11571impl AvroFileFormat {
11572 /// Creates a new default instance.
11573 pub fn new() -> Self {
11574 std::default::Default::default()
11575 }
11576}
11577
11578impl wkt::message::Message for AvroFileFormat {
11579 fn typename() -> &'static str {
11580 "type.googleapis.com/google.cloud.datastream.v1.AvroFileFormat"
11581 }
11582}
11583
11584/// JSON file format configuration.
11585#[derive(Clone, Default, PartialEq)]
11586#[non_exhaustive]
11587pub struct JsonFileFormat {
11588 /// The schema file format along JSON data files.
11589 pub schema_file_format: crate::model::json_file_format::SchemaFileFormat,
11590
11591 /// Compression of the loaded JSON file.
11592 pub compression: crate::model::json_file_format::JsonCompression,
11593
11594 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11595}
11596
11597impl JsonFileFormat {
11598 /// Creates a new default instance.
11599 pub fn new() -> Self {
11600 std::default::Default::default()
11601 }
11602
11603 /// Sets the value of [schema_file_format][crate::model::JsonFileFormat::schema_file_format].
11604 ///
11605 /// # Example
11606 /// ```ignore,no_run
11607 /// # use google_cloud_datastream_v1::model::JsonFileFormat;
11608 /// use google_cloud_datastream_v1::model::json_file_format::SchemaFileFormat;
11609 /// let x0 = JsonFileFormat::new().set_schema_file_format(SchemaFileFormat::NoSchemaFile);
11610 /// let x1 = JsonFileFormat::new().set_schema_file_format(SchemaFileFormat::AvroSchemaFile);
11611 /// ```
11612 pub fn set_schema_file_format<
11613 T: std::convert::Into<crate::model::json_file_format::SchemaFileFormat>,
11614 >(
11615 mut self,
11616 v: T,
11617 ) -> Self {
11618 self.schema_file_format = v.into();
11619 self
11620 }
11621
11622 /// Sets the value of [compression][crate::model::JsonFileFormat::compression].
11623 ///
11624 /// # Example
11625 /// ```ignore,no_run
11626 /// # use google_cloud_datastream_v1::model::JsonFileFormat;
11627 /// use google_cloud_datastream_v1::model::json_file_format::JsonCompression;
11628 /// let x0 = JsonFileFormat::new().set_compression(JsonCompression::NoCompression);
11629 /// let x1 = JsonFileFormat::new().set_compression(JsonCompression::Gzip);
11630 /// ```
11631 pub fn set_compression<
11632 T: std::convert::Into<crate::model::json_file_format::JsonCompression>,
11633 >(
11634 mut self,
11635 v: T,
11636 ) -> Self {
11637 self.compression = v.into();
11638 self
11639 }
11640}
11641
11642impl wkt::message::Message for JsonFileFormat {
11643 fn typename() -> &'static str {
11644 "type.googleapis.com/google.cloud.datastream.v1.JsonFileFormat"
11645 }
11646}
11647
11648/// Defines additional types related to [JsonFileFormat].
11649pub mod json_file_format {
11650 #[allow(unused_imports)]
11651 use super::*;
11652
11653 /// Schema file format.
11654 ///
11655 /// # Working with unknown values
11656 ///
11657 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11658 /// additional enum variants at any time. Adding new variants is not considered
11659 /// a breaking change. Applications should write their code in anticipation of:
11660 ///
11661 /// - New values appearing in future releases of the client library, **and**
11662 /// - New values received dynamically, without application changes.
11663 ///
11664 /// Please consult the [Working with enums] section in the user guide for some
11665 /// guidelines.
11666 ///
11667 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11668 #[derive(Clone, Debug, PartialEq)]
11669 #[non_exhaustive]
11670 pub enum SchemaFileFormat {
11671 /// Unspecified schema file format.
11672 Unspecified,
11673 /// Do not attach schema file.
11674 NoSchemaFile,
11675 /// Avro schema format.
11676 AvroSchemaFile,
11677 /// If set, the enum was initialized with an unknown value.
11678 ///
11679 /// Applications can examine the value using [SchemaFileFormat::value] or
11680 /// [SchemaFileFormat::name].
11681 UnknownValue(schema_file_format::UnknownValue),
11682 }
11683
11684 #[doc(hidden)]
11685 pub mod schema_file_format {
11686 #[allow(unused_imports)]
11687 use super::*;
11688 #[derive(Clone, Debug, PartialEq)]
11689 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11690 }
11691
11692 impl SchemaFileFormat {
11693 /// Gets the enum value.
11694 ///
11695 /// Returns `None` if the enum contains an unknown value deserialized from
11696 /// the string representation of enums.
11697 pub fn value(&self) -> std::option::Option<i32> {
11698 match self {
11699 Self::Unspecified => std::option::Option::Some(0),
11700 Self::NoSchemaFile => std::option::Option::Some(1),
11701 Self::AvroSchemaFile => std::option::Option::Some(2),
11702 Self::UnknownValue(u) => u.0.value(),
11703 }
11704 }
11705
11706 /// Gets the enum value as a string.
11707 ///
11708 /// Returns `None` if the enum contains an unknown value deserialized from
11709 /// the integer representation of enums.
11710 pub fn name(&self) -> std::option::Option<&str> {
11711 match self {
11712 Self::Unspecified => std::option::Option::Some("SCHEMA_FILE_FORMAT_UNSPECIFIED"),
11713 Self::NoSchemaFile => std::option::Option::Some("NO_SCHEMA_FILE"),
11714 Self::AvroSchemaFile => std::option::Option::Some("AVRO_SCHEMA_FILE"),
11715 Self::UnknownValue(u) => u.0.name(),
11716 }
11717 }
11718 }
11719
11720 impl std::default::Default for SchemaFileFormat {
11721 fn default() -> Self {
11722 use std::convert::From;
11723 Self::from(0)
11724 }
11725 }
11726
11727 impl std::fmt::Display for SchemaFileFormat {
11728 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11729 wkt::internal::display_enum(f, self.name(), self.value())
11730 }
11731 }
11732
11733 impl std::convert::From<i32> for SchemaFileFormat {
11734 fn from(value: i32) -> Self {
11735 match value {
11736 0 => Self::Unspecified,
11737 1 => Self::NoSchemaFile,
11738 2 => Self::AvroSchemaFile,
11739 _ => Self::UnknownValue(schema_file_format::UnknownValue(
11740 wkt::internal::UnknownEnumValue::Integer(value),
11741 )),
11742 }
11743 }
11744 }
11745
11746 impl std::convert::From<&str> for SchemaFileFormat {
11747 fn from(value: &str) -> Self {
11748 use std::string::ToString;
11749 match value {
11750 "SCHEMA_FILE_FORMAT_UNSPECIFIED" => Self::Unspecified,
11751 "NO_SCHEMA_FILE" => Self::NoSchemaFile,
11752 "AVRO_SCHEMA_FILE" => Self::AvroSchemaFile,
11753 _ => Self::UnknownValue(schema_file_format::UnknownValue(
11754 wkt::internal::UnknownEnumValue::String(value.to_string()),
11755 )),
11756 }
11757 }
11758 }
11759
11760 impl serde::ser::Serialize for SchemaFileFormat {
11761 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11762 where
11763 S: serde::Serializer,
11764 {
11765 match self {
11766 Self::Unspecified => serializer.serialize_i32(0),
11767 Self::NoSchemaFile => serializer.serialize_i32(1),
11768 Self::AvroSchemaFile => serializer.serialize_i32(2),
11769 Self::UnknownValue(u) => u.0.serialize(serializer),
11770 }
11771 }
11772 }
11773
11774 impl<'de> serde::de::Deserialize<'de> for SchemaFileFormat {
11775 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11776 where
11777 D: serde::Deserializer<'de>,
11778 {
11779 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SchemaFileFormat>::new(
11780 ".google.cloud.datastream.v1.JsonFileFormat.SchemaFileFormat",
11781 ))
11782 }
11783 }
11784
11785 /// Json file compression.
11786 ///
11787 /// # Working with unknown values
11788 ///
11789 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11790 /// additional enum variants at any time. Adding new variants is not considered
11791 /// a breaking change. Applications should write their code in anticipation of:
11792 ///
11793 /// - New values appearing in future releases of the client library, **and**
11794 /// - New values received dynamically, without application changes.
11795 ///
11796 /// Please consult the [Working with enums] section in the user guide for some
11797 /// guidelines.
11798 ///
11799 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11800 #[derive(Clone, Debug, PartialEq)]
11801 #[non_exhaustive]
11802 pub enum JsonCompression {
11803 /// Unspecified json file compression.
11804 Unspecified,
11805 /// Do not compress JSON file.
11806 NoCompression,
11807 /// Gzip compression.
11808 Gzip,
11809 /// If set, the enum was initialized with an unknown value.
11810 ///
11811 /// Applications can examine the value using [JsonCompression::value] or
11812 /// [JsonCompression::name].
11813 UnknownValue(json_compression::UnknownValue),
11814 }
11815
11816 #[doc(hidden)]
11817 pub mod json_compression {
11818 #[allow(unused_imports)]
11819 use super::*;
11820 #[derive(Clone, Debug, PartialEq)]
11821 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11822 }
11823
11824 impl JsonCompression {
11825 /// Gets the enum value.
11826 ///
11827 /// Returns `None` if the enum contains an unknown value deserialized from
11828 /// the string representation of enums.
11829 pub fn value(&self) -> std::option::Option<i32> {
11830 match self {
11831 Self::Unspecified => std::option::Option::Some(0),
11832 Self::NoCompression => std::option::Option::Some(1),
11833 Self::Gzip => std::option::Option::Some(2),
11834 Self::UnknownValue(u) => u.0.value(),
11835 }
11836 }
11837
11838 /// Gets the enum value as a string.
11839 ///
11840 /// Returns `None` if the enum contains an unknown value deserialized from
11841 /// the integer representation of enums.
11842 pub fn name(&self) -> std::option::Option<&str> {
11843 match self {
11844 Self::Unspecified => std::option::Option::Some("JSON_COMPRESSION_UNSPECIFIED"),
11845 Self::NoCompression => std::option::Option::Some("NO_COMPRESSION"),
11846 Self::Gzip => std::option::Option::Some("GZIP"),
11847 Self::UnknownValue(u) => u.0.name(),
11848 }
11849 }
11850 }
11851
11852 impl std::default::Default for JsonCompression {
11853 fn default() -> Self {
11854 use std::convert::From;
11855 Self::from(0)
11856 }
11857 }
11858
11859 impl std::fmt::Display for JsonCompression {
11860 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11861 wkt::internal::display_enum(f, self.name(), self.value())
11862 }
11863 }
11864
11865 impl std::convert::From<i32> for JsonCompression {
11866 fn from(value: i32) -> Self {
11867 match value {
11868 0 => Self::Unspecified,
11869 1 => Self::NoCompression,
11870 2 => Self::Gzip,
11871 _ => Self::UnknownValue(json_compression::UnknownValue(
11872 wkt::internal::UnknownEnumValue::Integer(value),
11873 )),
11874 }
11875 }
11876 }
11877
11878 impl std::convert::From<&str> for JsonCompression {
11879 fn from(value: &str) -> Self {
11880 use std::string::ToString;
11881 match value {
11882 "JSON_COMPRESSION_UNSPECIFIED" => Self::Unspecified,
11883 "NO_COMPRESSION" => Self::NoCompression,
11884 "GZIP" => Self::Gzip,
11885 _ => Self::UnknownValue(json_compression::UnknownValue(
11886 wkt::internal::UnknownEnumValue::String(value.to_string()),
11887 )),
11888 }
11889 }
11890 }
11891
11892 impl serde::ser::Serialize for JsonCompression {
11893 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11894 where
11895 S: serde::Serializer,
11896 {
11897 match self {
11898 Self::Unspecified => serializer.serialize_i32(0),
11899 Self::NoCompression => serializer.serialize_i32(1),
11900 Self::Gzip => serializer.serialize_i32(2),
11901 Self::UnknownValue(u) => u.0.serialize(serializer),
11902 }
11903 }
11904 }
11905
11906 impl<'de> serde::de::Deserialize<'de> for JsonCompression {
11907 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11908 where
11909 D: serde::Deserializer<'de>,
11910 {
11911 deserializer.deserialize_any(wkt::internal::EnumVisitor::<JsonCompression>::new(
11912 ".google.cloud.datastream.v1.JsonFileFormat.JsonCompression",
11913 ))
11914 }
11915 }
11916}
11917
11918/// Google Cloud Storage destination configuration
11919#[derive(Clone, Default, PartialEq)]
11920#[non_exhaustive]
11921pub struct GcsDestinationConfig {
11922 /// Path inside the Cloud Storage bucket to write data to.
11923 pub path: std::string::String,
11924
11925 /// The maximum file size to be saved in the bucket.
11926 pub file_rotation_mb: i32,
11927
11928 /// The maximum duration for which new events are added before a file is
11929 /// closed and a new file is created. Values within the range of 15-60 seconds
11930 /// are allowed.
11931 pub file_rotation_interval: std::option::Option<wkt::Duration>,
11932
11933 /// File Format that the data should be written in.
11934 pub file_format: std::option::Option<crate::model::gcs_destination_config::FileFormat>,
11935
11936 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11937}
11938
11939impl GcsDestinationConfig {
11940 /// Creates a new default instance.
11941 pub fn new() -> Self {
11942 std::default::Default::default()
11943 }
11944
11945 /// Sets the value of [path][crate::model::GcsDestinationConfig::path].
11946 ///
11947 /// # Example
11948 /// ```ignore,no_run
11949 /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
11950 /// let x = GcsDestinationConfig::new().set_path("example");
11951 /// ```
11952 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11953 self.path = v.into();
11954 self
11955 }
11956
11957 /// Sets the value of [file_rotation_mb][crate::model::GcsDestinationConfig::file_rotation_mb].
11958 ///
11959 /// # Example
11960 /// ```ignore,no_run
11961 /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
11962 /// let x = GcsDestinationConfig::new().set_file_rotation_mb(42);
11963 /// ```
11964 pub fn set_file_rotation_mb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11965 self.file_rotation_mb = v.into();
11966 self
11967 }
11968
11969 /// Sets the value of [file_rotation_interval][crate::model::GcsDestinationConfig::file_rotation_interval].
11970 ///
11971 /// # Example
11972 /// ```ignore,no_run
11973 /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
11974 /// use wkt::Duration;
11975 /// let x = GcsDestinationConfig::new().set_file_rotation_interval(Duration::default()/* use setters */);
11976 /// ```
11977 pub fn set_file_rotation_interval<T>(mut self, v: T) -> Self
11978 where
11979 T: std::convert::Into<wkt::Duration>,
11980 {
11981 self.file_rotation_interval = std::option::Option::Some(v.into());
11982 self
11983 }
11984
11985 /// Sets or clears the value of [file_rotation_interval][crate::model::GcsDestinationConfig::file_rotation_interval].
11986 ///
11987 /// # Example
11988 /// ```ignore,no_run
11989 /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
11990 /// use wkt::Duration;
11991 /// let x = GcsDestinationConfig::new().set_or_clear_file_rotation_interval(Some(Duration::default()/* use setters */));
11992 /// let x = GcsDestinationConfig::new().set_or_clear_file_rotation_interval(None::<Duration>);
11993 /// ```
11994 pub fn set_or_clear_file_rotation_interval<T>(mut self, v: std::option::Option<T>) -> Self
11995 where
11996 T: std::convert::Into<wkt::Duration>,
11997 {
11998 self.file_rotation_interval = v.map(|x| x.into());
11999 self
12000 }
12001
12002 /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format].
12003 ///
12004 /// Note that all the setters affecting `file_format` are mutually
12005 /// exclusive.
12006 ///
12007 /// # Example
12008 /// ```ignore,no_run
12009 /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
12010 /// use google_cloud_datastream_v1::model::AvroFileFormat;
12011 /// let x = GcsDestinationConfig::new().set_file_format(Some(
12012 /// google_cloud_datastream_v1::model::gcs_destination_config::FileFormat::AvroFileFormat(AvroFileFormat::default().into())));
12013 /// ```
12014 pub fn set_file_format<
12015 T: std::convert::Into<std::option::Option<crate::model::gcs_destination_config::FileFormat>>,
12016 >(
12017 mut self,
12018 v: T,
12019 ) -> Self {
12020 self.file_format = v.into();
12021 self
12022 }
12023
12024 /// The value of [file_format][crate::model::GcsDestinationConfig::file_format]
12025 /// if it holds a `AvroFileFormat`, `None` if the field is not set or
12026 /// holds a different branch.
12027 pub fn avro_file_format(
12028 &self,
12029 ) -> std::option::Option<&std::boxed::Box<crate::model::AvroFileFormat>> {
12030 #[allow(unreachable_patterns)]
12031 self.file_format.as_ref().and_then(|v| match v {
12032 crate::model::gcs_destination_config::FileFormat::AvroFileFormat(v) => {
12033 std::option::Option::Some(v)
12034 }
12035 _ => std::option::Option::None,
12036 })
12037 }
12038
12039 /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format]
12040 /// to hold a `AvroFileFormat`.
12041 ///
12042 /// Note that all the setters affecting `file_format` are
12043 /// mutually exclusive.
12044 ///
12045 /// # Example
12046 /// ```ignore,no_run
12047 /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
12048 /// use google_cloud_datastream_v1::model::AvroFileFormat;
12049 /// let x = GcsDestinationConfig::new().set_avro_file_format(AvroFileFormat::default()/* use setters */);
12050 /// assert!(x.avro_file_format().is_some());
12051 /// assert!(x.json_file_format().is_none());
12052 /// ```
12053 pub fn set_avro_file_format<
12054 T: std::convert::Into<std::boxed::Box<crate::model::AvroFileFormat>>,
12055 >(
12056 mut self,
12057 v: T,
12058 ) -> Self {
12059 self.file_format = std::option::Option::Some(
12060 crate::model::gcs_destination_config::FileFormat::AvroFileFormat(v.into()),
12061 );
12062 self
12063 }
12064
12065 /// The value of [file_format][crate::model::GcsDestinationConfig::file_format]
12066 /// if it holds a `JsonFileFormat`, `None` if the field is not set or
12067 /// holds a different branch.
12068 pub fn json_file_format(
12069 &self,
12070 ) -> std::option::Option<&std::boxed::Box<crate::model::JsonFileFormat>> {
12071 #[allow(unreachable_patterns)]
12072 self.file_format.as_ref().and_then(|v| match v {
12073 crate::model::gcs_destination_config::FileFormat::JsonFileFormat(v) => {
12074 std::option::Option::Some(v)
12075 }
12076 _ => std::option::Option::None,
12077 })
12078 }
12079
12080 /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format]
12081 /// to hold a `JsonFileFormat`.
12082 ///
12083 /// Note that all the setters affecting `file_format` are
12084 /// mutually exclusive.
12085 ///
12086 /// # Example
12087 /// ```ignore,no_run
12088 /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
12089 /// use google_cloud_datastream_v1::model::JsonFileFormat;
12090 /// let x = GcsDestinationConfig::new().set_json_file_format(JsonFileFormat::default()/* use setters */);
12091 /// assert!(x.json_file_format().is_some());
12092 /// assert!(x.avro_file_format().is_none());
12093 /// ```
12094 pub fn set_json_file_format<
12095 T: std::convert::Into<std::boxed::Box<crate::model::JsonFileFormat>>,
12096 >(
12097 mut self,
12098 v: T,
12099 ) -> Self {
12100 self.file_format = std::option::Option::Some(
12101 crate::model::gcs_destination_config::FileFormat::JsonFileFormat(v.into()),
12102 );
12103 self
12104 }
12105}
12106
12107impl wkt::message::Message for GcsDestinationConfig {
12108 fn typename() -> &'static str {
12109 "type.googleapis.com/google.cloud.datastream.v1.GcsDestinationConfig"
12110 }
12111}
12112
12113/// Defines additional types related to [GcsDestinationConfig].
12114pub mod gcs_destination_config {
12115 #[allow(unused_imports)]
12116 use super::*;
12117
12118 /// File Format that the data should be written in.
12119 #[derive(Clone, Debug, PartialEq)]
12120 #[non_exhaustive]
12121 pub enum FileFormat {
12122 /// AVRO file format configuration.
12123 AvroFileFormat(std::boxed::Box<crate::model::AvroFileFormat>),
12124 /// JSON file format configuration.
12125 JsonFileFormat(std::boxed::Box<crate::model::JsonFileFormat>),
12126 }
12127}
12128
12129/// BigQuery destination configuration
12130#[derive(Clone, Default, PartialEq)]
12131#[non_exhaustive]
12132pub struct BigQueryDestinationConfig {
12133 /// The guaranteed data freshness (in seconds) when querying tables created by
12134 /// the stream. Editing this field will only affect new tables created in the
12135 /// future, but existing tables will not be impacted. Lower values mean that
12136 /// queries will return fresher data, but may result in higher cost.
12137 pub data_freshness: std::option::Option<wkt::Duration>,
12138
12139 /// Optional. Big Lake Managed Tables (BLMT) configuration.
12140 pub blmt_config: std::option::Option<crate::model::big_query_destination_config::BlmtConfig>,
12141
12142 /// Target dataset(s) configuration.
12143 pub dataset_config:
12144 std::option::Option<crate::model::big_query_destination_config::DatasetConfig>,
12145
12146 #[allow(missing_docs)]
12147 pub write_mode: std::option::Option<crate::model::big_query_destination_config::WriteMode>,
12148
12149 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12150}
12151
12152impl BigQueryDestinationConfig {
12153 /// Creates a new default instance.
12154 pub fn new() -> Self {
12155 std::default::Default::default()
12156 }
12157
12158 /// Sets the value of [data_freshness][crate::model::BigQueryDestinationConfig::data_freshness].
12159 ///
12160 /// # Example
12161 /// ```ignore,no_run
12162 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12163 /// use wkt::Duration;
12164 /// let x = BigQueryDestinationConfig::new().set_data_freshness(Duration::default()/* use setters */);
12165 /// ```
12166 pub fn set_data_freshness<T>(mut self, v: T) -> Self
12167 where
12168 T: std::convert::Into<wkt::Duration>,
12169 {
12170 self.data_freshness = std::option::Option::Some(v.into());
12171 self
12172 }
12173
12174 /// Sets or clears the value of [data_freshness][crate::model::BigQueryDestinationConfig::data_freshness].
12175 ///
12176 /// # Example
12177 /// ```ignore,no_run
12178 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12179 /// use wkt::Duration;
12180 /// let x = BigQueryDestinationConfig::new().set_or_clear_data_freshness(Some(Duration::default()/* use setters */));
12181 /// let x = BigQueryDestinationConfig::new().set_or_clear_data_freshness(None::<Duration>);
12182 /// ```
12183 pub fn set_or_clear_data_freshness<T>(mut self, v: std::option::Option<T>) -> Self
12184 where
12185 T: std::convert::Into<wkt::Duration>,
12186 {
12187 self.data_freshness = v.map(|x| x.into());
12188 self
12189 }
12190
12191 /// Sets the value of [blmt_config][crate::model::BigQueryDestinationConfig::blmt_config].
12192 ///
12193 /// # Example
12194 /// ```ignore,no_run
12195 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12196 /// use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12197 /// let x = BigQueryDestinationConfig::new().set_blmt_config(BlmtConfig::default()/* use setters */);
12198 /// ```
12199 pub fn set_blmt_config<T>(mut self, v: T) -> Self
12200 where
12201 T: std::convert::Into<crate::model::big_query_destination_config::BlmtConfig>,
12202 {
12203 self.blmt_config = std::option::Option::Some(v.into());
12204 self
12205 }
12206
12207 /// Sets or clears the value of [blmt_config][crate::model::BigQueryDestinationConfig::blmt_config].
12208 ///
12209 /// # Example
12210 /// ```ignore,no_run
12211 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12212 /// use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12213 /// let x = BigQueryDestinationConfig::new().set_or_clear_blmt_config(Some(BlmtConfig::default()/* use setters */));
12214 /// let x = BigQueryDestinationConfig::new().set_or_clear_blmt_config(None::<BlmtConfig>);
12215 /// ```
12216 pub fn set_or_clear_blmt_config<T>(mut self, v: std::option::Option<T>) -> Self
12217 where
12218 T: std::convert::Into<crate::model::big_query_destination_config::BlmtConfig>,
12219 {
12220 self.blmt_config = v.map(|x| x.into());
12221 self
12222 }
12223
12224 /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config].
12225 ///
12226 /// Note that all the setters affecting `dataset_config` are mutually
12227 /// exclusive.
12228 ///
12229 /// # Example
12230 /// ```ignore,no_run
12231 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12232 /// use google_cloud_datastream_v1::model::big_query_destination_config::SingleTargetDataset;
12233 /// let x = BigQueryDestinationConfig::new().set_dataset_config(Some(
12234 /// google_cloud_datastream_v1::model::big_query_destination_config::DatasetConfig::SingleTargetDataset(SingleTargetDataset::default().into())));
12235 /// ```
12236 pub fn set_dataset_config<
12237 T: std::convert::Into<
12238 std::option::Option<crate::model::big_query_destination_config::DatasetConfig>,
12239 >,
12240 >(
12241 mut self,
12242 v: T,
12243 ) -> Self {
12244 self.dataset_config = v.into();
12245 self
12246 }
12247
12248 /// The value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
12249 /// if it holds a `SingleTargetDataset`, `None` if the field is not set or
12250 /// holds a different branch.
12251 pub fn single_target_dataset(
12252 &self,
12253 ) -> std::option::Option<
12254 &std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
12255 > {
12256 #[allow(unreachable_patterns)]
12257 self.dataset_config.as_ref().and_then(|v| match v {
12258 crate::model::big_query_destination_config::DatasetConfig::SingleTargetDataset(v) => {
12259 std::option::Option::Some(v)
12260 }
12261 _ => std::option::Option::None,
12262 })
12263 }
12264
12265 /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
12266 /// to hold a `SingleTargetDataset`.
12267 ///
12268 /// Note that all the setters affecting `dataset_config` are
12269 /// mutually exclusive.
12270 ///
12271 /// # Example
12272 /// ```ignore,no_run
12273 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12274 /// use google_cloud_datastream_v1::model::big_query_destination_config::SingleTargetDataset;
12275 /// let x = BigQueryDestinationConfig::new().set_single_target_dataset(SingleTargetDataset::default()/* use setters */);
12276 /// assert!(x.single_target_dataset().is_some());
12277 /// assert!(x.source_hierarchy_datasets().is_none());
12278 /// ```
12279 pub fn set_single_target_dataset<
12280 T: std::convert::Into<
12281 std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
12282 >,
12283 >(
12284 mut self,
12285 v: T,
12286 ) -> Self {
12287 self.dataset_config = std::option::Option::Some(
12288 crate::model::big_query_destination_config::DatasetConfig::SingleTargetDataset(
12289 v.into(),
12290 ),
12291 );
12292 self
12293 }
12294
12295 /// The value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
12296 /// if it holds a `SourceHierarchyDatasets`, `None` if the field is not set or
12297 /// holds a different branch.
12298 pub fn source_hierarchy_datasets(
12299 &self,
12300 ) -> std::option::Option<
12301 &std::boxed::Box<crate::model::big_query_destination_config::SourceHierarchyDatasets>,
12302 > {
12303 #[allow(unreachable_patterns)]
12304 self.dataset_config.as_ref().and_then(|v| match v {
12305 crate::model::big_query_destination_config::DatasetConfig::SourceHierarchyDatasets(
12306 v,
12307 ) => std::option::Option::Some(v),
12308 _ => std::option::Option::None,
12309 })
12310 }
12311
12312 /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
12313 /// to hold a `SourceHierarchyDatasets`.
12314 ///
12315 /// Note that all the setters affecting `dataset_config` are
12316 /// mutually exclusive.
12317 ///
12318 /// # Example
12319 /// ```ignore,no_run
12320 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12321 /// use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12322 /// let x = BigQueryDestinationConfig::new().set_source_hierarchy_datasets(SourceHierarchyDatasets::default()/* use setters */);
12323 /// assert!(x.source_hierarchy_datasets().is_some());
12324 /// assert!(x.single_target_dataset().is_none());
12325 /// ```
12326 pub fn set_source_hierarchy_datasets<
12327 T: std::convert::Into<
12328 std::boxed::Box<
12329 crate::model::big_query_destination_config::SourceHierarchyDatasets,
12330 >,
12331 >,
12332 >(
12333 mut self,
12334 v: T,
12335 ) -> Self {
12336 self.dataset_config = std::option::Option::Some(
12337 crate::model::big_query_destination_config::DatasetConfig::SourceHierarchyDatasets(
12338 v.into(),
12339 ),
12340 );
12341 self
12342 }
12343
12344 /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode].
12345 ///
12346 /// Note that all the setters affecting `write_mode` are mutually
12347 /// exclusive.
12348 ///
12349 /// # Example
12350 /// ```ignore,no_run
12351 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12352 /// use google_cloud_datastream_v1::model::big_query_destination_config::Merge;
12353 /// let x = BigQueryDestinationConfig::new().set_write_mode(Some(
12354 /// google_cloud_datastream_v1::model::big_query_destination_config::WriteMode::Merge(Merge::default().into())));
12355 /// ```
12356 pub fn set_write_mode<
12357 T: std::convert::Into<
12358 std::option::Option<crate::model::big_query_destination_config::WriteMode>,
12359 >,
12360 >(
12361 mut self,
12362 v: T,
12363 ) -> Self {
12364 self.write_mode = v.into();
12365 self
12366 }
12367
12368 /// The value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
12369 /// if it holds a `Merge`, `None` if the field is not set or
12370 /// holds a different branch.
12371 pub fn merge(
12372 &self,
12373 ) -> std::option::Option<&std::boxed::Box<crate::model::big_query_destination_config::Merge>>
12374 {
12375 #[allow(unreachable_patterns)]
12376 self.write_mode.as_ref().and_then(|v| match v {
12377 crate::model::big_query_destination_config::WriteMode::Merge(v) => {
12378 std::option::Option::Some(v)
12379 }
12380 _ => std::option::Option::None,
12381 })
12382 }
12383
12384 /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
12385 /// to hold a `Merge`.
12386 ///
12387 /// Note that all the setters affecting `write_mode` are
12388 /// mutually exclusive.
12389 ///
12390 /// # Example
12391 /// ```ignore,no_run
12392 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12393 /// use google_cloud_datastream_v1::model::big_query_destination_config::Merge;
12394 /// let x = BigQueryDestinationConfig::new().set_merge(Merge::default()/* use setters */);
12395 /// assert!(x.merge().is_some());
12396 /// assert!(x.append_only().is_none());
12397 /// ```
12398 pub fn set_merge<
12399 T: std::convert::Into<std::boxed::Box<crate::model::big_query_destination_config::Merge>>,
12400 >(
12401 mut self,
12402 v: T,
12403 ) -> Self {
12404 self.write_mode = std::option::Option::Some(
12405 crate::model::big_query_destination_config::WriteMode::Merge(v.into()),
12406 );
12407 self
12408 }
12409
12410 /// The value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
12411 /// if it holds a `AppendOnly`, `None` if the field is not set or
12412 /// holds a different branch.
12413 pub fn append_only(
12414 &self,
12415 ) -> std::option::Option<&std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>>
12416 {
12417 #[allow(unreachable_patterns)]
12418 self.write_mode.as_ref().and_then(|v| match v {
12419 crate::model::big_query_destination_config::WriteMode::AppendOnly(v) => {
12420 std::option::Option::Some(v)
12421 }
12422 _ => std::option::Option::None,
12423 })
12424 }
12425
12426 /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
12427 /// to hold a `AppendOnly`.
12428 ///
12429 /// Note that all the setters affecting `write_mode` are
12430 /// mutually exclusive.
12431 ///
12432 /// # Example
12433 /// ```ignore,no_run
12434 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12435 /// use google_cloud_datastream_v1::model::big_query_destination_config::AppendOnly;
12436 /// let x = BigQueryDestinationConfig::new().set_append_only(AppendOnly::default()/* use setters */);
12437 /// assert!(x.append_only().is_some());
12438 /// assert!(x.merge().is_none());
12439 /// ```
12440 pub fn set_append_only<
12441 T: std::convert::Into<std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>>,
12442 >(
12443 mut self,
12444 v: T,
12445 ) -> Self {
12446 self.write_mode = std::option::Option::Some(
12447 crate::model::big_query_destination_config::WriteMode::AppendOnly(v.into()),
12448 );
12449 self
12450 }
12451}
12452
12453impl wkt::message::Message for BigQueryDestinationConfig {
12454 fn typename() -> &'static str {
12455 "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig"
12456 }
12457}
12458
12459/// Defines additional types related to [BigQueryDestinationConfig].
12460pub mod big_query_destination_config {
12461 #[allow(unused_imports)]
12462 use super::*;
12463
12464 /// A single target dataset to which all data will be streamed.
12465 #[derive(Clone, Default, PartialEq)]
12466 #[non_exhaustive]
12467 pub struct SingleTargetDataset {
12468 /// The dataset ID of the target dataset.
12469 /// DatasetIds allowed characters:
12470 /// <https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets#datasetreference>.
12471 pub dataset_id: std::string::String,
12472
12473 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12474 }
12475
12476 impl SingleTargetDataset {
12477 /// Creates a new default instance.
12478 pub fn new() -> Self {
12479 std::default::Default::default()
12480 }
12481
12482 /// Sets the value of [dataset_id][crate::model::big_query_destination_config::SingleTargetDataset::dataset_id].
12483 ///
12484 /// # Example
12485 /// ```ignore,no_run
12486 /// # use google_cloud_datastream_v1::model::big_query_destination_config::SingleTargetDataset;
12487 /// let x = SingleTargetDataset::new().set_dataset_id("example");
12488 /// ```
12489 pub fn set_dataset_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12490 self.dataset_id = v.into();
12491 self
12492 }
12493 }
12494
12495 impl wkt::message::Message for SingleTargetDataset {
12496 fn typename() -> &'static str {
12497 "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SingleTargetDataset"
12498 }
12499 }
12500
12501 /// Destination datasets are created so that hierarchy of the destination data
12502 /// objects matches the source hierarchy.
12503 #[derive(Clone, Default, PartialEq)]
12504 #[non_exhaustive]
12505 pub struct SourceHierarchyDatasets {
12506 /// The dataset template to use for dynamic dataset creation.
12507 pub dataset_template: std::option::Option<
12508 crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate,
12509 >,
12510
12511 /// Optional. The project id of the BigQuery dataset. If not specified, the
12512 /// project will be inferred from the stream resource.
12513 pub project_id: std::option::Option<std::string::String>,
12514
12515 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12516 }
12517
12518 impl SourceHierarchyDatasets {
12519 /// Creates a new default instance.
12520 pub fn new() -> Self {
12521 std::default::Default::default()
12522 }
12523
12524 /// Sets the value of [dataset_template][crate::model::big_query_destination_config::SourceHierarchyDatasets::dataset_template].
12525 ///
12526 /// # Example
12527 /// ```ignore,no_run
12528 /// # use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12529 /// use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12530 /// let x = SourceHierarchyDatasets::new().set_dataset_template(DatasetTemplate::default()/* use setters */);
12531 /// ```
12532 pub fn set_dataset_template<T>(mut self, v: T) -> Self
12533 where T: std::convert::Into<crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate>
12534 {
12535 self.dataset_template = std::option::Option::Some(v.into());
12536 self
12537 }
12538
12539 /// Sets or clears the value of [dataset_template][crate::model::big_query_destination_config::SourceHierarchyDatasets::dataset_template].
12540 ///
12541 /// # Example
12542 /// ```ignore,no_run
12543 /// # use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12544 /// use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12545 /// let x = SourceHierarchyDatasets::new().set_or_clear_dataset_template(Some(DatasetTemplate::default()/* use setters */));
12546 /// let x = SourceHierarchyDatasets::new().set_or_clear_dataset_template(None::<DatasetTemplate>);
12547 /// ```
12548 pub fn set_or_clear_dataset_template<T>(mut self, v: std::option::Option<T>) -> Self
12549 where T: std::convert::Into<crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate>
12550 {
12551 self.dataset_template = v.map(|x| x.into());
12552 self
12553 }
12554
12555 /// Sets the value of [project_id][crate::model::big_query_destination_config::SourceHierarchyDatasets::project_id].
12556 ///
12557 /// # Example
12558 /// ```ignore,no_run
12559 /// # use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12560 /// let x = SourceHierarchyDatasets::new().set_project_id("example");
12561 /// ```
12562 pub fn set_project_id<T>(mut self, v: T) -> Self
12563 where
12564 T: std::convert::Into<std::string::String>,
12565 {
12566 self.project_id = std::option::Option::Some(v.into());
12567 self
12568 }
12569
12570 /// Sets or clears the value of [project_id][crate::model::big_query_destination_config::SourceHierarchyDatasets::project_id].
12571 ///
12572 /// # Example
12573 /// ```ignore,no_run
12574 /// # use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12575 /// let x = SourceHierarchyDatasets::new().set_or_clear_project_id(Some("example"));
12576 /// let x = SourceHierarchyDatasets::new().set_or_clear_project_id(None::<String>);
12577 /// ```
12578 pub fn set_or_clear_project_id<T>(mut self, v: std::option::Option<T>) -> Self
12579 where
12580 T: std::convert::Into<std::string::String>,
12581 {
12582 self.project_id = v.map(|x| x.into());
12583 self
12584 }
12585 }
12586
12587 impl wkt::message::Message for SourceHierarchyDatasets {
12588 fn typename() -> &'static str {
12589 "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SourceHierarchyDatasets"
12590 }
12591 }
12592
12593 /// Defines additional types related to [SourceHierarchyDatasets].
12594 pub mod source_hierarchy_datasets {
12595 #[allow(unused_imports)]
12596 use super::*;
12597
12598 /// Dataset template used for dynamic dataset creation.
12599 #[derive(Clone, Default, PartialEq)]
12600 #[non_exhaustive]
12601 pub struct DatasetTemplate {
12602 /// Required. The geographic location where the dataset should reside. See
12603 /// <https://cloud.google.com/bigquery/docs/locations> for supported
12604 /// locations.
12605 pub location: std::string::String,
12606
12607 /// If supplied, every created dataset will have its name prefixed by the
12608 /// provided value. The prefix and name will be separated by an underscore.
12609 /// i.e. \<prefix\>_<dataset_name>.
12610 pub dataset_id_prefix: std::string::String,
12611
12612 /// Describes the Cloud KMS encryption key that will be used to
12613 /// protect destination BigQuery table. The BigQuery Service Account
12614 /// associated with your project requires access to this encryption key.
12615 /// i.e.
12616 /// projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{cryptoKey}.
12617 /// See <https://cloud.google.com/bigquery/docs/customer-managed-encryption>
12618 /// for more information.
12619 pub kms_key_name: std::string::String,
12620
12621 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12622 }
12623
12624 impl DatasetTemplate {
12625 /// Creates a new default instance.
12626 pub fn new() -> Self {
12627 std::default::Default::default()
12628 }
12629
12630 /// Sets the value of [location][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::location].
12631 ///
12632 /// # Example
12633 /// ```ignore,no_run
12634 /// # use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12635 /// let x = DatasetTemplate::new().set_location("example");
12636 /// ```
12637 pub fn set_location<T: std::convert::Into<std::string::String>>(
12638 mut self,
12639 v: T,
12640 ) -> Self {
12641 self.location = v.into();
12642 self
12643 }
12644
12645 /// Sets the value of [dataset_id_prefix][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::dataset_id_prefix].
12646 ///
12647 /// # Example
12648 /// ```ignore,no_run
12649 /// # use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12650 /// let x = DatasetTemplate::new().set_dataset_id_prefix("example");
12651 /// ```
12652 pub fn set_dataset_id_prefix<T: std::convert::Into<std::string::String>>(
12653 mut self,
12654 v: T,
12655 ) -> Self {
12656 self.dataset_id_prefix = v.into();
12657 self
12658 }
12659
12660 /// Sets the value of [kms_key_name][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::kms_key_name].
12661 ///
12662 /// # Example
12663 /// ```ignore,no_run
12664 /// # use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12665 /// let x = DatasetTemplate::new().set_kms_key_name("example");
12666 /// ```
12667 pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(
12668 mut self,
12669 v: T,
12670 ) -> Self {
12671 self.kms_key_name = v.into();
12672 self
12673 }
12674 }
12675
12676 impl wkt::message::Message for DatasetTemplate {
12677 fn typename() -> &'static str {
12678 "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SourceHierarchyDatasets.DatasetTemplate"
12679 }
12680 }
12681 }
12682
12683 /// The configuration for BLMT.
12684 #[derive(Clone, Default, PartialEq)]
12685 #[non_exhaustive]
12686 pub struct BlmtConfig {
12687 /// Required. The Cloud Storage bucket name.
12688 pub bucket: std::string::String,
12689
12690 /// The root path inside the Cloud Storage bucket.
12691 pub root_path: std::string::String,
12692
12693 /// Required. The bigquery connection.
12694 /// Format: `{project}.{location}.{name}`
12695 pub connection_name: std::string::String,
12696
12697 /// Required. The file format.
12698 pub file_format: crate::model::big_query_destination_config::blmt_config::FileFormat,
12699
12700 /// Required. The table format.
12701 pub table_format: crate::model::big_query_destination_config::blmt_config::TableFormat,
12702
12703 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12704 }
12705
12706 impl BlmtConfig {
12707 /// Creates a new default instance.
12708 pub fn new() -> Self {
12709 std::default::Default::default()
12710 }
12711
12712 /// Sets the value of [bucket][crate::model::big_query_destination_config::BlmtConfig::bucket].
12713 ///
12714 /// # Example
12715 /// ```ignore,no_run
12716 /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12717 /// let x = BlmtConfig::new().set_bucket("example");
12718 /// ```
12719 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12720 self.bucket = v.into();
12721 self
12722 }
12723
12724 /// Sets the value of [root_path][crate::model::big_query_destination_config::BlmtConfig::root_path].
12725 ///
12726 /// # Example
12727 /// ```ignore,no_run
12728 /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12729 /// let x = BlmtConfig::new().set_root_path("example");
12730 /// ```
12731 pub fn set_root_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12732 self.root_path = v.into();
12733 self
12734 }
12735
12736 /// Sets the value of [connection_name][crate::model::big_query_destination_config::BlmtConfig::connection_name].
12737 ///
12738 /// # Example
12739 /// ```ignore,no_run
12740 /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12741 /// let x = BlmtConfig::new().set_connection_name("example");
12742 /// ```
12743 pub fn set_connection_name<T: std::convert::Into<std::string::String>>(
12744 mut self,
12745 v: T,
12746 ) -> Self {
12747 self.connection_name = v.into();
12748 self
12749 }
12750
12751 /// Sets the value of [file_format][crate::model::big_query_destination_config::BlmtConfig::file_format].
12752 ///
12753 /// # Example
12754 /// ```ignore,no_run
12755 /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12756 /// use google_cloud_datastream_v1::model::big_query_destination_config::blmt_config::FileFormat;
12757 /// let x0 = BlmtConfig::new().set_file_format(FileFormat::Parquet);
12758 /// ```
12759 pub fn set_file_format<
12760 T: std::convert::Into<crate::model::big_query_destination_config::blmt_config::FileFormat>,
12761 >(
12762 mut self,
12763 v: T,
12764 ) -> Self {
12765 self.file_format = v.into();
12766 self
12767 }
12768
12769 /// Sets the value of [table_format][crate::model::big_query_destination_config::BlmtConfig::table_format].
12770 ///
12771 /// # Example
12772 /// ```ignore,no_run
12773 /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12774 /// use google_cloud_datastream_v1::model::big_query_destination_config::blmt_config::TableFormat;
12775 /// let x0 = BlmtConfig::new().set_table_format(TableFormat::Iceberg);
12776 /// ```
12777 pub fn set_table_format<
12778 T: std::convert::Into<
12779 crate::model::big_query_destination_config::blmt_config::TableFormat,
12780 >,
12781 >(
12782 mut self,
12783 v: T,
12784 ) -> Self {
12785 self.table_format = v.into();
12786 self
12787 }
12788 }
12789
12790 impl wkt::message::Message for BlmtConfig {
12791 fn typename() -> &'static str {
12792 "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig"
12793 }
12794 }
12795
12796 /// Defines additional types related to [BlmtConfig].
12797 pub mod blmt_config {
12798 #[allow(unused_imports)]
12799 use super::*;
12800
12801 /// Supported file formats for BigLake managed tables.
12802 ///
12803 /// # Working with unknown values
12804 ///
12805 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12806 /// additional enum variants at any time. Adding new variants is not considered
12807 /// a breaking change. Applications should write their code in anticipation of:
12808 ///
12809 /// - New values appearing in future releases of the client library, **and**
12810 /// - New values received dynamically, without application changes.
12811 ///
12812 /// Please consult the [Working with enums] section in the user guide for some
12813 /// guidelines.
12814 ///
12815 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12816 #[derive(Clone, Debug, PartialEq)]
12817 #[non_exhaustive]
12818 pub enum FileFormat {
12819 /// Default value.
12820 Unspecified,
12821 /// Parquet file format.
12822 Parquet,
12823 /// If set, the enum was initialized with an unknown value.
12824 ///
12825 /// Applications can examine the value using [FileFormat::value] or
12826 /// [FileFormat::name].
12827 UnknownValue(file_format::UnknownValue),
12828 }
12829
12830 #[doc(hidden)]
12831 pub mod file_format {
12832 #[allow(unused_imports)]
12833 use super::*;
12834 #[derive(Clone, Debug, PartialEq)]
12835 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12836 }
12837
12838 impl FileFormat {
12839 /// Gets the enum value.
12840 ///
12841 /// Returns `None` if the enum contains an unknown value deserialized from
12842 /// the string representation of enums.
12843 pub fn value(&self) -> std::option::Option<i32> {
12844 match self {
12845 Self::Unspecified => std::option::Option::Some(0),
12846 Self::Parquet => std::option::Option::Some(1),
12847 Self::UnknownValue(u) => u.0.value(),
12848 }
12849 }
12850
12851 /// Gets the enum value as a string.
12852 ///
12853 /// Returns `None` if the enum contains an unknown value deserialized from
12854 /// the integer representation of enums.
12855 pub fn name(&self) -> std::option::Option<&str> {
12856 match self {
12857 Self::Unspecified => std::option::Option::Some("FILE_FORMAT_UNSPECIFIED"),
12858 Self::Parquet => std::option::Option::Some("PARQUET"),
12859 Self::UnknownValue(u) => u.0.name(),
12860 }
12861 }
12862 }
12863
12864 impl std::default::Default for FileFormat {
12865 fn default() -> Self {
12866 use std::convert::From;
12867 Self::from(0)
12868 }
12869 }
12870
12871 impl std::fmt::Display for FileFormat {
12872 fn fmt(
12873 &self,
12874 f: &mut std::fmt::Formatter<'_>,
12875 ) -> std::result::Result<(), std::fmt::Error> {
12876 wkt::internal::display_enum(f, self.name(), self.value())
12877 }
12878 }
12879
12880 impl std::convert::From<i32> for FileFormat {
12881 fn from(value: i32) -> Self {
12882 match value {
12883 0 => Self::Unspecified,
12884 1 => Self::Parquet,
12885 _ => Self::UnknownValue(file_format::UnknownValue(
12886 wkt::internal::UnknownEnumValue::Integer(value),
12887 )),
12888 }
12889 }
12890 }
12891
12892 impl std::convert::From<&str> for FileFormat {
12893 fn from(value: &str) -> Self {
12894 use std::string::ToString;
12895 match value {
12896 "FILE_FORMAT_UNSPECIFIED" => Self::Unspecified,
12897 "PARQUET" => Self::Parquet,
12898 _ => Self::UnknownValue(file_format::UnknownValue(
12899 wkt::internal::UnknownEnumValue::String(value.to_string()),
12900 )),
12901 }
12902 }
12903 }
12904
12905 impl serde::ser::Serialize for FileFormat {
12906 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12907 where
12908 S: serde::Serializer,
12909 {
12910 match self {
12911 Self::Unspecified => serializer.serialize_i32(0),
12912 Self::Parquet => serializer.serialize_i32(1),
12913 Self::UnknownValue(u) => u.0.serialize(serializer),
12914 }
12915 }
12916 }
12917
12918 impl<'de> serde::de::Deserialize<'de> for FileFormat {
12919 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12920 where
12921 D: serde::Deserializer<'de>,
12922 {
12923 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FileFormat>::new(
12924 ".google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig.FileFormat",
12925 ))
12926 }
12927 }
12928
12929 /// Supported table formats for BigLake managed tables.
12930 ///
12931 /// # Working with unknown values
12932 ///
12933 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12934 /// additional enum variants at any time. Adding new variants is not considered
12935 /// a breaking change. Applications should write their code in anticipation of:
12936 ///
12937 /// - New values appearing in future releases of the client library, **and**
12938 /// - New values received dynamically, without application changes.
12939 ///
12940 /// Please consult the [Working with enums] section in the user guide for some
12941 /// guidelines.
12942 ///
12943 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12944 #[derive(Clone, Debug, PartialEq)]
12945 #[non_exhaustive]
12946 pub enum TableFormat {
12947 /// Default value.
12948 Unspecified,
12949 /// Iceberg table format.
12950 Iceberg,
12951 /// If set, the enum was initialized with an unknown value.
12952 ///
12953 /// Applications can examine the value using [TableFormat::value] or
12954 /// [TableFormat::name].
12955 UnknownValue(table_format::UnknownValue),
12956 }
12957
12958 #[doc(hidden)]
12959 pub mod table_format {
12960 #[allow(unused_imports)]
12961 use super::*;
12962 #[derive(Clone, Debug, PartialEq)]
12963 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12964 }
12965
12966 impl TableFormat {
12967 /// Gets the enum value.
12968 ///
12969 /// Returns `None` if the enum contains an unknown value deserialized from
12970 /// the string representation of enums.
12971 pub fn value(&self) -> std::option::Option<i32> {
12972 match self {
12973 Self::Unspecified => std::option::Option::Some(0),
12974 Self::Iceberg => std::option::Option::Some(1),
12975 Self::UnknownValue(u) => u.0.value(),
12976 }
12977 }
12978
12979 /// Gets the enum value as a string.
12980 ///
12981 /// Returns `None` if the enum contains an unknown value deserialized from
12982 /// the integer representation of enums.
12983 pub fn name(&self) -> std::option::Option<&str> {
12984 match self {
12985 Self::Unspecified => std::option::Option::Some("TABLE_FORMAT_UNSPECIFIED"),
12986 Self::Iceberg => std::option::Option::Some("ICEBERG"),
12987 Self::UnknownValue(u) => u.0.name(),
12988 }
12989 }
12990 }
12991
12992 impl std::default::Default for TableFormat {
12993 fn default() -> Self {
12994 use std::convert::From;
12995 Self::from(0)
12996 }
12997 }
12998
12999 impl std::fmt::Display for TableFormat {
13000 fn fmt(
13001 &self,
13002 f: &mut std::fmt::Formatter<'_>,
13003 ) -> std::result::Result<(), std::fmt::Error> {
13004 wkt::internal::display_enum(f, self.name(), self.value())
13005 }
13006 }
13007
13008 impl std::convert::From<i32> for TableFormat {
13009 fn from(value: i32) -> Self {
13010 match value {
13011 0 => Self::Unspecified,
13012 1 => Self::Iceberg,
13013 _ => Self::UnknownValue(table_format::UnknownValue(
13014 wkt::internal::UnknownEnumValue::Integer(value),
13015 )),
13016 }
13017 }
13018 }
13019
13020 impl std::convert::From<&str> for TableFormat {
13021 fn from(value: &str) -> Self {
13022 use std::string::ToString;
13023 match value {
13024 "TABLE_FORMAT_UNSPECIFIED" => Self::Unspecified,
13025 "ICEBERG" => Self::Iceberg,
13026 _ => Self::UnknownValue(table_format::UnknownValue(
13027 wkt::internal::UnknownEnumValue::String(value.to_string()),
13028 )),
13029 }
13030 }
13031 }
13032
13033 impl serde::ser::Serialize for TableFormat {
13034 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13035 where
13036 S: serde::Serializer,
13037 {
13038 match self {
13039 Self::Unspecified => serializer.serialize_i32(0),
13040 Self::Iceberg => serializer.serialize_i32(1),
13041 Self::UnknownValue(u) => u.0.serialize(serializer),
13042 }
13043 }
13044 }
13045
13046 impl<'de> serde::de::Deserialize<'de> for TableFormat {
13047 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13048 where
13049 D: serde::Deserializer<'de>,
13050 {
13051 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TableFormat>::new(
13052 ".google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig.TableFormat",
13053 ))
13054 }
13055 }
13056 }
13057
13058 /// AppendOnly mode defines that all changes to a table will be written to the
13059 /// destination table.
13060 #[derive(Clone, Default, PartialEq)]
13061 #[non_exhaustive]
13062 pub struct AppendOnly {
13063 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13064 }
13065
13066 impl AppendOnly {
13067 /// Creates a new default instance.
13068 pub fn new() -> Self {
13069 std::default::Default::default()
13070 }
13071 }
13072
13073 impl wkt::message::Message for AppendOnly {
13074 fn typename() -> &'static str {
13075 "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.AppendOnly"
13076 }
13077 }
13078
13079 /// Merge mode defines that all changes to a table will be merged at the
13080 /// destination table.
13081 #[derive(Clone, Default, PartialEq)]
13082 #[non_exhaustive]
13083 pub struct Merge {
13084 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13085 }
13086
13087 impl Merge {
13088 /// Creates a new default instance.
13089 pub fn new() -> Self {
13090 std::default::Default::default()
13091 }
13092 }
13093
13094 impl wkt::message::Message for Merge {
13095 fn typename() -> &'static str {
13096 "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.Merge"
13097 }
13098 }
13099
13100 /// Target dataset(s) configuration.
13101 #[derive(Clone, Debug, PartialEq)]
13102 #[non_exhaustive]
13103 pub enum DatasetConfig {
13104 /// Single destination dataset.
13105 SingleTargetDataset(
13106 std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
13107 ),
13108 /// Source hierarchy datasets.
13109 SourceHierarchyDatasets(
13110 std::boxed::Box<crate::model::big_query_destination_config::SourceHierarchyDatasets>,
13111 ),
13112 }
13113
13114 #[allow(missing_docs)]
13115 #[derive(Clone, Debug, PartialEq)]
13116 #[non_exhaustive]
13117 pub enum WriteMode {
13118 /// The standard mode
13119 Merge(std::boxed::Box<crate::model::big_query_destination_config::Merge>),
13120 /// Append only mode
13121 AppendOnly(std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>),
13122 }
13123}
13124
13125/// The configuration of the stream destination.
13126#[derive(Clone, Default, PartialEq)]
13127#[non_exhaustive]
13128pub struct DestinationConfig {
13129 /// Required. Destination connection profile resource.
13130 /// Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
13131 pub destination_connection_profile: std::string::String,
13132
13133 /// Stream configuration that is specific to the data destination type.
13134 pub destination_stream_config:
13135 std::option::Option<crate::model::destination_config::DestinationStreamConfig>,
13136
13137 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13138}
13139
13140impl DestinationConfig {
13141 /// Creates a new default instance.
13142 pub fn new() -> Self {
13143 std::default::Default::default()
13144 }
13145
13146 /// Sets the value of [destination_connection_profile][crate::model::DestinationConfig::destination_connection_profile].
13147 ///
13148 /// # Example
13149 /// ```ignore,no_run
13150 /// # use google_cloud_datastream_v1::model::DestinationConfig;
13151 /// let x = DestinationConfig::new().set_destination_connection_profile("example");
13152 /// ```
13153 pub fn set_destination_connection_profile<T: std::convert::Into<std::string::String>>(
13154 mut self,
13155 v: T,
13156 ) -> Self {
13157 self.destination_connection_profile = v.into();
13158 self
13159 }
13160
13161 /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config].
13162 ///
13163 /// Note that all the setters affecting `destination_stream_config` are mutually
13164 /// exclusive.
13165 ///
13166 /// # Example
13167 /// ```ignore,no_run
13168 /// # use google_cloud_datastream_v1::model::DestinationConfig;
13169 /// use google_cloud_datastream_v1::model::GcsDestinationConfig;
13170 /// let x = DestinationConfig::new().set_destination_stream_config(Some(
13171 /// google_cloud_datastream_v1::model::destination_config::DestinationStreamConfig::GcsDestinationConfig(GcsDestinationConfig::default().into())));
13172 /// ```
13173 pub fn set_destination_stream_config<
13174 T: std::convert::Into<
13175 std::option::Option<crate::model::destination_config::DestinationStreamConfig>,
13176 >,
13177 >(
13178 mut self,
13179 v: T,
13180 ) -> Self {
13181 self.destination_stream_config = v.into();
13182 self
13183 }
13184
13185 /// The value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
13186 /// if it holds a `GcsDestinationConfig`, `None` if the field is not set or
13187 /// holds a different branch.
13188 pub fn gcs_destination_config(
13189 &self,
13190 ) -> std::option::Option<&std::boxed::Box<crate::model::GcsDestinationConfig>> {
13191 #[allow(unreachable_patterns)]
13192 self.destination_stream_config
13193 .as_ref()
13194 .and_then(|v| match v {
13195 crate::model::destination_config::DestinationStreamConfig::GcsDestinationConfig(
13196 v,
13197 ) => std::option::Option::Some(v),
13198 _ => std::option::Option::None,
13199 })
13200 }
13201
13202 /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
13203 /// to hold a `GcsDestinationConfig`.
13204 ///
13205 /// Note that all the setters affecting `destination_stream_config` are
13206 /// mutually exclusive.
13207 ///
13208 /// # Example
13209 /// ```ignore,no_run
13210 /// # use google_cloud_datastream_v1::model::DestinationConfig;
13211 /// use google_cloud_datastream_v1::model::GcsDestinationConfig;
13212 /// let x = DestinationConfig::new().set_gcs_destination_config(GcsDestinationConfig::default()/* use setters */);
13213 /// assert!(x.gcs_destination_config().is_some());
13214 /// assert!(x.bigquery_destination_config().is_none());
13215 /// ```
13216 pub fn set_gcs_destination_config<
13217 T: std::convert::Into<std::boxed::Box<crate::model::GcsDestinationConfig>>,
13218 >(
13219 mut self,
13220 v: T,
13221 ) -> Self {
13222 self.destination_stream_config = std::option::Option::Some(
13223 crate::model::destination_config::DestinationStreamConfig::GcsDestinationConfig(
13224 v.into(),
13225 ),
13226 );
13227 self
13228 }
13229
13230 /// The value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
13231 /// if it holds a `BigqueryDestinationConfig`, `None` if the field is not set or
13232 /// holds a different branch.
13233 pub fn bigquery_destination_config(
13234 &self,
13235 ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryDestinationConfig>> {
13236 #[allow(unreachable_patterns)]
13237 self.destination_stream_config.as_ref().and_then(|v| match v {
13238 crate::model::destination_config::DestinationStreamConfig::BigqueryDestinationConfig(v) => std::option::Option::Some(v),
13239 _ => std::option::Option::None,
13240 })
13241 }
13242
13243 /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
13244 /// to hold a `BigqueryDestinationConfig`.
13245 ///
13246 /// Note that all the setters affecting `destination_stream_config` are
13247 /// mutually exclusive.
13248 ///
13249 /// # Example
13250 /// ```ignore,no_run
13251 /// # use google_cloud_datastream_v1::model::DestinationConfig;
13252 /// use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
13253 /// let x = DestinationConfig::new().set_bigquery_destination_config(BigQueryDestinationConfig::default()/* use setters */);
13254 /// assert!(x.bigquery_destination_config().is_some());
13255 /// assert!(x.gcs_destination_config().is_none());
13256 /// ```
13257 pub fn set_bigquery_destination_config<
13258 T: std::convert::Into<std::boxed::Box<crate::model::BigQueryDestinationConfig>>,
13259 >(
13260 mut self,
13261 v: T,
13262 ) -> Self {
13263 self.destination_stream_config = std::option::Option::Some(
13264 crate::model::destination_config::DestinationStreamConfig::BigqueryDestinationConfig(
13265 v.into(),
13266 ),
13267 );
13268 self
13269 }
13270}
13271
13272impl wkt::message::Message for DestinationConfig {
13273 fn typename() -> &'static str {
13274 "type.googleapis.com/google.cloud.datastream.v1.DestinationConfig"
13275 }
13276}
13277
13278/// Defines additional types related to [DestinationConfig].
13279pub mod destination_config {
13280 #[allow(unused_imports)]
13281 use super::*;
13282
13283 /// Stream configuration that is specific to the data destination type.
13284 #[derive(Clone, Debug, PartialEq)]
13285 #[non_exhaustive]
13286 pub enum DestinationStreamConfig {
13287 /// A configuration for how data should be loaded to Cloud Storage.
13288 GcsDestinationConfig(std::boxed::Box<crate::model::GcsDestinationConfig>),
13289 /// BigQuery destination configuration.
13290 BigqueryDestinationConfig(std::boxed::Box<crate::model::BigQueryDestinationConfig>),
13291 }
13292}
13293
13294/// A resource representing streaming data from a source to a destination.
13295#[derive(Clone, Default, PartialEq)]
13296#[non_exhaustive]
13297pub struct Stream {
13298 /// Output only. Identifier. The stream's name.
13299 pub name: std::string::String,
13300
13301 /// Output only. The creation time of the stream.
13302 pub create_time: std::option::Option<wkt::Timestamp>,
13303
13304 /// Output only. The last update time of the stream.
13305 pub update_time: std::option::Option<wkt::Timestamp>,
13306
13307 /// Labels.
13308 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
13309
13310 /// Required. Display name.
13311 pub display_name: std::string::String,
13312
13313 /// Required. Source connection profile configuration.
13314 pub source_config: std::option::Option<crate::model::SourceConfig>,
13315
13316 /// Required. Destination connection profile configuration.
13317 pub destination_config: std::option::Option<crate::model::DestinationConfig>,
13318
13319 /// The state of the stream.
13320 pub state: crate::model::stream::State,
13321
13322 /// Output only. Errors on the Stream.
13323 pub errors: std::vec::Vec<crate::model::Error>,
13324
13325 /// Immutable. A reference to a KMS encryption key.
13326 /// If provided, it will be used to encrypt the data.
13327 /// If left blank, data will be encrypted using an internal Stream-specific
13328 /// encryption key provisioned through KMS.
13329 pub customer_managed_encryption_key: std::option::Option<std::string::String>,
13330
13331 /// Output only. If the stream was recovered, the time of the last recovery.
13332 /// Note: This field is currently experimental.
13333 pub last_recovery_time: std::option::Option<wkt::Timestamp>,
13334
13335 /// Output only. Reserved for future use.
13336 pub satisfies_pzs: std::option::Option<bool>,
13337
13338 /// Output only. Reserved for future use.
13339 pub satisfies_pzi: std::option::Option<bool>,
13340
13341 /// Stream backfill strategy.
13342 pub backfill_strategy: std::option::Option<crate::model::stream::BackfillStrategy>,
13343
13344 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13345}
13346
13347impl Stream {
13348 /// Creates a new default instance.
13349 pub fn new() -> Self {
13350 std::default::Default::default()
13351 }
13352
13353 /// Sets the value of [name][crate::model::Stream::name].
13354 ///
13355 /// # Example
13356 /// ```ignore,no_run
13357 /// # use google_cloud_datastream_v1::model::Stream;
13358 /// let x = Stream::new().set_name("example");
13359 /// ```
13360 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13361 self.name = v.into();
13362 self
13363 }
13364
13365 /// Sets the value of [create_time][crate::model::Stream::create_time].
13366 ///
13367 /// # Example
13368 /// ```ignore,no_run
13369 /// # use google_cloud_datastream_v1::model::Stream;
13370 /// use wkt::Timestamp;
13371 /// let x = Stream::new().set_create_time(Timestamp::default()/* use setters */);
13372 /// ```
13373 pub fn set_create_time<T>(mut self, v: T) -> Self
13374 where
13375 T: std::convert::Into<wkt::Timestamp>,
13376 {
13377 self.create_time = std::option::Option::Some(v.into());
13378 self
13379 }
13380
13381 /// Sets or clears the value of [create_time][crate::model::Stream::create_time].
13382 ///
13383 /// # Example
13384 /// ```ignore,no_run
13385 /// # use google_cloud_datastream_v1::model::Stream;
13386 /// use wkt::Timestamp;
13387 /// let x = Stream::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
13388 /// let x = Stream::new().set_or_clear_create_time(None::<Timestamp>);
13389 /// ```
13390 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13391 where
13392 T: std::convert::Into<wkt::Timestamp>,
13393 {
13394 self.create_time = v.map(|x| x.into());
13395 self
13396 }
13397
13398 /// Sets the value of [update_time][crate::model::Stream::update_time].
13399 ///
13400 /// # Example
13401 /// ```ignore,no_run
13402 /// # use google_cloud_datastream_v1::model::Stream;
13403 /// use wkt::Timestamp;
13404 /// let x = Stream::new().set_update_time(Timestamp::default()/* use setters */);
13405 /// ```
13406 pub fn set_update_time<T>(mut self, v: T) -> Self
13407 where
13408 T: std::convert::Into<wkt::Timestamp>,
13409 {
13410 self.update_time = std::option::Option::Some(v.into());
13411 self
13412 }
13413
13414 /// Sets or clears the value of [update_time][crate::model::Stream::update_time].
13415 ///
13416 /// # Example
13417 /// ```ignore,no_run
13418 /// # use google_cloud_datastream_v1::model::Stream;
13419 /// use wkt::Timestamp;
13420 /// let x = Stream::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
13421 /// let x = Stream::new().set_or_clear_update_time(None::<Timestamp>);
13422 /// ```
13423 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13424 where
13425 T: std::convert::Into<wkt::Timestamp>,
13426 {
13427 self.update_time = v.map(|x| x.into());
13428 self
13429 }
13430
13431 /// Sets the value of [labels][crate::model::Stream::labels].
13432 ///
13433 /// # Example
13434 /// ```ignore,no_run
13435 /// # use google_cloud_datastream_v1::model::Stream;
13436 /// let x = Stream::new().set_labels([
13437 /// ("key0", "abc"),
13438 /// ("key1", "xyz"),
13439 /// ]);
13440 /// ```
13441 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
13442 where
13443 T: std::iter::IntoIterator<Item = (K, V)>,
13444 K: std::convert::Into<std::string::String>,
13445 V: std::convert::Into<std::string::String>,
13446 {
13447 use std::iter::Iterator;
13448 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13449 self
13450 }
13451
13452 /// Sets the value of [display_name][crate::model::Stream::display_name].
13453 ///
13454 /// # Example
13455 /// ```ignore,no_run
13456 /// # use google_cloud_datastream_v1::model::Stream;
13457 /// let x = Stream::new().set_display_name("example");
13458 /// ```
13459 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13460 self.display_name = v.into();
13461 self
13462 }
13463
13464 /// Sets the value of [source_config][crate::model::Stream::source_config].
13465 ///
13466 /// # Example
13467 /// ```ignore,no_run
13468 /// # use google_cloud_datastream_v1::model::Stream;
13469 /// use google_cloud_datastream_v1::model::SourceConfig;
13470 /// let x = Stream::new().set_source_config(SourceConfig::default()/* use setters */);
13471 /// ```
13472 pub fn set_source_config<T>(mut self, v: T) -> Self
13473 where
13474 T: std::convert::Into<crate::model::SourceConfig>,
13475 {
13476 self.source_config = std::option::Option::Some(v.into());
13477 self
13478 }
13479
13480 /// Sets or clears the value of [source_config][crate::model::Stream::source_config].
13481 ///
13482 /// # Example
13483 /// ```ignore,no_run
13484 /// # use google_cloud_datastream_v1::model::Stream;
13485 /// use google_cloud_datastream_v1::model::SourceConfig;
13486 /// let x = Stream::new().set_or_clear_source_config(Some(SourceConfig::default()/* use setters */));
13487 /// let x = Stream::new().set_or_clear_source_config(None::<SourceConfig>);
13488 /// ```
13489 pub fn set_or_clear_source_config<T>(mut self, v: std::option::Option<T>) -> Self
13490 where
13491 T: std::convert::Into<crate::model::SourceConfig>,
13492 {
13493 self.source_config = v.map(|x| x.into());
13494 self
13495 }
13496
13497 /// Sets the value of [destination_config][crate::model::Stream::destination_config].
13498 ///
13499 /// # Example
13500 /// ```ignore,no_run
13501 /// # use google_cloud_datastream_v1::model::Stream;
13502 /// use google_cloud_datastream_v1::model::DestinationConfig;
13503 /// let x = Stream::new().set_destination_config(DestinationConfig::default()/* use setters */);
13504 /// ```
13505 pub fn set_destination_config<T>(mut self, v: T) -> Self
13506 where
13507 T: std::convert::Into<crate::model::DestinationConfig>,
13508 {
13509 self.destination_config = std::option::Option::Some(v.into());
13510 self
13511 }
13512
13513 /// Sets or clears the value of [destination_config][crate::model::Stream::destination_config].
13514 ///
13515 /// # Example
13516 /// ```ignore,no_run
13517 /// # use google_cloud_datastream_v1::model::Stream;
13518 /// use google_cloud_datastream_v1::model::DestinationConfig;
13519 /// let x = Stream::new().set_or_clear_destination_config(Some(DestinationConfig::default()/* use setters */));
13520 /// let x = Stream::new().set_or_clear_destination_config(None::<DestinationConfig>);
13521 /// ```
13522 pub fn set_or_clear_destination_config<T>(mut self, v: std::option::Option<T>) -> Self
13523 where
13524 T: std::convert::Into<crate::model::DestinationConfig>,
13525 {
13526 self.destination_config = v.map(|x| x.into());
13527 self
13528 }
13529
13530 /// Sets the value of [state][crate::model::Stream::state].
13531 ///
13532 /// # Example
13533 /// ```ignore,no_run
13534 /// # use google_cloud_datastream_v1::model::Stream;
13535 /// use google_cloud_datastream_v1::model::stream::State;
13536 /// let x0 = Stream::new().set_state(State::NotStarted);
13537 /// let x1 = Stream::new().set_state(State::Running);
13538 /// let x2 = Stream::new().set_state(State::Paused);
13539 /// ```
13540 pub fn set_state<T: std::convert::Into<crate::model::stream::State>>(mut self, v: T) -> Self {
13541 self.state = v.into();
13542 self
13543 }
13544
13545 /// Sets the value of [errors][crate::model::Stream::errors].
13546 ///
13547 /// # Example
13548 /// ```ignore,no_run
13549 /// # use google_cloud_datastream_v1::model::Stream;
13550 /// use google_cloud_datastream_v1::model::Error;
13551 /// let x = Stream::new()
13552 /// .set_errors([
13553 /// Error::default()/* use setters */,
13554 /// Error::default()/* use (different) setters */,
13555 /// ]);
13556 /// ```
13557 pub fn set_errors<T, V>(mut self, v: T) -> Self
13558 where
13559 T: std::iter::IntoIterator<Item = V>,
13560 V: std::convert::Into<crate::model::Error>,
13561 {
13562 use std::iter::Iterator;
13563 self.errors = v.into_iter().map(|i| i.into()).collect();
13564 self
13565 }
13566
13567 /// Sets the value of [customer_managed_encryption_key][crate::model::Stream::customer_managed_encryption_key].
13568 ///
13569 /// # Example
13570 /// ```ignore,no_run
13571 /// # use google_cloud_datastream_v1::model::Stream;
13572 /// let x = Stream::new().set_customer_managed_encryption_key("example");
13573 /// ```
13574 pub fn set_customer_managed_encryption_key<T>(mut self, v: T) -> Self
13575 where
13576 T: std::convert::Into<std::string::String>,
13577 {
13578 self.customer_managed_encryption_key = std::option::Option::Some(v.into());
13579 self
13580 }
13581
13582 /// Sets or clears the value of [customer_managed_encryption_key][crate::model::Stream::customer_managed_encryption_key].
13583 ///
13584 /// # Example
13585 /// ```ignore,no_run
13586 /// # use google_cloud_datastream_v1::model::Stream;
13587 /// let x = Stream::new().set_or_clear_customer_managed_encryption_key(Some("example"));
13588 /// let x = Stream::new().set_or_clear_customer_managed_encryption_key(None::<String>);
13589 /// ```
13590 pub fn set_or_clear_customer_managed_encryption_key<T>(
13591 mut self,
13592 v: std::option::Option<T>,
13593 ) -> Self
13594 where
13595 T: std::convert::Into<std::string::String>,
13596 {
13597 self.customer_managed_encryption_key = v.map(|x| x.into());
13598 self
13599 }
13600
13601 /// Sets the value of [last_recovery_time][crate::model::Stream::last_recovery_time].
13602 ///
13603 /// # Example
13604 /// ```ignore,no_run
13605 /// # use google_cloud_datastream_v1::model::Stream;
13606 /// use wkt::Timestamp;
13607 /// let x = Stream::new().set_last_recovery_time(Timestamp::default()/* use setters */);
13608 /// ```
13609 pub fn set_last_recovery_time<T>(mut self, v: T) -> Self
13610 where
13611 T: std::convert::Into<wkt::Timestamp>,
13612 {
13613 self.last_recovery_time = std::option::Option::Some(v.into());
13614 self
13615 }
13616
13617 /// Sets or clears the value of [last_recovery_time][crate::model::Stream::last_recovery_time].
13618 ///
13619 /// # Example
13620 /// ```ignore,no_run
13621 /// # use google_cloud_datastream_v1::model::Stream;
13622 /// use wkt::Timestamp;
13623 /// let x = Stream::new().set_or_clear_last_recovery_time(Some(Timestamp::default()/* use setters */));
13624 /// let x = Stream::new().set_or_clear_last_recovery_time(None::<Timestamp>);
13625 /// ```
13626 pub fn set_or_clear_last_recovery_time<T>(mut self, v: std::option::Option<T>) -> Self
13627 where
13628 T: std::convert::Into<wkt::Timestamp>,
13629 {
13630 self.last_recovery_time = v.map(|x| x.into());
13631 self
13632 }
13633
13634 /// Sets the value of [satisfies_pzs][crate::model::Stream::satisfies_pzs].
13635 ///
13636 /// # Example
13637 /// ```ignore,no_run
13638 /// # use google_cloud_datastream_v1::model::Stream;
13639 /// let x = Stream::new().set_satisfies_pzs(true);
13640 /// ```
13641 pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
13642 where
13643 T: std::convert::Into<bool>,
13644 {
13645 self.satisfies_pzs = std::option::Option::Some(v.into());
13646 self
13647 }
13648
13649 /// Sets or clears the value of [satisfies_pzs][crate::model::Stream::satisfies_pzs].
13650 ///
13651 /// # Example
13652 /// ```ignore,no_run
13653 /// # use google_cloud_datastream_v1::model::Stream;
13654 /// let x = Stream::new().set_or_clear_satisfies_pzs(Some(false));
13655 /// let x = Stream::new().set_or_clear_satisfies_pzs(None::<bool>);
13656 /// ```
13657 pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
13658 where
13659 T: std::convert::Into<bool>,
13660 {
13661 self.satisfies_pzs = v.map(|x| x.into());
13662 self
13663 }
13664
13665 /// Sets the value of [satisfies_pzi][crate::model::Stream::satisfies_pzi].
13666 ///
13667 /// # Example
13668 /// ```ignore,no_run
13669 /// # use google_cloud_datastream_v1::model::Stream;
13670 /// let x = Stream::new().set_satisfies_pzi(true);
13671 /// ```
13672 pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
13673 where
13674 T: std::convert::Into<bool>,
13675 {
13676 self.satisfies_pzi = std::option::Option::Some(v.into());
13677 self
13678 }
13679
13680 /// Sets or clears the value of [satisfies_pzi][crate::model::Stream::satisfies_pzi].
13681 ///
13682 /// # Example
13683 /// ```ignore,no_run
13684 /// # use google_cloud_datastream_v1::model::Stream;
13685 /// let x = Stream::new().set_or_clear_satisfies_pzi(Some(false));
13686 /// let x = Stream::new().set_or_clear_satisfies_pzi(None::<bool>);
13687 /// ```
13688 pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
13689 where
13690 T: std::convert::Into<bool>,
13691 {
13692 self.satisfies_pzi = v.map(|x| x.into());
13693 self
13694 }
13695
13696 /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy].
13697 ///
13698 /// Note that all the setters affecting `backfill_strategy` are mutually
13699 /// exclusive.
13700 ///
13701 /// # Example
13702 /// ```ignore,no_run
13703 /// # use google_cloud_datastream_v1::model::Stream;
13704 /// use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13705 /// let x = Stream::new().set_backfill_strategy(Some(
13706 /// google_cloud_datastream_v1::model::stream::BackfillStrategy::BackfillAll(BackfillAllStrategy::default().into())));
13707 /// ```
13708 pub fn set_backfill_strategy<
13709 T: std::convert::Into<std::option::Option<crate::model::stream::BackfillStrategy>>,
13710 >(
13711 mut self,
13712 v: T,
13713 ) -> Self {
13714 self.backfill_strategy = v.into();
13715 self
13716 }
13717
13718 /// The value of [backfill_strategy][crate::model::Stream::backfill_strategy]
13719 /// if it holds a `BackfillAll`, `None` if the field is not set or
13720 /// holds a different branch.
13721 pub fn backfill_all(
13722 &self,
13723 ) -> std::option::Option<&std::boxed::Box<crate::model::stream::BackfillAllStrategy>> {
13724 #[allow(unreachable_patterns)]
13725 self.backfill_strategy.as_ref().and_then(|v| match v {
13726 crate::model::stream::BackfillStrategy::BackfillAll(v) => std::option::Option::Some(v),
13727 _ => std::option::Option::None,
13728 })
13729 }
13730
13731 /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy]
13732 /// to hold a `BackfillAll`.
13733 ///
13734 /// Note that all the setters affecting `backfill_strategy` are
13735 /// mutually exclusive.
13736 ///
13737 /// # Example
13738 /// ```ignore,no_run
13739 /// # use google_cloud_datastream_v1::model::Stream;
13740 /// use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13741 /// let x = Stream::new().set_backfill_all(BackfillAllStrategy::default()/* use setters */);
13742 /// assert!(x.backfill_all().is_some());
13743 /// assert!(x.backfill_none().is_none());
13744 /// ```
13745 pub fn set_backfill_all<
13746 T: std::convert::Into<std::boxed::Box<crate::model::stream::BackfillAllStrategy>>,
13747 >(
13748 mut self,
13749 v: T,
13750 ) -> Self {
13751 self.backfill_strategy = std::option::Option::Some(
13752 crate::model::stream::BackfillStrategy::BackfillAll(v.into()),
13753 );
13754 self
13755 }
13756
13757 /// The value of [backfill_strategy][crate::model::Stream::backfill_strategy]
13758 /// if it holds a `BackfillNone`, `None` if the field is not set or
13759 /// holds a different branch.
13760 pub fn backfill_none(
13761 &self,
13762 ) -> std::option::Option<&std::boxed::Box<crate::model::stream::BackfillNoneStrategy>> {
13763 #[allow(unreachable_patterns)]
13764 self.backfill_strategy.as_ref().and_then(|v| match v {
13765 crate::model::stream::BackfillStrategy::BackfillNone(v) => std::option::Option::Some(v),
13766 _ => std::option::Option::None,
13767 })
13768 }
13769
13770 /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy]
13771 /// to hold a `BackfillNone`.
13772 ///
13773 /// Note that all the setters affecting `backfill_strategy` are
13774 /// mutually exclusive.
13775 ///
13776 /// # Example
13777 /// ```ignore,no_run
13778 /// # use google_cloud_datastream_v1::model::Stream;
13779 /// use google_cloud_datastream_v1::model::stream::BackfillNoneStrategy;
13780 /// let x = Stream::new().set_backfill_none(BackfillNoneStrategy::default()/* use setters */);
13781 /// assert!(x.backfill_none().is_some());
13782 /// assert!(x.backfill_all().is_none());
13783 /// ```
13784 pub fn set_backfill_none<
13785 T: std::convert::Into<std::boxed::Box<crate::model::stream::BackfillNoneStrategy>>,
13786 >(
13787 mut self,
13788 v: T,
13789 ) -> Self {
13790 self.backfill_strategy = std::option::Option::Some(
13791 crate::model::stream::BackfillStrategy::BackfillNone(v.into()),
13792 );
13793 self
13794 }
13795}
13796
13797impl wkt::message::Message for Stream {
13798 fn typename() -> &'static str {
13799 "type.googleapis.com/google.cloud.datastream.v1.Stream"
13800 }
13801}
13802
13803/// Defines additional types related to [Stream].
13804pub mod stream {
13805 #[allow(unused_imports)]
13806 use super::*;
13807
13808 /// Backfill strategy to automatically backfill the Stream's objects.
13809 /// Specific objects can be excluded.
13810 #[derive(Clone, Default, PartialEq)]
13811 #[non_exhaustive]
13812 pub struct BackfillAllStrategy {
13813 /// List of objects to exclude.
13814 pub excluded_objects:
13815 std::option::Option<crate::model::stream::backfill_all_strategy::ExcludedObjects>,
13816
13817 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13818 }
13819
13820 impl BackfillAllStrategy {
13821 /// Creates a new default instance.
13822 pub fn new() -> Self {
13823 std::default::Default::default()
13824 }
13825
13826 /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects].
13827 ///
13828 /// Note that all the setters affecting `excluded_objects` are mutually
13829 /// exclusive.
13830 ///
13831 /// # Example
13832 /// ```ignore,no_run
13833 /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13834 /// use google_cloud_datastream_v1::model::OracleRdbms;
13835 /// let x = BackfillAllStrategy::new().set_excluded_objects(Some(
13836 /// google_cloud_datastream_v1::model::stream::backfill_all_strategy::ExcludedObjects::OracleExcludedObjects(OracleRdbms::default().into())));
13837 /// ```
13838 pub fn set_excluded_objects<
13839 T: std::convert::Into<
13840 std::option::Option<
13841 crate::model::stream::backfill_all_strategy::ExcludedObjects,
13842 >,
13843 >,
13844 >(
13845 mut self,
13846 v: T,
13847 ) -> Self {
13848 self.excluded_objects = v.into();
13849 self
13850 }
13851
13852 /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13853 /// if it holds a `OracleExcludedObjects`, `None` if the field is not set or
13854 /// holds a different branch.
13855 pub fn oracle_excluded_objects(
13856 &self,
13857 ) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
13858 #[allow(unreachable_patterns)]
13859 self.excluded_objects.as_ref().and_then(|v| match v {
13860 crate::model::stream::backfill_all_strategy::ExcludedObjects::OracleExcludedObjects(v) => std::option::Option::Some(v),
13861 _ => std::option::Option::None,
13862 })
13863 }
13864
13865 /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13866 /// to hold a `OracleExcludedObjects`.
13867 ///
13868 /// Note that all the setters affecting `excluded_objects` are
13869 /// mutually exclusive.
13870 ///
13871 /// # Example
13872 /// ```ignore,no_run
13873 /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13874 /// use google_cloud_datastream_v1::model::OracleRdbms;
13875 /// let x = BackfillAllStrategy::new().set_oracle_excluded_objects(OracleRdbms::default()/* use setters */);
13876 /// assert!(x.oracle_excluded_objects().is_some());
13877 /// assert!(x.mysql_excluded_objects().is_none());
13878 /// assert!(x.postgresql_excluded_objects().is_none());
13879 /// assert!(x.sql_server_excluded_objects().is_none());
13880 /// assert!(x.salesforce_excluded_objects().is_none());
13881 /// assert!(x.mongodb_excluded_objects().is_none());
13882 /// ```
13883 pub fn set_oracle_excluded_objects<
13884 T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>,
13885 >(
13886 mut self,
13887 v: T,
13888 ) -> Self {
13889 self.excluded_objects = std::option::Option::Some(
13890 crate::model::stream::backfill_all_strategy::ExcludedObjects::OracleExcludedObjects(
13891 v.into(),
13892 ),
13893 );
13894 self
13895 }
13896
13897 /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13898 /// if it holds a `MysqlExcludedObjects`, `None` if the field is not set or
13899 /// holds a different branch.
13900 pub fn mysql_excluded_objects(
13901 &self,
13902 ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
13903 #[allow(unreachable_patterns)]
13904 self.excluded_objects.as_ref().and_then(|v| match v {
13905 crate::model::stream::backfill_all_strategy::ExcludedObjects::MysqlExcludedObjects(v) => std::option::Option::Some(v),
13906 _ => std::option::Option::None,
13907 })
13908 }
13909
13910 /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13911 /// to hold a `MysqlExcludedObjects`.
13912 ///
13913 /// Note that all the setters affecting `excluded_objects` are
13914 /// mutually exclusive.
13915 ///
13916 /// # Example
13917 /// ```ignore,no_run
13918 /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13919 /// use google_cloud_datastream_v1::model::MysqlRdbms;
13920 /// let x = BackfillAllStrategy::new().set_mysql_excluded_objects(MysqlRdbms::default()/* use setters */);
13921 /// assert!(x.mysql_excluded_objects().is_some());
13922 /// assert!(x.oracle_excluded_objects().is_none());
13923 /// assert!(x.postgresql_excluded_objects().is_none());
13924 /// assert!(x.sql_server_excluded_objects().is_none());
13925 /// assert!(x.salesforce_excluded_objects().is_none());
13926 /// assert!(x.mongodb_excluded_objects().is_none());
13927 /// ```
13928 pub fn set_mysql_excluded_objects<
13929 T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>,
13930 >(
13931 mut self,
13932 v: T,
13933 ) -> Self {
13934 self.excluded_objects = std::option::Option::Some(
13935 crate::model::stream::backfill_all_strategy::ExcludedObjects::MysqlExcludedObjects(
13936 v.into(),
13937 ),
13938 );
13939 self
13940 }
13941
13942 /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13943 /// if it holds a `PostgresqlExcludedObjects`, `None` if the field is not set or
13944 /// holds a different branch.
13945 pub fn postgresql_excluded_objects(
13946 &self,
13947 ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
13948 #[allow(unreachable_patterns)]
13949 self.excluded_objects.as_ref().and_then(|v| match v {
13950 crate::model::stream::backfill_all_strategy::ExcludedObjects::PostgresqlExcludedObjects(v) => std::option::Option::Some(v),
13951 _ => std::option::Option::None,
13952 })
13953 }
13954
13955 /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13956 /// to hold a `PostgresqlExcludedObjects`.
13957 ///
13958 /// Note that all the setters affecting `excluded_objects` are
13959 /// mutually exclusive.
13960 ///
13961 /// # Example
13962 /// ```ignore,no_run
13963 /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13964 /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
13965 /// let x = BackfillAllStrategy::new().set_postgresql_excluded_objects(PostgresqlRdbms::default()/* use setters */);
13966 /// assert!(x.postgresql_excluded_objects().is_some());
13967 /// assert!(x.oracle_excluded_objects().is_none());
13968 /// assert!(x.mysql_excluded_objects().is_none());
13969 /// assert!(x.sql_server_excluded_objects().is_none());
13970 /// assert!(x.salesforce_excluded_objects().is_none());
13971 /// assert!(x.mongodb_excluded_objects().is_none());
13972 /// ```
13973 pub fn set_postgresql_excluded_objects<
13974 T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
13975 >(
13976 mut self,
13977 v: T,
13978 ) -> Self {
13979 self.excluded_objects = std::option::Option::Some(
13980 crate::model::stream::backfill_all_strategy::ExcludedObjects::PostgresqlExcludedObjects(
13981 v.into()
13982 )
13983 );
13984 self
13985 }
13986
13987 /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13988 /// if it holds a `SqlServerExcludedObjects`, `None` if the field is not set or
13989 /// holds a different branch.
13990 pub fn sql_server_excluded_objects(
13991 &self,
13992 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
13993 #[allow(unreachable_patterns)]
13994 self.excluded_objects.as_ref().and_then(|v| match v {
13995 crate::model::stream::backfill_all_strategy::ExcludedObjects::SqlServerExcludedObjects(v) => std::option::Option::Some(v),
13996 _ => std::option::Option::None,
13997 })
13998 }
13999
14000 /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
14001 /// to hold a `SqlServerExcludedObjects`.
14002 ///
14003 /// Note that all the setters affecting `excluded_objects` are
14004 /// mutually exclusive.
14005 ///
14006 /// # Example
14007 /// ```ignore,no_run
14008 /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
14009 /// use google_cloud_datastream_v1::model::SqlServerRdbms;
14010 /// let x = BackfillAllStrategy::new().set_sql_server_excluded_objects(SqlServerRdbms::default()/* use setters */);
14011 /// assert!(x.sql_server_excluded_objects().is_some());
14012 /// assert!(x.oracle_excluded_objects().is_none());
14013 /// assert!(x.mysql_excluded_objects().is_none());
14014 /// assert!(x.postgresql_excluded_objects().is_none());
14015 /// assert!(x.salesforce_excluded_objects().is_none());
14016 /// assert!(x.mongodb_excluded_objects().is_none());
14017 /// ```
14018 pub fn set_sql_server_excluded_objects<
14019 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
14020 >(
14021 mut self,
14022 v: T,
14023 ) -> Self {
14024 self.excluded_objects = std::option::Option::Some(
14025 crate::model::stream::backfill_all_strategy::ExcludedObjects::SqlServerExcludedObjects(
14026 v.into()
14027 )
14028 );
14029 self
14030 }
14031
14032 /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
14033 /// if it holds a `SalesforceExcludedObjects`, `None` if the field is not set or
14034 /// holds a different branch.
14035 pub fn salesforce_excluded_objects(
14036 &self,
14037 ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceOrg>> {
14038 #[allow(unreachable_patterns)]
14039 self.excluded_objects.as_ref().and_then(|v| match v {
14040 crate::model::stream::backfill_all_strategy::ExcludedObjects::SalesforceExcludedObjects(v) => std::option::Option::Some(v),
14041 _ => std::option::Option::None,
14042 })
14043 }
14044
14045 /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
14046 /// to hold a `SalesforceExcludedObjects`.
14047 ///
14048 /// Note that all the setters affecting `excluded_objects` are
14049 /// mutually exclusive.
14050 ///
14051 /// # Example
14052 /// ```ignore,no_run
14053 /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
14054 /// use google_cloud_datastream_v1::model::SalesforceOrg;
14055 /// let x = BackfillAllStrategy::new().set_salesforce_excluded_objects(SalesforceOrg::default()/* use setters */);
14056 /// assert!(x.salesforce_excluded_objects().is_some());
14057 /// assert!(x.oracle_excluded_objects().is_none());
14058 /// assert!(x.mysql_excluded_objects().is_none());
14059 /// assert!(x.postgresql_excluded_objects().is_none());
14060 /// assert!(x.sql_server_excluded_objects().is_none());
14061 /// assert!(x.mongodb_excluded_objects().is_none());
14062 /// ```
14063 pub fn set_salesforce_excluded_objects<
14064 T: std::convert::Into<std::boxed::Box<crate::model::SalesforceOrg>>,
14065 >(
14066 mut self,
14067 v: T,
14068 ) -> Self {
14069 self.excluded_objects = std::option::Option::Some(
14070 crate::model::stream::backfill_all_strategy::ExcludedObjects::SalesforceExcludedObjects(
14071 v.into()
14072 )
14073 );
14074 self
14075 }
14076
14077 /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
14078 /// if it holds a `MongodbExcludedObjects`, `None` if the field is not set or
14079 /// holds a different branch.
14080 pub fn mongodb_excluded_objects(
14081 &self,
14082 ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbCluster>> {
14083 #[allow(unreachable_patterns)]
14084 self.excluded_objects.as_ref().and_then(|v| match v {
14085 crate::model::stream::backfill_all_strategy::ExcludedObjects::MongodbExcludedObjects(v) => std::option::Option::Some(v),
14086 _ => std::option::Option::None,
14087 })
14088 }
14089
14090 /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
14091 /// to hold a `MongodbExcludedObjects`.
14092 ///
14093 /// Note that all the setters affecting `excluded_objects` are
14094 /// mutually exclusive.
14095 ///
14096 /// # Example
14097 /// ```ignore,no_run
14098 /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
14099 /// use google_cloud_datastream_v1::model::MongodbCluster;
14100 /// let x = BackfillAllStrategy::new().set_mongodb_excluded_objects(MongodbCluster::default()/* use setters */);
14101 /// assert!(x.mongodb_excluded_objects().is_some());
14102 /// assert!(x.oracle_excluded_objects().is_none());
14103 /// assert!(x.mysql_excluded_objects().is_none());
14104 /// assert!(x.postgresql_excluded_objects().is_none());
14105 /// assert!(x.sql_server_excluded_objects().is_none());
14106 /// assert!(x.salesforce_excluded_objects().is_none());
14107 /// ```
14108 pub fn set_mongodb_excluded_objects<
14109 T: std::convert::Into<std::boxed::Box<crate::model::MongodbCluster>>,
14110 >(
14111 mut self,
14112 v: T,
14113 ) -> Self {
14114 self.excluded_objects = std::option::Option::Some(
14115 crate::model::stream::backfill_all_strategy::ExcludedObjects::MongodbExcludedObjects(
14116 v.into()
14117 )
14118 );
14119 self
14120 }
14121 }
14122
14123 impl wkt::message::Message for BackfillAllStrategy {
14124 fn typename() -> &'static str {
14125 "type.googleapis.com/google.cloud.datastream.v1.Stream.BackfillAllStrategy"
14126 }
14127 }
14128
14129 /// Defines additional types related to [BackfillAllStrategy].
14130 pub mod backfill_all_strategy {
14131 #[allow(unused_imports)]
14132 use super::*;
14133
14134 /// List of objects to exclude.
14135 #[derive(Clone, Debug, PartialEq)]
14136 #[non_exhaustive]
14137 pub enum ExcludedObjects {
14138 /// Oracle data source objects to avoid backfilling.
14139 OracleExcludedObjects(std::boxed::Box<crate::model::OracleRdbms>),
14140 /// MySQL data source objects to avoid backfilling.
14141 MysqlExcludedObjects(std::boxed::Box<crate::model::MysqlRdbms>),
14142 /// PostgreSQL data source objects to avoid backfilling.
14143 PostgresqlExcludedObjects(std::boxed::Box<crate::model::PostgresqlRdbms>),
14144 /// SQLServer data source objects to avoid backfilling
14145 SqlServerExcludedObjects(std::boxed::Box<crate::model::SqlServerRdbms>),
14146 /// Salesforce data source objects to avoid backfilling
14147 SalesforceExcludedObjects(std::boxed::Box<crate::model::SalesforceOrg>),
14148 /// MongoDB data source objects to avoid backfilling
14149 MongodbExcludedObjects(std::boxed::Box<crate::model::MongodbCluster>),
14150 }
14151 }
14152
14153 /// Backfill strategy to disable automatic backfill for the Stream's objects.
14154 #[derive(Clone, Default, PartialEq)]
14155 #[non_exhaustive]
14156 pub struct BackfillNoneStrategy {
14157 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14158 }
14159
14160 impl BackfillNoneStrategy {
14161 /// Creates a new default instance.
14162 pub fn new() -> Self {
14163 std::default::Default::default()
14164 }
14165 }
14166
14167 impl wkt::message::Message for BackfillNoneStrategy {
14168 fn typename() -> &'static str {
14169 "type.googleapis.com/google.cloud.datastream.v1.Stream.BackfillNoneStrategy"
14170 }
14171 }
14172
14173 /// Stream state.
14174 ///
14175 /// # Working with unknown values
14176 ///
14177 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14178 /// additional enum variants at any time. Adding new variants is not considered
14179 /// a breaking change. Applications should write their code in anticipation of:
14180 ///
14181 /// - New values appearing in future releases of the client library, **and**
14182 /// - New values received dynamically, without application changes.
14183 ///
14184 /// Please consult the [Working with enums] section in the user guide for some
14185 /// guidelines.
14186 ///
14187 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14188 #[derive(Clone, Debug, PartialEq)]
14189 #[non_exhaustive]
14190 pub enum State {
14191 /// Unspecified stream state.
14192 Unspecified,
14193 /// The stream has been created but has not yet started streaming data.
14194 NotStarted,
14195 /// The stream is running.
14196 Running,
14197 /// The stream is paused.
14198 Paused,
14199 /// The stream is in maintenance mode.
14200 ///
14201 /// Updates are rejected on the resource in this state.
14202 Maintenance,
14203 /// The stream is experiencing an error that is preventing data from being
14204 /// streamed.
14205 Failed,
14206 /// The stream has experienced a terminal failure.
14207 FailedPermanently,
14208 /// The stream is starting, but not yet running.
14209 Starting,
14210 /// The Stream is no longer reading new events, but still writing events in
14211 /// the buffer.
14212 Draining,
14213 /// If set, the enum was initialized with an unknown value.
14214 ///
14215 /// Applications can examine the value using [State::value] or
14216 /// [State::name].
14217 UnknownValue(state::UnknownValue),
14218 }
14219
14220 #[doc(hidden)]
14221 pub mod state {
14222 #[allow(unused_imports)]
14223 use super::*;
14224 #[derive(Clone, Debug, PartialEq)]
14225 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14226 }
14227
14228 impl State {
14229 /// Gets the enum value.
14230 ///
14231 /// Returns `None` if the enum contains an unknown value deserialized from
14232 /// the string representation of enums.
14233 pub fn value(&self) -> std::option::Option<i32> {
14234 match self {
14235 Self::Unspecified => std::option::Option::Some(0),
14236 Self::NotStarted => std::option::Option::Some(1),
14237 Self::Running => std::option::Option::Some(2),
14238 Self::Paused => std::option::Option::Some(3),
14239 Self::Maintenance => std::option::Option::Some(4),
14240 Self::Failed => std::option::Option::Some(5),
14241 Self::FailedPermanently => std::option::Option::Some(6),
14242 Self::Starting => std::option::Option::Some(7),
14243 Self::Draining => std::option::Option::Some(8),
14244 Self::UnknownValue(u) => u.0.value(),
14245 }
14246 }
14247
14248 /// Gets the enum value as a string.
14249 ///
14250 /// Returns `None` if the enum contains an unknown value deserialized from
14251 /// the integer representation of enums.
14252 pub fn name(&self) -> std::option::Option<&str> {
14253 match self {
14254 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14255 Self::NotStarted => std::option::Option::Some("NOT_STARTED"),
14256 Self::Running => std::option::Option::Some("RUNNING"),
14257 Self::Paused => std::option::Option::Some("PAUSED"),
14258 Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
14259 Self::Failed => std::option::Option::Some("FAILED"),
14260 Self::FailedPermanently => std::option::Option::Some("FAILED_PERMANENTLY"),
14261 Self::Starting => std::option::Option::Some("STARTING"),
14262 Self::Draining => std::option::Option::Some("DRAINING"),
14263 Self::UnknownValue(u) => u.0.name(),
14264 }
14265 }
14266 }
14267
14268 impl std::default::Default for State {
14269 fn default() -> Self {
14270 use std::convert::From;
14271 Self::from(0)
14272 }
14273 }
14274
14275 impl std::fmt::Display for State {
14276 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14277 wkt::internal::display_enum(f, self.name(), self.value())
14278 }
14279 }
14280
14281 impl std::convert::From<i32> for State {
14282 fn from(value: i32) -> Self {
14283 match value {
14284 0 => Self::Unspecified,
14285 1 => Self::NotStarted,
14286 2 => Self::Running,
14287 3 => Self::Paused,
14288 4 => Self::Maintenance,
14289 5 => Self::Failed,
14290 6 => Self::FailedPermanently,
14291 7 => Self::Starting,
14292 8 => Self::Draining,
14293 _ => Self::UnknownValue(state::UnknownValue(
14294 wkt::internal::UnknownEnumValue::Integer(value),
14295 )),
14296 }
14297 }
14298 }
14299
14300 impl std::convert::From<&str> for State {
14301 fn from(value: &str) -> Self {
14302 use std::string::ToString;
14303 match value {
14304 "STATE_UNSPECIFIED" => Self::Unspecified,
14305 "NOT_STARTED" => Self::NotStarted,
14306 "RUNNING" => Self::Running,
14307 "PAUSED" => Self::Paused,
14308 "MAINTENANCE" => Self::Maintenance,
14309 "FAILED" => Self::Failed,
14310 "FAILED_PERMANENTLY" => Self::FailedPermanently,
14311 "STARTING" => Self::Starting,
14312 "DRAINING" => Self::Draining,
14313 _ => Self::UnknownValue(state::UnknownValue(
14314 wkt::internal::UnknownEnumValue::String(value.to_string()),
14315 )),
14316 }
14317 }
14318 }
14319
14320 impl serde::ser::Serialize for State {
14321 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14322 where
14323 S: serde::Serializer,
14324 {
14325 match self {
14326 Self::Unspecified => serializer.serialize_i32(0),
14327 Self::NotStarted => serializer.serialize_i32(1),
14328 Self::Running => serializer.serialize_i32(2),
14329 Self::Paused => serializer.serialize_i32(3),
14330 Self::Maintenance => serializer.serialize_i32(4),
14331 Self::Failed => serializer.serialize_i32(5),
14332 Self::FailedPermanently => serializer.serialize_i32(6),
14333 Self::Starting => serializer.serialize_i32(7),
14334 Self::Draining => serializer.serialize_i32(8),
14335 Self::UnknownValue(u) => u.0.serialize(serializer),
14336 }
14337 }
14338 }
14339
14340 impl<'de> serde::de::Deserialize<'de> for State {
14341 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14342 where
14343 D: serde::Deserializer<'de>,
14344 {
14345 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14346 ".google.cloud.datastream.v1.Stream.State",
14347 ))
14348 }
14349 }
14350
14351 /// Stream backfill strategy.
14352 #[derive(Clone, Debug, PartialEq)]
14353 #[non_exhaustive]
14354 pub enum BackfillStrategy {
14355 /// Automatically backfill objects included in the stream source
14356 /// configuration. Specific objects can be excluded.
14357 BackfillAll(std::boxed::Box<crate::model::stream::BackfillAllStrategy>),
14358 /// Do not automatically backfill any objects.
14359 BackfillNone(std::boxed::Box<crate::model::stream::BackfillNoneStrategy>),
14360 }
14361}
14362
14363/// A specific stream object (e.g a specific DB table).
14364#[derive(Clone, Default, PartialEq)]
14365#[non_exhaustive]
14366pub struct StreamObject {
14367 /// Output only. Identifier. The object resource's name.
14368 pub name: std::string::String,
14369
14370 /// Output only. The creation time of the object.
14371 pub create_time: std::option::Option<wkt::Timestamp>,
14372
14373 /// Output only. The last update time of the object.
14374 pub update_time: std::option::Option<wkt::Timestamp>,
14375
14376 /// Required. Display name.
14377 pub display_name: std::string::String,
14378
14379 /// Output only. Active errors on the object.
14380 pub errors: std::vec::Vec<crate::model::Error>,
14381
14382 /// The latest backfill job that was initiated for the stream object.
14383 pub backfill_job: std::option::Option<crate::model::BackfillJob>,
14384
14385 /// The object identifier in the data source.
14386 pub source_object: std::option::Option<crate::model::SourceObjectIdentifier>,
14387
14388 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14389}
14390
14391impl StreamObject {
14392 /// Creates a new default instance.
14393 pub fn new() -> Self {
14394 std::default::Default::default()
14395 }
14396
14397 /// Sets the value of [name][crate::model::StreamObject::name].
14398 ///
14399 /// # Example
14400 /// ```ignore,no_run
14401 /// # use google_cloud_datastream_v1::model::StreamObject;
14402 /// let x = StreamObject::new().set_name("example");
14403 /// ```
14404 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14405 self.name = v.into();
14406 self
14407 }
14408
14409 /// Sets the value of [create_time][crate::model::StreamObject::create_time].
14410 ///
14411 /// # Example
14412 /// ```ignore,no_run
14413 /// # use google_cloud_datastream_v1::model::StreamObject;
14414 /// use wkt::Timestamp;
14415 /// let x = StreamObject::new().set_create_time(Timestamp::default()/* use setters */);
14416 /// ```
14417 pub fn set_create_time<T>(mut self, v: T) -> Self
14418 where
14419 T: std::convert::Into<wkt::Timestamp>,
14420 {
14421 self.create_time = std::option::Option::Some(v.into());
14422 self
14423 }
14424
14425 /// Sets or clears the value of [create_time][crate::model::StreamObject::create_time].
14426 ///
14427 /// # Example
14428 /// ```ignore,no_run
14429 /// # use google_cloud_datastream_v1::model::StreamObject;
14430 /// use wkt::Timestamp;
14431 /// let x = StreamObject::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
14432 /// let x = StreamObject::new().set_or_clear_create_time(None::<Timestamp>);
14433 /// ```
14434 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14435 where
14436 T: std::convert::Into<wkt::Timestamp>,
14437 {
14438 self.create_time = v.map(|x| x.into());
14439 self
14440 }
14441
14442 /// Sets the value of [update_time][crate::model::StreamObject::update_time].
14443 ///
14444 /// # Example
14445 /// ```ignore,no_run
14446 /// # use google_cloud_datastream_v1::model::StreamObject;
14447 /// use wkt::Timestamp;
14448 /// let x = StreamObject::new().set_update_time(Timestamp::default()/* use setters */);
14449 /// ```
14450 pub fn set_update_time<T>(mut self, v: T) -> Self
14451 where
14452 T: std::convert::Into<wkt::Timestamp>,
14453 {
14454 self.update_time = std::option::Option::Some(v.into());
14455 self
14456 }
14457
14458 /// Sets or clears the value of [update_time][crate::model::StreamObject::update_time].
14459 ///
14460 /// # Example
14461 /// ```ignore,no_run
14462 /// # use google_cloud_datastream_v1::model::StreamObject;
14463 /// use wkt::Timestamp;
14464 /// let x = StreamObject::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
14465 /// let x = StreamObject::new().set_or_clear_update_time(None::<Timestamp>);
14466 /// ```
14467 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
14468 where
14469 T: std::convert::Into<wkt::Timestamp>,
14470 {
14471 self.update_time = v.map(|x| x.into());
14472 self
14473 }
14474
14475 /// Sets the value of [display_name][crate::model::StreamObject::display_name].
14476 ///
14477 /// # Example
14478 /// ```ignore,no_run
14479 /// # use google_cloud_datastream_v1::model::StreamObject;
14480 /// let x = StreamObject::new().set_display_name("example");
14481 /// ```
14482 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14483 self.display_name = v.into();
14484 self
14485 }
14486
14487 /// Sets the value of [errors][crate::model::StreamObject::errors].
14488 ///
14489 /// # Example
14490 /// ```ignore,no_run
14491 /// # use google_cloud_datastream_v1::model::StreamObject;
14492 /// use google_cloud_datastream_v1::model::Error;
14493 /// let x = StreamObject::new()
14494 /// .set_errors([
14495 /// Error::default()/* use setters */,
14496 /// Error::default()/* use (different) setters */,
14497 /// ]);
14498 /// ```
14499 pub fn set_errors<T, V>(mut self, v: T) -> Self
14500 where
14501 T: std::iter::IntoIterator<Item = V>,
14502 V: std::convert::Into<crate::model::Error>,
14503 {
14504 use std::iter::Iterator;
14505 self.errors = v.into_iter().map(|i| i.into()).collect();
14506 self
14507 }
14508
14509 /// Sets the value of [backfill_job][crate::model::StreamObject::backfill_job].
14510 ///
14511 /// # Example
14512 /// ```ignore,no_run
14513 /// # use google_cloud_datastream_v1::model::StreamObject;
14514 /// use google_cloud_datastream_v1::model::BackfillJob;
14515 /// let x = StreamObject::new().set_backfill_job(BackfillJob::default()/* use setters */);
14516 /// ```
14517 pub fn set_backfill_job<T>(mut self, v: T) -> Self
14518 where
14519 T: std::convert::Into<crate::model::BackfillJob>,
14520 {
14521 self.backfill_job = std::option::Option::Some(v.into());
14522 self
14523 }
14524
14525 /// Sets or clears the value of [backfill_job][crate::model::StreamObject::backfill_job].
14526 ///
14527 /// # Example
14528 /// ```ignore,no_run
14529 /// # use google_cloud_datastream_v1::model::StreamObject;
14530 /// use google_cloud_datastream_v1::model::BackfillJob;
14531 /// let x = StreamObject::new().set_or_clear_backfill_job(Some(BackfillJob::default()/* use setters */));
14532 /// let x = StreamObject::new().set_or_clear_backfill_job(None::<BackfillJob>);
14533 /// ```
14534 pub fn set_or_clear_backfill_job<T>(mut self, v: std::option::Option<T>) -> Self
14535 where
14536 T: std::convert::Into<crate::model::BackfillJob>,
14537 {
14538 self.backfill_job = v.map(|x| x.into());
14539 self
14540 }
14541
14542 /// Sets the value of [source_object][crate::model::StreamObject::source_object].
14543 ///
14544 /// # Example
14545 /// ```ignore,no_run
14546 /// # use google_cloud_datastream_v1::model::StreamObject;
14547 /// use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14548 /// let x = StreamObject::new().set_source_object(SourceObjectIdentifier::default()/* use setters */);
14549 /// ```
14550 pub fn set_source_object<T>(mut self, v: T) -> Self
14551 where
14552 T: std::convert::Into<crate::model::SourceObjectIdentifier>,
14553 {
14554 self.source_object = std::option::Option::Some(v.into());
14555 self
14556 }
14557
14558 /// Sets or clears the value of [source_object][crate::model::StreamObject::source_object].
14559 ///
14560 /// # Example
14561 /// ```ignore,no_run
14562 /// # use google_cloud_datastream_v1::model::StreamObject;
14563 /// use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14564 /// let x = StreamObject::new().set_or_clear_source_object(Some(SourceObjectIdentifier::default()/* use setters */));
14565 /// let x = StreamObject::new().set_or_clear_source_object(None::<SourceObjectIdentifier>);
14566 /// ```
14567 pub fn set_or_clear_source_object<T>(mut self, v: std::option::Option<T>) -> Self
14568 where
14569 T: std::convert::Into<crate::model::SourceObjectIdentifier>,
14570 {
14571 self.source_object = v.map(|x| x.into());
14572 self
14573 }
14574}
14575
14576impl wkt::message::Message for StreamObject {
14577 fn typename() -> &'static str {
14578 "type.googleapis.com/google.cloud.datastream.v1.StreamObject"
14579 }
14580}
14581
14582/// Represents an identifier of an object in the data source.
14583#[derive(Clone, Default, PartialEq)]
14584#[non_exhaustive]
14585pub struct SourceObjectIdentifier {
14586 /// The identifier for an object in the data source.
14587 pub source_identifier:
14588 std::option::Option<crate::model::source_object_identifier::SourceIdentifier>,
14589
14590 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14591}
14592
14593impl SourceObjectIdentifier {
14594 /// Creates a new default instance.
14595 pub fn new() -> Self {
14596 std::default::Default::default()
14597 }
14598
14599 /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier].
14600 ///
14601 /// Note that all the setters affecting `source_identifier` are mutually
14602 /// exclusive.
14603 ///
14604 /// # Example
14605 /// ```ignore,no_run
14606 /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14607 /// use google_cloud_datastream_v1::model::source_object_identifier::OracleObjectIdentifier;
14608 /// let x = SourceObjectIdentifier::new().set_source_identifier(Some(
14609 /// google_cloud_datastream_v1::model::source_object_identifier::SourceIdentifier::OracleIdentifier(OracleObjectIdentifier::default().into())));
14610 /// ```
14611 pub fn set_source_identifier<
14612 T: std::convert::Into<
14613 std::option::Option<crate::model::source_object_identifier::SourceIdentifier>,
14614 >,
14615 >(
14616 mut self,
14617 v: T,
14618 ) -> Self {
14619 self.source_identifier = v.into();
14620 self
14621 }
14622
14623 /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14624 /// if it holds a `OracleIdentifier`, `None` if the field is not set or
14625 /// holds a different branch.
14626 pub fn oracle_identifier(
14627 &self,
14628 ) -> std::option::Option<
14629 &std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
14630 > {
14631 #[allow(unreachable_patterns)]
14632 self.source_identifier.as_ref().and_then(|v| match v {
14633 crate::model::source_object_identifier::SourceIdentifier::OracleIdentifier(v) => {
14634 std::option::Option::Some(v)
14635 }
14636 _ => std::option::Option::None,
14637 })
14638 }
14639
14640 /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14641 /// to hold a `OracleIdentifier`.
14642 ///
14643 /// Note that all the setters affecting `source_identifier` are
14644 /// mutually exclusive.
14645 ///
14646 /// # Example
14647 /// ```ignore,no_run
14648 /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14649 /// use google_cloud_datastream_v1::model::source_object_identifier::OracleObjectIdentifier;
14650 /// let x = SourceObjectIdentifier::new().set_oracle_identifier(OracleObjectIdentifier::default()/* use setters */);
14651 /// assert!(x.oracle_identifier().is_some());
14652 /// assert!(x.mysql_identifier().is_none());
14653 /// assert!(x.postgresql_identifier().is_none());
14654 /// assert!(x.sql_server_identifier().is_none());
14655 /// assert!(x.salesforce_identifier().is_none());
14656 /// assert!(x.mongodb_identifier().is_none());
14657 /// ```
14658 pub fn set_oracle_identifier<
14659 T: std::convert::Into<
14660 std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
14661 >,
14662 >(
14663 mut self,
14664 v: T,
14665 ) -> Self {
14666 self.source_identifier = std::option::Option::Some(
14667 crate::model::source_object_identifier::SourceIdentifier::OracleIdentifier(v.into()),
14668 );
14669 self
14670 }
14671
14672 /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14673 /// if it holds a `MysqlIdentifier`, `None` if the field is not set or
14674 /// holds a different branch.
14675 pub fn mysql_identifier(
14676 &self,
14677 ) -> std::option::Option<
14678 &std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
14679 > {
14680 #[allow(unreachable_patterns)]
14681 self.source_identifier.as_ref().and_then(|v| match v {
14682 crate::model::source_object_identifier::SourceIdentifier::MysqlIdentifier(v) => {
14683 std::option::Option::Some(v)
14684 }
14685 _ => std::option::Option::None,
14686 })
14687 }
14688
14689 /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14690 /// to hold a `MysqlIdentifier`.
14691 ///
14692 /// Note that all the setters affecting `source_identifier` are
14693 /// mutually exclusive.
14694 ///
14695 /// # Example
14696 /// ```ignore,no_run
14697 /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14698 /// use google_cloud_datastream_v1::model::source_object_identifier::MysqlObjectIdentifier;
14699 /// let x = SourceObjectIdentifier::new().set_mysql_identifier(MysqlObjectIdentifier::default()/* use setters */);
14700 /// assert!(x.mysql_identifier().is_some());
14701 /// assert!(x.oracle_identifier().is_none());
14702 /// assert!(x.postgresql_identifier().is_none());
14703 /// assert!(x.sql_server_identifier().is_none());
14704 /// assert!(x.salesforce_identifier().is_none());
14705 /// assert!(x.mongodb_identifier().is_none());
14706 /// ```
14707 pub fn set_mysql_identifier<
14708 T: std::convert::Into<
14709 std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
14710 >,
14711 >(
14712 mut self,
14713 v: T,
14714 ) -> Self {
14715 self.source_identifier = std::option::Option::Some(
14716 crate::model::source_object_identifier::SourceIdentifier::MysqlIdentifier(v.into()),
14717 );
14718 self
14719 }
14720
14721 /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14722 /// if it holds a `PostgresqlIdentifier`, `None` if the field is not set or
14723 /// holds a different branch.
14724 pub fn postgresql_identifier(
14725 &self,
14726 ) -> std::option::Option<
14727 &std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
14728 > {
14729 #[allow(unreachable_patterns)]
14730 self.source_identifier.as_ref().and_then(|v| match v {
14731 crate::model::source_object_identifier::SourceIdentifier::PostgresqlIdentifier(v) => {
14732 std::option::Option::Some(v)
14733 }
14734 _ => std::option::Option::None,
14735 })
14736 }
14737
14738 /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14739 /// to hold a `PostgresqlIdentifier`.
14740 ///
14741 /// Note that all the setters affecting `source_identifier` are
14742 /// mutually exclusive.
14743 ///
14744 /// # Example
14745 /// ```ignore,no_run
14746 /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14747 /// use google_cloud_datastream_v1::model::source_object_identifier::PostgresqlObjectIdentifier;
14748 /// let x = SourceObjectIdentifier::new().set_postgresql_identifier(PostgresqlObjectIdentifier::default()/* use setters */);
14749 /// assert!(x.postgresql_identifier().is_some());
14750 /// assert!(x.oracle_identifier().is_none());
14751 /// assert!(x.mysql_identifier().is_none());
14752 /// assert!(x.sql_server_identifier().is_none());
14753 /// assert!(x.salesforce_identifier().is_none());
14754 /// assert!(x.mongodb_identifier().is_none());
14755 /// ```
14756 pub fn set_postgresql_identifier<
14757 T: std::convert::Into<
14758 std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
14759 >,
14760 >(
14761 mut self,
14762 v: T,
14763 ) -> Self {
14764 self.source_identifier = std::option::Option::Some(
14765 crate::model::source_object_identifier::SourceIdentifier::PostgresqlIdentifier(
14766 v.into(),
14767 ),
14768 );
14769 self
14770 }
14771
14772 /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14773 /// if it holds a `SqlServerIdentifier`, `None` if the field is not set or
14774 /// holds a different branch.
14775 pub fn sql_server_identifier(
14776 &self,
14777 ) -> std::option::Option<
14778 &std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
14779 > {
14780 #[allow(unreachable_patterns)]
14781 self.source_identifier.as_ref().and_then(|v| match v {
14782 crate::model::source_object_identifier::SourceIdentifier::SqlServerIdentifier(v) => {
14783 std::option::Option::Some(v)
14784 }
14785 _ => std::option::Option::None,
14786 })
14787 }
14788
14789 /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14790 /// to hold a `SqlServerIdentifier`.
14791 ///
14792 /// Note that all the setters affecting `source_identifier` are
14793 /// mutually exclusive.
14794 ///
14795 /// # Example
14796 /// ```ignore,no_run
14797 /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14798 /// use google_cloud_datastream_v1::model::source_object_identifier::SqlServerObjectIdentifier;
14799 /// let x = SourceObjectIdentifier::new().set_sql_server_identifier(SqlServerObjectIdentifier::default()/* use setters */);
14800 /// assert!(x.sql_server_identifier().is_some());
14801 /// assert!(x.oracle_identifier().is_none());
14802 /// assert!(x.mysql_identifier().is_none());
14803 /// assert!(x.postgresql_identifier().is_none());
14804 /// assert!(x.salesforce_identifier().is_none());
14805 /// assert!(x.mongodb_identifier().is_none());
14806 /// ```
14807 pub fn set_sql_server_identifier<
14808 T: std::convert::Into<
14809 std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
14810 >,
14811 >(
14812 mut self,
14813 v: T,
14814 ) -> Self {
14815 self.source_identifier = std::option::Option::Some(
14816 crate::model::source_object_identifier::SourceIdentifier::SqlServerIdentifier(v.into()),
14817 );
14818 self
14819 }
14820
14821 /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14822 /// if it holds a `SalesforceIdentifier`, `None` if the field is not set or
14823 /// holds a different branch.
14824 pub fn salesforce_identifier(
14825 &self,
14826 ) -> std::option::Option<
14827 &std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>,
14828 > {
14829 #[allow(unreachable_patterns)]
14830 self.source_identifier.as_ref().and_then(|v| match v {
14831 crate::model::source_object_identifier::SourceIdentifier::SalesforceIdentifier(v) => {
14832 std::option::Option::Some(v)
14833 }
14834 _ => std::option::Option::None,
14835 })
14836 }
14837
14838 /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14839 /// to hold a `SalesforceIdentifier`.
14840 ///
14841 /// Note that all the setters affecting `source_identifier` are
14842 /// mutually exclusive.
14843 ///
14844 /// # Example
14845 /// ```ignore,no_run
14846 /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14847 /// use google_cloud_datastream_v1::model::source_object_identifier::SalesforceObjectIdentifier;
14848 /// let x = SourceObjectIdentifier::new().set_salesforce_identifier(SalesforceObjectIdentifier::default()/* use setters */);
14849 /// assert!(x.salesforce_identifier().is_some());
14850 /// assert!(x.oracle_identifier().is_none());
14851 /// assert!(x.mysql_identifier().is_none());
14852 /// assert!(x.postgresql_identifier().is_none());
14853 /// assert!(x.sql_server_identifier().is_none());
14854 /// assert!(x.mongodb_identifier().is_none());
14855 /// ```
14856 pub fn set_salesforce_identifier<
14857 T: std::convert::Into<
14858 std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>,
14859 >,
14860 >(
14861 mut self,
14862 v: T,
14863 ) -> Self {
14864 self.source_identifier = std::option::Option::Some(
14865 crate::model::source_object_identifier::SourceIdentifier::SalesforceIdentifier(
14866 v.into(),
14867 ),
14868 );
14869 self
14870 }
14871
14872 /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14873 /// if it holds a `MongodbIdentifier`, `None` if the field is not set or
14874 /// holds a different branch.
14875 pub fn mongodb_identifier(
14876 &self,
14877 ) -> std::option::Option<
14878 &std::boxed::Box<crate::model::source_object_identifier::MongodbObjectIdentifier>,
14879 > {
14880 #[allow(unreachable_patterns)]
14881 self.source_identifier.as_ref().and_then(|v| match v {
14882 crate::model::source_object_identifier::SourceIdentifier::MongodbIdentifier(v) => {
14883 std::option::Option::Some(v)
14884 }
14885 _ => std::option::Option::None,
14886 })
14887 }
14888
14889 /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14890 /// to hold a `MongodbIdentifier`.
14891 ///
14892 /// Note that all the setters affecting `source_identifier` are
14893 /// mutually exclusive.
14894 ///
14895 /// # Example
14896 /// ```ignore,no_run
14897 /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14898 /// use google_cloud_datastream_v1::model::source_object_identifier::MongodbObjectIdentifier;
14899 /// let x = SourceObjectIdentifier::new().set_mongodb_identifier(MongodbObjectIdentifier::default()/* use setters */);
14900 /// assert!(x.mongodb_identifier().is_some());
14901 /// assert!(x.oracle_identifier().is_none());
14902 /// assert!(x.mysql_identifier().is_none());
14903 /// assert!(x.postgresql_identifier().is_none());
14904 /// assert!(x.sql_server_identifier().is_none());
14905 /// assert!(x.salesforce_identifier().is_none());
14906 /// ```
14907 pub fn set_mongodb_identifier<
14908 T: std::convert::Into<
14909 std::boxed::Box<crate::model::source_object_identifier::MongodbObjectIdentifier>,
14910 >,
14911 >(
14912 mut self,
14913 v: T,
14914 ) -> Self {
14915 self.source_identifier = std::option::Option::Some(
14916 crate::model::source_object_identifier::SourceIdentifier::MongodbIdentifier(v.into()),
14917 );
14918 self
14919 }
14920}
14921
14922impl wkt::message::Message for SourceObjectIdentifier {
14923 fn typename() -> &'static str {
14924 "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier"
14925 }
14926}
14927
14928/// Defines additional types related to [SourceObjectIdentifier].
14929pub mod source_object_identifier {
14930 #[allow(unused_imports)]
14931 use super::*;
14932
14933 /// Oracle data source object identifier.
14934 #[derive(Clone, Default, PartialEq)]
14935 #[non_exhaustive]
14936 pub struct OracleObjectIdentifier {
14937 /// Required. The schema name.
14938 pub schema: std::string::String,
14939
14940 /// Required. The table name.
14941 pub table: std::string::String,
14942
14943 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14944 }
14945
14946 impl OracleObjectIdentifier {
14947 /// Creates a new default instance.
14948 pub fn new() -> Self {
14949 std::default::Default::default()
14950 }
14951
14952 /// Sets the value of [schema][crate::model::source_object_identifier::OracleObjectIdentifier::schema].
14953 ///
14954 /// # Example
14955 /// ```ignore,no_run
14956 /// # use google_cloud_datastream_v1::model::source_object_identifier::OracleObjectIdentifier;
14957 /// let x = OracleObjectIdentifier::new().set_schema("example");
14958 /// ```
14959 pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14960 self.schema = v.into();
14961 self
14962 }
14963
14964 /// Sets the value of [table][crate::model::source_object_identifier::OracleObjectIdentifier::table].
14965 ///
14966 /// # Example
14967 /// ```ignore,no_run
14968 /// # use google_cloud_datastream_v1::model::source_object_identifier::OracleObjectIdentifier;
14969 /// let x = OracleObjectIdentifier::new().set_table("example");
14970 /// ```
14971 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14972 self.table = v.into();
14973 self
14974 }
14975 }
14976
14977 impl wkt::message::Message for OracleObjectIdentifier {
14978 fn typename() -> &'static str {
14979 "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.OracleObjectIdentifier"
14980 }
14981 }
14982
14983 /// PostgreSQL data source object identifier.
14984 #[derive(Clone, Default, PartialEq)]
14985 #[non_exhaustive]
14986 pub struct PostgresqlObjectIdentifier {
14987 /// Required. The schema name.
14988 pub schema: std::string::String,
14989
14990 /// Required. The table name.
14991 pub table: std::string::String,
14992
14993 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14994 }
14995
14996 impl PostgresqlObjectIdentifier {
14997 /// Creates a new default instance.
14998 pub fn new() -> Self {
14999 std::default::Default::default()
15000 }
15001
15002 /// Sets the value of [schema][crate::model::source_object_identifier::PostgresqlObjectIdentifier::schema].
15003 ///
15004 /// # Example
15005 /// ```ignore,no_run
15006 /// # use google_cloud_datastream_v1::model::source_object_identifier::PostgresqlObjectIdentifier;
15007 /// let x = PostgresqlObjectIdentifier::new().set_schema("example");
15008 /// ```
15009 pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15010 self.schema = v.into();
15011 self
15012 }
15013
15014 /// Sets the value of [table][crate::model::source_object_identifier::PostgresqlObjectIdentifier::table].
15015 ///
15016 /// # Example
15017 /// ```ignore,no_run
15018 /// # use google_cloud_datastream_v1::model::source_object_identifier::PostgresqlObjectIdentifier;
15019 /// let x = PostgresqlObjectIdentifier::new().set_table("example");
15020 /// ```
15021 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15022 self.table = v.into();
15023 self
15024 }
15025 }
15026
15027 impl wkt::message::Message for PostgresqlObjectIdentifier {
15028 fn typename() -> &'static str {
15029 "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.PostgresqlObjectIdentifier"
15030 }
15031 }
15032
15033 /// Mysql data source object identifier.
15034 #[derive(Clone, Default, PartialEq)]
15035 #[non_exhaustive]
15036 pub struct MysqlObjectIdentifier {
15037 /// Required. The database name.
15038 pub database: std::string::String,
15039
15040 /// Required. The table name.
15041 pub table: std::string::String,
15042
15043 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15044 }
15045
15046 impl MysqlObjectIdentifier {
15047 /// Creates a new default instance.
15048 pub fn new() -> Self {
15049 std::default::Default::default()
15050 }
15051
15052 /// Sets the value of [database][crate::model::source_object_identifier::MysqlObjectIdentifier::database].
15053 ///
15054 /// # Example
15055 /// ```ignore,no_run
15056 /// # use google_cloud_datastream_v1::model::source_object_identifier::MysqlObjectIdentifier;
15057 /// let x = MysqlObjectIdentifier::new().set_database("example");
15058 /// ```
15059 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15060 self.database = v.into();
15061 self
15062 }
15063
15064 /// Sets the value of [table][crate::model::source_object_identifier::MysqlObjectIdentifier::table].
15065 ///
15066 /// # Example
15067 /// ```ignore,no_run
15068 /// # use google_cloud_datastream_v1::model::source_object_identifier::MysqlObjectIdentifier;
15069 /// let x = MysqlObjectIdentifier::new().set_table("example");
15070 /// ```
15071 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15072 self.table = v.into();
15073 self
15074 }
15075 }
15076
15077 impl wkt::message::Message for MysqlObjectIdentifier {
15078 fn typename() -> &'static str {
15079 "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.MysqlObjectIdentifier"
15080 }
15081 }
15082
15083 /// SQLServer data source object identifier.
15084 #[derive(Clone, Default, PartialEq)]
15085 #[non_exhaustive]
15086 pub struct SqlServerObjectIdentifier {
15087 /// Required. The schema name.
15088 pub schema: std::string::String,
15089
15090 /// Required. The table name.
15091 pub table: std::string::String,
15092
15093 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15094 }
15095
15096 impl SqlServerObjectIdentifier {
15097 /// Creates a new default instance.
15098 pub fn new() -> Self {
15099 std::default::Default::default()
15100 }
15101
15102 /// Sets the value of [schema][crate::model::source_object_identifier::SqlServerObjectIdentifier::schema].
15103 ///
15104 /// # Example
15105 /// ```ignore,no_run
15106 /// # use google_cloud_datastream_v1::model::source_object_identifier::SqlServerObjectIdentifier;
15107 /// let x = SqlServerObjectIdentifier::new().set_schema("example");
15108 /// ```
15109 pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15110 self.schema = v.into();
15111 self
15112 }
15113
15114 /// Sets the value of [table][crate::model::source_object_identifier::SqlServerObjectIdentifier::table].
15115 ///
15116 /// # Example
15117 /// ```ignore,no_run
15118 /// # use google_cloud_datastream_v1::model::source_object_identifier::SqlServerObjectIdentifier;
15119 /// let x = SqlServerObjectIdentifier::new().set_table("example");
15120 /// ```
15121 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15122 self.table = v.into();
15123 self
15124 }
15125 }
15126
15127 impl wkt::message::Message for SqlServerObjectIdentifier {
15128 fn typename() -> &'static str {
15129 "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.SqlServerObjectIdentifier"
15130 }
15131 }
15132
15133 /// Salesforce data source object identifier.
15134 #[derive(Clone, Default, PartialEq)]
15135 #[non_exhaustive]
15136 pub struct SalesforceObjectIdentifier {
15137 /// Required. The object name.
15138 pub object_name: std::string::String,
15139
15140 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15141 }
15142
15143 impl SalesforceObjectIdentifier {
15144 /// Creates a new default instance.
15145 pub fn new() -> Self {
15146 std::default::Default::default()
15147 }
15148
15149 /// Sets the value of [object_name][crate::model::source_object_identifier::SalesforceObjectIdentifier::object_name].
15150 ///
15151 /// # Example
15152 /// ```ignore,no_run
15153 /// # use google_cloud_datastream_v1::model::source_object_identifier::SalesforceObjectIdentifier;
15154 /// let x = SalesforceObjectIdentifier::new().set_object_name("example");
15155 /// ```
15156 pub fn set_object_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15157 self.object_name = v.into();
15158 self
15159 }
15160 }
15161
15162 impl wkt::message::Message for SalesforceObjectIdentifier {
15163 fn typename() -> &'static str {
15164 "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.SalesforceObjectIdentifier"
15165 }
15166 }
15167
15168 /// MongoDB data source object identifier.
15169 #[derive(Clone, Default, PartialEq)]
15170 #[non_exhaustive]
15171 pub struct MongodbObjectIdentifier {
15172 /// Required. The database name.
15173 pub database: std::string::String,
15174
15175 /// Required. The collection name.
15176 pub collection: std::string::String,
15177
15178 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15179 }
15180
15181 impl MongodbObjectIdentifier {
15182 /// Creates a new default instance.
15183 pub fn new() -> Self {
15184 std::default::Default::default()
15185 }
15186
15187 /// Sets the value of [database][crate::model::source_object_identifier::MongodbObjectIdentifier::database].
15188 ///
15189 /// # Example
15190 /// ```ignore,no_run
15191 /// # use google_cloud_datastream_v1::model::source_object_identifier::MongodbObjectIdentifier;
15192 /// let x = MongodbObjectIdentifier::new().set_database("example");
15193 /// ```
15194 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15195 self.database = v.into();
15196 self
15197 }
15198
15199 /// Sets the value of [collection][crate::model::source_object_identifier::MongodbObjectIdentifier::collection].
15200 ///
15201 /// # Example
15202 /// ```ignore,no_run
15203 /// # use google_cloud_datastream_v1::model::source_object_identifier::MongodbObjectIdentifier;
15204 /// let x = MongodbObjectIdentifier::new().set_collection("example");
15205 /// ```
15206 pub fn set_collection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15207 self.collection = v.into();
15208 self
15209 }
15210 }
15211
15212 impl wkt::message::Message for MongodbObjectIdentifier {
15213 fn typename() -> &'static str {
15214 "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.MongodbObjectIdentifier"
15215 }
15216 }
15217
15218 /// The identifier for an object in the data source.
15219 #[derive(Clone, Debug, PartialEq)]
15220 #[non_exhaustive]
15221 pub enum SourceIdentifier {
15222 /// Oracle data source object identifier.
15223 OracleIdentifier(
15224 std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
15225 ),
15226 /// Mysql data source object identifier.
15227 MysqlIdentifier(
15228 std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
15229 ),
15230 /// PostgreSQL data source object identifier.
15231 PostgresqlIdentifier(
15232 std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
15233 ),
15234 /// SQLServer data source object identifier.
15235 SqlServerIdentifier(
15236 std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
15237 ),
15238 /// Salesforce data source object identifier.
15239 SalesforceIdentifier(
15240 std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>,
15241 ),
15242 /// MongoDB data source object identifier.
15243 MongodbIdentifier(
15244 std::boxed::Box<crate::model::source_object_identifier::MongodbObjectIdentifier>,
15245 ),
15246 }
15247}
15248
15249/// Represents a backfill job on a specific stream object.
15250#[derive(Clone, Default, PartialEq)]
15251#[non_exhaustive]
15252pub struct BackfillJob {
15253 /// Output only. Backfill job state.
15254 pub state: crate::model::backfill_job::State,
15255
15256 /// Backfill job's triggering reason.
15257 pub trigger: crate::model::backfill_job::Trigger,
15258
15259 /// Output only. Backfill job's start time.
15260 pub last_start_time: std::option::Option<wkt::Timestamp>,
15261
15262 /// Output only. Backfill job's end time.
15263 pub last_end_time: std::option::Option<wkt::Timestamp>,
15264
15265 /// Output only. Errors which caused the backfill job to fail.
15266 pub errors: std::vec::Vec<crate::model::Error>,
15267
15268 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15269}
15270
15271impl BackfillJob {
15272 /// Creates a new default instance.
15273 pub fn new() -> Self {
15274 std::default::Default::default()
15275 }
15276
15277 /// Sets the value of [state][crate::model::BackfillJob::state].
15278 ///
15279 /// # Example
15280 /// ```ignore,no_run
15281 /// # use google_cloud_datastream_v1::model::BackfillJob;
15282 /// use google_cloud_datastream_v1::model::backfill_job::State;
15283 /// let x0 = BackfillJob::new().set_state(State::NotStarted);
15284 /// let x1 = BackfillJob::new().set_state(State::Pending);
15285 /// let x2 = BackfillJob::new().set_state(State::Active);
15286 /// ```
15287 pub fn set_state<T: std::convert::Into<crate::model::backfill_job::State>>(
15288 mut self,
15289 v: T,
15290 ) -> Self {
15291 self.state = v.into();
15292 self
15293 }
15294
15295 /// Sets the value of [trigger][crate::model::BackfillJob::trigger].
15296 ///
15297 /// # Example
15298 /// ```ignore,no_run
15299 /// # use google_cloud_datastream_v1::model::BackfillJob;
15300 /// use google_cloud_datastream_v1::model::backfill_job::Trigger;
15301 /// let x0 = BackfillJob::new().set_trigger(Trigger::Automatic);
15302 /// let x1 = BackfillJob::new().set_trigger(Trigger::Manual);
15303 /// ```
15304 pub fn set_trigger<T: std::convert::Into<crate::model::backfill_job::Trigger>>(
15305 mut self,
15306 v: T,
15307 ) -> Self {
15308 self.trigger = v.into();
15309 self
15310 }
15311
15312 /// Sets the value of [last_start_time][crate::model::BackfillJob::last_start_time].
15313 ///
15314 /// # Example
15315 /// ```ignore,no_run
15316 /// # use google_cloud_datastream_v1::model::BackfillJob;
15317 /// use wkt::Timestamp;
15318 /// let x = BackfillJob::new().set_last_start_time(Timestamp::default()/* use setters */);
15319 /// ```
15320 pub fn set_last_start_time<T>(mut self, v: T) -> Self
15321 where
15322 T: std::convert::Into<wkt::Timestamp>,
15323 {
15324 self.last_start_time = std::option::Option::Some(v.into());
15325 self
15326 }
15327
15328 /// Sets or clears the value of [last_start_time][crate::model::BackfillJob::last_start_time].
15329 ///
15330 /// # Example
15331 /// ```ignore,no_run
15332 /// # use google_cloud_datastream_v1::model::BackfillJob;
15333 /// use wkt::Timestamp;
15334 /// let x = BackfillJob::new().set_or_clear_last_start_time(Some(Timestamp::default()/* use setters */));
15335 /// let x = BackfillJob::new().set_or_clear_last_start_time(None::<Timestamp>);
15336 /// ```
15337 pub fn set_or_clear_last_start_time<T>(mut self, v: std::option::Option<T>) -> Self
15338 where
15339 T: std::convert::Into<wkt::Timestamp>,
15340 {
15341 self.last_start_time = v.map(|x| x.into());
15342 self
15343 }
15344
15345 /// Sets the value of [last_end_time][crate::model::BackfillJob::last_end_time].
15346 ///
15347 /// # Example
15348 /// ```ignore,no_run
15349 /// # use google_cloud_datastream_v1::model::BackfillJob;
15350 /// use wkt::Timestamp;
15351 /// let x = BackfillJob::new().set_last_end_time(Timestamp::default()/* use setters */);
15352 /// ```
15353 pub fn set_last_end_time<T>(mut self, v: T) -> Self
15354 where
15355 T: std::convert::Into<wkt::Timestamp>,
15356 {
15357 self.last_end_time = std::option::Option::Some(v.into());
15358 self
15359 }
15360
15361 /// Sets or clears the value of [last_end_time][crate::model::BackfillJob::last_end_time].
15362 ///
15363 /// # Example
15364 /// ```ignore,no_run
15365 /// # use google_cloud_datastream_v1::model::BackfillJob;
15366 /// use wkt::Timestamp;
15367 /// let x = BackfillJob::new().set_or_clear_last_end_time(Some(Timestamp::default()/* use setters */));
15368 /// let x = BackfillJob::new().set_or_clear_last_end_time(None::<Timestamp>);
15369 /// ```
15370 pub fn set_or_clear_last_end_time<T>(mut self, v: std::option::Option<T>) -> Self
15371 where
15372 T: std::convert::Into<wkt::Timestamp>,
15373 {
15374 self.last_end_time = v.map(|x| x.into());
15375 self
15376 }
15377
15378 /// Sets the value of [errors][crate::model::BackfillJob::errors].
15379 ///
15380 /// # Example
15381 /// ```ignore,no_run
15382 /// # use google_cloud_datastream_v1::model::BackfillJob;
15383 /// use google_cloud_datastream_v1::model::Error;
15384 /// let x = BackfillJob::new()
15385 /// .set_errors([
15386 /// Error::default()/* use setters */,
15387 /// Error::default()/* use (different) setters */,
15388 /// ]);
15389 /// ```
15390 pub fn set_errors<T, V>(mut self, v: T) -> Self
15391 where
15392 T: std::iter::IntoIterator<Item = V>,
15393 V: std::convert::Into<crate::model::Error>,
15394 {
15395 use std::iter::Iterator;
15396 self.errors = v.into_iter().map(|i| i.into()).collect();
15397 self
15398 }
15399}
15400
15401impl wkt::message::Message for BackfillJob {
15402 fn typename() -> &'static str {
15403 "type.googleapis.com/google.cloud.datastream.v1.BackfillJob"
15404 }
15405}
15406
15407/// Defines additional types related to [BackfillJob].
15408pub mod backfill_job {
15409 #[allow(unused_imports)]
15410 use super::*;
15411
15412 /// State of the stream object's backfill job.
15413 ///
15414 /// # Working with unknown values
15415 ///
15416 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15417 /// additional enum variants at any time. Adding new variants is not considered
15418 /// a breaking change. Applications should write their code in anticipation of:
15419 ///
15420 /// - New values appearing in future releases of the client library, **and**
15421 /// - New values received dynamically, without application changes.
15422 ///
15423 /// Please consult the [Working with enums] section in the user guide for some
15424 /// guidelines.
15425 ///
15426 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15427 #[derive(Clone, Debug, PartialEq)]
15428 #[non_exhaustive]
15429 pub enum State {
15430 /// Default value.
15431 Unspecified,
15432 /// Backfill job was never started for the stream object (stream has backfill
15433 /// strategy defined as manual or object was explicitly excluded from
15434 /// automatic backfill).
15435 NotStarted,
15436 /// Backfill job will start pending available resources.
15437 Pending,
15438 /// Backfill job is running.
15439 Active,
15440 /// Backfill job stopped (next job run will start from beginning).
15441 Stopped,
15442 /// Backfill job failed (due to an error).
15443 Failed,
15444 /// Backfill completed successfully.
15445 Completed,
15446 /// Backfill job failed since the table structure is currently unsupported
15447 /// for backfill.
15448 Unsupported,
15449 /// If set, the enum was initialized with an unknown value.
15450 ///
15451 /// Applications can examine the value using [State::value] or
15452 /// [State::name].
15453 UnknownValue(state::UnknownValue),
15454 }
15455
15456 #[doc(hidden)]
15457 pub mod state {
15458 #[allow(unused_imports)]
15459 use super::*;
15460 #[derive(Clone, Debug, PartialEq)]
15461 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15462 }
15463
15464 impl State {
15465 /// Gets the enum value.
15466 ///
15467 /// Returns `None` if the enum contains an unknown value deserialized from
15468 /// the string representation of enums.
15469 pub fn value(&self) -> std::option::Option<i32> {
15470 match self {
15471 Self::Unspecified => std::option::Option::Some(0),
15472 Self::NotStarted => std::option::Option::Some(1),
15473 Self::Pending => std::option::Option::Some(2),
15474 Self::Active => std::option::Option::Some(3),
15475 Self::Stopped => std::option::Option::Some(4),
15476 Self::Failed => std::option::Option::Some(5),
15477 Self::Completed => std::option::Option::Some(6),
15478 Self::Unsupported => std::option::Option::Some(7),
15479 Self::UnknownValue(u) => u.0.value(),
15480 }
15481 }
15482
15483 /// Gets the enum value as a string.
15484 ///
15485 /// Returns `None` if the enum contains an unknown value deserialized from
15486 /// the integer representation of enums.
15487 pub fn name(&self) -> std::option::Option<&str> {
15488 match self {
15489 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
15490 Self::NotStarted => std::option::Option::Some("NOT_STARTED"),
15491 Self::Pending => std::option::Option::Some("PENDING"),
15492 Self::Active => std::option::Option::Some("ACTIVE"),
15493 Self::Stopped => std::option::Option::Some("STOPPED"),
15494 Self::Failed => std::option::Option::Some("FAILED"),
15495 Self::Completed => std::option::Option::Some("COMPLETED"),
15496 Self::Unsupported => std::option::Option::Some("UNSUPPORTED"),
15497 Self::UnknownValue(u) => u.0.name(),
15498 }
15499 }
15500 }
15501
15502 impl std::default::Default for State {
15503 fn default() -> Self {
15504 use std::convert::From;
15505 Self::from(0)
15506 }
15507 }
15508
15509 impl std::fmt::Display for State {
15510 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15511 wkt::internal::display_enum(f, self.name(), self.value())
15512 }
15513 }
15514
15515 impl std::convert::From<i32> for State {
15516 fn from(value: i32) -> Self {
15517 match value {
15518 0 => Self::Unspecified,
15519 1 => Self::NotStarted,
15520 2 => Self::Pending,
15521 3 => Self::Active,
15522 4 => Self::Stopped,
15523 5 => Self::Failed,
15524 6 => Self::Completed,
15525 7 => Self::Unsupported,
15526 _ => Self::UnknownValue(state::UnknownValue(
15527 wkt::internal::UnknownEnumValue::Integer(value),
15528 )),
15529 }
15530 }
15531 }
15532
15533 impl std::convert::From<&str> for State {
15534 fn from(value: &str) -> Self {
15535 use std::string::ToString;
15536 match value {
15537 "STATE_UNSPECIFIED" => Self::Unspecified,
15538 "NOT_STARTED" => Self::NotStarted,
15539 "PENDING" => Self::Pending,
15540 "ACTIVE" => Self::Active,
15541 "STOPPED" => Self::Stopped,
15542 "FAILED" => Self::Failed,
15543 "COMPLETED" => Self::Completed,
15544 "UNSUPPORTED" => Self::Unsupported,
15545 _ => Self::UnknownValue(state::UnknownValue(
15546 wkt::internal::UnknownEnumValue::String(value.to_string()),
15547 )),
15548 }
15549 }
15550 }
15551
15552 impl serde::ser::Serialize for State {
15553 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15554 where
15555 S: serde::Serializer,
15556 {
15557 match self {
15558 Self::Unspecified => serializer.serialize_i32(0),
15559 Self::NotStarted => serializer.serialize_i32(1),
15560 Self::Pending => serializer.serialize_i32(2),
15561 Self::Active => serializer.serialize_i32(3),
15562 Self::Stopped => serializer.serialize_i32(4),
15563 Self::Failed => serializer.serialize_i32(5),
15564 Self::Completed => serializer.serialize_i32(6),
15565 Self::Unsupported => serializer.serialize_i32(7),
15566 Self::UnknownValue(u) => u.0.serialize(serializer),
15567 }
15568 }
15569 }
15570
15571 impl<'de> serde::de::Deserialize<'de> for State {
15572 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15573 where
15574 D: serde::Deserializer<'de>,
15575 {
15576 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
15577 ".google.cloud.datastream.v1.BackfillJob.State",
15578 ))
15579 }
15580 }
15581
15582 /// Triggering reason for a backfill job.
15583 ///
15584 /// # Working with unknown values
15585 ///
15586 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15587 /// additional enum variants at any time. Adding new variants is not considered
15588 /// a breaking change. Applications should write their code in anticipation of:
15589 ///
15590 /// - New values appearing in future releases of the client library, **and**
15591 /// - New values received dynamically, without application changes.
15592 ///
15593 /// Please consult the [Working with enums] section in the user guide for some
15594 /// guidelines.
15595 ///
15596 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15597 #[derive(Clone, Debug, PartialEq)]
15598 #[non_exhaustive]
15599 pub enum Trigger {
15600 /// Default value.
15601 Unspecified,
15602 /// Object backfill job was triggered automatically according to the stream's
15603 /// backfill strategy.
15604 Automatic,
15605 /// Object backfill job was triggered manually using the dedicated API.
15606 Manual,
15607 /// If set, the enum was initialized with an unknown value.
15608 ///
15609 /// Applications can examine the value using [Trigger::value] or
15610 /// [Trigger::name].
15611 UnknownValue(trigger::UnknownValue),
15612 }
15613
15614 #[doc(hidden)]
15615 pub mod trigger {
15616 #[allow(unused_imports)]
15617 use super::*;
15618 #[derive(Clone, Debug, PartialEq)]
15619 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15620 }
15621
15622 impl Trigger {
15623 /// Gets the enum value.
15624 ///
15625 /// Returns `None` if the enum contains an unknown value deserialized from
15626 /// the string representation of enums.
15627 pub fn value(&self) -> std::option::Option<i32> {
15628 match self {
15629 Self::Unspecified => std::option::Option::Some(0),
15630 Self::Automatic => std::option::Option::Some(1),
15631 Self::Manual => std::option::Option::Some(2),
15632 Self::UnknownValue(u) => u.0.value(),
15633 }
15634 }
15635
15636 /// Gets the enum value as a string.
15637 ///
15638 /// Returns `None` if the enum contains an unknown value deserialized from
15639 /// the integer representation of enums.
15640 pub fn name(&self) -> std::option::Option<&str> {
15641 match self {
15642 Self::Unspecified => std::option::Option::Some("TRIGGER_UNSPECIFIED"),
15643 Self::Automatic => std::option::Option::Some("AUTOMATIC"),
15644 Self::Manual => std::option::Option::Some("MANUAL"),
15645 Self::UnknownValue(u) => u.0.name(),
15646 }
15647 }
15648 }
15649
15650 impl std::default::Default for Trigger {
15651 fn default() -> Self {
15652 use std::convert::From;
15653 Self::from(0)
15654 }
15655 }
15656
15657 impl std::fmt::Display for Trigger {
15658 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15659 wkt::internal::display_enum(f, self.name(), self.value())
15660 }
15661 }
15662
15663 impl std::convert::From<i32> for Trigger {
15664 fn from(value: i32) -> Self {
15665 match value {
15666 0 => Self::Unspecified,
15667 1 => Self::Automatic,
15668 2 => Self::Manual,
15669 _ => Self::UnknownValue(trigger::UnknownValue(
15670 wkt::internal::UnknownEnumValue::Integer(value),
15671 )),
15672 }
15673 }
15674 }
15675
15676 impl std::convert::From<&str> for Trigger {
15677 fn from(value: &str) -> Self {
15678 use std::string::ToString;
15679 match value {
15680 "TRIGGER_UNSPECIFIED" => Self::Unspecified,
15681 "AUTOMATIC" => Self::Automatic,
15682 "MANUAL" => Self::Manual,
15683 _ => Self::UnknownValue(trigger::UnknownValue(
15684 wkt::internal::UnknownEnumValue::String(value.to_string()),
15685 )),
15686 }
15687 }
15688 }
15689
15690 impl serde::ser::Serialize for Trigger {
15691 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15692 where
15693 S: serde::Serializer,
15694 {
15695 match self {
15696 Self::Unspecified => serializer.serialize_i32(0),
15697 Self::Automatic => serializer.serialize_i32(1),
15698 Self::Manual => serializer.serialize_i32(2),
15699 Self::UnknownValue(u) => u.0.serialize(serializer),
15700 }
15701 }
15702 }
15703
15704 impl<'de> serde::de::Deserialize<'de> for Trigger {
15705 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15706 where
15707 D: serde::Deserializer<'de>,
15708 {
15709 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Trigger>::new(
15710 ".google.cloud.datastream.v1.BackfillJob.Trigger",
15711 ))
15712 }
15713 }
15714}
15715
15716/// Represent a user-facing Error.
15717#[derive(Clone, Default, PartialEq)]
15718#[non_exhaustive]
15719pub struct Error {
15720 /// A title that explains the reason for the error.
15721 pub reason: std::string::String,
15722
15723 /// A unique identifier for this specific error,
15724 /// allowing it to be traced throughout the system in logs and API responses.
15725 pub error_uuid: std::string::String,
15726
15727 /// A message containing more information about the error that occurred.
15728 pub message: std::string::String,
15729
15730 /// The time when the error occurred.
15731 pub error_time: std::option::Option<wkt::Timestamp>,
15732
15733 /// Additional information about the error.
15734 pub details: std::collections::HashMap<std::string::String, std::string::String>,
15735
15736 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15737}
15738
15739impl Error {
15740 /// Creates a new default instance.
15741 pub fn new() -> Self {
15742 std::default::Default::default()
15743 }
15744
15745 /// Sets the value of [reason][crate::model::Error::reason].
15746 ///
15747 /// # Example
15748 /// ```ignore,no_run
15749 /// # use google_cloud_datastream_v1::model::Error;
15750 /// let x = Error::new().set_reason("example");
15751 /// ```
15752 pub fn set_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15753 self.reason = v.into();
15754 self
15755 }
15756
15757 /// Sets the value of [error_uuid][crate::model::Error::error_uuid].
15758 ///
15759 /// # Example
15760 /// ```ignore,no_run
15761 /// # use google_cloud_datastream_v1::model::Error;
15762 /// let x = Error::new().set_error_uuid("example");
15763 /// ```
15764 pub fn set_error_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15765 self.error_uuid = v.into();
15766 self
15767 }
15768
15769 /// Sets the value of [message][crate::model::Error::message].
15770 ///
15771 /// # Example
15772 /// ```ignore,no_run
15773 /// # use google_cloud_datastream_v1::model::Error;
15774 /// let x = Error::new().set_message("example");
15775 /// ```
15776 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15777 self.message = v.into();
15778 self
15779 }
15780
15781 /// Sets the value of [error_time][crate::model::Error::error_time].
15782 ///
15783 /// # Example
15784 /// ```ignore,no_run
15785 /// # use google_cloud_datastream_v1::model::Error;
15786 /// use wkt::Timestamp;
15787 /// let x = Error::new().set_error_time(Timestamp::default()/* use setters */);
15788 /// ```
15789 pub fn set_error_time<T>(mut self, v: T) -> Self
15790 where
15791 T: std::convert::Into<wkt::Timestamp>,
15792 {
15793 self.error_time = std::option::Option::Some(v.into());
15794 self
15795 }
15796
15797 /// Sets or clears the value of [error_time][crate::model::Error::error_time].
15798 ///
15799 /// # Example
15800 /// ```ignore,no_run
15801 /// # use google_cloud_datastream_v1::model::Error;
15802 /// use wkt::Timestamp;
15803 /// let x = Error::new().set_or_clear_error_time(Some(Timestamp::default()/* use setters */));
15804 /// let x = Error::new().set_or_clear_error_time(None::<Timestamp>);
15805 /// ```
15806 pub fn set_or_clear_error_time<T>(mut self, v: std::option::Option<T>) -> Self
15807 where
15808 T: std::convert::Into<wkt::Timestamp>,
15809 {
15810 self.error_time = v.map(|x| x.into());
15811 self
15812 }
15813
15814 /// Sets the value of [details][crate::model::Error::details].
15815 ///
15816 /// # Example
15817 /// ```ignore,no_run
15818 /// # use google_cloud_datastream_v1::model::Error;
15819 /// let x = Error::new().set_details([
15820 /// ("key0", "abc"),
15821 /// ("key1", "xyz"),
15822 /// ]);
15823 /// ```
15824 pub fn set_details<T, K, V>(mut self, v: T) -> Self
15825 where
15826 T: std::iter::IntoIterator<Item = (K, V)>,
15827 K: std::convert::Into<std::string::String>,
15828 V: std::convert::Into<std::string::String>,
15829 {
15830 use std::iter::Iterator;
15831 self.details = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
15832 self
15833 }
15834}
15835
15836impl wkt::message::Message for Error {
15837 fn typename() -> &'static str {
15838 "type.googleapis.com/google.cloud.datastream.v1.Error"
15839 }
15840}
15841
15842/// Contains the current validation results.
15843#[derive(Clone, Default, PartialEq)]
15844#[non_exhaustive]
15845pub struct ValidationResult {
15846 /// A list of validations (includes both executed as well as not executed
15847 /// validations).
15848 pub validations: std::vec::Vec<crate::model::Validation>,
15849
15850 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15851}
15852
15853impl ValidationResult {
15854 /// Creates a new default instance.
15855 pub fn new() -> Self {
15856 std::default::Default::default()
15857 }
15858
15859 /// Sets the value of [validations][crate::model::ValidationResult::validations].
15860 ///
15861 /// # Example
15862 /// ```ignore,no_run
15863 /// # use google_cloud_datastream_v1::model::ValidationResult;
15864 /// use google_cloud_datastream_v1::model::Validation;
15865 /// let x = ValidationResult::new()
15866 /// .set_validations([
15867 /// Validation::default()/* use setters */,
15868 /// Validation::default()/* use (different) setters */,
15869 /// ]);
15870 /// ```
15871 pub fn set_validations<T, V>(mut self, v: T) -> Self
15872 where
15873 T: std::iter::IntoIterator<Item = V>,
15874 V: std::convert::Into<crate::model::Validation>,
15875 {
15876 use std::iter::Iterator;
15877 self.validations = v.into_iter().map(|i| i.into()).collect();
15878 self
15879 }
15880}
15881
15882impl wkt::message::Message for ValidationResult {
15883 fn typename() -> &'static str {
15884 "type.googleapis.com/google.cloud.datastream.v1.ValidationResult"
15885 }
15886}
15887
15888/// A validation to perform on a stream.
15889#[derive(Clone, Default, PartialEq)]
15890#[non_exhaustive]
15891pub struct Validation {
15892 /// A short description of the validation.
15893 pub description: std::string::String,
15894
15895 /// Output only. Validation execution status.
15896 pub state: crate::model::validation::State,
15897
15898 /// Messages reflecting the validation results.
15899 pub message: std::vec::Vec<crate::model::ValidationMessage>,
15900
15901 /// A custom code identifying this validation.
15902 pub code: std::string::String,
15903
15904 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15905}
15906
15907impl Validation {
15908 /// Creates a new default instance.
15909 pub fn new() -> Self {
15910 std::default::Default::default()
15911 }
15912
15913 /// Sets the value of [description][crate::model::Validation::description].
15914 ///
15915 /// # Example
15916 /// ```ignore,no_run
15917 /// # use google_cloud_datastream_v1::model::Validation;
15918 /// let x = Validation::new().set_description("example");
15919 /// ```
15920 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15921 self.description = v.into();
15922 self
15923 }
15924
15925 /// Sets the value of [state][crate::model::Validation::state].
15926 ///
15927 /// # Example
15928 /// ```ignore,no_run
15929 /// # use google_cloud_datastream_v1::model::Validation;
15930 /// use google_cloud_datastream_v1::model::validation::State;
15931 /// let x0 = Validation::new().set_state(State::NotExecuted);
15932 /// let x1 = Validation::new().set_state(State::Failed);
15933 /// let x2 = Validation::new().set_state(State::Passed);
15934 /// ```
15935 pub fn set_state<T: std::convert::Into<crate::model::validation::State>>(
15936 mut self,
15937 v: T,
15938 ) -> Self {
15939 self.state = v.into();
15940 self
15941 }
15942
15943 /// Sets the value of [message][crate::model::Validation::message].
15944 ///
15945 /// # Example
15946 /// ```ignore,no_run
15947 /// # use google_cloud_datastream_v1::model::Validation;
15948 /// use google_cloud_datastream_v1::model::ValidationMessage;
15949 /// let x = Validation::new()
15950 /// .set_message([
15951 /// ValidationMessage::default()/* use setters */,
15952 /// ValidationMessage::default()/* use (different) setters */,
15953 /// ]);
15954 /// ```
15955 pub fn set_message<T, V>(mut self, v: T) -> Self
15956 where
15957 T: std::iter::IntoIterator<Item = V>,
15958 V: std::convert::Into<crate::model::ValidationMessage>,
15959 {
15960 use std::iter::Iterator;
15961 self.message = v.into_iter().map(|i| i.into()).collect();
15962 self
15963 }
15964
15965 /// Sets the value of [code][crate::model::Validation::code].
15966 ///
15967 /// # Example
15968 /// ```ignore,no_run
15969 /// # use google_cloud_datastream_v1::model::Validation;
15970 /// let x = Validation::new().set_code("example");
15971 /// ```
15972 pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15973 self.code = v.into();
15974 self
15975 }
15976}
15977
15978impl wkt::message::Message for Validation {
15979 fn typename() -> &'static str {
15980 "type.googleapis.com/google.cloud.datastream.v1.Validation"
15981 }
15982}
15983
15984/// Defines additional types related to [Validation].
15985pub mod validation {
15986 #[allow(unused_imports)]
15987 use super::*;
15988
15989 /// Validation execution state.
15990 ///
15991 /// # Working with unknown values
15992 ///
15993 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15994 /// additional enum variants at any time. Adding new variants is not considered
15995 /// a breaking change. Applications should write their code in anticipation of:
15996 ///
15997 /// - New values appearing in future releases of the client library, **and**
15998 /// - New values received dynamically, without application changes.
15999 ///
16000 /// Please consult the [Working with enums] section in the user guide for some
16001 /// guidelines.
16002 ///
16003 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16004 #[derive(Clone, Debug, PartialEq)]
16005 #[non_exhaustive]
16006 pub enum State {
16007 /// Unspecified state.
16008 Unspecified,
16009 /// Validation did not execute.
16010 NotExecuted,
16011 /// Validation failed.
16012 Failed,
16013 /// Validation passed.
16014 Passed,
16015 /// Validation executed with warnings.
16016 Warning,
16017 /// If set, the enum was initialized with an unknown value.
16018 ///
16019 /// Applications can examine the value using [State::value] or
16020 /// [State::name].
16021 UnknownValue(state::UnknownValue),
16022 }
16023
16024 #[doc(hidden)]
16025 pub mod state {
16026 #[allow(unused_imports)]
16027 use super::*;
16028 #[derive(Clone, Debug, PartialEq)]
16029 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16030 }
16031
16032 impl State {
16033 /// Gets the enum value.
16034 ///
16035 /// Returns `None` if the enum contains an unknown value deserialized from
16036 /// the string representation of enums.
16037 pub fn value(&self) -> std::option::Option<i32> {
16038 match self {
16039 Self::Unspecified => std::option::Option::Some(0),
16040 Self::NotExecuted => std::option::Option::Some(1),
16041 Self::Failed => std::option::Option::Some(2),
16042 Self::Passed => std::option::Option::Some(3),
16043 Self::Warning => std::option::Option::Some(4),
16044 Self::UnknownValue(u) => u.0.value(),
16045 }
16046 }
16047
16048 /// Gets the enum value as a string.
16049 ///
16050 /// Returns `None` if the enum contains an unknown value deserialized from
16051 /// the integer representation of enums.
16052 pub fn name(&self) -> std::option::Option<&str> {
16053 match self {
16054 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16055 Self::NotExecuted => std::option::Option::Some("NOT_EXECUTED"),
16056 Self::Failed => std::option::Option::Some("FAILED"),
16057 Self::Passed => std::option::Option::Some("PASSED"),
16058 Self::Warning => std::option::Option::Some("WARNING"),
16059 Self::UnknownValue(u) => u.0.name(),
16060 }
16061 }
16062 }
16063
16064 impl std::default::Default for State {
16065 fn default() -> Self {
16066 use std::convert::From;
16067 Self::from(0)
16068 }
16069 }
16070
16071 impl std::fmt::Display for State {
16072 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16073 wkt::internal::display_enum(f, self.name(), self.value())
16074 }
16075 }
16076
16077 impl std::convert::From<i32> for State {
16078 fn from(value: i32) -> Self {
16079 match value {
16080 0 => Self::Unspecified,
16081 1 => Self::NotExecuted,
16082 2 => Self::Failed,
16083 3 => Self::Passed,
16084 4 => Self::Warning,
16085 _ => Self::UnknownValue(state::UnknownValue(
16086 wkt::internal::UnknownEnumValue::Integer(value),
16087 )),
16088 }
16089 }
16090 }
16091
16092 impl std::convert::From<&str> for State {
16093 fn from(value: &str) -> Self {
16094 use std::string::ToString;
16095 match value {
16096 "STATE_UNSPECIFIED" => Self::Unspecified,
16097 "NOT_EXECUTED" => Self::NotExecuted,
16098 "FAILED" => Self::Failed,
16099 "PASSED" => Self::Passed,
16100 "WARNING" => Self::Warning,
16101 _ => Self::UnknownValue(state::UnknownValue(
16102 wkt::internal::UnknownEnumValue::String(value.to_string()),
16103 )),
16104 }
16105 }
16106 }
16107
16108 impl serde::ser::Serialize for State {
16109 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16110 where
16111 S: serde::Serializer,
16112 {
16113 match self {
16114 Self::Unspecified => serializer.serialize_i32(0),
16115 Self::NotExecuted => serializer.serialize_i32(1),
16116 Self::Failed => serializer.serialize_i32(2),
16117 Self::Passed => serializer.serialize_i32(3),
16118 Self::Warning => serializer.serialize_i32(4),
16119 Self::UnknownValue(u) => u.0.serialize(serializer),
16120 }
16121 }
16122 }
16123
16124 impl<'de> serde::de::Deserialize<'de> for State {
16125 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16126 where
16127 D: serde::Deserializer<'de>,
16128 {
16129 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16130 ".google.cloud.datastream.v1.Validation.State",
16131 ))
16132 }
16133 }
16134}
16135
16136/// Represent user-facing validation result message.
16137#[derive(Clone, Default, PartialEq)]
16138#[non_exhaustive]
16139pub struct ValidationMessage {
16140 /// The result of the validation.
16141 pub message: std::string::String,
16142
16143 /// Message severity level (warning or error).
16144 pub level: crate::model::validation_message::Level,
16145
16146 /// Additional metadata related to the result.
16147 pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
16148
16149 /// A custom code identifying this specific message.
16150 pub code: std::string::String,
16151
16152 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16153}
16154
16155impl ValidationMessage {
16156 /// Creates a new default instance.
16157 pub fn new() -> Self {
16158 std::default::Default::default()
16159 }
16160
16161 /// Sets the value of [message][crate::model::ValidationMessage::message].
16162 ///
16163 /// # Example
16164 /// ```ignore,no_run
16165 /// # use google_cloud_datastream_v1::model::ValidationMessage;
16166 /// let x = ValidationMessage::new().set_message("example");
16167 /// ```
16168 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16169 self.message = v.into();
16170 self
16171 }
16172
16173 /// Sets the value of [level][crate::model::ValidationMessage::level].
16174 ///
16175 /// # Example
16176 /// ```ignore,no_run
16177 /// # use google_cloud_datastream_v1::model::ValidationMessage;
16178 /// use google_cloud_datastream_v1::model::validation_message::Level;
16179 /// let x0 = ValidationMessage::new().set_level(Level::Warning);
16180 /// let x1 = ValidationMessage::new().set_level(Level::Error);
16181 /// ```
16182 pub fn set_level<T: std::convert::Into<crate::model::validation_message::Level>>(
16183 mut self,
16184 v: T,
16185 ) -> Self {
16186 self.level = v.into();
16187 self
16188 }
16189
16190 /// Sets the value of [metadata][crate::model::ValidationMessage::metadata].
16191 ///
16192 /// # Example
16193 /// ```ignore,no_run
16194 /// # use google_cloud_datastream_v1::model::ValidationMessage;
16195 /// let x = ValidationMessage::new().set_metadata([
16196 /// ("key0", "abc"),
16197 /// ("key1", "xyz"),
16198 /// ]);
16199 /// ```
16200 pub fn set_metadata<T, K, V>(mut self, v: T) -> Self
16201 where
16202 T: std::iter::IntoIterator<Item = (K, V)>,
16203 K: std::convert::Into<std::string::String>,
16204 V: std::convert::Into<std::string::String>,
16205 {
16206 use std::iter::Iterator;
16207 self.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16208 self
16209 }
16210
16211 /// Sets the value of [code][crate::model::ValidationMessage::code].
16212 ///
16213 /// # Example
16214 /// ```ignore,no_run
16215 /// # use google_cloud_datastream_v1::model::ValidationMessage;
16216 /// let x = ValidationMessage::new().set_code("example");
16217 /// ```
16218 pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16219 self.code = v.into();
16220 self
16221 }
16222}
16223
16224impl wkt::message::Message for ValidationMessage {
16225 fn typename() -> &'static str {
16226 "type.googleapis.com/google.cloud.datastream.v1.ValidationMessage"
16227 }
16228}
16229
16230/// Defines additional types related to [ValidationMessage].
16231pub mod validation_message {
16232 #[allow(unused_imports)]
16233 use super::*;
16234
16235 /// Validation message level.
16236 ///
16237 /// # Working with unknown values
16238 ///
16239 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16240 /// additional enum variants at any time. Adding new variants is not considered
16241 /// a breaking change. Applications should write their code in anticipation of:
16242 ///
16243 /// - New values appearing in future releases of the client library, **and**
16244 /// - New values received dynamically, without application changes.
16245 ///
16246 /// Please consult the [Working with enums] section in the user guide for some
16247 /// guidelines.
16248 ///
16249 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16250 #[derive(Clone, Debug, PartialEq)]
16251 #[non_exhaustive]
16252 pub enum Level {
16253 /// Unspecified level.
16254 Unspecified,
16255 /// Potentially cause issues with the Stream.
16256 Warning,
16257 /// Definitely cause issues with the Stream.
16258 Error,
16259 /// If set, the enum was initialized with an unknown value.
16260 ///
16261 /// Applications can examine the value using [Level::value] or
16262 /// [Level::name].
16263 UnknownValue(level::UnknownValue),
16264 }
16265
16266 #[doc(hidden)]
16267 pub mod level {
16268 #[allow(unused_imports)]
16269 use super::*;
16270 #[derive(Clone, Debug, PartialEq)]
16271 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16272 }
16273
16274 impl Level {
16275 /// Gets the enum value.
16276 ///
16277 /// Returns `None` if the enum contains an unknown value deserialized from
16278 /// the string representation of enums.
16279 pub fn value(&self) -> std::option::Option<i32> {
16280 match self {
16281 Self::Unspecified => std::option::Option::Some(0),
16282 Self::Warning => std::option::Option::Some(1),
16283 Self::Error => std::option::Option::Some(2),
16284 Self::UnknownValue(u) => u.0.value(),
16285 }
16286 }
16287
16288 /// Gets the enum value as a string.
16289 ///
16290 /// Returns `None` if the enum contains an unknown value deserialized from
16291 /// the integer representation of enums.
16292 pub fn name(&self) -> std::option::Option<&str> {
16293 match self {
16294 Self::Unspecified => std::option::Option::Some("LEVEL_UNSPECIFIED"),
16295 Self::Warning => std::option::Option::Some("WARNING"),
16296 Self::Error => std::option::Option::Some("ERROR"),
16297 Self::UnknownValue(u) => u.0.name(),
16298 }
16299 }
16300 }
16301
16302 impl std::default::Default for Level {
16303 fn default() -> Self {
16304 use std::convert::From;
16305 Self::from(0)
16306 }
16307 }
16308
16309 impl std::fmt::Display for Level {
16310 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16311 wkt::internal::display_enum(f, self.name(), self.value())
16312 }
16313 }
16314
16315 impl std::convert::From<i32> for Level {
16316 fn from(value: i32) -> Self {
16317 match value {
16318 0 => Self::Unspecified,
16319 1 => Self::Warning,
16320 2 => Self::Error,
16321 _ => Self::UnknownValue(level::UnknownValue(
16322 wkt::internal::UnknownEnumValue::Integer(value),
16323 )),
16324 }
16325 }
16326 }
16327
16328 impl std::convert::From<&str> for Level {
16329 fn from(value: &str) -> Self {
16330 use std::string::ToString;
16331 match value {
16332 "LEVEL_UNSPECIFIED" => Self::Unspecified,
16333 "WARNING" => Self::Warning,
16334 "ERROR" => Self::Error,
16335 _ => Self::UnknownValue(level::UnknownValue(
16336 wkt::internal::UnknownEnumValue::String(value.to_string()),
16337 )),
16338 }
16339 }
16340 }
16341
16342 impl serde::ser::Serialize for Level {
16343 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16344 where
16345 S: serde::Serializer,
16346 {
16347 match self {
16348 Self::Unspecified => serializer.serialize_i32(0),
16349 Self::Warning => serializer.serialize_i32(1),
16350 Self::Error => serializer.serialize_i32(2),
16351 Self::UnknownValue(u) => u.0.serialize(serializer),
16352 }
16353 }
16354 }
16355
16356 impl<'de> serde::de::Deserialize<'de> for Level {
16357 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16358 where
16359 D: serde::Deserializer<'de>,
16360 {
16361 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Level>::new(
16362 ".google.cloud.datastream.v1.ValidationMessage.Level",
16363 ))
16364 }
16365 }
16366}
16367
16368/// The strategy that the stream uses for CDC replication.
16369#[derive(Clone, Default, PartialEq)]
16370#[non_exhaustive]
16371pub struct CdcStrategy {
16372 /// The position to start reading from when starting, resuming, or recovering
16373 /// the stream.
16374 /// If not set, the system's default value will be used.
16375 pub start_position: std::option::Option<crate::model::cdc_strategy::StartPosition>,
16376
16377 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16378}
16379
16380impl CdcStrategy {
16381 /// Creates a new default instance.
16382 pub fn new() -> Self {
16383 std::default::Default::default()
16384 }
16385
16386 /// Sets the value of [start_position][crate::model::CdcStrategy::start_position].
16387 ///
16388 /// Note that all the setters affecting `start_position` are mutually
16389 /// exclusive.
16390 ///
16391 /// # Example
16392 /// ```ignore,no_run
16393 /// # use google_cloud_datastream_v1::model::CdcStrategy;
16394 /// use google_cloud_datastream_v1::model::cdc_strategy::MostRecentStartPosition;
16395 /// let x = CdcStrategy::new().set_start_position(Some(
16396 /// google_cloud_datastream_v1::model::cdc_strategy::StartPosition::MostRecentStartPosition(MostRecentStartPosition::default().into())));
16397 /// ```
16398 pub fn set_start_position<
16399 T: std::convert::Into<std::option::Option<crate::model::cdc_strategy::StartPosition>>,
16400 >(
16401 mut self,
16402 v: T,
16403 ) -> Self {
16404 self.start_position = v.into();
16405 self
16406 }
16407
16408 /// The value of [start_position][crate::model::CdcStrategy::start_position]
16409 /// if it holds a `MostRecentStartPosition`, `None` if the field is not set or
16410 /// holds a different branch.
16411 pub fn most_recent_start_position(
16412 &self,
16413 ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>>
16414 {
16415 #[allow(unreachable_patterns)]
16416 self.start_position.as_ref().and_then(|v| match v {
16417 crate::model::cdc_strategy::StartPosition::MostRecentStartPosition(v) => {
16418 std::option::Option::Some(v)
16419 }
16420 _ => std::option::Option::None,
16421 })
16422 }
16423
16424 /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
16425 /// to hold a `MostRecentStartPosition`.
16426 ///
16427 /// Note that all the setters affecting `start_position` are
16428 /// mutually exclusive.
16429 ///
16430 /// # Example
16431 /// ```ignore,no_run
16432 /// # use google_cloud_datastream_v1::model::CdcStrategy;
16433 /// use google_cloud_datastream_v1::model::cdc_strategy::MostRecentStartPosition;
16434 /// let x = CdcStrategy::new().set_most_recent_start_position(MostRecentStartPosition::default()/* use setters */);
16435 /// assert!(x.most_recent_start_position().is_some());
16436 /// assert!(x.next_available_start_position().is_none());
16437 /// assert!(x.specific_start_position().is_none());
16438 /// ```
16439 pub fn set_most_recent_start_position<
16440 T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>>,
16441 >(
16442 mut self,
16443 v: T,
16444 ) -> Self {
16445 self.start_position = std::option::Option::Some(
16446 crate::model::cdc_strategy::StartPosition::MostRecentStartPosition(v.into()),
16447 );
16448 self
16449 }
16450
16451 /// The value of [start_position][crate::model::CdcStrategy::start_position]
16452 /// if it holds a `NextAvailableStartPosition`, `None` if the field is not set or
16453 /// holds a different branch.
16454 pub fn next_available_start_position(
16455 &self,
16456 ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>>
16457 {
16458 #[allow(unreachable_patterns)]
16459 self.start_position.as_ref().and_then(|v| match v {
16460 crate::model::cdc_strategy::StartPosition::NextAvailableStartPosition(v) => {
16461 std::option::Option::Some(v)
16462 }
16463 _ => std::option::Option::None,
16464 })
16465 }
16466
16467 /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
16468 /// to hold a `NextAvailableStartPosition`.
16469 ///
16470 /// Note that all the setters affecting `start_position` are
16471 /// mutually exclusive.
16472 ///
16473 /// # Example
16474 /// ```ignore,no_run
16475 /// # use google_cloud_datastream_v1::model::CdcStrategy;
16476 /// use google_cloud_datastream_v1::model::cdc_strategy::NextAvailableStartPosition;
16477 /// let x = CdcStrategy::new().set_next_available_start_position(NextAvailableStartPosition::default()/* use setters */);
16478 /// assert!(x.next_available_start_position().is_some());
16479 /// assert!(x.most_recent_start_position().is_none());
16480 /// assert!(x.specific_start_position().is_none());
16481 /// ```
16482 pub fn set_next_available_start_position<
16483 T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>>,
16484 >(
16485 mut self,
16486 v: T,
16487 ) -> Self {
16488 self.start_position = std::option::Option::Some(
16489 crate::model::cdc_strategy::StartPosition::NextAvailableStartPosition(v.into()),
16490 );
16491 self
16492 }
16493
16494 /// The value of [start_position][crate::model::CdcStrategy::start_position]
16495 /// if it holds a `SpecificStartPosition`, `None` if the field is not set or
16496 /// holds a different branch.
16497 pub fn specific_start_position(
16498 &self,
16499 ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>>
16500 {
16501 #[allow(unreachable_patterns)]
16502 self.start_position.as_ref().and_then(|v| match v {
16503 crate::model::cdc_strategy::StartPosition::SpecificStartPosition(v) => {
16504 std::option::Option::Some(v)
16505 }
16506 _ => std::option::Option::None,
16507 })
16508 }
16509
16510 /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
16511 /// to hold a `SpecificStartPosition`.
16512 ///
16513 /// Note that all the setters affecting `start_position` are
16514 /// mutually exclusive.
16515 ///
16516 /// # Example
16517 /// ```ignore,no_run
16518 /// # use google_cloud_datastream_v1::model::CdcStrategy;
16519 /// use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16520 /// let x = CdcStrategy::new().set_specific_start_position(SpecificStartPosition::default()/* use setters */);
16521 /// assert!(x.specific_start_position().is_some());
16522 /// assert!(x.most_recent_start_position().is_none());
16523 /// assert!(x.next_available_start_position().is_none());
16524 /// ```
16525 pub fn set_specific_start_position<
16526 T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>>,
16527 >(
16528 mut self,
16529 v: T,
16530 ) -> Self {
16531 self.start_position = std::option::Option::Some(
16532 crate::model::cdc_strategy::StartPosition::SpecificStartPosition(v.into()),
16533 );
16534 self
16535 }
16536}
16537
16538impl wkt::message::Message for CdcStrategy {
16539 fn typename() -> &'static str {
16540 "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy"
16541 }
16542}
16543
16544/// Defines additional types related to [CdcStrategy].
16545pub mod cdc_strategy {
16546 #[allow(unused_imports)]
16547 use super::*;
16548
16549 /// CDC strategy to start replicating from the most recent position in the
16550 /// source.
16551 #[derive(Clone, Default, PartialEq)]
16552 #[non_exhaustive]
16553 pub struct MostRecentStartPosition {
16554 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16555 }
16556
16557 impl MostRecentStartPosition {
16558 /// Creates a new default instance.
16559 pub fn new() -> Self {
16560 std::default::Default::default()
16561 }
16562 }
16563
16564 impl wkt::message::Message for MostRecentStartPosition {
16565 fn typename() -> &'static str {
16566 "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.MostRecentStartPosition"
16567 }
16568 }
16569
16570 /// CDC strategy to resume replication from the next available position in the
16571 /// source.
16572 #[derive(Clone, Default, PartialEq)]
16573 #[non_exhaustive]
16574 pub struct NextAvailableStartPosition {
16575 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16576 }
16577
16578 impl NextAvailableStartPosition {
16579 /// Creates a new default instance.
16580 pub fn new() -> Self {
16581 std::default::Default::default()
16582 }
16583 }
16584
16585 impl wkt::message::Message for NextAvailableStartPosition {
16586 fn typename() -> &'static str {
16587 "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.NextAvailableStartPosition"
16588 }
16589 }
16590
16591 /// CDC strategy to start replicating from a specific position in the source.
16592 #[derive(Clone, Default, PartialEq)]
16593 #[non_exhaustive]
16594 pub struct SpecificStartPosition {
16595 #[allow(missing_docs)]
16596 pub position:
16597 std::option::Option<crate::model::cdc_strategy::specific_start_position::Position>,
16598
16599 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16600 }
16601
16602 impl SpecificStartPosition {
16603 /// Creates a new default instance.
16604 pub fn new() -> Self {
16605 std::default::Default::default()
16606 }
16607
16608 /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position].
16609 ///
16610 /// Note that all the setters affecting `position` are mutually
16611 /// exclusive.
16612 ///
16613 /// # Example
16614 /// ```ignore,no_run
16615 /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16616 /// use google_cloud_datastream_v1::model::MysqlLogPosition;
16617 /// let x = SpecificStartPosition::new().set_position(Some(
16618 /// google_cloud_datastream_v1::model::cdc_strategy::specific_start_position::Position::MysqlLogPosition(MysqlLogPosition::default().into())));
16619 /// ```
16620 pub fn set_position<
16621 T: std::convert::Into<
16622 std::option::Option<
16623 crate::model::cdc_strategy::specific_start_position::Position,
16624 >,
16625 >,
16626 >(
16627 mut self,
16628 v: T,
16629 ) -> Self {
16630 self.position = v.into();
16631 self
16632 }
16633
16634 /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16635 /// if it holds a `MysqlLogPosition`, `None` if the field is not set or
16636 /// holds a different branch.
16637 pub fn mysql_log_position(
16638 &self,
16639 ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlLogPosition>> {
16640 #[allow(unreachable_patterns)]
16641 self.position.as_ref().and_then(|v| match v {
16642 crate::model::cdc_strategy::specific_start_position::Position::MysqlLogPosition(
16643 v,
16644 ) => std::option::Option::Some(v),
16645 _ => std::option::Option::None,
16646 })
16647 }
16648
16649 /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16650 /// to hold a `MysqlLogPosition`.
16651 ///
16652 /// Note that all the setters affecting `position` are
16653 /// mutually exclusive.
16654 ///
16655 /// # Example
16656 /// ```ignore,no_run
16657 /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16658 /// use google_cloud_datastream_v1::model::MysqlLogPosition;
16659 /// let x = SpecificStartPosition::new().set_mysql_log_position(MysqlLogPosition::default()/* use setters */);
16660 /// assert!(x.mysql_log_position().is_some());
16661 /// assert!(x.oracle_scn_position().is_none());
16662 /// assert!(x.sql_server_lsn_position().is_none());
16663 /// assert!(x.mysql_gtid_position().is_none());
16664 /// ```
16665 pub fn set_mysql_log_position<
16666 T: std::convert::Into<std::boxed::Box<crate::model::MysqlLogPosition>>,
16667 >(
16668 mut self,
16669 v: T,
16670 ) -> Self {
16671 self.position = std::option::Option::Some(
16672 crate::model::cdc_strategy::specific_start_position::Position::MysqlLogPosition(
16673 v.into(),
16674 ),
16675 );
16676 self
16677 }
16678
16679 /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16680 /// if it holds a `OracleScnPosition`, `None` if the field is not set or
16681 /// holds a different branch.
16682 pub fn oracle_scn_position(
16683 &self,
16684 ) -> std::option::Option<&std::boxed::Box<crate::model::OracleScnPosition>> {
16685 #[allow(unreachable_patterns)]
16686 self.position.as_ref().and_then(|v| match v {
16687 crate::model::cdc_strategy::specific_start_position::Position::OracleScnPosition(v) => std::option::Option::Some(v),
16688 _ => std::option::Option::None,
16689 })
16690 }
16691
16692 /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16693 /// to hold a `OracleScnPosition`.
16694 ///
16695 /// Note that all the setters affecting `position` are
16696 /// mutually exclusive.
16697 ///
16698 /// # Example
16699 /// ```ignore,no_run
16700 /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16701 /// use google_cloud_datastream_v1::model::OracleScnPosition;
16702 /// let x = SpecificStartPosition::new().set_oracle_scn_position(OracleScnPosition::default()/* use setters */);
16703 /// assert!(x.oracle_scn_position().is_some());
16704 /// assert!(x.mysql_log_position().is_none());
16705 /// assert!(x.sql_server_lsn_position().is_none());
16706 /// assert!(x.mysql_gtid_position().is_none());
16707 /// ```
16708 pub fn set_oracle_scn_position<
16709 T: std::convert::Into<std::boxed::Box<crate::model::OracleScnPosition>>,
16710 >(
16711 mut self,
16712 v: T,
16713 ) -> Self {
16714 self.position = std::option::Option::Some(
16715 crate::model::cdc_strategy::specific_start_position::Position::OracleScnPosition(
16716 v.into(),
16717 ),
16718 );
16719 self
16720 }
16721
16722 /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16723 /// if it holds a `SqlServerLsnPosition`, `None` if the field is not set or
16724 /// holds a different branch.
16725 pub fn sql_server_lsn_position(
16726 &self,
16727 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerLsnPosition>> {
16728 #[allow(unreachable_patterns)]
16729 self.position.as_ref().and_then(|v| match v {
16730 crate::model::cdc_strategy::specific_start_position::Position::SqlServerLsnPosition(v) => std::option::Option::Some(v),
16731 _ => std::option::Option::None,
16732 })
16733 }
16734
16735 /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16736 /// to hold a `SqlServerLsnPosition`.
16737 ///
16738 /// Note that all the setters affecting `position` are
16739 /// mutually exclusive.
16740 ///
16741 /// # Example
16742 /// ```ignore,no_run
16743 /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16744 /// use google_cloud_datastream_v1::model::SqlServerLsnPosition;
16745 /// let x = SpecificStartPosition::new().set_sql_server_lsn_position(SqlServerLsnPosition::default()/* use setters */);
16746 /// assert!(x.sql_server_lsn_position().is_some());
16747 /// assert!(x.mysql_log_position().is_none());
16748 /// assert!(x.oracle_scn_position().is_none());
16749 /// assert!(x.mysql_gtid_position().is_none());
16750 /// ```
16751 pub fn set_sql_server_lsn_position<
16752 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerLsnPosition>>,
16753 >(
16754 mut self,
16755 v: T,
16756 ) -> Self {
16757 self.position = std::option::Option::Some(
16758 crate::model::cdc_strategy::specific_start_position::Position::SqlServerLsnPosition(
16759 v.into(),
16760 ),
16761 );
16762 self
16763 }
16764
16765 /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16766 /// if it holds a `MysqlGtidPosition`, `None` if the field is not set or
16767 /// holds a different branch.
16768 pub fn mysql_gtid_position(
16769 &self,
16770 ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlGtidPosition>> {
16771 #[allow(unreachable_patterns)]
16772 self.position.as_ref().and_then(|v| match v {
16773 crate::model::cdc_strategy::specific_start_position::Position::MysqlGtidPosition(v) => std::option::Option::Some(v),
16774 _ => std::option::Option::None,
16775 })
16776 }
16777
16778 /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16779 /// to hold a `MysqlGtidPosition`.
16780 ///
16781 /// Note that all the setters affecting `position` are
16782 /// mutually exclusive.
16783 ///
16784 /// # Example
16785 /// ```ignore,no_run
16786 /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16787 /// use google_cloud_datastream_v1::model::MysqlGtidPosition;
16788 /// let x = SpecificStartPosition::new().set_mysql_gtid_position(MysqlGtidPosition::default()/* use setters */);
16789 /// assert!(x.mysql_gtid_position().is_some());
16790 /// assert!(x.mysql_log_position().is_none());
16791 /// assert!(x.oracle_scn_position().is_none());
16792 /// assert!(x.sql_server_lsn_position().is_none());
16793 /// ```
16794 pub fn set_mysql_gtid_position<
16795 T: std::convert::Into<std::boxed::Box<crate::model::MysqlGtidPosition>>,
16796 >(
16797 mut self,
16798 v: T,
16799 ) -> Self {
16800 self.position = std::option::Option::Some(
16801 crate::model::cdc_strategy::specific_start_position::Position::MysqlGtidPosition(
16802 v.into(),
16803 ),
16804 );
16805 self
16806 }
16807 }
16808
16809 impl wkt::message::Message for SpecificStartPosition {
16810 fn typename() -> &'static str {
16811 "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.SpecificStartPosition"
16812 }
16813 }
16814
16815 /// Defines additional types related to [SpecificStartPosition].
16816 pub mod specific_start_position {
16817 #[allow(unused_imports)]
16818 use super::*;
16819
16820 #[allow(missing_docs)]
16821 #[derive(Clone, Debug, PartialEq)]
16822 #[non_exhaustive]
16823 pub enum Position {
16824 /// MySQL specific log position to start replicating from.
16825 MysqlLogPosition(std::boxed::Box<crate::model::MysqlLogPosition>),
16826 /// Oracle SCN to start replicating from.
16827 OracleScnPosition(std::boxed::Box<crate::model::OracleScnPosition>),
16828 /// SqlServer LSN to start replicating from.
16829 SqlServerLsnPosition(std::boxed::Box<crate::model::SqlServerLsnPosition>),
16830 /// MySQL GTID set to start replicating from.
16831 MysqlGtidPosition(std::boxed::Box<crate::model::MysqlGtidPosition>),
16832 }
16833 }
16834
16835 /// The position to start reading from when starting, resuming, or recovering
16836 /// the stream.
16837 /// If not set, the system's default value will be used.
16838 #[derive(Clone, Debug, PartialEq)]
16839 #[non_exhaustive]
16840 pub enum StartPosition {
16841 /// Optional. Start replicating from the most recent position in the source.
16842 MostRecentStartPosition(
16843 std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>,
16844 ),
16845 /// Optional. Resume replication from the next available position in the
16846 /// source.
16847 NextAvailableStartPosition(
16848 std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>,
16849 ),
16850 /// Optional. Start replicating from a specific position in the source.
16851 SpecificStartPosition(std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>),
16852 }
16853}
16854
16855/// SQL Server LSN position
16856#[derive(Clone, Default, PartialEq)]
16857#[non_exhaustive]
16858pub struct SqlServerLsnPosition {
16859 /// Required. Log sequence number (LSN) from where Logs will be read
16860 pub lsn: std::string::String,
16861
16862 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16863}
16864
16865impl SqlServerLsnPosition {
16866 /// Creates a new default instance.
16867 pub fn new() -> Self {
16868 std::default::Default::default()
16869 }
16870
16871 /// Sets the value of [lsn][crate::model::SqlServerLsnPosition::lsn].
16872 ///
16873 /// # Example
16874 /// ```ignore,no_run
16875 /// # use google_cloud_datastream_v1::model::SqlServerLsnPosition;
16876 /// let x = SqlServerLsnPosition::new().set_lsn("example");
16877 /// ```
16878 pub fn set_lsn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16879 self.lsn = v.into();
16880 self
16881 }
16882}
16883
16884impl wkt::message::Message for SqlServerLsnPosition {
16885 fn typename() -> &'static str {
16886 "type.googleapis.com/google.cloud.datastream.v1.SqlServerLsnPosition"
16887 }
16888}
16889
16890/// Oracle SCN position
16891#[derive(Clone, Default, PartialEq)]
16892#[non_exhaustive]
16893pub struct OracleScnPosition {
16894 /// Required. SCN number from where Logs will be read
16895 pub scn: i64,
16896
16897 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16898}
16899
16900impl OracleScnPosition {
16901 /// Creates a new default instance.
16902 pub fn new() -> Self {
16903 std::default::Default::default()
16904 }
16905
16906 /// Sets the value of [scn][crate::model::OracleScnPosition::scn].
16907 ///
16908 /// # Example
16909 /// ```ignore,no_run
16910 /// # use google_cloud_datastream_v1::model::OracleScnPosition;
16911 /// let x = OracleScnPosition::new().set_scn(42);
16912 /// ```
16913 pub fn set_scn<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
16914 self.scn = v.into();
16915 self
16916 }
16917}
16918
16919impl wkt::message::Message for OracleScnPosition {
16920 fn typename() -> &'static str {
16921 "type.googleapis.com/google.cloud.datastream.v1.OracleScnPosition"
16922 }
16923}
16924
16925/// MySQL log position
16926#[derive(Clone, Default, PartialEq)]
16927#[non_exhaustive]
16928pub struct MysqlLogPosition {
16929 /// Required. The binary log file name.
16930 pub log_file: std::string::String,
16931
16932 /// Optional. The position within the binary log file. Default is head of file.
16933 pub log_position: std::option::Option<i32>,
16934
16935 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16936}
16937
16938impl MysqlLogPosition {
16939 /// Creates a new default instance.
16940 pub fn new() -> Self {
16941 std::default::Default::default()
16942 }
16943
16944 /// Sets the value of [log_file][crate::model::MysqlLogPosition::log_file].
16945 ///
16946 /// # Example
16947 /// ```ignore,no_run
16948 /// # use google_cloud_datastream_v1::model::MysqlLogPosition;
16949 /// let x = MysqlLogPosition::new().set_log_file("example");
16950 /// ```
16951 pub fn set_log_file<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16952 self.log_file = v.into();
16953 self
16954 }
16955
16956 /// Sets the value of [log_position][crate::model::MysqlLogPosition::log_position].
16957 ///
16958 /// # Example
16959 /// ```ignore,no_run
16960 /// # use google_cloud_datastream_v1::model::MysqlLogPosition;
16961 /// let x = MysqlLogPosition::new().set_log_position(42);
16962 /// ```
16963 pub fn set_log_position<T>(mut self, v: T) -> Self
16964 where
16965 T: std::convert::Into<i32>,
16966 {
16967 self.log_position = std::option::Option::Some(v.into());
16968 self
16969 }
16970
16971 /// Sets or clears the value of [log_position][crate::model::MysqlLogPosition::log_position].
16972 ///
16973 /// # Example
16974 /// ```ignore,no_run
16975 /// # use google_cloud_datastream_v1::model::MysqlLogPosition;
16976 /// let x = MysqlLogPosition::new().set_or_clear_log_position(Some(42));
16977 /// let x = MysqlLogPosition::new().set_or_clear_log_position(None::<i32>);
16978 /// ```
16979 pub fn set_or_clear_log_position<T>(mut self, v: std::option::Option<T>) -> Self
16980 where
16981 T: std::convert::Into<i32>,
16982 {
16983 self.log_position = v.map(|x| x.into());
16984 self
16985 }
16986}
16987
16988impl wkt::message::Message for MysqlLogPosition {
16989 fn typename() -> &'static str {
16990 "type.googleapis.com/google.cloud.datastream.v1.MysqlLogPosition"
16991 }
16992}
16993
16994/// MySQL GTID position
16995#[derive(Clone, Default, PartialEq)]
16996#[non_exhaustive]
16997pub struct MysqlGtidPosition {
16998 /// Required. The gtid set to start replication from.
16999 pub gtid_set: std::string::String,
17000
17001 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17002}
17003
17004impl MysqlGtidPosition {
17005 /// Creates a new default instance.
17006 pub fn new() -> Self {
17007 std::default::Default::default()
17008 }
17009
17010 /// Sets the value of [gtid_set][crate::model::MysqlGtidPosition::gtid_set].
17011 ///
17012 /// # Example
17013 /// ```ignore,no_run
17014 /// # use google_cloud_datastream_v1::model::MysqlGtidPosition;
17015 /// let x = MysqlGtidPosition::new().set_gtid_set("example");
17016 /// ```
17017 pub fn set_gtid_set<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17018 self.gtid_set = v.into();
17019 self
17020 }
17021}
17022
17023impl wkt::message::Message for MysqlGtidPosition {
17024 fn typename() -> &'static str {
17025 "type.googleapis.com/google.cloud.datastream.v1.MysqlGtidPosition"
17026 }
17027}